Browse Source

[Fix] [UI-Next] [V1.0.0-Alpha] Fix the resource options in task node display incorrect after creating a new file. (#9269)

Amy0104 3 years ago
parent
commit
4ad1764932

+ 7 - 0
dolphinscheduler-ui-next/src/store/project/task-node.ts

@@ -115,6 +115,13 @@ export const useTaskNodeStore = defineStore({
     },
     updateMainJar(type: ProgramType, mainJar: IMainJar[]) {
       this.mainJars[type] = mainJar
+    },
+    init() {
+      this.preTaskOptions = []
+      this.postTaskOptions = []
+      this.preTasks = []
+      this.resources = []
+      this.mainJars = {}
     }
   }
 })

+ 4 - 0
dolphinscheduler-ui-next/src/views/projects/task/components/node/detail.tsx

@@ -18,6 +18,7 @@
 import { defineComponent, ref, watch, inject, Ref, unref } from 'vue'
 import Form from '@/components/form'
 import { useTask } from './use-task'
+import { useTaskNodeStore } from '@/store/project/task-node'
 import type { ITaskData, EditWorkflowDefinition } from './types'
 
 interface IDetailPanel {
@@ -33,6 +34,9 @@ const NodeDetail = defineComponent({
   name: 'NodeDetail',
   emits: ['taskTypeChange'],
   setup(props, { expose, emit }) {
+    const taskStore = useTaskNodeStore()
+    taskStore.init()
+
     const formRef = ref()
     const detailData: IDetailPanel = inject('data') || {
       projectCode: 0,