From 58fa8e4051bc8432d29c3f0a1b23d0a1a3a21851 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Mon, 22 Jul 2024 12:43:27 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E5=9B=BE=E8=A1=A8):=20=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E8=A1=A8=E3=80=81=E6=B1=87=E6=80=BB=E8=A1=A8=E5=A4=9A?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E5=BC=B9=E6=A1=86=E4=BC=98=E5=8C=96,?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=9C=AA=E8=AE=BE=E7=BD=AE=E8=81=94=E5=8A=A8?= =?UTF-8?q?=E6=88=96=E8=B7=B3=E8=BD=AC=E5=AD=97=E6=AE=B5=E4=BE=9D=E7=84=B6?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E6=9C=89=E5=85=A8=E9=83=A8=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E5=BC=B9=E6=A1=86=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/visualization/LinkageSet.vue | 3 ++ .../views/components/ChartComponentS2.vue | 45 +++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/core/core-frontend/src/components/visualization/LinkageSet.vue b/core/core-frontend/src/components/visualization/LinkageSet.vue index a56c335afe..cae2f9c8b9 100644 --- a/core/core-frontend/src/components/visualization/LinkageSet.vue +++ b/core/core-frontend/src/components/visualization/LinkageSet.vue @@ -553,6 +553,9 @@ const sourceLinkageInfoFilter = computed(() => { JSON.stringify(state.curLinkageViewInfo.xAxisExt) + (state.curLinkageViewInfo.type.includes('chart-mix') ? JSON.stringify(state.curLinkageViewInfo.extBubble) + : '') + + (state.curLinkageViewInfo.type.includes('table-normal') + ? JSON.stringify(state.curLinkageViewInfo.yAxis) : '') return state.sourceLinkageInfo.targetViewFields.filter(item => curCheckAllAxisStr.includes(item.id) diff --git a/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue b/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue index b6e2d88815..b196979682 100644 --- a/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue +++ b/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue @@ -83,6 +83,8 @@ const errMsg = ref('') const chartExtRequest = inject('chartExtRequest') as ShallowRef const state = reactive({ + curActionId: null, + curTrackMenu: [], trackBarStyle: { position: 'absolute', left: '50px', @@ -302,6 +304,8 @@ const pointClickTrans = () => { const action = param => { state.pointParam = param + state.curActionId = param.data.name + state.curTrackMenu = trackMenuCalc(state.curActionId) // 点击 pointClickTrans() // 下钻 联动 跳转 @@ -405,6 +409,14 @@ const trackClick = trackAction => { } const trackMenu = computed(() => { + if (['table-info', 'table-normal'].includes(view.value.type) && state.curActionId) { + return trackMenuCalc(state.curActionId) + } else { + return trackMenuCmp.value + } +}) + +const trackMenuCmp = computed(() => { let trackMenuInfo = [] if (showPosition.value === 'viewDialog') { return trackMenuInfo @@ -439,6 +451,39 @@ const trackMenu = computed(() => { return trackMenuInfo }) +const trackMenuCalc = itemId => { + let trackMenuInfo = [] + if (showPosition.value === 'viewDialog') { + return trackMenuInfo + } + let linkageCount = 0 + let jumpCount = 0 + const sourceInfo = view.value.id + '#' + itemId + if (nowPanelTrackInfo.value[sourceInfo]) { + linkageCount++ + } + if (nowPanelJumpInfo.value[sourceInfo]) { + jumpCount++ + } + jumpCount && + view.value?.jumpActive && + (!mobileInPc.value || inMobile.value) && + trackMenuInfo.push('jump') + linkageCount && view.value?.linkageActive && trackMenuInfo.push('linkage') + view.value.drillFields.length && trackMenuInfo.push('drill') + // 如果同时配置jump linkage drill 切配置联动时同时下钻 在实际只显示两个 '跳转' '联动和下钻' + if (trackMenuInfo.length === 3 && props.element.actionSelection.linkageActive === 'auto') { + trackMenuInfo = ['jump', 'linkageAndDrill'] + } else if ( + trackMenuInfo.length === 2 && + props.element.actionSelection.linkageActive === 'auto' && + !trackMenuInfo.includes('jump') + ) { + trackMenuInfo = ['linkageAndDrill'] + } + return trackMenuInfo +} + const resizeAction = resizeColumn => { // 从头开始滚动 if (myChart?.facet.timer) {