懒羊羊
2023-08-30 1ac2bc1590406d9babec036e154d8d08f34a6aa1
提交 | 用户 | 时间
1ac2bc 1 <!doctype html>
2 <html>
3 <head>
4     <title>Activiti Editor</title>
5     <meta charset="utf-8"/>
6     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
7     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
8     <link rel="stylesheet" href="${ctxPath}/assets/common/libs/layui/css/layui.css?v=${constants.getReleaseVersion()}"/>
9     <link rel="stylesheet" href="${ctxPath}/assets/common/module/admin.css?v=${constants.getReleaseVersion()}" media="all"/>
10     <link rel="stylesheet" href="${ctxPath}/assets/expand/css/style.css?v=${constants.getReleaseVersion()}" media="all"/>
11 </head>
12 <body>
13 <div class="layui-card">
14     <div class="layui-card-body">
15         <div class="layui-form toolbar">
16             <div class="layui-form-item">
17                 <input id="roleId" value="" type="hidden"/>
18                 <div class="layui-inline">
19                     <input id="name" class="layui-input" type="text" placeholder="角色名称"/>
20                 </div>
21                 <div class="layui-inline">
22                     <button id="btnSearch" class="layui-btn icon-btn"><i class="layui-icon">&#xe615;</i>搜索</button>
23                 </div>
24             </div>
25         </div>
26         <table class="layui-table" id="selectRoleTable" lay-filter="selectRoleTable"></table>
27     </div>
28 </div>
29 </body>
30 </html>
31 <script type="text/javascript">
32     var Feng = {
33         ctxPath: "${ctxPath}",
34         version: '${constants.getReleaseVersion()}'
35     };
36 </script>
37
38 <script type="text/javascript" src="${ctxPath}/assets/common/libs/layui/layui.js?v=${constants.getReleaseVersion()}"></script>
39 <script type="text/javascript" src="${ctxPath}/assets/common/js/common.js?v=${constants.getReleaseVersion()}"></script>
40 <script>
41     layui.use(['jquery', 'table'], function () {
42
43         var $ = layui.jquery;
44         var table = layui.table;
45
46         var SelectRoleTable = {
47             tableId: 'selectRoleTable'
48         };
49
50         SelectRoleTable.initColumn = function () {
51             return [[
52                 {type: 'numbers', title: 'No'},
53                 {field: "id", hide: true, title: 'id'},
54                 {field: "name", title: '角色名'},
55                 {field: "description", title: '描述'}
56             ]]
57         };
58
59         // 搜索按钮点击事件
60         $('#btnSearch').click(function () {
61             SelectRoleTable.search();
62         });
63
64         /**
65          * 点击查询按钮
66          */
67         SelectRoleTable.search = function () {
68             var queryData = {};
69             queryData['name'] = $("#name").val();
70             table.reload(SelectRoleTable.tableId, {
71                 where: queryData, page: {curr: 1}
72             });
73         };
74
75         table.render({
76             elem: '#' + SelectRoleTable.tableId,
77             url: Feng.ctxPath + '/role/listRole',
78             page: true,
79             height: "full-98",
80             cellMinWidth: 100,
81             cols: SelectRoleTable.initColumn()
82         });
83
84         table.on('rowDouble(selectRoleTable)', function (obj) {
85             //缓存roleId
86             top.layui.data('tempIndex', {
87                 key: 'roleId', value: obj.data.id
88             });
89
90             //关闭窗口
91             top.layer.close(top.layui.data('tempIndex').roleIndex);
92         });
93     });
94 </script>
95