From 5693e0623315886555afda38a51ecb7caed55713 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Mon, 2 Sep 2024 19:02:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=8A=E4=BC=A0excel=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E6=83=85=E5=86=B5=EF=BC=8C=E6=B8=85=E7=90=86=E7=BC=93?= =?UTF-8?q?=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../visualized/data/datasource/form/ExcelDetail.vue | 12 ++++++++++++ .../src/views/visualized/data/datasource/index.vue | 3 +++ 2 files changed, 15 insertions(+) diff --git a/core/core-frontend/src/views/visualized/data/datasource/form/ExcelDetail.vue b/core/core-frontend/src/views/visualized/data/datasource/form/ExcelDetail.vue index 2bcf1cf458..a6efe1c2bb 100644 --- a/core/core-frontend/src/views/visualized/data/datasource/form/ExcelDetail.vue +++ b/core/core-frontend/src/views/visualized/data/datasource/form/ExcelDetail.vue @@ -145,6 +145,10 @@ const handleTabClick = tab => { } const uploadFail = response => { + state.excelData = [] + activeTab.value = '' + tabList.value = [] + Object.assign(sheetObj, cloneDeep(defaultSheetObj)) let myError = response.toString() myError.replace('Error: ', '') } @@ -160,6 +164,10 @@ const handleExcelDel = () => { const uploadSuccess = response => { if (response?.code !== 0) { + state.excelData = [] + activeTab.value = '' + tabList.value = [] + Object.assign(sheetObj, cloneDeep(defaultSheetObj)) ElMessage.warning(response.msg) return } @@ -365,6 +373,10 @@ const uploadExcel = () => { loading.value = false }) .catch(error => { + state.excelData = [] + activeTab.value = '' + tabList.value = [] + Object.assign(sheetObj, cloneDeep(defaultSheetObj)) if (error.code === 'ECONNABORTED') { ElMessage({ type: 'error', 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 fb3ffa8df4..9078198992 100644 --- a/core/core-frontend/src/views/visualized/data/datasource/index.vue +++ b/core/core-frontend/src/views/visualized/data/datasource/index.vue @@ -884,6 +884,9 @@ const uploadExcel = editType => { addLoading.value = editType === 1 return uploadFile(formData) .then(res => { + if (res?.code !== 0) { + return + } nodeInfo.editType = editType datasourceEditor.value.init(nodeInfo, nodeInfo.id, res) })