From bf94e9adfb6bea73fb8f525398a6d7c698528f78 Mon Sep 17 00:00:00 2001 From: ndbs Date: Wed, 9 Feb 2022 12:21:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=92=E8=89=B2=E7=AE=A1=E7=90=86=20:=20?= =?UTF-8?q?=E8=A7=92=E8=89=B2=E6=8E=88=E6=9D=83=E6=8A=98=E5=8F=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/Authorize/Form.js | 60 ++++++++++++++++--- .../Controllers/ModuleController.cs | 52 ++++++++++++++++ .../SystemModule/Module/ModuleBLL.cs | 6 +- 3 files changed, 106 insertions(+), 12 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_AuthorizeModule/Views/Authorize/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_AuthorizeModule/Views/Authorize/Form.js index a95a4a8f2..82827cd7a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_AuthorizeModule/Views/Authorize/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_AuthorizeModule/Views/Authorize/Form.js @@ -66,32 +66,74 @@ var bootstrap = function ($, learun) { /*绑定事件和初始化控件*/ bind: function () { learun.loading(true, '正在获取数据'); - learun.httpAsyncGet(top.$.rootUrl + '/LR_SystemModule/Module/GetCheckTree', function (res) { + learun.httpAsyncGet(top.$.rootUrl + '/LR_SystemModule/Module/GetCheckTreeForModuleList', function (res) { if (res.code == 200) { treeData = res.data; $('#step-1').lrtree({ - data: treeData.moduleList + data: treeData.moduleList, + isAllExpand:false }); + if (!!objectId) { + setTreeData1(); + } + } + setTimeout(function () { + learun.loading(false); + }); + }); + learun.httpAsyncGet(top.$.rootUrl + '/LR_SystemModule/Module/GetCheckTreeForButtonList', function (res) { + if (res.code == 200) { + treeData = res.data; $('#step-2').lrtree({ data: treeData.buttonList }); + if (!!objectId) { + setTreeData2(); + } + } + setTimeout(function () { + learun.loading(false); + }); + }); + learun.httpAsyncGet(top.$.rootUrl + '/LR_SystemModule/Module/GetCheckTreeForColumnList', function (res) { + if (res.code == 200) { + treeData = res.data; $('#step-3').lrtree({ data: treeData.columnList }); - //$('#step-4').lrtree({ - // data: treeData.formList - //}); if (!!objectId) { - setTreeData1(); - setTreeData2(); setTreeData3(); - //setTreeData4(); } } setTimeout(function () { learun.loading(false); }); }); + //learun.httpAsyncGet(top.$.rootUrl + '/LR_SystemModule/Module/GetCheckTree', function (res) { + // if (res.code == 200) { + // treeData = res.data; + // $('#step-1').lrtree({ + // data: treeData.moduleList + // }); + // $('#step-2').lrtree({ + // data: treeData.buttonList + // }); + // $('#step-3').lrtree({ + // data: treeData.columnList + // }); + // //$('#step-4').lrtree({ + // // data: treeData.formList + // //}); + // if (!!objectId) { + // setTreeData1(); + // setTreeData2(); + // setTreeData3(); + // } + // } + // setTimeout(function () { + // learun.loading(false); + // }); + //}); // 加载导向 $('#wizard').wizard().on('change', function (e, data) { var $finish = $("#btn_finish"); @@ -107,7 +149,7 @@ var bootstrap = function ($, learun) { $('#step-3_' + item.replace(/-/g, '_') + '_learun_moduleId').parent().show(); //$('#step-4_' + item.replace(/-/g, '_') + '_learun_moduleId').parent().show(); }); - //} else if (data.step == 3) { + //} else if (data.step == 3) { } else if (data.step == 2) { $finish.removeAttr('disabled'); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Controllers/ModuleController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Controllers/ModuleController.cs index d5ab12eaf..68959df82 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Controllers/ModuleController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Controllers/ModuleController.cs @@ -121,6 +121,58 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers return this.JsonResult(jsonData); } + /// + /// 获取树形数据(带勾选框)--系统模块 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetCheckTreeForModuleList() + { + var moduleList = moduleIBLL.GetModuleCheckTree(); + + var jsonData = new + { + moduleList, + }; + + return this.JsonResult(jsonData); + } + /// + /// 获取树形数据(带勾选框)--系统按钮 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetCheckTreeForButtonList() + { + var buttonList = moduleIBLL.GetButtonCheckTree(); + + var jsonData = new + { + buttonList, + }; + + return this.JsonResult(jsonData); + } + /// + /// 获取树形数据(带勾选框)--系统视图 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetCheckTreeForColumnList() + { + var columnList = moduleIBLL.GetColumnCheckTree(); + + var jsonData = new + { + columnList + //formList + }; + + return this.JsonResult(jsonData); + } #endregion #region 模块按钮 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Base/SystemModule/Module/ModuleBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Base/SystemModule/Module/ModuleBLL.cs index 2c3889e69..f1e84280c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Base/SystemModule/Module/ModuleBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Base/SystemModule/Module/ModuleBLL.cs @@ -147,7 +147,7 @@ namespace Learun.Application.Base.SystemModule node.value = item.F_EnCode; node.showcheck = true; node.checkstate = 0; - node.isexpand = true; + node.isexpand = false; node.icon = item.F_Icon; node.parentId = item.F_ParentId; treeList.Add(node); @@ -346,7 +346,7 @@ namespace Learun.Application.Base.SystemModule node.value = module.F_EnCode; node.showcheck = true; node.checkstate = 0; - node.isexpand = true; + node.isexpand = false; node.icon = module.F_Icon; node.parentId = module.F_ParentId + "_learun_moduleId"; if (module.F_Target != "expand") @@ -462,7 +462,7 @@ namespace Learun.Application.Base.SystemModule node.value = module.F_EnCode; node.showcheck = true; node.checkstate = 0; - node.isexpand = true; + node.isexpand = false; node.icon = module.F_Icon; node.parentId = module.F_ParentId + "_learun_moduleId";