forked from github/dataease
fix: 大屏联动有时无法清除、双向联动相互影响等问题修复
This commit is contained in:
parent
99e990eb5c
commit
951fca808f
@ -253,7 +253,7 @@ const editQueryCriteria = () => {
|
||||
popComponentDataLength === 0
|
||||
"
|
||||
>
|
||||
移动到大屏弹框区
|
||||
移动到大屏弹窗区
|
||||
</li>
|
||||
<el-divider class="custom-divider" />
|
||||
<li @click="hide" v-show="curComponent['isShow']">隐藏</li>
|
||||
|
@ -3,6 +3,7 @@
|
||||
v-if="existLinkage && !dvMainStore.mobileInPc"
|
||||
class="bar-main-right"
|
||||
:class="{ 'bar-main-edit-right': dvEditMode }"
|
||||
@mousedown="handOptBarMousedown"
|
||||
>
|
||||
<el-button size="mini" type="warning" @click="clearAllLinkage"
|
||||
><el-icon class="bar-base-icon"> <Icon name="dv-bar-unLinkage"></Icon></el-icon
|
||||
@ -35,6 +36,11 @@ const props = defineProps({
|
||||
}
|
||||
})
|
||||
|
||||
const handOptBarMousedown = e => {
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
}
|
||||
|
||||
const clearAllLinkage = () => {
|
||||
dvMainStore.clearPanelLinkageInfo()
|
||||
useEmitt().emitter.emit('clearPanelLinkage', { viewId: 'all' })
|
||||
|
@ -537,6 +537,7 @@ export const dvMainStore = defineStore('dataVisualization', {
|
||||
if (item.linkageFilters && item.linkageFilters.length > 0) {
|
||||
const historyLinkageFiltersLength = item.linkageFilters.length
|
||||
const newList = item.linkageFilters.filter(linkage => linkage.sourceViewId !== viewId)
|
||||
console.log('===newList= ' + JSON.stringify(newList))
|
||||
item.linkageFilters.splice(0, item.linkageFilters.length)
|
||||
// 重新push 可保证数组指针不变 可以watch到
|
||||
if (newList.length > 0) {
|
||||
@ -894,27 +895,35 @@ export const dvMainStore = defineStore('dataVisualization', {
|
||||
const checkQDList = [...data.dimensionList, ...data.quotaList]
|
||||
for (let indexOuter = 0; indexOuter < this.componentData.length; indexOuter++) {
|
||||
const element = this.componentData[indexOuter]
|
||||
if (['UserView', 'VQuery'].includes(element.component)) {
|
||||
this.trackFilterCursor(element, checkQDList, trackInfo, preActiveComponentIds, viewId)
|
||||
this.componentData[indexOuter] = element
|
||||
} else if (element.component === 'Group') {
|
||||
element.propValue.forEach((groupItem, index) => {
|
||||
this.trackFilterCursor(groupItem, checkQDList, trackInfo, preActiveComponentIds, viewId)
|
||||
element.propValue[index] = groupItem
|
||||
})
|
||||
} else if (element.component === 'DeTabs') {
|
||||
element.propValue.forEach(tabItem => {
|
||||
tabItem.componentData.forEach((tabComponent, index) => {
|
||||
if (element.id !== viewId) {
|
||||
if (['UserView', 'VQuery'].includes(element.component)) {
|
||||
this.trackFilterCursor(element, checkQDList, trackInfo, preActiveComponentIds, viewId)
|
||||
this.componentData[indexOuter] = element
|
||||
} else if (element.component === 'Group') {
|
||||
element.propValue.forEach((groupItem, index) => {
|
||||
this.trackFilterCursor(
|
||||
tabComponent,
|
||||
groupItem,
|
||||
checkQDList,
|
||||
trackInfo,
|
||||
preActiveComponentIds,
|
||||
viewId
|
||||
)
|
||||
tabItem.componentData[index] = tabComponent
|
||||
element.propValue[index] = groupItem
|
||||
})
|
||||
})
|
||||
} else if (element.component === 'DeTabs') {
|
||||
element.propValue.forEach(tabItem => {
|
||||
tabItem.componentData.forEach((tabComponent, index) => {
|
||||
this.trackFilterCursor(
|
||||
tabComponent,
|
||||
checkQDList,
|
||||
trackInfo,
|
||||
preActiveComponentIds,
|
||||
viewId
|
||||
)
|
||||
tabItem.componentData[index] = tabComponent
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
preActiveComponentIds.forEach(viewId => {
|
||||
|
@ -102,9 +102,13 @@ const viewTrack = ref(null)
|
||||
|
||||
const clearLinkage = () => {
|
||||
linkageActiveHistory.value = false
|
||||
myChart?.setState('active', () => true, false)
|
||||
myChart?.setState('inactive', () => true, false)
|
||||
myChart?.setState('selected', () => true, false)
|
||||
try {
|
||||
myChart?.setState('active', () => true, false)
|
||||
myChart?.setState('inactive', () => true, false)
|
||||
myChart?.setState('selected', () => true, false)
|
||||
} catch (e) {
|
||||
console.warn('clearLinkage error')
|
||||
}
|
||||
}
|
||||
const reDrawView = () => {
|
||||
linkageActiveHistory.value = false
|
||||
|
@ -169,6 +169,7 @@ const handleDragOver = e => {
|
||||
}
|
||||
|
||||
const handleMouseDown = e => {
|
||||
console.log('====handleMouseDown===' + e)
|
||||
// e.stopPropagation()
|
||||
dvMainStore.setClickComponentStatus(false)
|
||||
// 点击画布的空区域 提前清空curComponent 防止右击菜单内容抖动
|
||||
|
Loading…
Reference in New Issue
Block a user