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; }