forked from github/dataease
refactor(图表): 表格跳转优化,支持明细表和汇总表点击维度和指标使用不同的跳转逻辑
This commit is contained in:
parent
0774f0413f
commit
5d0f6d1860
@ -1026,7 +1026,10 @@ export const dvMainStore = defineStore('dataVisualization', {
|
||||
}
|
||||
},
|
||||
trackFilterCursor(element, checkQDList, trackInfo, preActiveComponentIds, viewId) {
|
||||
const currentFilters = element.linkageFilters || [] // 当前联动filter
|
||||
let currentFilters = element.linkageFilters || [] // 当前联动filter
|
||||
if (['table-info', 'table-normal'].includes(element.innerType)) {
|
||||
currentFilters = []
|
||||
}
|
||||
// 联动的图表情况历史条件
|
||||
// const currentFilters = []
|
||||
checkQDList.forEach(QDItem => {
|
||||
|
@ -334,6 +334,36 @@ const trackClick = trackAction => {
|
||||
dimensionList: state.pointParam.data.dimensionList,
|
||||
quotaList: state.pointParam.data.quotaList
|
||||
}
|
||||
// 明细表 汇总表特殊处理 1.点击维度传递触发字段的值 2.点击指标传递的值非触发的维度字段值
|
||||
if (['table-info', 'table-normal'].includes(view.value.type)) {
|
||||
linkageParam.quotaList = []
|
||||
const dimensionIds = []
|
||||
const quotaIds = []
|
||||
view.value.xAxis.forEach(xd => {
|
||||
if (xd.groupType === 'd') {
|
||||
dimensionIds.push(xd.id)
|
||||
} else {
|
||||
quotaIds.push(xd.id)
|
||||
}
|
||||
})
|
||||
view.value.yAxis.forEach(xd => {
|
||||
if (xd.groupType === 'd') {
|
||||
dimensionIds.push(xd.id)
|
||||
} else {
|
||||
quotaIds.push(xd.id)
|
||||
}
|
||||
})
|
||||
if (dimensionIds.includes(param.data.name)) {
|
||||
linkageParam.dimensionList = linkageParam.dimensionList.filter(
|
||||
dimension => dimension.id === param.data.name
|
||||
)
|
||||
} else if (quotaIds.includes(param.data.name)) {
|
||||
linkageParam.dimensionList = linkageParam.dimensionList.filter(dimension =>
|
||||
dimensionIds.includes(dimension.id)
|
||||
)
|
||||
}
|
||||
view.value
|
||||
}
|
||||
const jumpParam = {
|
||||
option: 'jump',
|
||||
name: state.pointParam.data.name,
|
||||
|
Loading…
Reference in New Issue
Block a user