mirror of
https://github.com/dataease/dataease.git
synced 2026-05-20 02:58:10 +08:00
fix(数据源): 修复 Excel 文件上传时超过 1 分钟被取消但是系统无提示信息给用户
This commit is contained in:
@@ -152,6 +152,7 @@ export const uploadFile = async (data): Promise<IResponse> => {
|
||||
.post({
|
||||
url: '/datasource/uploadFile',
|
||||
data,
|
||||
loading: true,
|
||||
headersType: 'multipart/form-data;'
|
||||
})
|
||||
.then(res => {
|
||||
|
||||
@@ -210,7 +210,7 @@ service.interceptors.response.use(
|
||||
) {
|
||||
ElMessage({
|
||||
type: 'error',
|
||||
message: error.message,
|
||||
message: error.response?.data?.msg ? error.response?.data?.msg : error.message,
|
||||
showClose: true
|
||||
})
|
||||
} else if (error?.config?.url.startsWith('/xpackComponent/content')) {
|
||||
|
||||
@@ -354,11 +354,24 @@ const uploadExcel = () => {
|
||||
formData.append('type', '')
|
||||
formData.append('editType', param.value.editType)
|
||||
formData.append('id', param.value.id || 0)
|
||||
return uploadFile(formData).then(res => {
|
||||
upload.value?.clearFiles()
|
||||
uploadAgain.value?.clearFiles()
|
||||
uploadSuccess(res)
|
||||
})
|
||||
loading.value = true
|
||||
return uploadFile(formData)
|
||||
.then(res => {
|
||||
upload.value?.clearFiles()
|
||||
uploadAgain.value?.clearFiles()
|
||||
uploadSuccess(res)
|
||||
loading.value = false
|
||||
})
|
||||
.catch(error => {
|
||||
if (error.code === 'ECONNABORTED') {
|
||||
ElMessage({
|
||||
type: 'error',
|
||||
message: error.message,
|
||||
showClose: true
|
||||
})
|
||||
}
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
const excelForm = ref()
|
||||
const submitForm = () => {
|
||||
@@ -394,6 +407,7 @@ defineExpose({
|
||||
require-asterisk-position="right"
|
||||
:model="param"
|
||||
label-position="top"
|
||||
v-loading="loading"
|
||||
>
|
||||
<el-form-item
|
||||
v-if="sheetFile.name"
|
||||
|
||||
Reference in New Issue
Block a user