From 5d6623a52617c74180069ac34e4b884eb23c0bd7 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 11 Apr 2024 17:30:49 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=95=B0=E6=8D=AE=E9=9B=86):=20=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E6=95=B0=E6=8D=AE=E9=9B=86=E9=A1=B5=E9=9D=A2=E9=A6=96?= =?UTF-8?q?=E5=85=88=E9=AA=8C=E8=AF=81=E6=95=B0=E6=8D=AE=E6=BA=90=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E5=AD=98=E5=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/visualized/data/dataset/form/index.vue | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/core/core-frontend/src/views/visualized/data/dataset/form/index.vue b/core/core-frontend/src/views/visualized/data/dataset/form/index.vue index 9ccf993290..db3d19719a 100644 --- a/core/core-frontend/src/views/visualized/data/dataset/form/index.vue +++ b/core/core-frontend/src/views/visualized/data/dataset/form/index.vue @@ -34,7 +34,8 @@ import { getTables, getPreviewData, getDatasetDetails, - saveDatasetTree + saveDatasetTree, + barInfoApi } from '@/api/dataset' import type { Table } from '@/api/dataset' import DatasetUnion from './DatasetUnion.vue' @@ -581,14 +582,19 @@ const getTableName = async (datasourceId, tableName) => { } } -const initEdite = () => { +const initEdite = async () => { const { id, datasourceId, tableName } = route.query const { id: copyId } = route.params + const barRes = await barInfoApi(copyId || id) + if (!barRes || !barRes['id']) { + return + } if (datasourceId) { dataSource.value = datasourceId as string getTableName(datasourceId as string, tableName) } if (!id && !copyId) return + loading.value = true getDatasetDetails(copyId || id) .then(res => { @@ -859,7 +865,7 @@ let p = null const XpackLoaded = () => p(true) onMounted(async () => { await new Promise(r => (p = r)) - initEdite() + await initEdite() getDatasource() useEmitt({ name: 'onDatasetSave',