mirror of
https://gitee.com/dolphinscheduler/DolphinScheduler.git
synced 2024-12-05 05:38:30 +08:00
[Fix] add resource capacity required rule (#9922)
* [Fix] add resource capacity required rule * Update use-form.ts
This commit is contained in:
parent
96b31c81ff
commit
cac3f780e5
@ -28,8 +28,8 @@ export function useForm() {
|
|||||||
formData: {
|
formData: {
|
||||||
id: 0,
|
id: 0,
|
||||||
name: '',
|
name: '',
|
||||||
projectCode: '',
|
projectCode: null as string | null,
|
||||||
groupSize: '0',
|
groupSize: '',
|
||||||
status: 1,
|
status: 1,
|
||||||
description: ''
|
description: ''
|
||||||
} as TaskGroupUpdateReq,
|
} as TaskGroupUpdateReq,
|
||||||
@ -39,17 +39,30 @@ export function useForm() {
|
|||||||
required: true,
|
required: true,
|
||||||
trigger: ['input', 'blur'],
|
trigger: ['input', 'blur'],
|
||||||
validator() {
|
validator() {
|
||||||
if (state.formData.name === '') {
|
if (!state.formData.name) {
|
||||||
return new Error(t('resource.task_group_option.please_enter_name'))
|
return new Error(t('resource.task_group_option.please_enter_name'))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
description: {
|
groupSize: {
|
||||||
required: true,
|
required: true,
|
||||||
trigger: ['input', 'blur'],
|
trigger: ['input', 'blur'],
|
||||||
validator() {
|
validator() {
|
||||||
if (state.formData.description === '') {
|
if (!state.formData.groupSize) {
|
||||||
return new Error(t('resource.task_group_option.please_enter_desc'))
|
return new Error(
|
||||||
|
t('resource.task_group_option.please_enter_resource_pool_size')
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
projectCode: {
|
||||||
|
required: true,
|
||||||
|
trigger: ['input', 'blur'],
|
||||||
|
validator() {
|
||||||
|
if (!state.formData.projectCode) {
|
||||||
|
return new Error(
|
||||||
|
t('resource.task_group_option.please_select_project')
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user