diff --git a/core/core-frontend/src/views/dashboard/MobileConfigPanel.vue b/core/core-frontend/src/views/dashboard/MobileConfigPanel.vue
index 2ccb74eaad..0634d90dd3 100644
--- a/core/core-frontend/src/views/dashboard/MobileConfigPanel.vue
+++ b/core/core-frontend/src/views/dashboard/MobileConfigPanel.vue
@@ -46,7 +46,6 @@ const iframeSrc = computed(() => {
? `${embeddedStore.baseUrl}mobile.html#/panel`
: './mobile.html#/panel'
})
-
const handleLoad = () => {
mobileStatusChange(
'panelInit',
@@ -67,7 +66,19 @@ const componentDataNotInMobile = computed(() => {
return componentData.value.filter(ele => !ele.inMobile)
})
+const newWindow = ref()
+
const hanedleMessage = event => {
+ if (event.data?.msgOrigin === 'de-fit2cloud' && !!embeddedStore.token) {
+ const params = {
+ embeddedToken: embeddedStore.token
+ }
+ params['de-embedded'] = true
+ const contentWindow = newWindow.value.contentWindow
+ console.log('call back from dataease!', contentWindow)
+ contentWindow.postMessage(params, '*')
+ return
+ }
if (event.data.type === 'panelInit') {
loadCanvasData()
}
@@ -214,7 +225,7 @@ const save = () => {
{{ dvInfo.name }}
-
+
diff --git a/core/core-frontend/src/views/mobile/panel/index.vue b/core/core-frontend/src/views/mobile/panel/index.vue
index 5f4247d6bf..1bbb88466d 100644
--- a/core/core-frontend/src/views/mobile/panel/index.vue
+++ b/core/core-frontend/src/views/mobile/panel/index.vue
@@ -3,6 +3,7 @@ import { onBeforeMount, ref, onBeforeUnmount } from 'vue'
import { useEmitt } from '@/hooks/web/useEmitt'
import eventBus from '@/utils/eventBus'
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
+import { XpackComponent } from '@/components/plugin'
import DePreviewMobile from './MobileInPc.vue'
const panelInit = ref(false)
const dvMainStore = dvMainStoreWithOut()
@@ -61,7 +62,7 @@ const hanedleMessage = event => {
}
if (event.data.type === 'mobileSave') {
- window.top.postMessage(
+ window.parent.postMessage(
{
type: 'mobileSaveFromMobile',
value: dvMainStore.componentData.reduce((pre, next) => {
@@ -89,8 +90,15 @@ const hanedleMessage = event => {
}
}
-onBeforeMount(async () => {
- window.top.postMessage({ type: 'panelInit', value: true }, '*')
+const initIframe = () => {
+ panelInit.value = false
+ setTimeout(() => {
+ panelInit.value = true
+ })
+}
+
+onBeforeMount(() => {
+ window.parent.postMessage({ type: 'panelInit', value: true }, '*')
window.addEventListener('message', hanedleMessage)
useEmitt({
name: 'onMobileStatusChange',
@@ -101,7 +109,7 @@ onBeforeMount(async () => {
})
const mobileStatusChange = (type, value) => {
- window.top.postMessage({ type, value }, '*')
+ window.parent.postMessage({ type, value }, '*')
if (type === 'delFromMobile') {
eventBus.emit('removeMatrixItemById-canvas-main', value)
}
@@ -116,6 +124,10 @@ onBeforeUnmount(() => {
+