Browse Source

[Fix][UI] Fix the task name validator error. (#10008)

(cherry picked from commit 00f102959b)
3.0.0/version-upgrade
Amy0104 3 years ago committed by Jiajie Zhong
parent
commit
ca0f41c10f
  1. 12
      dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-dependent.ts
  2. 4
      dolphinscheduler-ui/src/views/projects/task/components/node/types.ts

12
dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-dependent.ts

@ -31,7 +31,8 @@ import type {
IJsonItem,
IDependpendItem,
IDependTask,
ITaskState
ITaskState,
IDateType
} from '../types'
export function useDependent(model: { [field: string]: any }): IJsonItem[] {
@ -172,7 +173,7 @@ export function useDependent(model: { [field: string]: any }): IJsonItem[] {
label: t('project.node.last_month_end')
}
]
}
} as { [key in IDateType]: { value: string; label: string }[] }
const getProjectList = async () => {
const result = await queryAllProjectList()
@ -338,8 +339,8 @@ export function useDependent(model: { [field: string]: any }): IJsonItem[] {
rule: {
required: true,
trigger: ['input', 'blur'],
validator(validate: any, value: string) {
if (!value) {
validator(validate: any, value: number) {
if (!value && value !== 0) {
return Error(t('project.node.task_name_tips'))
}
}
@ -351,9 +352,10 @@ export function useDependent(model: { [field: string]: any }): IJsonItem[] {
span: 10,
name: t('project.node.cycle_time'),
props: {
onUpdateValue: (value: 'month') => {
onUpdateValue: (value: IDateType) => {
model.dependTaskList[i].dependItemList[j].dateOptions =
DATE_LSIT[value]
model.dependTaskList[i].dependItemList[j].dateValue = null
}
},
options: CYCLE_LIST,

4
dolphinscheduler-ui/src/views/projects/task/components/node/types.ts

@ -37,6 +37,7 @@ type SourceType = 'MYSQL' | 'HDFS' | 'HIVE'
type ModelType = 'import' | 'export'
type RelationType = 'AND' | 'OR'
type ITaskType = TaskType
type IDateType = 'hour' | 'day' | 'week' | 'month'
interface IOption {
label: string
@ -383,5 +384,6 @@ export {
IJsonItem,
FormRules,
IJsonItemParams,
IResponseJsonItem
IResponseJsonItem,
IDateType
}

Loading…
Cancel
Save