forked from github/dataease
perf: 下拉过滤器与选项卡交互
This commit is contained in:
parent
515b881558
commit
f78ab3f29d
@ -136,6 +136,7 @@ export function panelDataPrepare(componentData, componentStyle, callback) {
|
||||
}
|
||||
if (item.type === 'custom') {
|
||||
item.options.manualModify = false
|
||||
item.options.loaded = false
|
||||
}
|
||||
if (item.filters && item.filters.length > 0) {
|
||||
item.filters = []
|
||||
|
@ -382,6 +382,8 @@ export default {
|
||||
componentId: this.element.id,
|
||||
val: (this.value && Array.isArray(this.value)) ? this.value.join(',') : this.value
|
||||
})
|
||||
this.element.options.loaded = true
|
||||
this.$store.commit('setComponentWithId', this.element)
|
||||
}
|
||||
},
|
||||
refreshLoad() {
|
||||
|
@ -91,11 +91,6 @@ const cacheCondition = (cb, obj) => {
|
||||
obj.cb = cb
|
||||
}
|
||||
|
||||
const crossCanvasFilter = (filterEle, viewId) => {
|
||||
const filterCanvas = filterEle.canvasId
|
||||
const canvasIdMap = buildCanvasIdMap(store.state.componentData)
|
||||
return canvasIdMap[viewId] !== filterCanvas
|
||||
}
|
||||
export const buildViewKeyFilters = (panelItems, result, isEdit = false) => {
|
||||
if (!(panelItems && panelItems.length > 0)) {
|
||||
return result
|
||||
@ -118,7 +113,7 @@ export const buildViewKeyFilters = (panelItems, result, isEdit = false) => {
|
||||
// 进行过滤时 如果过滤组件在主画布 则条件适用于所有画布视图 否则需要过滤组件和视图在相同画布
|
||||
if (element.canvasId === 'canvas-main' || element.canvasId === canvasIdMap[viewId]) {
|
||||
const vidMatch = viewIdMatch(condition.viewIds, viewId)
|
||||
if (vidMatch && selectFirst && !(crossCanvasFilter(element, viewId) && isEdit)) {
|
||||
if (vidMatch && selectFirst && !element.options.loaded) {
|
||||
const obj = {}
|
||||
const promise = new Promise(resolve => {
|
||||
cacheCondition(cbParam => {
|
||||
|
Loading…
Reference in New Issue
Block a user