From 3a8f5ca1af7bb37997873ed847cb964453fb160b Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 21 Dec 2021 11:21:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=90=9C=E7=B4=A2=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=85=BC=E5=AE=B9=E8=80=81=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/widget/DeWidget/DeInputSearch.vue | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/widget/DeWidget/DeInputSearch.vue b/frontend/src/components/widget/DeWidget/DeInputSearch.vue index d35478bd47..65a43db761 100644 --- a/frontend/src/components/widget/DeWidget/DeInputSearch.vue +++ b/frontend/src/components/widget/DeWidget/DeInputSearch.vue @@ -38,6 +38,10 @@ export default { } }, computed: { + defaultValueStr() { + if (!this.element || !this.element.options || !this.element.options.value) return '' + return this.element.options.value.toString() + }, viewIds() { if (!this.element || !this.element.options || !this.element.options.attrs.viewIds) return '' return this.element.options.attrs.viewIds.toString() @@ -48,9 +52,9 @@ export default { if (typeof value === 'undefined' || value === old) return this.setCondition() }, - 'element.options.value': function(value, old) { + 'defaultValueStr': function(value, old) { if (value === old) return - this.value = value + this.value = this.fillValueDerfault() this.search() } }, @@ -82,6 +86,11 @@ export default { if (!this.inDraw) { this.element.options.value = val } + }, + fillValueDerfault() { + const defaultV = this.element.options.value === null ? '' : this.element.options.value.toString() + if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') return null + return defaultV.split(',')[0] } } }