forked from github/dataease
refactor(仪表板、数据大屏): 仪表板中的明细表下钻功能优化,只有在当前下钻路径的字段上才会出现下钻选项#9094
This commit is contained in:
parent
5b1805c863
commit
5154408873
@ -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']
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user