1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
| {extend name="../../base/view/common/base" /}
| <!-- 主体 -->
| {block name="body"}
| <div class="p-page">
| <table class="layui-hide" id="conf" lay-filter="conf"></table>
| </div>
|
| <script type="text/html" id="toolbarDemo">
| <div class="layui-btn-container">
| <h3>模块配置及数据权限配置</h3>
| </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: '#conf',
| title: '配置列表',
| toolbar: '#toolbarDemo',
| defaultToolbar: false,
| url: "/home/dataauth/index",
| cellMinWidth: 80,
| page: false, //开启分页
| limit: 20,
| cols: [
| [{
| field: 'id',
| width: 80,
| title: 'ID编号',
| align: 'center'
| }, {
| field: 'title',
| width: 200,
| title: '权限名称'
| }, {
| field: 'name',
| width: 200,
| title: '权限标识'
| }, {
| field: 'desc',
| minWidth: 300,
| title: '描述'
| }, {
| width: 100,
| title: '操作',
| align: 'center',
| templet: function (d) {
| var html = '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit" >编辑配置</button>';
| return html;
| }
| }]
| ]
| });
|
| //监听行工具事件
| table.on('tool(conf)', function (obj) {
| var data = obj.data;
| if (obj.event === 'edit') {
| tool.side('/home/dataauth/edit?id=' + data.id);
| return;
| }
| });
| }
| </script>
| {/block}
| <!-- /脚本 -->
|
|