From a321351fe2629a34fd4888e1a73d9835c04ff6ce Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Thu, 9 May 2024 14:40:55 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=B5=8C=E5=85=A5=E5=BC=8F):=20=E5=B5=8C?= =?UTF-8?q?=E5=85=A5=E5=BC=8F=E5=9C=BA=E6=99=AF=E4=B8=8B=E4=BB=AA=E8=A1=A8?= =?UTF-8?q?=E6=9D=BF=E5=88=87=E6=8D=A2=E5=88=B0=E7=A7=BB=E5=8A=A8=E7=AB=AF?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E6=AD=A3=E5=B8=B8=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/dashboard/MobileConfigPanel.vue | 14 +++++++++++--- .../core-frontend/src/views/mobile/panel/index.vue | 4 ++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/core/core-frontend/src/views/dashboard/MobileConfigPanel.vue b/core/core-frontend/src/views/dashboard/MobileConfigPanel.vue index afeac5ce9f..4bc3babe8e 100644 --- a/core/core-frontend/src/views/dashboard/MobileConfigPanel.vue +++ b/core/core-frontend/src/views/dashboard/MobileConfigPanel.vue @@ -95,7 +95,7 @@ const hanedleMessage = event => { }) } - if (event.data.type === 'mobileSaveFromMobile') { + if (['mobileSaveFromMobile', 'mobilePatchFromMobile'].includes(event.data.type)) { componentData.value.forEach(ele => { const com = event.data.value[ele.id] if (!!com) { @@ -117,8 +117,14 @@ const hanedleMessage = event => { } } }) + } + if (event.data.type === 'mobileSaveFromMobile') { saveCanvasWithCheckFromMobile() } + + if (event.data.type === 'mobilePatchFromMobile') { + emits('pcMode') + } } const saveCanvasWithCheckFromMobile = () => { @@ -175,7 +181,7 @@ const changeTimes = ref(0) const activeCollapse = ref('com') const handleBack = () => { if (!changeTimes.value) { - emits('pcMode') + mobileStatusChange('mobilePatch', undefined) return } ElMessageBox.confirm('当前的更改尚未保存,确定退出吗?', { @@ -184,7 +190,9 @@ const handleBack = () => { autofocus: false, showClose: false }).then(() => { - emits('pcMode') + setTimeout(() => { + mobileStatusChange('mobilePatch', undefined) + }, 100) }) } diff --git a/core/core-frontend/src/views/mobile/panel/index.vue b/core/core-frontend/src/views/mobile/panel/index.vue index 04736e5e81..86d00fbbe7 100644 --- a/core/core-frontend/src/views/mobile/panel/index.vue +++ b/core/core-frontend/src/views/mobile/panel/index.vue @@ -62,10 +62,10 @@ const hanedleMessage = event => { dvMainStore.setCanvasStyle(event.data.value) } - if (event.data.type === 'mobileSave') { + if (['mobileSave', 'mobilePatch'].includes(event.data.type)) { window.parent.postMessage( { - type: 'mobileSaveFromMobile', + type: `${event.data.type}FromMobile`, value: dvMainStore.componentData.reduce((pre, next) => { const { x, y, sizeX, sizeY, id, component } = next pre[id] = { x, y, sizeX, sizeY, component }