Browse Source

[Fix][UI Next][V1.0.0-Beta] Remove the default values for node name and child node. (#9760)

Amy0104 3 years ago
parent
commit
83d9ea3ccb

+ 1 - 0
dolphinscheduler-ui-next/src/locales/modules/en_US.ts

@@ -631,6 +631,7 @@ const project = {
     workflow_name: 'Workflow Name',
     workflow_name: 'Workflow Name',
     workflow_name_tips: 'Please select a workflow (required)',
     workflow_name_tips: 'Please select a workflow (required)',
     child_node: 'Child Node',
     child_node: 'Child Node',
+    child_node_tips: 'Please select a child node (required)',
     run_flag: 'Run flag',
     run_flag: 'Run flag',
     normal: 'Normal',
     normal: 'Normal',
     prohibition_execution: 'Prohibition execution',
     prohibition_execution: 'Prohibition execution',

+ 1 - 0
dolphinscheduler-ui-next/src/locales/modules/zh_CN.ts

@@ -627,6 +627,7 @@ const project = {
     workflow_name: '工作流名称',
     workflow_name: '工作流名称',
     workflow_name_tips: '请选择工作流(必选)',
     workflow_name_tips: '请选择工作流(必选)',
     child_node: '子节点',
     child_node: '子节点',
+    child_node_tips: '请选择子节点(必选)',
     run_flag: '运行标志',
     run_flag: '运行标志',
     normal: '正常',
     normal: '正常',
     prohibition_execution: '禁止执行',
     prohibition_execution: '禁止执行',

+ 11 - 11
dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-child-node.ts

@@ -52,10 +52,6 @@ export function useChildNode({
         value: option.code
         value: option.code
       }))
       }))
     loading.value = false
     loading.value = false
-    if (!model.processDefinitionCode) {
-      model.processDefinitionCode = options.value[0].value
-      if (!model.name) model.name = options.value[0].label
-    }
   }
   }
   const getProcessListByCode = async (processCode: number) => {
   const getProcessListByCode = async (processCode: number) => {
     if (!processCode) return
     if (!processCode) return
@@ -63,10 +59,6 @@ export function useChildNode({
     model.definition = res
     model.definition = res
   }
   }
 
 
-  const onChange = (code: number, options: { label: string }) => {
-    if (!model.name) model.name = options.label
-  }
-
   onMounted(() => {
   onMounted(() => {
     if (from === 1 && processName) {
     if (from === 1 && processName) {
       getProcessListByCode(processName)
       getProcessListByCode(processName)
@@ -80,10 +72,18 @@ export function useChildNode({
     span: 24,
     span: 24,
     name: t('project.node.child_node'),
     name: t('project.node.child_node'),
     props: {
     props: {
-      loading: loading,
-      'on-update:value': onChange
+      loading: loading
     },
     },
     options: options,
     options: options,
-    class: 'select-child-node'
+    class: 'select-child-node',
+    validate: {
+      trigger: ['input', 'blur'],
+      required: true,
+      validator(unuse: any, value: number) {
+        if (!value) {
+          return Error(t('project.node.child_node_tips'))
+        }
+      }
+    }
   }
   }
 }
 }

+ 1 - 2
dolphinscheduler-ui-next/src/views/projects/task/components/node/tasks/use-sub-process.ts

@@ -45,8 +45,7 @@ export function useSubProcess({
     failRetryTimes: 0,
     failRetryTimes: 0,
     workerGroup: 'default',
     workerGroup: 'default',
     delayTime: 0,
     delayTime: 0,
-    timeout: 30,
-    processDefinitionCode: 0
+    timeout: 30
   } as INodeData)
   } as INodeData)
 
 
   let extra: IJsonItem[] = []
   let extra: IJsonItem[] = []