Browse Source

fix: 流程drawer编辑 conditionList 条件编辑 问题修复

lanceJiang 6 months ago
parent
commit
ae0b6b7149

+ 6 - 1
src/components/scWorkflow/nodes/branch.vue

@@ -289,7 +289,12 @@ export default {
 			conditionList.splice(index, 1)
 		},
 		addConditionGroup() {
-			this.addConditionList(this.form.conditionList[this.form.conditionList.push([]) - 1], 'custom')
+			let conditionList = this.form.conditionList
+			if (!conditionList) {
+				this.form.conditionList = []
+				conditionList = this.form.conditionList
+			}
+			this.addConditionList(conditionList[conditionList.push([]) - 1], 'custom')
 		},
 		deleteConditionGroup(index) {
 			this.form.conditionList.splice(index, 1)

+ 0 - 1
src/components/scWorkflow/nodes/delayProcess.vue

@@ -148,7 +148,6 @@ export default {
 	methods: {
 		show() {
 			if (this.disabled) return
-			this.form = {}
 			this.form = JSON.parse(JSON.stringify(this.nodeConfig))
 			this.drawer = true
 		},

+ 6 - 1
src/components/scWorkflow/nodes/mergeBranch.vue

@@ -309,7 +309,12 @@ export default {
 			conditionList.splice(index, 1)
 		},
 		addConditionGroup() {
-			this.addConditionList(this.form.conditionList[this.form.conditionList.push([]) - 1], 'custom')
+			let conditionList = this.form.conditionList
+			if (!conditionList) {
+				this.form.conditionList = []
+				conditionList = this.form.conditionList
+			}
+			this.addConditionList(conditionList[conditionList.push([]) - 1], 'custom')
 		},
 		deleteConditionGroup(index) {
 			this.form.conditionList.splice(index, 1)

+ 6 - 2
src/components/scWorkflow/nodes/parallelBranch.vue

@@ -104,7 +104,6 @@ export default {
 		show(index) {
 			const self = this
 			this.index = index
-			this.form = {}
 			this.form = _.cloneDeep(self.nodeConfig.parallelNodes[index])
 			this.drawer = true
 		},
@@ -186,7 +185,12 @@ export default {
 			conditionList.splice(index, 1)
 		},
 		addConditionGroup() {
-			this.addConditionList(this.form.conditionList[this.form.conditionList.push([]) - 1])
+			let conditionList = this.form.conditionList
+			if (!conditionList) {
+				this.form.conditionList = []
+				conditionList = this.form.conditionList
+			}
+			this.addConditionList(conditionList[conditionList.push([]) - 1])
 		},
 		deleteConditionGroup(index) {
 			this.form.conditionList.splice(index, 1)

+ 3 - 1
src/components/scWorkflow/nodes/routeBranch.vue

@@ -275,7 +275,6 @@ export default {
 		},
 		show() {
 			if (this.disabled) return
-			this.form = {}
 			this.form = JSON.parse(JSON.stringify(this.nodeConfig))
 			this.queryValidNodeList()
 			this.getExpressionFormList()
@@ -345,6 +344,9 @@ export default {
 			})
 		},
 		addConditionGroup(route) {
+			if (!route.conditionList) {
+				route.conditionList = []
+			}
 			this.addConditionList(route.conditionList[route.conditionList.push([]) - 1], 'custom')
 		},
 		deleteConditionGroup(route, index) {

+ 0 - 1
src/components/scWorkflow/nodes/send.vue

@@ -100,7 +100,6 @@ export default {
 	methods: {
 		show() {
 			if (this.disabled) return
-			this.form = {}
 			this.form = JSON.parse(JSON.stringify(this.nodeConfig))
 			this.drawer = true
 		},

+ 0 - 1
src/components/scWorkflow/nodes/subProcess.vue

@@ -152,7 +152,6 @@ export default {
 		},
 		show() {
 			if (this.disabled) return
-			this.form = {}
 			this.form = JSON.parse(JSON.stringify(this.nodeConfig))
 			// const { formStructure } = JSON.parse(this.processForm)
 			const { formStructure } = this.getProcessForm()

+ 0 - 1
src/components/scWorkflow/nodes/trigger.vue

@@ -165,7 +165,6 @@ export default {
 	methods: {
 		show() {
 			if (this.disabled) return
-			this.form = {}
 			this.form = JSON.parse(JSON.stringify(this.nodeConfig))
 			this.drawer = true
 		},