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 }