diff --git a/core/core-frontend/src/views/dashboard/MobileConfigPanel.vue b/core/core-frontend/src/views/dashboard/MobileConfigPanel.vue index 7fc793567f..eb4f6478c6 100644 --- a/core/core-frontend/src/views/dashboard/MobileConfigPanel.vue +++ b/core/core-frontend/src/views/dashboard/MobileConfigPanel.vue @@ -111,19 +111,30 @@ const hanedleMessage = event => { componentData.value.forEach(ele => { const com = event.data.value[ele.id] if (!!com) { - const { x, y, sizeX, sizeY } = com + const { x, y, sizeX, sizeY, style, commonBackground } = com ele.mx = x ele.my = y ele.mSizeX = sizeX ele.mSizeY = sizeY + ele.mStyle = style + ele.mCommonBackground = commonBackground if (ele.component === 'DeTabs') { ele.propValue.forEach(tabItem => { tabItem.componentData.forEach(tabComponent => { - const { x: tx, y: ty, sizeX: tSizeX, sizeY: tSizeY } = com.tab[tabComponent.id] + const { + x: tx, + y: ty, + sizeX: tSizeX, + sizeY: tSizeY, + style: tStyle, + commonBackground: tCommonBackground + } = com.tab[tabComponent.id] tabComponent.mx = tx tabComponent.my = ty tabComponent.mSizeX = tSizeX tabComponent.mSizeY = tSizeY + tabComponent.mStyle = tStyle + tabComponent.mCommonBackground = tCommonBackground }) }) } diff --git a/core/core-frontend/src/views/mobile/panel/index.vue b/core/core-frontend/src/views/mobile/panel/index.vue index a3ad7c9f46..b142e21062 100644 --- a/core/core-frontend/src/views/mobile/panel/index.vue +++ b/core/core-frontend/src/views/mobile/panel/index.vue @@ -22,21 +22,32 @@ const hanedleMessage = event => { if (event.data.type === 'panelInit') { const { componentData, canvasStyleData, dvInfo, canvasViewInfo, isEmbedded } = event.data.value componentData.forEach(ele => { - const { mx, my, mSizeX, mSizeY } = ele + const { mx, my, mSizeX, mSizeY, mStyle, mCommonBackground } = ele ele.x = mx ele.y = my ele.sizeX = mSizeX ele.sizeY = mSizeY + ele.style = mStyle || ele.style + ele.commonBackground = mCommonBackground || ele.commonBackground if (ele.component === 'DeTabs') { ele.propValue.forEach(tabItem => { tabItem.componentData.forEach(tabComponent => { - const { mx: tx, my: ty, mSizeX: tSizeX, mSizeY: tSizeY } = tabComponent + const { + mx: tx, + my: ty, + mSizeX: tSizeX, + mSizeY: tSizeY, + mStyle: tStyle, + mCommonBackground: tCommonBackground + } = tabComponent if (tSizeX && tSizeY) { tabComponent.x = tx tabComponent.y = ty tabComponent.sizeX = tSizeX tabComponent.sizeY = tSizeY + tabComponent.style = tStyle || tabComponent.style + tabComponent.commonBackground = tCommonBackground || tabComponent.commonBackground } }) }) @@ -80,18 +91,36 @@ const hanedleMessage = event => { { 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 } + const { x, y, sizeX, sizeY, id, component, style, commonBackground } = next + pre[id] = { + x, + y, + sizeX, + sizeY, + component, + style: JSON.parse(JSON.stringify(style)), + commonBackground: JSON.parse(JSON.stringify(commonBackground)) + } if (next.component === 'DeTabs') { pre[id].tab = {} next.propValue.forEach(tabItem => { tabItem.componentData.forEach(tabComponent => { - const { x: tx, y: ty, sizeX: tSizeX, sizeY: tSizeY, id: tId } = tabComponent + const { + x: tx, + y: ty, + sizeX: tSizeX, + sizeY: tSizeY, + id: tId, + style: tStyle, + commonBackground: tCommonBackground + } = tabComponent pre[id].tab[tId] = { x: tx, y: ty, sizeX: tSizeX, - sizeY: tSizeY + sizeY: tSizeY, + style: JSON.parse(JSON.stringify(tStyle)), + commonBackground: JSON.parse(JSON.stringify(tCommonBackground)) } }) })