refactor(仪表板、数据大屏): 仪表板中的明细表下钻功能优化,只有在当前下钻路径的字段上才会出现下钻选项#9094

This commit is contained in:
wangjiahao 2024-07-25 18:06:56 +08:00
parent 5b1805c863
commit 5154408873
2 changed files with 15 additions and 2 deletions

View File

@ -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']

View File

@ -152,6 +152,8 @@ const state = reactive({
drillClickDimensionList: []
})
const drillClickLength = computed(() => state.drillClickDimensionList.length)
const titleAlign = computed<string>(() => {
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"