소스 검색

feat: 兼容触发器问题

luoyali 3 달 전
부모
커밋
a31f7607c4
1개의 변경된 파일10개의 추가작업 그리고 0개의 파일을 삭제
  1. 10 0
      src/components/scWorkflow/nodes/trigger.vue

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

@@ -152,6 +152,16 @@ export default {
 	mounted() {
 		this.nodeConfig = this.modelValue
 		const { delayType, triggerType } = this.nodeConfig
+
+		// 检查 extendConfig 是否存在,如果不存在则初始化
+		if (!this.nodeConfig.hasOwnProperty('extendConfig')) {
+			this.nodeConfig.extendConfig = {
+				time: '', // 立即执行 time不用设置
+				args: '',
+				trigger: ''
+			}
+			return
+		}
 		if (triggerType === '1') return
 		const extendConfig = this.nodeConfig?.extendConfig?.time.split(':')
 		if (delayType === '1') {