From 1de88e87a38a5f2054ad9d5b4e168e15656db3b6 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Wed, 27 Mar 2024 13:20:01 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E8=BF=87=E6=BB=A4=E7=BB=84=E4=BB=B6):=20?= =?UTF-8?q?=E5=A4=9A=E4=B8=AA=E4=B8=8B=E6=8B=89=E8=BF=87=E6=BB=A4=E5=99=A8?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E9=A6=96=E9=A1=B9=E5=AF=BC=E8=87=B4=E8=A7=86?= =?UTF-8?q?=E5=9B=BE=E6=97=A0=E6=B3=95=E5=8A=A0=E8=BD=BD=20close#8579?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/canvas/customComponent/UserView.vue | 14 +++++++++++--- .../src/components/widget/deWidget/DeSelect.vue | 6 +++--- core/frontend/src/utils/conditionUtil.js | 3 ++- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/core/frontend/src/components/canvas/customComponent/UserView.vue b/core/frontend/src/components/canvas/customComponent/UserView.vue index 904fe21254..a577b81a8d 100644 --- a/core/frontend/src/components/canvas/customComponent/UserView.vue +++ b/core/frontend/src/components/canvas/customComponent/UserView.vue @@ -354,6 +354,7 @@ export default { }, data() { return { + unReadyList: [], dialogLoading: false, imageDownloading: false, innerRefreshTimer: null, @@ -653,6 +654,7 @@ export default { }, mounted() { bus.$on('tab-canvas-change', this.tabSwitch) + bus.$on('resolve-wait-condition', this.resolveWaitCondition) this.bindPluginEvent() }, @@ -674,15 +676,16 @@ export default { bus.$off('onThemeAttrChange', this.optFromBatchSingleProp) bus.$off('clear_panel_linkage', this.clearPanelLinkage) bus.$off('tab-canvas-change', this.tabSwitch) + bus.$off('resolve-wait-condition', this.resolveWaitCondition) }, created() { this.refId = uuid.v1 if (this.element && this.element.propValue && this.element.propValue.viewId) { const group = this.groupFilter(this.filters) - const unReadyList = group.unReady + this.unReadyList = group.unReady const readyList = group.ready - if (unReadyList.length) { - Promise.all(this.filters.filter(f => f instanceof Promise)).then(fList => { + if (this.unReadyList.length) { + Promise.all(this.unReadyList.filter(f => f instanceof Promise)).then(fList => { this.filter.filter = readyList.concat(fList) this.getData(this.element.propValue.viewId, false) }) @@ -692,6 +695,11 @@ export default { } }, methods: { + resolveWaitCondition(p) { + this.unReadyList.filter(f => f instanceof Promise && f.componentId === p.componentId).map(f => { + f.cacheObj.cb(p) + }) + }, groupFilter(filters) { const result = { ready: [], diff --git a/core/frontend/src/components/widget/deWidget/DeSelect.vue b/core/frontend/src/components/widget/deWidget/DeSelect.vue index a8688a8c9f..213bfaf64e 100644 --- a/core/frontend/src/components/widget/deWidget/DeSelect.vue +++ b/core/frontend/src/components/widget/deWidget/DeSelect.vue @@ -2,9 +2,9 @@ { if (conditions?.length) { conditions.forEach(condition => { if (condition instanceof Promise && condition.componentId === componentId && condition.cacheObj?.cb) { + bus.$emit('resolve-wait-condition', p) condition.cacheObj.cb(p) } })