删除多余文件,补上遗漏的index模板文件

This commit is contained in:
liuxiaoquan 2023-03-04 02:19:17 +08:00
parent d379e9b9db
commit ce83c26013
4 changed files with 401 additions and 1 deletions

2
.gitignore vendored
View File

@ -7,7 +7,7 @@
*.ini
.htaccess
404.html
index.html
# index.html
/runtime/*
/public/storage/*
/public/backup/*

View File

@ -0,0 +1,93 @@
{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
<div class="p-3">
<div class="gg-form-bar border-t border-x">
<button class="layui-btn layui-btn-sm add-menu">+ 添加菜单/节点</button>
</div>
<div>
<table class="layui-hide" id="treeTable" lay-filter="treeTable"></table>
</div>
</div>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool', 'treeGrid'];
function gouguInit() {
var treeGrid = layui.treeGrid,table = layui.table, tool = layui.tool;
var pageTable = treeGrid.render({
id: 'treeTable'
, elem: '#treeTable'
, idField: 'id'
, url: "/admin/merchant/menu/lst"
, cellMinWidth: 80
, treeId: 'id'//树形id字段名称
, treeUpId: 'pid'//树形父id字段名称
, treeShowName: 'title'//以树形式显示的字段
, cols: [[
{ field: 'id', width: 80, title: 'ID号', align: 'center' }
, { field: 'sort', width: 60, title: '排序', align: 'center' }
,{field:'icon',title: '菜单图标',width: 80, align: 'center' ,templet: function(d){
var html='<strong class="bi '+d.icon+'"></strong>';
return html;
}}
, { field: 'title', width: 160, title: '菜单/节点名称' }
, { field: 'pid', title: '父ID', width: 80, align: 'center' }
, { field: 'src', title: 'URL链接' }
, {
field: 'menu', width: 100, title: '是否是菜单', align: 'center', templet: function (d) {
var html = '<span style="color:#fbbc05"></span>';
if (d.menu == '1') {
html = '<span style="color:#12bb37"></span>';
}
return html;
}
}
, { field: 'name', width: 110, title: '操作日志名称', align: 'center' }
, {
width: 188, title: '操作', align: 'center'
, templet: function (d) {
var html = '<span class="layui-btn-group"><button class="layui-btn layui-btn-xs" lay-event="add">添加子菜单/节点</button><button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit">编辑</button><button class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</button>';
return html;
}
}
]]
, page: false
});
//表头工具栏事件
$('.add-menu').on('click', function () {
tool.side("/admin/merchant/menu/addform");
return;
});
//操作按钮
treeGrid.on('tool(treeTable)', function (obj) {
console.log(obj);
if (obj.event === 'add') {
tool.side('/admin/merchant/menu/addform?pid=' + obj.data.id);
return;
}
if (obj.event === 'edit') {
tool.side('/admin/merchant/menu/addform?id=' + obj.data.id);
return;
}
if (obj.event === 'del') {
layer.confirm('确定要删除吗?', { icon: 3, title: '提示' }, function (index) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
obj.del();
}
}
tool.delete("/admin/merchant/menu/del", { id: obj.data.id }, callback);
layer.close(index);
});
}
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,135 @@
{extend name="common/base"/}
{block name="style"}
<style type="text/css">
.editormd-code-toolbar select {display: inline-block}
.editormd li {list-style: inherit;}
</style>
{/block}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
<!-- <h3 class="pb-3">新建文章</h3> -->
<table class="layui-table layui-table-form">
<tr>
<td colspan="6" class="layui-td-gray" style="text-align:left">店铺说明</td>
</tr>
<tr>
<td colspan="6">
<textarea class="layui-textarea" id="container_content"></textarea>
</td>
</tr>
</table>
<div class="pt-3">
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</form>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script src="/static/assets/js/xm-select.js"></script>
<script>
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
var group_access = "{:session('gougu_admin')['group_access']}"
function gouguInit() {
var form =layui.form, tool = layui.tool,tagspicker = layui.tagpicker,laydate=layui.laydate;
laydate.render({
elem: '#test1' //指定元素
});
//上传缩略图
var upload_thumb = layui.upload.render({
elem: '#upload_btn_thumb',
url: '/admin/api/upload',
done: function (res) {
//如果上传失败
if (res.code == 1) {
return layer.msg('上传失败');
}
//上传成功
$('#upload_box_thumb input').attr('value', res.data.filepath);
$('#upload_box_thumb img').attr('src', res.data.filepath);
}
});
street();
village();
form.on('select(area_id)', function (data) {
street(data.value)
});
function street (id) {
var demo1 = xmSelect.render({
name: 'township',
el: '#demo1',
initValue: [],
prop: {
name: 'name',
value: 'code',
},
data: [],
radio: true,
disabled: group_access == 2 ||group_access == 4? true : false,
on: function (data) {
var arr = data.arr;
if(arr.length > 0){
village(arr[0]['code']);
}else{
village();
}
},
})
$.get('/api/geo/street?pcode=' + id, function (result) {
demo1.update({
data: result.data
})
});
}
function village (id) {
var demo2 = xmSelect.render({
name: 'village',
el: '#demo2',
initValue: [],
prop: {
name: 'name',
value: 'id',
},
data: [],
radio: true,
disabled: group_access == 2 ? true : false,
})
$.get('/api/geo/village?pcode=' + id, function (result) {
demo2.update({
data: result.data
})
});
}
var editor = layui.tinymce;
var edit = editor.render({
selector: "#container_content",
height: 500
});
//监听提交
form.on('submit(webform)', function (data) {
data.field.content = tinyMCE.editors['container_content'].getContent();
if (data.field.content == '') {
layer.msg('请先完善文章内容');
return false;
}
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
tool.tabRefresh(71);
tool.sideClose(1000);
}
}
tool.post('', data.field, callback);
return false;
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,172 @@
{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
<div class="p-3">
<form class="layui-form gg-form-bar border-t border-x">
<div class="layui-input-inline" style="width:300px;">
<input type="text" name="keywords" placeholder="请输入关键字" class="layui-input" autocomplete="off" />
</div>
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">提交搜索</button>
</form>
<table class="layui-hide" id="store_product" lay-filter="store_product"></table>
</div>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加商品">+ 添加商品</span>
</div>
</script>
<script type="text/html" id="barDemo">
<div class="layui-btn-group"><a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a><a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a><a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a></div>
</script>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool'];
function gouguInit() {
var table = layui.table,tool = layui.tool, form = layui.form;
layui.pageTable = table.render({
elem: '#store_product',
title: '商品表列表',
toolbar: '#toolbarDemo',
url: '/admin/store_product/datalist',
page: true,
limit: 20,
cellMinWidth: 300,
cols: [
[
{
fixed: 'left',
field: 'product_id',
title: '编号',
align: 'center',
width: 80
},{
field: 'image',
title: '商品图片',
align: 'center',
width: 100,
templet: '<div><img src="{{ d.image }}" style="width:30px; height:30px;"></div>',
},{
field: 'store_name',
title: '商品名称',
align: 'center',
width: 100
},{
field: 'store_info',
title: '商品简介',
align: 'center',
width: 100
},{
field: 'keyword',
title: '关键字',
align: 'center',
width: 100
},{
field: 'brand_id',
title: '品牌 id',
align: 'center',
width: 100
},{
field: 'cate_id',
title: '分类',
align: 'center',
width: 100
},{
field: 'unit_name',
title: '单位名',
align: 'center',
width: 100
},{
field: 'sales',
title: '销量',
align: 'center',
width: 100
},{
field: 'price',
title: '最低价格',
align: 'center',
width: 100
},{
field: 'cost',
title: '成本价',
align: 'center',
width: 100
},{
field: 'ot_price',
title: '原价',
align: 'center',
width: 100
},{
field: 'stock',
title: '总库存',
align: 'center',
width: 100
}, {
fixed: 'right',
field: 'right',
title: '操作',
toolbar: '#barDemo',
width: 136,
align: 'center'
}
]
]
});
//监听表头工具栏事件
table.on('toolbar(store_product)', function(obj){
if (obj.event === 'add') {
tool.side("/admin/store_product/add");
return false;
}
});
//监听表格行工具事件
table.on('tool(store_product)', function(obj) {
var data = obj.data;
if (obj.event === 'read') {
tool.side('/admin/store_product/read?product_id='+obj.data.product_id);
}
else if (obj.event === 'edit') {
tool.side('/admin/store_product/edit?product_id='+obj.data.product_id);
}
else if (obj.event === 'del') {
layer.confirm('确定要删除该记录吗?', {
icon: 3,
title: '提示'
}, function(index) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
obj.del();
}
}
tool.delete("/admin/store_product/del", { product_id: data.product_id }, callback);
layer.close(index);
});
}
return false;
});
//监听搜索提交
form.on('submit(searchform)', function(data) {
layui.pageTable.reload({
where: {
keywords: data.field.keywords
},
page: {
curr: 1
}
});
return false;
});
}
</script>
{/block}
<!-- /脚本 -->