From 4f1c8a7baab17aa5fea01222dc2d741a2ab1de04 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 12 Nov 2024 10:52:05 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E4=BB=AA=E8=A1=A8=E6=9D=BF=E3=80=81?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F):=20=E5=B5=8C=E5=85=A5?= =?UTF-8?q?=E5=BC=8F=E6=94=AF=E6=8C=81=E7=9B=B4=E6=8E=A5=E5=B1=95=E7=A4=BA?= =?UTF-8?q?Tab=E3=80=81=E5=88=86=E7=BB=84=EF=BC=8C=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E6=94=AF=E6=8C=81Tab=E5=88=86=E7=BB=84=E5=86=85=E9=83=A8?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/pages/panel/ViewWrapper.vue | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/core/core-frontend/src/pages/panel/ViewWrapper.vue b/core/core-frontend/src/pages/panel/ViewWrapper.vue index 313df29e69..487683614a 100644 --- a/core/core-frontend/src/pages/panel/ViewWrapper.vue +++ b/core/core-frontend/src/pages/panel/ViewWrapper.vue @@ -26,7 +26,7 @@ const state = reactive({ canvasStylePreview: null, canvasViewInfoPreview: null, dvInfo: null, - chartId: null, + dvId: null, suffixId: 'common', initState: true }) @@ -41,7 +41,7 @@ const winMsgHandle = event => { if ( msgInfo && msgInfo.type === 'attachParams' && - msgInfo.targetSourceId === state.chartId + '' && + msgInfo.targetSourceId === state.dvId + '' && (!msgInfo.suffixId || msgInfo.suffixId === state.suffixId) ) { const attachParams = msgInfo.params @@ -65,7 +65,7 @@ onBeforeMount(async () => { if (!checkResult) { return } - state.chartId = embeddedParams.dvId + state.dvId = embeddedParams.dvId state.suffixId = embeddedParams.suffixId || 'common' window.addEventListener('message', winMsgHandle) @@ -112,9 +112,7 @@ onBeforeMount(async () => { if (ele.id === chartId) { config.value = ele return true - } - - if (ele.component === 'Group') { + } else if (ele.component === 'Group') { return (ele.propValue || []).some(itx => { if (itx.id === chartId) { config.value = itx @@ -122,6 +120,16 @@ onBeforeMount(async () => { } return false }) + } else if (ele.component === 'DeTabs') { + ele.propValue.forEach(tabItem => { + return (tabItem.componentData || []).some(itx => { + if (itx.id === chartId) { + config.value = itx + return true + } + return false + }) + }) } return false })