提交 8bd36794 authored 作者: lhh's avatar lhh

updatre

上级 7643a254
......@@ -114,6 +114,8 @@ const checkTrainPlatformConfigs = (rule: any, value: any, callback: any) => {
if (item.is_show === '1') {
if (item.url === '') {
callback(new Error(`请填写${item.name}的链接`))
} else {
callback()
}
}
})
......@@ -132,6 +134,8 @@ const checkCompetitionPlatformConfigs = (rule: any, value: any, callback: any) =
if (item.is_show === '1') {
if (item.url === '') {
callback(new Error(`请填写${item.name}的链接`))
} else {
callback()
}
}
})
......@@ -159,8 +163,8 @@ const rules = ref<FormRules>({
status: [{ required: true, message: '请选择有效状态' }],
logo: [{ required: true, message: '请上传赛项LOGO' }],
cover: [{ required: true, message: '请上传赛项封面' }],
train_platform_configs: [{ validator: checkTrainPlatformConfigs }],
competition_platform_configs: [{ validator: checkCompetitionPlatformConfigs }]
train_platform_configs: [{ required: true, message: '' }, { validator: checkTrainPlatformConfigs }],
competition_platform_configs: [{ required: true, message: '' }, { validator: checkCompetitionPlatformConfigs }]
})
const isUpdate = $computed(() => {
return !!form.id
......@@ -212,6 +216,7 @@ function handleSubmit() {
'train_platform_configs',
'competition_platform_configs'
])
console.log(isUpdate, 'isUpdate')
isUpdate ? handleUpdate(params) : handleCreate(params)
})
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论