diff --git a/core/frontend/src/lang/en.js b/core/frontend/src/lang/en.js index 50cf3bf5d3..4446dd2642 100644 --- a/core/frontend/src/lang/en.js +++ b/core/frontend/src/lang/en.js @@ -3227,7 +3227,14 @@ export default { export_failed: 'Export failed', export_from: 'Export source', export_obj: 'Export object', - export_time: 'Export time' + export_time: 'Export time', + sure_del_all: 'Are you sure you want to delete all export records?', + sure_del: 'Are you sure you want to delete this export record?', + no_failed_file: 'No failed files', + no_file: 'No files available', + no_task: 'No tasks available', + download_all: 'Download All', + download: 'Download' }, link_ticket: { require: 'Require', diff --git a/core/frontend/src/lang/tw.js b/core/frontend/src/lang/tw.js index 4b27333c9e..a4ef2e00a1 100644 --- a/core/frontend/src/lang/tw.js +++ b/core/frontend/src/lang/tw.js @@ -3219,7 +3219,14 @@ export default { export_failed: '匯出失敗', export_from: '匯出來源', export_obj: '匯出對象', - export_time: '匯出時間' + export_time: '匯出時間', + sure_del_all: '確定刪除全部導出記錄嗎?', + sure_del: '確定刪除該導出記錄嗎?', + no_failed_file: '暫無失敗文件', + no_file: '暫無文件', + no_task: '暫無任務', + download_all: '下載', + download: '下載' }, link_ticket: { require: '必選', diff --git a/core/frontend/src/lang/zh.js b/core/frontend/src/lang/zh.js index 6c586ab605..a5a3f4329e 100644 --- a/core/frontend/src/lang/zh.js +++ b/core/frontend/src/lang/zh.js @@ -3225,7 +3225,9 @@ export default { sure_del: '确定删除该导出记录吗?', no_failed_file: '暂无失败文件', no_file: '暂无文件', - no_task: '暂无任务' + no_task: '暂无任务', + download_all: '下载全部', + download: '下载' }, link_ticket: { require: '必选', diff --git a/core/frontend/src/views/dataset/exportExcel/index.vue b/core/frontend/src/views/dataset/exportExcel/index.vue index 219eb81b05..339716788a 100644 --- a/core/frontend/src/views/dataset/exportExcel/index.vue +++ b/core/frontend/src/views/dataset/exportExcel/index.vue @@ -20,6 +20,20 @@ :name="tab.name" /> + {{ $t("data_export.download_all") }} + + {{ $t("data_export.download") }} + { + downloadFile(item.id).then((res) => { + const blob = new Blob([res], { type: 'application/vnd.ms-excel' }) + const link = document.createElement('a') + link.style.display = 'none' + link.href = URL.createObjectURL(blob) + link.download = item.fileName // 下载的文件名 + document.body.appendChild(link) + link.click() + document.body.removeChild(link) + }).finally(() => { + this.exportDatasetLoading = false + }) + }) + return + } + this.multipleSelection.map((ele) => { + downloadFile(ele.id).then((res) => { + const blob = new Blob([res], { type: 'application/vnd.ms-excel' }) + const link = document.createElement('a') + link.style.display = 'none' + link.href = URL.createObjectURL(blob) + link.download = ele.fileName // 下载的文件名 + document.body.appendChild(link) + link.click() + document.body.removeChild(link) + }).finally(() => { + this.exportDatasetLoading = false + }) + }) + }, downloadClick(item) { downloadFile(item.id).then((res) => { const blob = new Blob([res], { type: 'application/vnd.ms-excel' }) @@ -354,15 +402,28 @@ export default { ) }, deleteField(item) { - request({ - url: '/exportCenter/delete/' + item.id, - method: 'get' - }).then( - (res) => { - this.handleClick() - } - ) - this.openMessageSuccess('commons.delete_success') + this.$confirm(this.$t('data_export.sure_del'), '', { + confirmButtonText: this.$t('commons.delete'), + cancelButtonText: this.$t('commons.cancel'), + cancelButtonClass: 'de-confirm-fail-btn de-confirm-fail-cancel', + confirmButtonClass: 'de-confirm-fail-btn de-confirm-fail-confirm', + customClass: 'de-confirm de-confirm-fail', + iconClass: 'el-icon-warning' + }) + .then(() => { + request({ + url: '/exportCenter/delete/' + item.id, + method: 'get' + }).then( + (res) => { + this.openMessageSuccess('commons.delete_success') + this.handleClick() + } + ) + }) + .catch(() => { + this.$info(this.$t('commons.delete_cancel')) + }) }, handleSelectionChange(val) { this.multipleSelection = val @@ -392,6 +453,7 @@ export default { true ).then( (res) => { + this.openMessageSuccess('commons.delete_success') this.handleClick() } ) @@ -399,7 +461,6 @@ export default { .catch(() => { this.$info(this.$t('commons.delete_cancel')) }) - this.openMessageSuccess('commons.delete_success') return } @@ -418,6 +479,7 @@ export default { true ).then( (res) => { + this.openMessageSuccess('commons.delete_success') this.handleClick() } ) @@ -425,7 +487,6 @@ export default { .catch(() => { this.$info(this.$t('commons.delete_cancel')) }) - this.openMessageSuccess('commons.delete_success') }, handleClose() {