From 12f4743eab09eab0508e485e58fa1ef6fa0c35d2 Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Fri, 29 Dec 2023 11:26:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=BB=BA=E8=AE=AE=E9=80=9A=E8=BF=87?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E5=AE=8C=E4=B8=8A=E4=B8=80=E4=B8=AA=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=BA=90=E5=90=8E=E7=9A=84=E7=BB=A7=E7=BB=AD=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E6=93=8D=E4=BD=9C=E7=9A=84=E9=BB=98=E8=AE=A4=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=A4=B9=E4=BB=8D=E7=84=B6=E4=BF=9D=E6=8C=81=E4=B8=BA?= =?UTF-8?q?=E5=90=8C=E4=B8=80=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datasource/form/CreatDsGroup.vue | 9 +++-- .../visualized/data/datasource/form/index.vue | 38 ++++++++++++------- 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/core/core-frontend/src/views/visualized/data/datasource/form/CreatDsGroup.vue b/core/core-frontend/src/views/visualized/data/datasource/form/CreatDsGroup.vue index 5a0592a1eb..9acd0a2a6a 100644 --- a/core/core-frontend/src/views/visualized/data/datasource/form/CreatDsGroup.vue +++ b/core/core-frontend/src/views/visualized/data/datasource/form/CreatDsGroup.vue @@ -107,7 +107,10 @@ const showAll = ref(true) const datasource = ref() const loading = ref(false) const createDataset = ref(false) -const filterMethod = (value, data) => data.name.includes(value) +const filterMethod = (value, data) => { + if (!data) return false + data.name.includes(value) +} const resetForm = () => { createDataset.value = false } @@ -277,7 +280,7 @@ const saveDataset = () => { .then(res => { if (res !== undefined) { wsCache.set('ds-new-success', true) - emits('handleShowFinishPage', res) + emits('handleShowFinishPage', { ...res, pid: params.pid }) ElMessage.success('保存数据源成功') successCb() } @@ -292,7 +295,7 @@ const saveDataset = () => { .then(res => { if (res !== undefined) { wsCache.set('ds-new-success', true) - emits('handleShowFinishPage', res) + emits('handleShowFinishPage', { ...res, pid: params.pid }) ElMessage.success('保存数据源成功') successCb() } diff --git a/core/core-frontend/src/views/visualized/data/datasource/form/index.vue b/core/core-frontend/src/views/visualized/data/datasource/form/index.vue index 5d109de04f..1650f7a9c3 100644 --- a/core/core-frontend/src/views/visualized/data/datasource/form/index.vue +++ b/core/core-frontend/src/views/visualized/data/datasource/form/index.vue @@ -211,7 +211,14 @@ const next = () => { } const complete = (params, successCb, finallyCb) => { - excel.value.saveExcelDs(params, successCb, finallyCb) + excel.value.saveExcelDs( + params, + () => { + pid.value = params.pid + successCb() + }, + finallyCb + ) return } @@ -239,24 +246,29 @@ const continueCreating = () => { init(null, pid.value) } -const handleShowFinishPage = ({ id, name }) => { - isShowFinishPage().then(res => { - if (editDs.value || !res.data) { - emits('refresh') - visible.value = false - return - } else { - showFinishPage.value = true - Object.assign(dsInfo, { id, name }) - } - }) +const handleShowFinishPage = ({ id, name, pid }) => { + isShowFinishPage() + .then(res => { + if (editDs.value || !res.data) { + emits('refresh') + visible.value = false + return + } else { + showFinishPage.value = true + Object.assign(dsInfo, { id, name }) + } + }) + .finally(() => { + pid.value = pid + }) } emitter.on('showFinishPage', handleShowFinishPage) const prev = () => { if (currentDsType.value === 'API' && activeApiStep.value === 2) { - activeApiStep.value = activeStep.value = 1 + activeApiStep.value = 1 + activeStep.value = 1 return }