From 51544088734276dfa5575c1589b60626626b973f Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 25 Jul 2024 18:06:56 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=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=E4=BB=AA=E8=A1=A8?= =?UTF-8?q?=E6=9D=BF=E4=B8=AD=E7=9A=84=E6=98=8E=E7=BB=86=E8=A1=A8=E4=B8=8B?= =?UTF-8?q?=E9=92=BB=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96=EF=BC=8C=E5=8F=AA?= =?UTF-8?q?=E6=9C=89=E5=9C=A8=E5=BD=93=E5=89=8D=E4=B8=8B=E9=92=BB=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E7=9A=84=E5=AD=97=E6=AE=B5=E4=B8=8A=E6=89=8D=E4=BC=9A?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E4=B8=8B=E9=92=BB=E9=80=89=E9=A1=B9#9094?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/components/ChartComponentS2.vue | 14 ++++++++++++-- .../src/views/chart/components/views/index.vue | 3 +++ 2 files changed, 15 insertions(+), 2 deletions(-) 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 b196979682..512deeccfc 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 @@ -71,12 +71,17 @@ const props = defineProps({ terminal: { type: String, default: 'pc' + }, + drillLength: { + type: Number, + required: false, + default: 0 } }) const emit = defineEmits(['onPointClick', 'onChartClick', 'onDrillFilters', 'onJumpClick']) -const { view, showPosition, scale, terminal } = toRefs(props) +const { view, showPosition, scale, terminal, drillLength } = toRefs(props) const isError = ref(false) const errMsg = ref('') @@ -458,6 +463,7 @@ const trackMenuCalc = itemId => { } let linkageCount = 0 let jumpCount = 0 + let drillCount = 0 const sourceInfo = view.value.id + '#' + itemId if (nowPanelTrackInfo.value[sourceInfo]) { linkageCount++ @@ -470,7 +476,11 @@ const trackMenuCalc = itemId => { (!mobileInPc.value || inMobile.value) && trackMenuInfo.push('jump') linkageCount && view.value?.linkageActive && trackMenuInfo.push('linkage') - view.value.drillFields.length && trackMenuInfo.push('drill') + // 判断是否有下钻 同时判断下钻到第几层 + if (view.value.drillFields.length && view.value.drillFields[drillLength.value].id === itemId) { + drillCount++ + } + drillCount && trackMenuInfo.push('drill') // 如果同时配置jump linkage drill 切配置联动时同时下钻 在实际只显示两个 '跳转' '联动和下钻' if (trackMenuInfo.length === 3 && props.element.actionSelection.linkageActive === 'auto') { trackMenuInfo = ['jump', 'linkageAndDrill'] diff --git a/core/core-frontend/src/views/chart/components/views/index.vue b/core/core-frontend/src/views/chart/components/views/index.vue index 1abc251bb9..d27b719c85 100644 --- a/core/core-frontend/src/views/chart/components/views/index.vue +++ b/core/core-frontend/src/views/chart/components/views/index.vue @@ -152,6 +152,8 @@ const state = reactive({ drillClickDimensionList: [] }) +const drillClickLength = computed(() => state.drillClickDimensionList.length) + const titleAlign = computed(() => { if (!titleShow.value) { return 'flex-start' @@ -911,6 +913,7 @@ const loadPluginCategory = data => { :scale="scale" :show-position="showPosition" :element="element" + :drill-length="drillClickLength" v-else-if="showChartView(ChartLibraryType.S2)" ref="chartComponent" @onPointClick="onPointClick"