From 7f46b2470d9f67eca3269e0f1323e0b55c591e6f Mon Sep 17 00:00:00 2001 From: smallchill Date: Wed, 4 Dec 2019 12:25:33 +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 | 42 ++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/src/views/authority/datascope.vue b/src/views/authority/datascope.vue index 00277e1..31c0233 100644 --- a/src/views/authority/datascope.vue +++ b/src/views/authority/datascope.vue @@ -103,6 +103,7 @@ drawerVisible: false, direction: 'rtl', scopeMenuId: 0, + scopeMenuCode: '', scopeMenuName: "菜单", scopeLoading: false, menu: true, @@ -308,6 +309,7 @@ label: "权限名称", prop: "scopeName", search: true, + valueDefault: "", rules: [{ required: true, message: "请输入数据权限名称", @@ -357,6 +359,7 @@ prop: "scopeField", span: 24, hide: true, + valueDefault: "*", rules: [{ required: true, message: "请输入数据权限可见的字段", @@ -380,6 +383,7 @@ span: 24, minRows: 5, type: "textarea", + display: true, hide: true, }, { @@ -393,7 +397,42 @@ dataScope: [] }; }, - + watch: { + 'formScope.scopeType'() { + const scopeType = this.formScope.scopeType; + let column = "-", name = "暂无"; + if (scopeType === "1") { + column = "-"; + name = "全部可见"; + } else if (scopeType === "2") { + column = "create_user"; + name = "本人可见"; + } else if (scopeType === "3") { + column = "create_dept"; + name = "所在机构可见"; + } else if (scopeType === "4") { + column = "create_dept"; + name = "所在机构可见及子级可见"; + } else if (scopeType === "5") { + column = ""; + name = "自定义"; + } + this.$refs.crudScope.option.column.filter(item => { + if (item.prop === "scopeName") { + this.formScope.scopeName = `${this.scopeMenuName} [${name}]`; + } + if (item.prop === "resourceCode") { + this.formScope.resourceCode = this.scopeMenuCode; + } + if (item.prop === "scopeColumn") { + this.formScope.scopeColumn = column; + } + if (item.prop === "scopeValue") { + item.display = scopeType === '5'; + } + }); + } + }, computed: { ...mapGetters(["permission"]), permissionList() { @@ -531,6 +570,7 @@ handleDataScope(row) { this.drawerVisible = true; this.scopeMenuId = row.id; + this.scopeMenuCode = row.code; this.scopeMenuName = row.name; this.onLoadScope(this.pageScope) },