wip(semantic):调整模板文件内容

This commit is contained in:
zhengxinonly
2021-09-09 02:52:15 +08:00
parent 733286b090
commit db5b4e89ed
2 changed files with 14 additions and 14 deletions
+10 -10
View File
@@ -54,11 +54,11 @@
{% endif %}
</script>
{#操作字段,需要在表格中使用#}
<script type="text/html" id="tools">
<button class="pear-btn pear-btn-primary pear-btn-sm" lay-event="tools_edit">
<script type="text/html" id="tool">
<button class="pear-btn pear-btn-primary pear-btn-sm" lay-event="tool_edit">
<i class="layui-icon layui-icon-edit"></i>
</button>
<button class="pear-btn pear-btn-danger pear-btn-sm" lay-event="tools_remove">
<button class="pear-btn pear-btn-danger pear-btn-sm" lay-event="tool_remove">
<i class="layui-icon layui-icon-delete"></i>
</button>
</script>
@@ -114,7 +114,7 @@
{ field: 'address', title: '详细地址' },
{ field: 'status', title: '状态', templet: '#dept-status' },
{ field: 'sort', title: '排序', width: 100 },
{ title: '操作', templet: '#tools', width: 120, align: 'center' }
{ title: '操作', templet: '#tool', width: 120, align: 'center' }
]
]/*表格渲染的数据*/
})
@@ -155,12 +155,12 @@
/*表格的操作栏*/
table.on('tool(tables)', function (obj) {
if (obj.event === 'tools_remove') {
if (obj.event === 'tool_remove') {
/*移出事件*/
window.tools_remove(obj)
} else if (obj.event === 'tools_edit') {
window.tool_remove(obj)
} else if (obj.event === 'tool_edit') {
/*编辑事件*/
window.tools_edit(obj)
window.tool_edit(obj)
}
})
@@ -215,7 +215,7 @@
})
}
window.tools_edit = function (obj) {
window.tool_edit = function (obj) {
layer.open({
type: 2,
@@ -227,7 +227,7 @@
}
window.tools_remove = function (obj) {
window.tool_remove = function (obj) {
layer.confirm('确定要删除该部门', { icon: 3, title: '提示' }, function (index) {
layer.close(index)
let loading = layer.load()
+4 -4
View File
@@ -24,8 +24,8 @@
删除
</button>
</script>
<script type="text/html" id="tools">
<button class="pear-btn pear-btn-danger pear-btn-sm" lay-event="tools-remove">
<script type="text/html" id="tool">
<button class="pear-btn pear-btn-danger pear-btn-sm" lay-event="tool-remove">
<i class="layui-icon layui-icon-delete"></i>
</button>
</script>
@@ -64,7 +64,7 @@
unresize: true,
align: 'center',
templet: (d) => {
return `<img class="tools-photo" style="max-width: 100%;height: 100%;cursor: pointer;" lay-event="photo" src="${d.href}"></i>`
return `<img class="tool-photo" style="max-width: 100%;height: 100%;cursor: pointer;" lay-event="photo" src="${d.href}"></i>`
},
},
@@ -89,7 +89,7 @@
},
{
title: '操作',
toolbar: '#tools',
toolbar: '#tool',
align: 'center',
unresize: true,
width: 200,