From d512420c5c85616bfdd46982b0e827cb1f172298 Mon Sep 17 00:00:00 2001 From: weizhiqiang <598748873@qq.com> Date: Thu, 17 Nov 2022 09:57:02 +0000 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=9D=83=E9=99=90=E6=8F=92?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../js/teamTemplate/teamTemplateAdd.js | 20 +------ .../template/assets/lib/layui/custom.js | 1 + .../customer/teamObjectPermissionUtil.js | 56 +++++++++++++++++++ 3 files changed, 58 insertions(+), 19 deletions(-) create mode 100644 web/src/main/resources/template/assets/lib/layui/customer/teamObjectPermissionUtil.js diff --git a/common/src/main/resources/template/js/teamTemplate/teamTemplateAdd.js b/common/src/main/resources/template/js/teamTemplate/teamTemplateAdd.js index 245e728f7..dabc1a937 100644 --- a/common/src/main/resources/template/js/teamTemplate/teamTemplateAdd.js +++ b/common/src/main/resources/template/js/teamTemplate/teamTemplateAdd.js @@ -40,25 +40,7 @@ layui.config({ function loadAuthList() { var objectType = $('#objectType').val(); - if (isNull(objectType)) { - $('#authList').html(''); - } else { - jsGetJsonFile("../../json/teamObjectLink.json", function(data) { - var authStrList = data[objectType]; - var str = ``; - $.each(authStrList, function(i, item) { - var bean = { - key: item, - name: skyeyeClassEnum[item].name - }; - var authBtnJson = skyeyeClassEnumUtil.getEnumDataListByClassName(item); - authBtnJson["bean"] = bean; - str += getDataUseHandlebars($('#authTableTemplate').html(), {json: authBtnJson}); - }); - $('#authList').html(str); - }); - } - form.render(); + teamObjectPermissionUtil.insertPageShow(objectType, 'authList', form); } $("body").on("click", "#cancle", function() { diff --git a/web/src/main/resources/template/assets/lib/layui/custom.js b/web/src/main/resources/template/assets/lib/layui/custom.js index 959122f07..222e34a70 100644 --- a/web/src/main/resources/template/assets/lib/layui/custom.js +++ b/web/src/main/resources/template/assets/lib/layui/custom.js @@ -39,6 +39,7 @@ var customerJS = { "sysDictDataUtil": "../../assets/lib/layui/customer/skyeye/sysDictDataUtil.js", // 数据字典插件 "initTableSearchUtil": "../../assets/lib/layui/customer/tableUtil/initTableSearchUtil.js", // 表格高级查询插件 "skyeyeClassEnumUtil": "../../assets/lib/layui/customer/skyeye/skyeyeClassEnumUtil.js", // 动态枚举插件 + "teamObjectPermissionUtil": "../../assets/lib/layui/customer/teamObjectPermissionUtil.js", // 团队成员权限插件 }; //系统基础信息 diff --git a/web/src/main/resources/template/assets/lib/layui/customer/teamObjectPermissionUtil.js b/web/src/main/resources/template/assets/lib/layui/customer/teamObjectPermissionUtil.js new file mode 100644 index 000000000..35dd61d0b --- /dev/null +++ b/web/src/main/resources/template/assets/lib/layui/customer/teamObjectPermissionUtil.js @@ -0,0 +1,56 @@ + +// 团队成员权限工具 +var teamObjectPermissionUtil = { + + template: `{{#json}} +
+ +
+ + + + + {{#each rows}} + + {{/each}} + + + + {{#each roleList}} + + + {{#each ../rows}} + + {{/each}} + + {{/each}} + +
成员{{name}}
{{name}}{{name}}
+
+
+ {{/json}}`; + + // 新增时的展示 + insertPageShow: function (objectType, showBoxId, form) { + if (isNull(objectType)) { + $('#authList').html(''); + } else { + jsGetJsonFile("../../json/teamObjectLink.json", function(data) { + var authStrList = data[objectType]; + var str = ``; + $.each(authStrList, function(i, item) { + var bean = { + key: item, + name: skyeyeClassEnum[item].name + }; + var authBtnJson = skyeyeClassEnumUtil.getEnumDataListByClassName(item); + authBtnJson["bean"] = bean; + str += getDataUseHandlebars($('#authTableTemplate').html(), {json: authBtnJson}); + }); + $('#authList').html(str); + }); + } + form.render(); + } + +} -- GitLab