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

Merge pull request #1482 from dataease/pr@dev@fix_compatible_filter

fix: 兼容老版本过滤组件
...@@ -87,7 +87,7 @@ export default { ...@@ -87,7 +87,7 @@ export default {
} }
}, },
created() { created() {
if (this.element.serviceName === 'timeDateWidget' && this.element.options.attrs.default.isDynamic) { if (this.element.serviceName === 'timeDateWidget' && this.element.options.attrs.default && this.element.options.attrs.default.isDynamic) {
if (this.element.options.attrs.default) { if (this.element.options.attrs.default) {
const widget = ApplicationContext.getService(this.element.serviceName) const widget = ApplicationContext.getService(this.element.serviceName)
this.values = widget.dynamicDateFormNow(this.element) this.values = widget.dynamicDateFormNow(this.element)
...@@ -154,10 +154,10 @@ export default { ...@@ -154,10 +154,10 @@ export default {
fillValueDerfault() { fillValueDerfault() {
const defaultV = this.element.options.value === null ? '' : this.element.options.value.toString() const defaultV = this.element.options.value === null ? '' : this.element.options.value.toString()
if (this.element.options.attrs.type === 'daterange') { if (this.element.options.attrs.type === 'daterange') {
if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '') return [] if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') return []
return defaultV.split(',').map(item => parseFloat(item)) return defaultV.split(',').map(item => parseFloat(item))
} else { } else {
if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '') return null if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') return null
return parseFloat(defaultV.split(',')[0]) return parseFloat(defaultV.split(',')[0])
} }
} }
......
...@@ -161,10 +161,10 @@ export default { ...@@ -161,10 +161,10 @@ export default {
fillValueDerfault() { fillValueDerfault() {
const defaultV = this.element.options.value === null ? '' : this.element.options.value.toString() const defaultV = this.element.options.value === null ? '' : this.element.options.value.toString()
if (this.element.options.attrs.multiple) { if (this.element.options.attrs.multiple) {
if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '') return [] if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') return []
return defaultV.split(',') return defaultV.split(',')
} else { } else {
if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '') return null if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') return null
return defaultV.split(',')[0] return defaultV.split(',')[0]
} }
}, },
......
...@@ -165,12 +165,12 @@ export default { ...@@ -165,12 +165,12 @@ export default {
return this.value.split(',') return this.value.split(',')
}, },
fillValueDerfault() { fillValueDerfault() {
const defaultV = this.element.options.value const defaultV = this.element.options.value === null ? '' : this.element.options.value.toString()
if (this.element.options.attrs.multiple) { if (this.element.options.attrs.multiple) {
if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '') return [] if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') return []
return defaultV.split(',') return defaultV.split(',')
} else { } else {
if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '') return null if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') return null
return defaultV.split(',')[0] return defaultV.split(',')[0]
} }
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论