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) } })