Unverified 提交 18ec8aae authored 作者: fit2cloud-chenyw's avatar fit2cloud-chenyw 提交者: GitHub

Merge pull request #1484 from dataease/pr@dev@fix_input_search

fix: 搜索过滤组件兼容老版本
...@@ -38,6 +38,10 @@ export default { ...@@ -38,6 +38,10 @@ export default {
} }
}, },
computed: { computed: {
defaultValueStr() {
if (!this.element || !this.element.options || !this.element.options.value) return ''
return this.element.options.value.toString()
},
viewIds() { viewIds() {
if (!this.element || !this.element.options || !this.element.options.attrs.viewIds) return '' if (!this.element || !this.element.options || !this.element.options.attrs.viewIds) return ''
return this.element.options.attrs.viewIds.toString() return this.element.options.attrs.viewIds.toString()
...@@ -48,9 +52,9 @@ export default { ...@@ -48,9 +52,9 @@ export default {
if (typeof value === 'undefined' || value === old) return if (typeof value === 'undefined' || value === old) return
this.setCondition() this.setCondition()
}, },
'element.options.value': function(value, old) { 'defaultValueStr': function(value, old) {
if (value === old) return if (value === old) return
this.value = value this.value = this.fillValueDerfault()
this.search() this.search()
} }
}, },
...@@ -82,6 +86,11 @@ export default { ...@@ -82,6 +86,11 @@ export default {
if (!this.inDraw) { if (!this.inDraw) {
this.element.options.value = val 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]
} }
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论