From 9172c504af66b2c2fb3f18b4df19bd18c01864a1 Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Tue, 2 Jul 2024 14:30:20 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20=E5=85=A8?= =?UTF-8?q?=E5=B1=8F=E7=8A=B6=E6=80=81=E4=B8=8B=E6=95=B0=E6=8D=AE=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E6=B2=A1=E6=9C=89=E5=B1=95=E7=A4=BA=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/frontend/src/layout/components/Topbar.vue | 13 ++----------- .../src/views/dataset/exportExcel/index.vue | 6 +++--- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/core/frontend/src/layout/components/Topbar.vue b/core/frontend/src/layout/components/Topbar.vue index 942d3af0ab..7093343682 100644 --- a/core/frontend/src/layout/components/Topbar.vue +++ b/core/frontend/src/layout/components/Topbar.vue @@ -124,7 +124,6 @@ - import { mapGetters } from 'vuex' -import ExportExcel from '@/views/dataset/exportExcel/index.vue' import AppLink from './Sidebar/Link' import variables from '@/styles/variables.scss' import { isExternal } from '@/utils/validate' @@ -184,7 +182,6 @@ export default { AppLink, Notification, LangSelect, - ExportExcel }, props: { showTips: { @@ -290,7 +287,6 @@ export default { bus.$on('set-top-text-info', this.setTopTextInfo) bus.$on('set-top-text-active-info', this.setTopTextActiveInfo) bus.$on('sys-logout', this.logout) - bus.$on('data-export-center', this.dataExportCenter) this.showTips && this.$nextTick(() => { const drop = this.$refs['my-drop'] drop && drop.show && drop.show() @@ -300,8 +296,6 @@ export default { beforeDestroy() { window.removeEventListener('beforeunload', (e) => this.beforeunloadHandler(e)) window.removeEventListener('unload', (e) => this.unloadHandler(e)) - - bus.$off('data-export-center', this.dataExportCenter) bus.$off('set-top-menu-info', this.setTopMenuInfo) bus.$off('set-top-menu-active-info', this.setTopMenuActiveInfo) bus.$off('set-top-text-info', this.setTopTextInfo) @@ -324,8 +318,8 @@ export default { localStorage.setItem('DE1.0-AI-TIPS-CHECK', 'CHECKED') this.showOverlay = false }, - dataExportCenter() { - this.downloadClick() + downloadClick() { + bus.$emit('data-export-center') }, async initAiBase() { const aiTipsCheck = localStorage.getItem('DE1.0-AI-TIPS-CHECK') @@ -342,9 +336,6 @@ export default { beforeunloadHandler() { this.beforeUnload_time = new Date().getTime() }, - downloadClick() { - this.$refs.ExportExcelRef.init() - }, unloadHandler(e) { this.gap_time = new Date().getTime() - this.beforeUnload_time if (this.gap_time <= 5) { diff --git a/core/frontend/src/views/dataset/exportExcel/index.vue b/core/frontend/src/views/dataset/exportExcel/index.vue index 24c1595420..1df66255fe 100644 --- a/core/frontend/src/views/dataset/exportExcel/index.vue +++ b/core/frontend/src/views/dataset/exportExcel/index.vue @@ -231,6 +231,9 @@ export default { mounted() { bus.$on('task-export-topic-call', this.taskExportTopicCall) }, + beforeDestroy() { + bus.$off('task-export-topic-call', this.taskExportTopicCall) + }, methods: { init() { this.drawer = true @@ -268,9 +271,6 @@ export default { } }, 5000) }, - format(percentage) { - return '' - }, taskExportTopicCall(task) { if (JSON.parse(task).exportStatus === 'SUCCESS') { this.openMessageLoading(JSON.parse(task).exportFromName + ' ' + this.$t('excel.export') + this.$t('dataset.completed') + this.$t('dataset.goto'), 'success', this.callbackExport)