From 6f5fec69286ee0468875c32c14c1ef4b62047807 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Fri, 28 Jan 2022 11:40:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=96=87=E6=9C=AC=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=A9=BA=E9=BB=98=E8=AE=A4=E5=80=BC=E5=BC=82?= =?UTF-8?q?=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/widget/DeWidget/DeInputSearch.vue | 2 +- .../components/widget/serviceImpl/TextInputServiceImpl.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/widget/DeWidget/DeInputSearch.vue b/frontend/src/components/widget/DeWidget/DeInputSearch.vue index ec0e54a320..f38ddef05c 100644 --- a/frontend/src/components/widget/DeWidget/DeInputSearch.vue +++ b/frontend/src/components/widget/DeWidget/DeInputSearch.vue @@ -64,7 +64,7 @@ export default { }, created() { if (this.element.options.value) { - this.value = this.element.options.value + this.value = this.fillValueDerfault() this.search() } }, diff --git a/frontend/src/components/widget/serviceImpl/TextInputServiceImpl.js b/frontend/src/components/widget/serviceImpl/TextInputServiceImpl.js index 764c354bae..6d5ab5116d 100644 --- a/frontend/src/components/widget/serviceImpl/TextInputServiceImpl.js +++ b/frontend/src/components/widget/serviceImpl/TextInputServiceImpl.js @@ -68,7 +68,7 @@ class TextInputServiceImpl extends WidgetService { }) } getParam(element) { - const value = element.options.value + const value = this.fillValueDerfault(element) const param = { component: element, value: !value ? [] : Array.isArray(value) ? value : [value], @@ -76,6 +76,11 @@ class TextInputServiceImpl extends WidgetService { } return param } + fillValueDerfault(element) { + const defaultV = element.options.value === null ? '' : element.options.value.toString() + if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') return null + return defaultV.split(',')[0] + } } const textInputServiceImpl = new TextInputServiceImpl() export default textInputServiceImpl