From a14d9744b26d9490a36426a61af255160829285c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E4=BC=9F=E4=BD=B3?= <2797716443@qq.com> Date: Wed, 16 Mar 2022 16:22:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=81=E6=A0=87=E6=95=B0=E6=8D=AE=E6=9D=83?= =?UTF-8?q?=E9=99=90=E9=85=8D=E7=BD=AE=20=20=E9=87=8D=E7=82=B9=E6=A0=87?= =?UTF-8?q?=E5=87=86=E8=B7=9F=E8=B8=AA=E6=B8=85=E5=8D=95=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/config/pages/roleManage/index.vue | 101 ++++++++++++++++++ .../accessStandardsAndRegulations/index.vue | 2 +- 2 files changed, 102 insertions(+), 1 deletion(-) diff --git a/src/pages/config/pages/roleManage/index.vue b/src/pages/config/pages/roleManage/index.vue index 87d126f6c..595f0bca7 100644 --- a/src/pages/config/pages/roleManage/index.vue +++ b/src/pages/config/pages/roleManage/index.vue @@ -40,6 +40,12 @@ v-btn-permission="'bb2571b08179edb36880aae169cb2e54'" size="mini">配置法规库权限 + 配置法规库数据权限 + + +
+ + +
+
+ 取消 + + + 确定 + +
+
0){ this.treeData3 = this.sortByKey(list1,"displaySeq") + this.treeData4 = this.sortByKey(list1,"displaySeq") } @@ -651,9 +692,27 @@ export default { } }) }, + //配置数据确定按钮 + confirmDialogData2(){ + let menuIds = this.$refs.tree4.getCheckedKeys().join(',') + this.$http.postData('tsRoleMeunData/ts-role-menu-data/saveBatch', { + menuIds: menuIds, + roleId: this.id + }, {}, res => { + if (res.ok) { + this.$message.success('设置权限成功') + this.modalflag2 = false + }else{ + this.$message.warning(res.message) + } + }) + }, closeDialogData() { this.modalflag = false }, + closeDialogData2() { + this.modalflag2 = false + }, /** 父子节点的级联 */ nodeClick(currentObj, treeStatus) { // 用于:父子节点严格互不关联时,父节点勾选变化时通知子节点同步变化,实现单向关联。 @@ -671,6 +730,30 @@ export default { } } }, + /** 父子节点的级联 */ + nodeClick3(currentObj, treeStatus) { + // 用于:父子节点严格互不关联时,父节点勾选变化时通知子节点同步变化,实现单向关联。 + let selected = treeStatus.checkedKeys.indexOf(currentObj.id) // -1未选中 + // 选中 + if (selected !== -1) { + // 子节点只要被选中父节点就被选中 + this.selectedParent4(currentObj) + // 统一处理子节点为相同的勾选状态 + this.uniteChildSame4(currentObj, true) + } else { + // 未选中 处理子节点全部未选中 + if (currentObj.children.length !== 0) { + this.uniteChildSame4(currentObj, false) + } + } + }, + // 统一处理子节点为相同的勾选状态 + uniteChildSame4(treeList, isSelected) { + this.$refs.tree4.setChecked(treeList.id, isSelected) + for (let i = 0; i < treeList.children.length; i++) { + this.uniteChildSame4(treeList.children[i], isSelected) + } + }, // 统一处理子节点为相同的勾选状态 uniteChildSame(treeList, isSelected) { this.$refs.tree3.setChecked(treeList.id, isSelected) @@ -686,6 +769,14 @@ export default { this.selectedParent(currentNode.parent) } }, + // 统一处理父节点为选中 + selectedParent4(currentObj) { + let currentNode = this.$refs.tree4.getNode(currentObj) + if (currentNode.parent.key !== undefined) { + this.$refs.tree4.setChecked(currentNode.parent, true) + this.selectedParent4(currentNode.parent) + } + }, nodeClick2(currentObj, treeStatus) { // 用于:父子节点严格互不关联时,父节点勾选变化时通知子节点同步变化,实现单向关联。 let selected = treeStatus.checkedKeys.indexOf(currentObj.id) // -1未选中 @@ -726,6 +817,16 @@ export default { } }) }, + roleDataAdd(){ + this.$http.get('tsRoleMeunData/ts-role-menu-data/list', { + ids: this.id + }, {}, res => { + if (res.ok) { + this.nodeList4 = res.data + this.modalflag2 = true + } + }) + }, closeDialog() { this.treeData2 = [] this.modalshowflag = false diff --git a/src/pages/regulatoryRepository/accessStandardsAndRegulations/index.vue b/src/pages/regulatoryRepository/accessStandardsAndRegulations/index.vue index 41db2c5bc..6071af3b9 100644 --- a/src/pages/regulatoryRepository/accessStandardsAndRegulations/index.vue +++ b/src/pages/regulatoryRepository/accessStandardsAndRegulations/index.vue @@ -39,7 +39,7 @@ export default { library: false, list: [], tabValue: "", - menuName: ["国家/地区清单", "车型类别清单"/*, "重点标准跟踪清单"*/, "其他清单", "项目清单"] + menuName: ["国家/地区清单", "车型类别清单","重点标准跟踪清单", "其他清单", "项目清单"] }; }, methods: {