From 1caa650253a1426df299778a4039fea597b6d07a Mon Sep 17 00:00:00 2001 From: konbai <1527468660@qq.com> Date: Sun, 20 Mar 2022 01:25:55 +0800 Subject: [PATCH] =?UTF-8?q?fix=20--=20=E4=BF=AE=E5=A4=8D=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E9=80=89=E6=8B=A9=E7=94=A8=E6=88=B7=E6=9C=AA?= =?UTF-8?q?=E6=B8=85=E7=90=86=E9=80=89=E9=A1=B9=E9=97=AE=E9=A2=98=EF=BC=8C?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E8=AE=BE=E8=AE=A1=E6=B7=BB=E5=8A=A0=E6=9B=B4?= =?UTF-8?q?=E5=A4=9A=E4=BF=A1=E6=81=AF=E5=88=B0xml=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../penal/task/task-components/UserTask.vue | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/ruoyi-ui/src/plugins/package/penal/task/task-components/UserTask.vue b/ruoyi-ui/src/plugins/package/penal/task/task-components/UserTask.vue index bde1b6cf..8f712806 100644 --- a/ruoyi-ui/src/plugins/package/penal/task/task-components/UserTask.vue +++ b/ruoyi-ui/src/plugins/package/penal/task/task-components/UserTask.vue @@ -9,16 +9,16 @@ - 固定 - 动态 + 固定 + 动态 - + - - + + {{ item.label }} {{ item.value }} @@ -140,7 +140,7 @@ export default { }, formData: { groupType: 'ASSIGNEE', - assignType: '1' + assignType: 'fixed' }, userTaskForm: {}, candidateVisible: false, @@ -157,7 +157,6 @@ export default { userList: [], total: 0, selectedUserDate: [], - userMockDate: [], variableData: [{ label: "流程发起人", value: "${INITIATOR}" @@ -186,7 +185,7 @@ export default { }, created() { listUser().then(response => { - this.userMockDate = response.rows; + this.userList = response.rows; }) }, methods: { @@ -211,12 +210,13 @@ export default { } else if (key === "assignee") { this.formData.groupType = 'ASSIGNEE'; let val = this.bpmnElement?.businessObject[key] || this.defaultTaskForm[key]; + // TODO 2022/03/20 根据type判断是否为动态用户 // 判断是否为动态用户 if (val && val.startsWith('${') && val.endsWith('}')) { - this.formData.assignType = '2'; + this.formData.assignType = 'dynamic'; this.$set(this.userTaskForm, key, val); } else { - this.formData.assignType = '1'; + this.formData.assignType = 'fixed'; getUser(val).then(response => { let user = response.data.user this.$set(this.userTaskForm, key, user); @@ -227,20 +227,21 @@ export default { }, updateElementTask(key) { const taskAttr = Object.create(null); + taskAttr.type = this.formData.assignType; if (key === "candidateUsers" || key === "candidateGroups") { if (this.userTaskForm[key] && this.userTaskForm[key].length > 0) { - taskAttr['assignee'] = null; taskAttr[key] = this.userTaskForm[key].map(k => k.userId) || null } // TODO 2022/01/10 添加候选组的设值 // taskAttr[key] = this.userTaskForm[key] && this.userTaskForm[key].length ? this.userTaskForm[key].join() : null; } else { if (this.userTaskForm[key]) { - taskAttr['candidateUsers'] = null; - if (this.formData.assignType === '1') { + if (this.formData.assignType === ('fixed' || '1')) { + taskAttr['text'] = this.userTaskForm[key].nickName taskAttr[key] = this.userTaskForm[key].userId || null; - } else if (this.formData.assignType === '2') { - taskAttr[key] = this.userTaskForm[key] || null; + } else if (this.formData.assignType === ('dynamic' || '2')) { + taskAttr['text'] = this.userTaskForm[key].label + taskAttr[key] = this.userTaskForm[key].value || null; } } } @@ -315,7 +316,7 @@ export default { this.userTaskForm = {} // 清空已选候选人数据 if (val === 'ASSIGNEE') { - this.formData.assignType = '1' + this.formData.assignType = 'fixed' } this.selectedUserDate = [] this.$refs.multipleTable?.clearSelection(); @@ -324,6 +325,8 @@ export default { this.userTaskForm.assignee = null }, onSelectAssignee() { + this.selectedUserDate = [] + this.$refs.multipleTable?.clearSelection(); this.getDeptTreeSelect(); this.candidateVisible = true; }