| | |
| | | <div class="layui-card-body"> |
| | | <div class="layui-form toolbar"> |
| | | 所属应用:<select id="menu_clients" lay-filter="menu_clients"></select> |
| | |  搜索:<input id="menus-edit-search" class="layui-input search-input" type="text" placeholder="输入关键字"/>  |
| | |  搜索:<input id="menus-edit-search" class="layui-input search-input" type="text" |
| | | placeholder="按关键字" />  |
| | | <button id="menus-btn-search" class="layui-btn icon-btn"><i class="layui-icon"></i>搜索</button> |
| | | <button id="menus-btn-add" class="layui-btn icon-btn"><i class="layui-icon"></i>添加</button> |
| | | <button id="menus-btn-add" class="layui-btn icon-btn permissions" permissions="saveOrUpdate"><i class="layui-icon"></i>添加</button> |
| | | <button id="menus-btn-expand" class="layui-btn">全部展开</button> |
| | | <button id="menus-btn-fold" class="layui-btn">全部折叠</button> |
| | | </div> |
| | |
| | | <!-- 表格操作列 --> |
| | | <script type="text/html" id="menus-state"> |
| | | <!-- <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="add">下级</a>--> |
| | | <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-primary layui-btn-xs permissions" permissions="saveOrUpdate" lay-event="edit">修改</a> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs permissions" permissions="menus-del" lay-event="del">删除</a> |
| | | </script> |
| | | |
| | | |
| | |
| | | where: param, |
| | | page: false, |
| | | cols: [[ |
| | | {type: 'numbers'}, |
| | | {field: 'name', minWidth: 200, title: '菜单名称'}, |
| | | {field: 'tenantId', minWidth: 80, title: '应用标识'}, |
| | | {field: 'url', title: '菜单url'}, |
| | | {field: 'path', title: '菜单path'}, |
| | | {field: 'css', align: 'center', title: '样式'}, |
| | | {field: 'sort', width: 80, align: 'center', title: '排序号'}, |
| | | { type: 'numbers' ,width: "3%" }, |
| | | { field: 'name',width: "15%", minWidth: 200, title: '菜单名称' }, |
| | | { field: 'tenantId',width: "7%", minWidth: 80, title: '应用标识' }, |
| | | { field: 'url',width: "20%", title: '菜单url' }, |
| | | { field: 'path',width: "15%", title: '菜单path' }, |
| | | { field: 'css',width: "10%", align: 'center', title: '样式' }, |
| | | { field: 'sort', width: "5%", align: 'center', title: '排序号' }, |
| | | { |
| | | field: 'type', width: 80, align: 'center', templet: function (d) { |
| | | field: 'type', width: "5%", align: 'center', templet: function (d) { |
| | | if (d.type === 2) { |
| | | return '<span class="layui-badge layui-bg-gray">资源</span>'; |
| | | } |
| | |
| | | } |
| | | }, title: '类型' |
| | | }, |
| | | {field: 'enabled', width: 100,sort: true, templet: '#menu-tpl-state', title: '状态'}, |
| | | {templet: '#menus-state', width: 120, align: 'center', title: '操作'} |
| | | ]] |
| | | { field: 'enabled', width: "10%", sort: true, templet: '#menu-tpl-state', title: '状态' }, |
| | | { templet: '#menus-state', width: "10%", align: 'center', title: '操作' } |
| | | ]], |
| | | done: function (res) { |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | }; |
| | | renderTable({tenantId: config.clientId}); |
| | |
| | | }) |
| | | form.render(); |
| | | } else { |
| | | layer.msg(data.msg, {icon: 2, time: 500}); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | } |
| | | }, 'GET'); |
| | | |
| | |
| | | }, 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'); |
| | | } |
| | |
| | | admin.req('api-user/menus/'+obj.data.id+'?tenantId='+tenantId, {}, 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 }); |
| | | renderTable({tenantId: tenantId}); |
| | | } else { |
| | | layer.msg(data.msg, {icon: 2, time: 500}); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | } |
| | | }, 'DELETE'); |
| | | }); |
| | |
| | | } |
| | | }); |
| | | if (keyword !== '' && searchCount === 0) { |
| | | layer.msg("没有匹配结果", {icon: 5, time: 500}); |
| | | layer.msg("没有匹配结果", { icon: 5, time: 2000 }); |
| | | } else { |
| | | treetable.expandAll('#menus-table'); |
| | | } |