From 2e66cd657c618225c58aa81191265a69ea0acbeb Mon Sep 17 00:00:00 2001 From: ssc <273702440@qq.com> Date: Fri, 29 Jul 2022 14:44:35 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=A8=A1=E5=9E=8B=E6=9D=83=E9=99=90?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=89=80=E6=9C=89=E4=BA=BA=E5=9D=87=E5=8F=AF?= =?UTF-8?q?=E5=8F=91=E8=B5=B7=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/plugin/workflow/design/model.vue | 15 ++++++++++++--- .../workflow/process/components/user-option.vue | 12 +++++++++--- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/views/plugin/workflow/design/model.vue b/src/views/plugin/workflow/design/model.vue index 8fe7a55..b58a2e4 100644 --- a/src/views/plugin/workflow/design/model.vue +++ b/src/views/plugin/workflow/design/model.vue @@ -108,6 +108,7 @@ @@ -264,13 +265,13 @@ export default { this.categoryId = id this.searchChange(this.query) }, - handleScopeSubmit(list) { + handleScopeSubmit(list, all) { list.forEach(l => l.val = l.value) const { id, modelKey } = this.row const param = { modelId: id, modelKey, - scopeList: list + scopeList: all? list.concat([{type: 'WF_ALL', val: 'WF_ALL'}]): list } scopeSubmit(param).then(() => { this.$message.success('操作成功') @@ -278,7 +279,15 @@ export default { }, handleScope(row) { scopeList({ modelId: row.id }).then(res => { - this.$set(this.userOption, 'data', res.data.data.map(d => { + const data = res.data.data + const index = data.findIndex(d => d.type == 'WF_ALL') + if (index != -1) { + this.$refs.userOption.switchAll = true + data.splice(index, 1) + } + else this.$refs.userOption.switchAll = false + + this.$set(this.userOption, 'data', data.map(d => { return { value: d.val, text: d.text, diff --git a/src/views/plugin/workflow/process/components/user-option.vue b/src/views/plugin/workflow/process/components/user-option.vue index e721559..e85c8b7 100644 --- a/src/views/plugin/workflow/process/components/user-option.vue +++ b/src/views/plugin/workflow/process/components/user-option.vue @@ -6,6 +6,7 @@ width="60%" :before-close="handleClose" append-to-body> +

不限制权限,所有人均可发起:(平台需单独配置)

+ :disabled="Boolean(data.find(d => d.type == item.value)) || (switchAll && !['platform'].includes(item.value))"> @@ -137,7 +138,11 @@ import UserSelect from './user-select.vue' export default { props: { - userOption: Object + userOption: Object, + all: { + type: Boolean, + default: false + } }, components: { UserSelect, @@ -184,6 +189,7 @@ export default { }, data() { return { + switchAll: false, init: false, visible: false, data: [], @@ -272,7 +278,7 @@ export default { }) }, handleSubmit() { - this.$emit('submit', this.data.filter(d => d.type && d.value)) + this.$emit('submit', this.data.filter(d => d.type && d.value), this.switchAll) this.visible = false }, handleClose(done) {