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) })