From 0ec077167060c324057ba0c6cdfbddcde997598b Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Wed, 3 Apr 2024 16:38:22 +0800 Subject: [PATCH] =?UTF-8?q?perf(X-Pack):=20=E5=B5=8C=E5=85=A5=E5=BC=8F?= =?UTF-8?q?=E4=B8=8E=E5=AE=BF=E4=B8=BB=E4=BA=A4=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/dashboard/DbToolbar.vue | 19 +++++++++++++++-- .../data-visualization/DvToolbar.vue | 21 +++++++++++++++++-- de-xpack | 2 +- 3 files changed, 37 insertions(+), 5 deletions(-) diff --git a/core/core-frontend/src/components/dashboard/DbToolbar.vue b/core/core-frontend/src/components/dashboard/DbToolbar.vue index 6ff00cc466..0f6154912f 100644 --- a/core/core-frontend/src/components/dashboard/DbToolbar.vue +++ b/core/core-frontend/src/components/dashboard/DbToolbar.vue @@ -179,13 +179,28 @@ const backToMain = () => { autofocus: false, showClose: false }).then(() => { - window.open(url, '_self') + backHandler(url) }) } else { - window.open(url, '_self') + backHandler(url) } } +const backHandler = (url: string) => { + if (window['dataease-embedded-host'] && openHandler?.value) { + const pm = { + methodName: 'interactive', + args: { + eventName: 'de-dashboard-editor-back', + args: 'Just a demo that descript dataease embedded interactive' + } + } + openHandler.value.invokeMethod(pm) + return + } + window.open(url, '_self') +} + const multiplexingCanvasOpen = () => { multiplexingRef.value.dialogInit() } diff --git a/core/core-frontend/src/components/data-visualization/DvToolbar.vue b/core/core-frontend/src/components/data-visualization/DvToolbar.vue index 45cb048977..5d23619350 100644 --- a/core/core-frontend/src/components/data-visualization/DvToolbar.vue +++ b/core/core-frontend/src/components/data-visualization/DvToolbar.vue @@ -16,6 +16,7 @@ import DeResourceGroupOpt from '@/views/common/DeResourceGroupOpt.vue' import { canvasSave } from '@/utils/canvasUtils' import { changeSizeWithScale } from '@/utils/changeComponentsSizeWithScale' import MoreComGroup from '@/custom-component/component-group/MoreComGroup.vue' +import { XpackComponent } from '@/components/plugin' let nameEdit = ref(false) let inputName = ref('') let nameInput = ref(null) @@ -121,12 +122,27 @@ const backToMain = () => { autofocus: false, showClose: false }).then(() => { - window.open(url, '_self') + backHandler(url) }) } else { - window.open(url, '_self') + backHandler(url) } } +const backHandler = (url: string) => { + if (window['dataease-embedded-host'] && openHandler?.value) { + const pm = { + methodName: 'interactive', + args: { + eventName: 'de-dashboard-editor-back', + args: 'Just a demo that descript dataease embedded interactive' + } + } + openHandler.value.invokeMethod(pm) + return + } + window.open(url, '_self') +} +const openHandler = ref(null) const onDvNameChange = () => { snapshotStore.recordSnapshotCache() @@ -252,6 +268,7 @@ eventBus.on('clearCanvas', clearCanvas) ref="resourceGroupOpt" /> +