fix: 修复APILark数据源

This commit is contained in:
taojinlong
2025-02-25 17:24:45 +08:00
committed by taojinlong
parent d51c68c450
commit 8085dcdfc1
3 changed files with 21 additions and 2 deletions

View File

@@ -220,6 +220,10 @@ const initApiItem = (
methodName: 'clearForm',
args: []
})
xpackApiItemBasicInfo?.value?.invokeMethod({
methodName: 'initForm',
args: []
})
} else {
apiItemBasicInfo.value.clearValidate()
}

View File

@@ -491,6 +491,11 @@ const submitForm = () => {
return dsForm.value.validate
}
const submitApiForm = () => {
dsApiForm.value.clearValidate()
return dsApiForm.value.validate
}
const clearForm = () => {
return dsForm.value.clearValidate()
}
@@ -641,7 +646,7 @@ const apiRule = {
'syncSetting.startTime': [
{
required: true,
message: t('datasource.start_time'),
message: t('sync_task.please_choose_start_time'),
trigger: 'change'
}
]
@@ -804,6 +809,7 @@ const datasetTypeList = [
]
defineExpose({
submitForm,
submitApiForm,
resetForm,
initForm,
clearForm

View File

@@ -493,7 +493,16 @@ const saveDS = () => {
request.apiConfiguration = ''
validate(val => {
if (val) {
doSaveDs(request)
if (currentDsType.value.includes('API')) {
const validateApi = detail?.value?.submitApiForm()
validateApi(v => {
if (v) {
doSaveDs(request)
}
})
} else {
doSaveDs(request)
}
}
})
}