From a759731111e3906512cb3d894b9b54055cb2be29 Mon Sep 17 00:00:00 2001 From: tjlygdx Date: Tue, 12 May 2026 15:30:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E3=80=90=E6=95=B0=E6=8D=AE=E6=BA=90?= =?UTF-8?q?=E3=80=91=E8=BF=9C=E7=A8=8BExcel/CSV=E6=95=B0=E6=8D=AE=E6=BA=90?= =?UTF-8?q?=EF=BC=8C=E9=85=8D=E7=BD=AE=E5=AE=9A=E6=97=B6=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=90=8E=E6=94=AF=E6=8C=81=E6=89=8B=E5=8A=A8=E7=AB=8B=E5=8D=B3?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=20#18340?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datasource/server/DatasourceServer.java | 10 +++- .../visualized/data/datasource/index.vue | 59 ++++++++++++++++--- 2 files changed, 58 insertions(+), 11 deletions(-) diff --git a/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java b/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java index cbd19efd2c..cf9ab5f742 100644 --- a/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java +++ b/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java @@ -876,8 +876,14 @@ public class DatasourceServer implements DatasourceApi { Long datasourceId = Long.valueOf(req.get("datasourceId")); CoreDatasourceTask coreDatasourceTask = datasourceTaskServer.selectByDSId(datasourceId); CoreDatasource coreDatasource = dataSourceManage.getCoreDatasource(datasourceId); - DatasourceServer.UpdateType updateType = DatasourceServer.UpdateType.valueOf(coreDatasourceTask.getUpdateType()); - datasourceSyncManage.extractedData(null, coreDatasource, updateType, MANUAL.toString()); + if (coreDatasource.getType().equalsIgnoreCase("ExcelRemote")) { + DatasourceServer.UpdateType updateType = DatasourceServer.UpdateType.valueOf(coreDatasourceTask.getUpdateType()); + datasourceSyncManage.extractedExcelData(null, coreDatasource, updateType, MANUAL.toString()); + } else { + DatasourceServer.UpdateType updateType = DatasourceServer.UpdateType.valueOf(coreDatasourceTask.getUpdateType()); + datasourceSyncManage.extractedData(null, coreDatasource, updateType, MANUAL.toString()); + } + } public static List deepCopy(List originalList) { 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 1fa1be99ea..a0ef784add 100644 --- a/core/core-frontend/src/views/visualized/data/datasource/index.vue +++ b/core/core-frontend/src/views/visualized/data/datasource/index.vue @@ -690,6 +690,24 @@ const updateApiDs = () => { }) } +const syncRemoteExcelDsLoading = ref(false) +const updateRemoteExcelDs = () => { + if (syncRemoteExcelDsLoading.value) { + return + } + syncRemoteExcelDsLoading.value = true + syncApiDs({ datasourceId: nodeInfo.id }) + .then(() => { + ElMessage.success(t('datasource.req_completed')) + if (showRecord.value) { + getRecord() + } + }) + .finally(() => { + syncRemoteExcelDsLoading.value = false + }) +} + const nodeExpand = data => { if (data.id) { expandedKey.value.push(data.id) @@ -1819,14 +1837,30 @@ const getMenuList = (val: boolean) => { - - - {{ t('dataset.update_records') }} - +
+ + + {{ t('datasource.execute_once') }} + + + + {{ t('dataset.update_records') }} + +
@@ -2099,10 +2133,17 @@ const getMenuList = (val: boolean) => { } } - .update-records { + .update-actions { position: absolute; top: 19px; right: 12px; + display: flex; + align-items: center; + gap: 8px; + } + + .update-records { + margin: 0; } .update-info {