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" /> +