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