mirror of
https://github.com/dataease/dataease.git
synced 2025-02-24 19:42:56 +08:00
fix: 兼容老版本过滤组件
This commit is contained in:
parent
184a2a9d5a
commit
c44cb8bf02
@ -87,7 +87,7 @@ export default {
|
||||
}
|
||||
},
|
||||
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) {
|
||||
const widget = ApplicationContext.getService(this.element.serviceName)
|
||||
this.values = widget.dynamicDateFormNow(this.element)
|
||||
@ -154,10 +154,10 @@ export default {
|
||||
fillValueDerfault() {
|
||||
const defaultV = this.element.options.value === null ? '' : this.element.options.value.toString()
|
||||
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))
|
||||
} 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])
|
||||
}
|
||||
}
|
||||
|
@ -161,10 +161,10 @@ export default {
|
||||
fillValueDerfault() {
|
||||
const defaultV = this.element.options.value === null ? '' : this.element.options.value.toString()
|
||||
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(',')
|
||||
} 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]
|
||||
}
|
||||
},
|
||||
|
@ -165,12 +165,12 @@ export default {
|
||||
return this.value.split(',')
|
||||
},
|
||||
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 (defaultV === null || typeof defaultV === 'undefined' || defaultV === '') return []
|
||||
if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') return []
|
||||
return defaultV.split(',')
|
||||
} 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]
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user