From 37050dfdd0c53421059e4a6b394ed0962d024d73 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Fri, 16 Dec 2022 17:20:18 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20=E4=BB=AA?= =?UTF-8?q?=E8=A1=A8=E6=9D=BF=E5=88=B7=E6=96=B0=E6=97=B6=EF=BC=8C=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E7=BB=84=E4=BB=B6=E7=9A=84=E5=A4=87=E9=80=89=E9=A1=B9?= =?UTF-8?q?=E5=90=8C=E6=97=B6=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canvas/components/editor/ComponentWrapper.vue | 3 ++- frontend/src/components/dataease/DeOutWidget.vue | 14 ++++++++++++++ .../src/components/widget/deWidget/DeSelect.vue | 15 +++++++++++---- .../components/widget/deWidget/DeSelectGrid.vue | 14 ++++++++++---- .../components/widget/deWidget/DeSelectTree.vue | 15 +++++++++++---- 5 files changed, 48 insertions(+), 13 deletions(-) diff --git a/frontend/src/components/canvas/components/editor/ComponentWrapper.vue b/frontend/src/components/canvas/components/editor/ComponentWrapper.vue index 562c484ec2..b12a130c2e 100644 --- a/frontend/src/components/canvas/components/editor/ComponentWrapper.vue +++ b/frontend/src/components/canvas/components/editor/ComponentWrapper.vue @@ -44,6 +44,7 @@ :in-screen="inScreen" :edit-mode="'preview'" :h="config.style.height" + :search-count="searchCount" :canvas-id="canvasId" /> 0 && this.needRefreshComponents.includes(this.element.component) && (!this.curComponent || this.curComponent.id !== this.element.id)) { + this.$refs['deOutWidget'].refreshLoad() + } } }, mounted() { diff --git a/frontend/src/components/widget/deWidget/DeSelect.vue b/frontend/src/components/widget/deWidget/DeSelect.vue index a020ad61f0..a0f2b5a393 100644 --- a/frontend/src/components/widget/deWidget/DeSelect.vue +++ b/frontend/src/components/widget/deWidget/DeSelect.vue @@ -47,6 +47,7 @@ import { isSameVueObj, mergeCustomSortOption } from '@/utils' import { getLinkToken, getToken } from '@/utils/auth' import customInput from '@/components/widget/deWidget/customInput' import { textSelectWidget } from '@/components/widget/deWidget/serviceNameFn.js' + export default { components: { ElVisualSelect }, mixins: [customInput], @@ -255,6 +256,16 @@ export default { }, initLoad() { this.value = this.fillValueDerfault() + this.initOptions() + if (this.element.options.value) { + this.value = this.fillValueDerfault() + this.changeValue(this.value) + } + }, + refreshLoad() { + this.initOptions() + }, + initOptions() { this.data = [] if (this.element.options.attrs.fieldId) { let method = multFieldValues @@ -273,10 +284,6 @@ export default { bus.$emit('valid-values-change', false) }) } - if (this.element.options.value) { - this.value = this.fillValueDerfault() - this.changeValue(this.value) - } }, visualChange(value) { this.value = value diff --git a/frontend/src/components/widget/deWidget/DeSelectGrid.vue b/frontend/src/components/widget/deWidget/DeSelectGrid.vue index 5fa5cd6bc8..b6cb323382 100644 --- a/frontend/src/components/widget/deWidget/DeSelectGrid.vue +++ b/frontend/src/components/widget/deWidget/DeSelectGrid.vue @@ -286,6 +286,16 @@ export default { textSelectGridWidget: textSelectGridWidget, initLoad() { this.value = this.element.options.attrs.multiple ? [] : null + this.initOptions() + if (this.element.options.value) { + this.value = this.fillValueDerfault() + this.changeValue(this.value) + } + }, + refreshLoad() { + this.initOptions() + }, + initOptions() { if (this.element.options.attrs.fieldId) { let method = multFieldValues const token = this.$store.getters.token || getToken() @@ -305,10 +315,6 @@ export default { } }) } - if (this.element.options.value) { - this.value = this.fillValueDerfault() - this.changeValue(this.value) - } }, changeValue(value) { if (!this.inDraw) { diff --git a/frontend/src/components/widget/deWidget/DeSelectTree.vue b/frontend/src/components/widget/deWidget/DeSelectTree.vue index 15a6f49710..06c055d3d0 100644 --- a/frontend/src/components/widget/deWidget/DeSelectTree.vue +++ b/frontend/src/components/widget/deWidget/DeSelectTree.vue @@ -265,6 +265,17 @@ export default { }, initLoad() { this.value = this.fillValueDerfault() + this.data = [] + this.initOptions() + if (this.element.options.value) { + this.value = this.fillValueDerfault() + this.changeValue(this.value) + } + }, + refreshLoad() { + this.initOptions() + }, + initOptions() { this.data = [] if (this.element.options.attrs.fieldId) { let method = mappingFieldValues @@ -283,10 +294,6 @@ export default { }) }) } - if (this.element.options.value) { - this.value = this.fillValueDerfault() - this.changeValue(this.value) - } }, changeValue(value) { if (!this.inDraw) {