From f78ab3f29d0d48d2324d1016506167c8fb36a7a3 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Wed, 29 Nov 2023 16:23:56 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=B8=8B=E6=8B=89=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E5=99=A8=E4=B8=8E=E9=80=89=E9=A1=B9=E5=8D=A1=E4=BA=A4=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/frontend/src/components/canvas/utils/utils.js | 1 + core/frontend/src/components/widget/deWidget/DeSelect.vue | 2 ++ core/frontend/src/utils/conditionUtil.js | 7 +------ 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/core/frontend/src/components/canvas/utils/utils.js b/core/frontend/src/components/canvas/utils/utils.js index 630adfcbb8..19ed237940 100644 --- a/core/frontend/src/components/canvas/utils/utils.js +++ b/core/frontend/src/components/canvas/utils/utils.js @@ -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 = [] diff --git a/core/frontend/src/components/widget/deWidget/DeSelect.vue b/core/frontend/src/components/widget/deWidget/DeSelect.vue index 599e192c0e..d8097e4361 100644 --- a/core/frontend/src/components/widget/deWidget/DeSelect.vue +++ b/core/frontend/src/components/widget/deWidget/DeSelect.vue @@ -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() { diff --git a/core/frontend/src/utils/conditionUtil.js b/core/frontend/src/utils/conditionUtil.js index 0c960538b9..ac93c68890 100644 --- a/core/frontend/src/utils/conditionUtil.js +++ b/core/frontend/src/utils/conditionUtil.js @@ -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 => {