Merge pull request #10070 from dataease/pr@dev-v2@refactor_linkage

refactor: 优化联动设置,联动源字段只允许是维度字段
This commit is contained in:
王嘉豪 2024-06-04 12:08:11 +08:00 committed by GitHub
commit 70292d4299
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -371,14 +371,9 @@ const linkageFieldAdaptor = async data => {
if (state.curLinkageViewInfo.tableId === targetChartDetails.tableId) {
const curCheckAllAxisStr =
JSON.stringify(state.curLinkageViewInfo.xAxis) +
JSON.stringify(state.curLinkageViewInfo.xAxisExt) +
JSON.stringify(state.curLinkageViewInfo.yAxis) +
JSON.stringify(state.curLinkageViewInfo.yAxisExt)
JSON.stringify(state.curLinkageViewInfo.xAxisExt)
const targetCheckAllAxisStr =
JSON.stringify(targetChartDetails.xAxis) +
JSON.stringify(targetChartDetails.xAxisExt) +
JSON.stringify(targetChartDetails.yAxis) +
JSON.stringify(targetChartDetails.yAxisExt)
JSON.stringify(targetChartDetails.xAxis) + JSON.stringify(targetChartDetails.xAxisExt)
state.sourceLinkageInfo.targetViewFields.forEach(item => {
if (curCheckAllAxisStr.includes(item.id) && targetCheckAllAxisStr.includes(item.id)) {
addLinkageField(item.id, item.id)
@ -395,9 +390,7 @@ const sourceLinkageInfoFilter = computed(() => {
if (state.sourceLinkageInfo.targetViewFields) {
const curCheckAllAxisStr =
JSON.stringify(state.curLinkageViewInfo.xAxis) +
JSON.stringify(state.curLinkageViewInfo.xAxisExt) +
JSON.stringify(state.curLinkageViewInfo.yAxis) +
JSON.stringify(state.curLinkageViewInfo.yAxisExt)
JSON.stringify(state.curLinkageViewInfo.xAxisExt)
return state.sourceLinkageInfo.targetViewFields.filter(item =>
curCheckAllAxisStr.includes(item.id)
)