diff --git a/component/pear/modules/admin.js b/component/pear/modules/admin.js index ca22e3f..2e13229 100644 --- a/component/pear/modules/admin.js +++ b/component/pear/modules/admin.js @@ -138,7 +138,10 @@ layui.define(['table', 'jquery', 'element', 'yaml', 'form', 'tab', 'menu', 'fram }) sideMenu.click(function(dom, data) { - + + console.log("点击项:"+JSON.stringify(dom)) + console.log("元数据:"+JSON.stringify(data)); + bodyTab.addTabOnly({ id: data.menuId, title: data.menuTitle, @@ -159,6 +162,10 @@ layui.define(['table', 'jquery', 'element', 'yaml', 'form', 'tab', 'menu', 'fram }); sideMenu.click(function(dom, data) { + + console.log("点击项:"+dom) + console.log("元数据:"+data); + bodyFrame.changePage(data.menuUrl, data.menuPath, true); compatible() }) diff --git a/component/pear/modules/menu.js b/component/pear/modules/menu.js index d8e1547..855a103 100644 --- a/component/pear/modules/menu.js +++ b/component/pear/modules/menu.js @@ -50,7 +50,8 @@ layui.define(['table', 'jquery', 'element'], function(exports) { menuTitle: dom.attr("menu-title"), menuPath: dom.attr("menu-title"), menuIcon: dom.attr("menu-icon"), - menuUrl: dom.attr("menu-url") + menuUrl: dom.attr("menu-url"), + openType: dom.attr("open-type") }; var doms = hash(dom); if (doms.text() != '') { diff --git a/view/document/treetable.html b/view/document/treetable.html index fdd0e76..2d0b8e2 100644 --- a/view/document/treetable.html +++ b/view/document/treetable.html @@ -192,7 +192,50 @@ }) }); } - + + window.batchRemove = function(obj) { + let data = table.checkStatus(obj.config.id).data; + if (data.length === 0) { + layer.msg("未选中数据", { + icon: 3, + time: 1000 + }); + return false; + } + let ids = ""; + for (let i = 0; i < data.length; i++) { + ids += data[i].powerId + ","; + } + ids = ids.substr(0, ids.length - 1); + layer.confirm('确定要删除这些数据', { + icon: 3, + title: '提示' + }, function(index) { + layer.close(index); + let loading = layer.load(); + $.ajax({ + url: MODULE_PATH + "batchRemove/" + ids, + dataType: 'json', + type: 'delete', + success: function(result) { + layer.close(loading); + if (result.success) { + layer.msg(result.msg, { + icon: 1, + time: 1000 + }, function() { + table.reload('user-table'); + }); + } else { + layer.msg(result.msg, { + icon: 2, + time: 1000 + }); + } + } + }) + }); + } }) diff --git a/view/system/power.html b/view/system/power.html index 68a546a..9f69343 100644 --- a/view/system/power.html +++ b/view/system/power.html @@ -194,6 +194,50 @@ }); } + + window.batchRemove = function(obj) { + let data = table.checkStatus(obj.config.id).data; + if (data.length === 0) { + layer.msg("未选中数据", { + icon: 3, + time: 1000 + }); + return false; + } + let ids = ""; + for (let i = 0; i < data.length; i++) { + ids += data[i].powerId + ","; + } + ids = ids.substr(0, ids.length - 1); + layer.confirm('确定要删除这些权限', { + icon: 3, + title: '提示' + }, function(index) { + layer.close(index); + let loading = layer.load(); + $.ajax({ + url: MODULE_PATH + "batchRemove/" + ids, + dataType: 'json', + type: 'delete', + success: function(result) { + layer.close(loading); + if (result.success) { + layer.msg(result.msg, { + icon: 1, + time: 1000 + }, function() { + table.reload('user-table'); + }); + } else { + layer.msg(result.msg, { + icon: 2, + time: 1000 + }); + } + } + }) + }); + } })