Browse Source

feat: approver 审核人 form.nodeCandidate.type 1用户 2角色 => 0用户 1角色

lanceJiang 5 months ago
parent
commit
a2abd8bdf8
1 changed files with 6 additions and 5 deletions
  1. 6 5
      src/components/scWorkflow/nodes/approver.vue

+ 6 - 5
src/components/scWorkflow/nodes/approver.vue

@@ -419,10 +419,10 @@ export default {
 			this.select(type, { assignees })
 		},
 		selectHandle_nodeCandidate(nodeCandidate) {
-			// form.nodeCandidate: {type: 1(用户)|2(角色), assignees: {name, id}[]}
 			const limit = { minSelected: 2 } // selectModeOptions_config[this.form.selectMode]?.limit || {} // {minSelected, maxSelected}
-			// type: 1人员, 3角色 5子表单
-			this.select({ 1: 1, 2: 3 }[nodeCandidate.type], { ...nodeCandidate, ...limit })
+			// form.nodeCandidate: {type: 0(用户)|1(角色), assignees: {name, id}[]}
+			// select type: 1人员, 3角色 5子表单
+			this.select({ 0: 1, 1: 3 }[nodeCandidate.type], { ...nodeCandidate, ...limit })
 		},
 		selectModeChange(mode) {
 			const oldMode = this.form.selectMode
@@ -431,8 +431,9 @@ export default {
 			if (!this.form.nodeCandidate) {
 				this.form.nodeCandidate = {}
 			}
-			// 1:用户 2:角色 (3:部门)
-			this.form.nodeCandidate.type = [1, 2].includes(mode) ? 1 : 2
+			// selectMode(mode): 1(自选一个人) | 2(自选多个人) | 3(自选角色)
+			// nodeCandidate.type 0:用户 1:角色
+			this.form.nodeCandidate.type = [1, 2].includes(mode) ? 0 : 1
 			const isSameMode = [1, 2].includes(mode) && [1, 2].includes(oldMode)
 			if (!isSameMode || !this.form.nodeCandidate.assignees) {
 				// selectMode 变化 对 assignees 重置