diff --git a/ui/src/api/dataset.ts b/ui/src/api/dataset.ts index 60b0b46fc..b05dab50f 100644 --- a/ui/src/api/dataset.ts +++ b/ui/src/api/dataset.ts @@ -82,7 +82,7 @@ const postDateset: (data: datasetData, loading?: Ref) => Promise - + @@ -97,12 +97,12 @@ const detail = ref({}) const application_list = ref>([]) const application_id_list = ref([]) const form = ref({ - url: '', + source_url: '', selector: '' }) const rules = reactive({ - url: [{ required: true, message: '请输入 Web 根地址', trigger: 'blur' }] + source_url: [{ required: true, message: '请输入 Web 根地址', trigger: 'blur' }] }) async function submit() { @@ -110,10 +110,16 @@ async function submit() { await webFormRef.value.validate((valid: any) => { if (valid) { loading.value = true - const obj = { - application_id_list: application_id_list.value, - ...BaseFormRef.value.form - } + const obj = + detail.value.type === '1' + ? { + ...BaseFormRef.value.form, + ...form.value + } + : { + application_id_list: application_id_list.value, + ...BaseFormRef.value.form + } datasetApi .putDateset(id, obj) .then((res) => { @@ -131,6 +137,10 @@ async function submit() { function getDetail() { dataset.asyncGetDatesetDetail(id, loading).then((res: any) => { detail.value = res.data + if (detail.value.type === '1') { + form.value = res.data.meta + } + application_id_list.value = res.data?.application_id_list datasetApi.listUsableApplication(id, loading).then((ok) => { application_list.value = ok.data diff --git a/ui/src/views/dataset/step/StepFirst.vue b/ui/src/views/dataset/step/StepFirst.vue index f6fa30811..f5eaebfcc 100644 --- a/ui/src/views/dataset/step/StepFirst.vue +++ b/ui/src/views/dataset/step/StepFirst.vue @@ -43,11 +43,11 @@ - + @@ -88,12 +88,12 @@ const loading = ref(false) const form = ref({ type: '0', - url: '', + source_url: '', selector: '' }) const rules = reactive({ - url: [{ required: true, message: '请输入 Web 根地址', trigger: 'blur' }] + source_url: [{ required: true, message: '请输入 Web 根地址', trigger: 'blur' }] }) watch(form.value, (value) => { @@ -106,7 +106,7 @@ watch(form.value, (value) => { function radioChange() { dataset.saveDocumentsFile([]) - form.value.url = '' + form.value.source_url = '' form.value.selector = '' }