From af585ecb179e85098936ad1463b12fbf06861853 Mon Sep 17 00:00:00 2001 From: liuyusheng Date: Wed, 6 Nov 2024 15:18:50 +0800 Subject: [PATCH] =?UTF-8?q?APP=E8=8F=9C=E5=8D=95=E6=9D=83=E9=99=90?= =?UTF-8?q?=E5=8F=8A=E7=A7=9F=E6=88=B7=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- imt-ui/src/api/system/appMenu.js | 0 imt-ui/src/views/system/appMenu/index.vue | 0 .../src/views/system/tenantPackage/index.vue | 49 ++++++++++++++++++- 3 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 imt-ui/src/api/system/appMenu.js create mode 100644 imt-ui/src/views/system/appMenu/index.vue diff --git a/imt-ui/src/api/system/appMenu.js b/imt-ui/src/api/system/appMenu.js new file mode 100644 index 0000000..e69de29 diff --git a/imt-ui/src/views/system/appMenu/index.vue b/imt-ui/src/views/system/appMenu/index.vue new file mode 100644 index 0000000..e69de29 diff --git a/imt-ui/src/views/system/tenantPackage/index.vue b/imt-ui/src/views/system/tenantPackage/index.vue index 27f6fba..5fba9ea 100644 --- a/imt-ui/src/views/system/tenantPackage/index.vue +++ b/imt-ui/src/views/system/tenantPackage/index.vue @@ -71,6 +71,12 @@ + + 展开/折叠 + 全选/全不选 + + { + // 处理 APPmenuOptions 参数 + this.APPmenuOptions = []; + // 只需要配置 + this.APPmenuOptions.push(...this.handleTree(response.data, "id")); + }); }, /** 提交按钮 */ submitForm() { @@ -234,7 +266,8 @@ export default { if (this.form.id != null) { updateTenantPackage({ ...this.form, - menuIds: [...this.$refs.menu.getCheckedKeys(), ...this.$refs.menu.getHalfCheckedKeys()] + menuIds: [...this.$refs.menu.getCheckedKeys(), ...this.$refs.menu.getHalfCheckedKeys()], + appMenuIds: [...this.$refs.APPmenu.getCheckedKeys(), ...this.$refs.APPmenu.getHalfCheckedKeys()] }).then(response => { this.$modal.msgSuccess("修改成功"); this.open = false; @@ -245,7 +278,8 @@ export default { // 添加的提交 createTenantPackage({ ...this.form, - menuIds: [...this.$refs.menu.getCheckedKeys(), ...this.$refs.menu.getHalfCheckedKeys()] + menuIds: [...this.$refs.menu.getCheckedKeys(), ...this.$refs.menu.getHalfCheckedKeys()], + appMenuIds: [...this.$refs.APPmenu.getCheckedKeys(), ...this.$refs.APPmenu.getHalfCheckedKeys()] }).then(response => { this.$modal.msgSuccess("新增成功"); this.open = false; @@ -274,6 +308,17 @@ export default { handleCheckedTreeNodeAll(value) { this.$refs.menu.setCheckedNodes(value ? this.menuOptions: []); }, + // 树权限(展开/折叠) + handleCheckedAPPTreeExpand(value, type) { + let treeList = this.APPmenuOptions; + for (let i = 0; i < treeList.length; i++) { + this.$refs.APPmenu.store.nodesMap[treeList[i].id].expanded = value; + } + }, + // 树权限(全选/全不选) + handleCheckedAPPTreeNodeAll(value) { + this.$refs.APPmenu.setCheckedNodes(value ? this.APPmenuOptions: []); + }, // 树权限(父子联动) handleCheckedTreeConnect(value) { this.form.menuCheckStrictly = value;