From 4cfafd538fbacc952d89683e1722fdd19c672bcb Mon Sep 17 00:00:00 2001 From: smallchill Date: Wed, 4 Dec 2019 12:29:31 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=20=E6=95=B0=E6=8D=AE=E6=9D=83=E9=99=90?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8A=A8=E6=80=81=E6=98=BE=E9=9A=90=E3=80=81?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E6=95=B0=E6=8D=AE=E8=87=AA=E5=8A=A8=E4=BB=A3?= =?UTF-8?q?=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/authority/datascope.vue | 60 +++++++++++++++++-------------- 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/src/views/authority/datascope.vue b/src/views/authority/datascope.vue index 31c0233..1c0ef88 100644 --- a/src/views/authority/datascope.vue +++ b/src/views/authority/datascope.vue @@ -399,6 +399,36 @@ }, watch: { 'formScope.scopeType'() { + this.initScope(); + } + }, + computed: { + ...mapGetters(["permission"]), + permissionList() { + return { + addBtn: this.vaildData(this.permission.menu_add, false), + viewBtn: this.vaildData(this.permission.menu_view, false), + delBtn: this.vaildData(this.permission.menu_delete, false), + editBtn: this.vaildData(this.permission.menu_edit, false) + }; + }, + ids() { + let ids = []; + this.selectionList.forEach(ele => { + ids.push(ele.id); + }); + return ids.join(","); + }, + scopeIds() { + let ids = []; + this.selectionListScope.forEach(ele => { + ids.push(ele.id); + }); + return ids.join(","); + } + }, + methods: { + initScope() { const scopeType = this.formScope.scopeType; let column = "-", name = "暂无"; if (scopeType === "1") { @@ -431,34 +461,7 @@ item.display = scopeType === '5'; } }); - } - }, - computed: { - ...mapGetters(["permission"]), - permissionList() { - return { - addBtn: this.vaildData(this.permission.menu_add, false), - viewBtn: this.vaildData(this.permission.menu_view, false), - delBtn: this.vaildData(this.permission.menu_delete, false), - editBtn: this.vaildData(this.permission.menu_edit, false) - }; - }, - ids() { - let ids = []; - this.selectionList.forEach(ele => { - ids.push(ele.id); - }); - return ids.join(","); }, - scopeIds() { - let ids = []; - this.selectionListScope.forEach(ele => { - ids.push(ele.id); - }); - return ids.join(","); - } - }, - methods: { // 菜单管理模块 rowSave(row, loading, done) { add(row).then(() => { @@ -651,6 +654,9 @@ }); }, beforeOpenScope(done, type) { + if (["add"].includes(type)) { + this.initScope(); + } if (["edit", "view"].includes(type)) { getMenuDataScope(this.formScope.id).then(res => { this.formScope = res.data.data;