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 |   48 +++++++++++++++++++++---------------------------
 1 files changed, 21 insertions(+), 27 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 d015f0d..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,7 +16,7 @@
                 <option value="">-请选择-</option>
                 <option value="name">角色名称</option>
             </select>&emsp;
-            <input id="role-edit-value" class="layui-input search-input" type="text" placeholder="输入关键字" />&emsp;
+            <input id="role-edit-value" class="layui-input search-input" type="text" placeholder="按关键字" />&emsp;
             <button id="role-btn-search" class="layui-btn icon-btn"><i class="layui-icon">&#xe615;</i>搜索</button>
             <button id="role-btn-add" class="layui-btn icon-btn permissions" permissions="saveOrUpdate"><i class="layui-icon">&#xe654;</i>添加</button>
         </div>
@@ -138,21 +138,20 @@
             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(){
-                permissionsInput();
+            done:function(res){
+                permissionsInput(res,config);
             }
         });
 
@@ -174,7 +173,7 @@
                 })
                 form.render();
             } else {
-                layer.msg(data.msg, { icon: 2, time: 500 });
+                layer.msg(data.msg, { icon: 2, time: 2000 });
             }
         }, 'GET');
 
@@ -190,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;
@@ -207,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);
                 }
@@ -219,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');
@@ -255,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');
                 }
@@ -296,7 +292,7 @@
                     layer.closeAll('loading');
 
                 } else {
-                    layer.msg(data.msg, { icon: 2, time: 500 });
+                    layer.msg(data.msg, { icon: 2, time: 2000 });
                 }
             }, 'get');
         }
@@ -343,7 +339,6 @@
         };
         //数据权限的点击事件
         form.on('select(role_organization)', function (data) {
-            console.log(data.value)
             if (data.value == 2) {
                 $("#tree").show();
             }else{
@@ -363,7 +358,6 @@
                     $('#role-form').attr('method', 'POST');
                     if (data) {
                         getData();
-                        console.log(data.type)
                         if(data.type!=2){
                             $("#tree").hide();
                         }
@@ -383,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');
             });
@@ -438,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