From 08edc27cf7fa4b5afe782c02a71ea20b1606c1af Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Wed, 8 Nov 2023 14:21:54 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E6=96=87=E6=9C=AC=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E9=A6=96=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/widget/deWidget/DeSelect.vue | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/core/frontend/src/components/widget/deWidget/DeSelect.vue b/core/frontend/src/components/widget/deWidget/DeSelect.vue index fd1f17830c..e01b735f2d 100644 --- a/core/frontend/src/components/widget/deWidget/DeSelect.vue +++ b/core/frontend/src/components/widget/deWidget/DeSelect.vue @@ -144,7 +144,7 @@ export default { watch: { 'viewIds': function(value, old) { if (typeof value === 'undefined' || value === old) return - this.value = this.fillFirstValue() + this.fillFirstValue() this.setCondition() }, 'defaultValueStr': function(value, old) { @@ -180,7 +180,12 @@ export default { }, 'selectFirst': function(value, old) { if (value === old) return - this.fillFirstValue() + if (value) { + this.fillFirstValue() + } else { + this.value = '' + this.firstChange(this.value) + } }, 'element.options.attrs.multiple': function(value, old) { if (typeof old === 'undefined' || value === old) return @@ -285,6 +290,11 @@ export default { }, resetDefaultValue(id) { if (this.inDraw && this.manualModify && this.element.id === id) { + if (this.selectFirst) { + this.fillFirstValue() + this.firstChange(this.value) + return + } this.value = this.fillValueDerfault() this.changeValue(this.value) } @@ -311,7 +321,7 @@ export default { this.fillFirstValue() this.$emit('filter-loaded', { componentId: this.element.id, - val: this.value + val: (this.value && Array.isArray(this.value)) ? this.value.join(',') : this.value }) } },