From 616f6efb36f599f7bcc5b01133c8d8bfab7ee026 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Wed, 27 Nov 2024 15:53:53 +0800 Subject: [PATCH] =?UTF-8?q?=20fix:=20=E3=80=90=E6=95=B0=E6=8D=AE=E6=BA=90?= =?UTF-8?q?=E3=80=91=E6=95=B0=E6=8D=AE=E6=BA=90=E6=A0=A1=E9=AA=8C=E9=80=9A?= =?UTF-8?q?=E8=BF=87=E4=BF=9D=E5=AD=98=E5=90=8E=E6=8F=90=E7=A4=BA=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../visualized/data/datasource/index.vue | 34 +++++++++++-------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/core/core-frontend/src/views/visualized/data/datasource/index.vue b/core/core-frontend/src/views/visualized/data/datasource/index.vue index 607522ce79..cf41e7ae30 100644 --- a/core/core-frontend/src/views/visualized/data/datasource/index.vue +++ b/core/core-frontend/src/views/visualized/data/datasource/index.vue @@ -919,25 +919,29 @@ const handleClick = (tabName: TabPaneName) => { switch (tabName) { case 'config': tableData.value = [] - listDatasourceTables({ datasourceId: nodeInfo.id }).then(res => { - tabList.value = res.data.map(ele => { - const { name, tableName } = ele - return { - value: name, - label: tableName - } - }) - if (!!tabList.value.length && !activeTab.value) { - activeTab.value = tabList.value[0].value - if (nodeInfo.type === 'Excel') { + if (nodeInfo.type === 'Excel') { + listDatasourceTables({ datasourceId: nodeInfo.id }).then(res => { + tabList.value = res.data.map(ele => { + const { name, tableName } = ele + return { + value: name, + label: tableName + } + }) + if (!!tabList.value.length && !activeTab.value) { + activeTab.value = tabList.value[0].value handleTabClick(activeTab) } - } - tableData.value = res.data - }) + tableData.value = res.data + }) + } break case 'table': - initSearch() + tableData.value = [] + listDatasourceTables({ datasourceId: nodeInfo.id }).then(res => { + tableData.value = res.data + initSearch() + }) break default: break