forked from github/dataease
fix: 文本过滤组件空默认值异常
This commit is contained in:
parent
ac3fa4eca6
commit
ccbd5eccc6
@ -64,7 +64,7 @@ export default {
|
||||
},
|
||||
created() {
|
||||
if (this.element.options.value) {
|
||||
this.value = this.element.options.value
|
||||
this.value = this.fillValueDerfault()
|
||||
this.search()
|
||||
}
|
||||
},
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user