From e6bdc34995298e807824097e555c3e46fb746e3b Mon Sep 17 00:00:00 2001 From: zxh <279049017@qq.com> Date: Wed, 26 Aug 2020 09:48:53 +0800 Subject: [PATCH] 调整表格的宽度 --- kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/system/role.html | 61 ++++++++++++++---------------- 1 files changed, 29 insertions(+), 32 deletions(-) diff --git a/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/system/role.html b/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/system/role.html index 66ee95e..ce7367f 100644 --- a/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/system/role.html +++ b/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/system/role.html @@ -16,9 +16,9 @@ <option value="">-请选择-</option> <option value="name">角色名称</option> </select>  - <input id="role-edit-value" class="layui-input search-input" type="text" placeholder="输入关键字" />  + <input id="role-edit-value" class="layui-input search-input" type="text" placeholder="按关键字" />  <button id="role-btn-search" class="layui-btn icon-btn"><i class="layui-icon"></i>搜索</button> - <button id="role-btn-add" class="layui-btn icon-btn"><i class="layui-icon"></i>添加</button> + <button id="role-btn-add" class="layui-btn icon-btn permissions" permissions="saveOrUpdate"><i class="layui-icon"></i>添加</button> </div> <!-- 数据表格 --> @@ -102,10 +102,10 @@ <!-- 表格操作列 --> <script type="text/html" id="role-table-bar"> - <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">修改</a> - <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a> - <a class="layui-btn layui-btn-xs" lay-event="auth">权限分配</a> - <a class="layui-btn layui-btn-xs" lay-event="auth_role">分配数据权限</a> + <a class="layui-btn layui-btn-primary layui-btn-xs permissions" permissions="updateEnabled" lay-event="edit">修改</a> + <a class="layui-btn layui-btn-danger layui-btn-xs permissions" permissions="role-del" lay-event="del">删除</a> + <a class="layui-btn layui-btn-xs permissions" permissions="menus-granted" lay-event="auth">权限分配</a> + <a class="layui-btn layui-btn-xs permissions" permissions="sysroleorganization" lay-event="auth_role">分配数据权限</a> </script> <!-- 表格状态列 --> @@ -138,19 +138,21 @@ page: true, cellMinWidth: 80, cols: [[ - { type: 'numbers' }, - { field: 'id', sort: true, title: 'ID', width: 80 }, { field: 'name', sort: true, title: '角色名' }, { field: 'code', sort: true, title: 'Code' }, { field: 'tenantId', sort: true, title: '应用标识' }, - { - field: 'createTime', sort: true, templet: function (d) { - return util.toDateString(d.createTime); - }, title: '创建时间' - }, + // { + // field: 'createTime', sort: true, templet: function (d) { + // return util.toDateString(d.createTime); + // }, title: '创建时间' + // }, + { field: 'createTime', width: 250, sort: true, title: '创建时间', templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy/MM/dd HH:mm')}}</div>" }, { field: 'enabled', width: 100, sort: true, templet: '#role-tpl-state', title: '状态' }, { align: 'center', toolbar: '#role-table-bar', title: '操作', width: 320 } - ]] + ]], + done:function(res){ + permissionsInput(res,config); + } }); // 获取应用列表 @@ -171,7 +173,7 @@ }) form.render(); } else { - layer.msg(data.msg, { icon: 2, time: 500 }); + layer.msg(data.msg, { icon: 2, time: 2000 }); } }, 'GET'); @@ -187,13 +189,12 @@ layer.load(2); admin.req('api-user/roles/saveOrUpdate?tenantId=' + tenantId, JSON.stringify(data.field), function (data) { layer.closeAll('loading'); - // console.log(data); if (data.code === 0) { - layer.msg(data.msg, { icon: 1, time: 500 }); + layer.msg(data.msg, { icon: 1, time: 2000 }); table.reload('role-table'); layer.closeAll('page'); } else { - layer.msg(data.msg, { icon: 2, time: 500 }); + layer.msg(data.msg, { icon: 2, time: 2000 }); } }, $('#role-form').attr('method')); return false; @@ -204,7 +205,6 @@ var treeObj = $.fn.zTree.getZTreeObj('treeMenu-role'); var nodes = treeObj.getCheckedNodes(true); $.each(nodes,function(i,item){ - // console.log(item) if(!item.children){ array.push(item.id); } @@ -216,13 +216,12 @@ layer.load(2); admin.req('api-user/sysroleorganization', JSON.stringify(data.field), function (data) { layer.closeAll('loading'); - console.log(data); if (data.code === 0) { - layer.msg(data.msg, { icon: 1, time: 500 }); + layer.msg(data.msg, { icon: 1, time: 2000 }); table.reload('role-table'); layer.closeAll('page'); } else { - layer.msg(data.msg, { icon: 2, time: 500 }); + layer.msg(data.msg, { icon: 2, time: 2000 }); } }, $('#role-form').attr('method')); layer.closeAll('page'); @@ -239,7 +238,7 @@ } else if (obj.event === 'auth') { // 权限分配 showMenuDialog(obj.data.id, obj.data.tenantId); } else if (obj.event === 'auth_role') { - showEditModelRole(data); + showEditModelRole(data);//分配数据权限 } }); @@ -252,9 +251,9 @@ }, function (data) { layer.closeAll('loading'); if (data.code == 0) { - layer.msg(data.msg, { icon: 1, time: 500 }); + layer.msg(data.msg, { icon: 1, time: 2000 }); } else { - layer.msg(data.msg, { icon: 2, time: 500 }); + layer.msg(data.msg, { icon: 2, time: 2000 }); $(obj.elem).prop('checked', !obj.elem.checked); form.render('checkbox'); } @@ -293,7 +292,7 @@ layer.closeAll('loading'); } else { - layer.msg(data.msg, { icon: 2, time: 500 }); + layer.msg(data.msg, { icon: 2, time: 2000 }); } }, 'get'); } @@ -340,7 +339,6 @@ }; //数据权限的点击事件 form.on('select(role_organization)', function (data) { - console.log(data.value) if (data.value == 2) { $("#tree").show(); }else{ @@ -360,7 +358,6 @@ $('#role-form').attr('method', 'POST'); if (data) { getData(); - console.log(data.type) if(data.type!=2){ $("#tree").hide(); } @@ -380,10 +377,10 @@ admin.req('api-user/roles/' + obj.data.id + '?tenantId=' + tenantId, {}, function (data) { layer.closeAll('loading'); if (data.code === 0) { - layer.msg(data.msg, { icon: 1, time: 500 }); + layer.msg(data.msg, { icon: 1, time: 2000 }); obj.del(); } else { - layer.msg(data.msg, { icon: 2, time: 500 }); + layer.msg(data.msg, { icon: 2, time: 2000 }); } }, 'DELETE'); }); @@ -435,10 +432,10 @@ admin.req('api-user/menus/granted?tenantId=' + tenantId, JSON.stringify(data), function (data) { layer.closeAll('loading'); if (0 == data.code) { - layer.msg(data.msg, { icon: 1, time: 500 }); + layer.msg(data.msg, { icon: 1, time: 2000 }); layer.close(index); } else { - layer.msg(data.msg, { icon: 2, time: 500 }); + layer.msg(data.msg, { icon: 2, time: 2000 }); } }, 'POST'); } -- Gitblit v1.8.0