mirror of
https://github.com/dataease/dataease.git
synced 2025-02-24 19:42:56 +08:00
fix(仪表板): 修复被联动图表被删除后,联动配置没有清理问题
This commit is contained in:
parent
3d2395bccb
commit
93d4fd8f66
@ -867,6 +867,7 @@ function removeItem(index) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
componentData.value.splice(index, 1)
|
componentData.value.splice(index, 1)
|
||||||
|
dvMainStore.removeLinkageInfo(item['id'])
|
||||||
if (!!checkedFields.length) {
|
if (!!checkedFields.length) {
|
||||||
Array.from(new Set(checkedFields)).forEach(ele => {
|
Array.from(new Set(checkedFields)).forEach(ele => {
|
||||||
emitter.emit(`query-data-${ele}`)
|
emitter.emit(`query-data-${ele}`)
|
||||||
|
@ -793,6 +793,9 @@ export const dvMainStore = defineStore('dataVisualization', {
|
|||||||
setNowPanelJumpInfo(jumpInfo) {
|
setNowPanelJumpInfo(jumpInfo) {
|
||||||
this.nowPanelJumpInfo = jumpInfo.baseJumpInfoMap
|
this.nowPanelJumpInfo = jumpInfo.baseJumpInfoMap
|
||||||
},
|
},
|
||||||
|
setNowPanelJumpInfoInner(jumpInfo) {
|
||||||
|
this.nowPanelJumpInfo = jumpInfo
|
||||||
|
},
|
||||||
setNowTargetPanelJumpInfo(jumpInfo) {
|
setNowTargetPanelJumpInfo(jumpInfo) {
|
||||||
this.nowPanelJumpInfoTargetPanel = jumpInfo.baseJumpInfoVisualizationMap
|
this.nowPanelJumpInfoTargetPanel = jumpInfo.baseJumpInfoVisualizationMap
|
||||||
},
|
},
|
||||||
@ -1122,6 +1125,24 @@ export const dvMainStore = defineStore('dataVisualization', {
|
|||||||
this.componentData = []
|
this.componentData = []
|
||||||
this.canvasViewInfo = {}
|
this.canvasViewInfo = {}
|
||||||
},
|
},
|
||||||
|
removeLinkageInfo(targetId) {
|
||||||
|
if (!!targetId && !!this.nowPanelTrackInfo) {
|
||||||
|
Object.keys(this.nowPanelTrackInfo).forEach(trackId => {
|
||||||
|
const targetInfo = this.nowPanelTrackInfo[trackId]
|
||||||
|
for (let i = 0; i < targetInfo.length; i++) {
|
||||||
|
if (targetInfo[i].indexOf(targetId) > -1) {
|
||||||
|
targetInfo.splice(i, 1)
|
||||||
|
i--
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
Object.keys(this.nowPanelTrackInfo).forEach(trackId => {
|
||||||
|
if (trackId.indexOf(targetId) > -1 || this.nowPanelTrackInfo[trackId].length === 0) {
|
||||||
|
delete this.nowPanelTrackInfo[trackId]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
canvasDataInit() {
|
canvasDataInit() {
|
||||||
this.canvasViewInfo = {}
|
this.canvasViewInfo = {}
|
||||||
this.componentData = []
|
this.componentData = []
|
||||||
|
@ -13,7 +13,8 @@ const {
|
|||||||
canvasStyleData,
|
canvasStyleData,
|
||||||
canvasViewInfo,
|
canvasViewInfo,
|
||||||
curOriginThemes,
|
curOriginThemes,
|
||||||
dataPrepareState
|
dataPrepareState,
|
||||||
|
nowPanelTrackInfo
|
||||||
} = storeToRefs(dvMainStore)
|
} = storeToRefs(dvMainStore)
|
||||||
|
|
||||||
let defaultCanvasInfo = {
|
let defaultCanvasInfo = {
|
||||||
@ -81,6 +82,7 @@ export const snapshotStore = defineStore('snapshot', {
|
|||||||
dvMainStore.setComponentData(snapshotInfo.componentData)
|
dvMainStore.setComponentData(snapshotInfo.componentData)
|
||||||
dvMainStore.setCanvasStyle(snapshotInfo.canvasStyleData)
|
dvMainStore.setCanvasStyle(snapshotInfo.canvasStyleData)
|
||||||
dvMainStore.setCanvasViewInfo(snapshotInfo.canvasViewInfo)
|
dvMainStore.setCanvasViewInfo(snapshotInfo.canvasViewInfo)
|
||||||
|
dvMainStore.setNowPanelJumpInfoInner(snapshotInfo.nowPanelTrackInfo)
|
||||||
const curCacheViewIdInfo = deepCopy(this.cacheViewIdInfo)
|
const curCacheViewIdInfo = deepCopy(this.cacheViewIdInfo)
|
||||||
this.cacheViewIdInfo = snapshotInfo.cacheViewIdInfo
|
this.cacheViewIdInfo = snapshotInfo.cacheViewIdInfo
|
||||||
|
|
||||||
@ -139,7 +141,8 @@ export const snapshotStore = defineStore('snapshot', {
|
|||||||
componentData: deepCopy(componentData.value),
|
componentData: deepCopy(componentData.value),
|
||||||
canvasStyleData: deepCopy(canvasStyleData.value),
|
canvasStyleData: deepCopy(canvasStyleData.value),
|
||||||
canvasViewInfo: deepCopy(canvasViewInfo.value),
|
canvasViewInfo: deepCopy(canvasViewInfo.value),
|
||||||
cacheViewIdInfo: deepCopy(this.cacheViewIdInfo)
|
cacheViewIdInfo: deepCopy(this.cacheViewIdInfo),
|
||||||
|
nowPanelTrackInfo: deepCopy(nowPanelTrackInfo.value)
|
||||||
}
|
}
|
||||||
this.snapshotData[++this.snapshotIndex] = newSnapshot
|
this.snapshotData[++this.snapshotIndex] = newSnapshot
|
||||||
// 在 undo 过程中,添加新的快照时,要将它后面的快照清理掉
|
// 在 undo 过程中,添加新的快照时,要将它后面的快照清理掉
|
||||||
|
@ -21,7 +21,7 @@ import { BASE_VIEW_CONFIG } from '../util/chart'
|
|||||||
import { cloneDeep, defaultsDeep } from 'lodash-es'
|
import { cloneDeep, defaultsDeep } from 'lodash-es'
|
||||||
const dvMainStore = dvMainStoreWithOut()
|
const dvMainStore = dvMainStoreWithOut()
|
||||||
|
|
||||||
const { nowPanelTrackInfo, nowPanelJumpInfo, dvInfo } = storeToRefs(dvMainStore)
|
const { nowPanelTrackInfo, nowPanelJumpInfo, dvInfo, componentData } = storeToRefs(dvMainStore)
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
const linkJumpRef = ref(null)
|
const linkJumpRef = ref(null)
|
||||||
|
Loading…
Reference in New Issue
Block a user