Merge pull request #6587 from dataease/pr@dev@perf_filter_select

perf: 文本下拉选择首项
This commit is contained in:
fit2cloud-chenyw 2023-11-08 14:24:34 +08:00 committed by GitHub
commit b945b2357a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -144,7 +144,7 @@ export default {
watch: {
'viewIds': function(value, old) {
if (typeof value === 'undefined' || value === old) return
this.value = this.fillFirstValue()
this.fillFirstValue()
this.setCondition()
},
'defaultValueStr': function(value, old) {
@ -180,7 +180,12 @@ export default {
},
'selectFirst': function(value, old) {
if (value === old) return
this.fillFirstValue()
if (value) {
this.fillFirstValue()
} else {
this.value = ''
this.firstChange(this.value)
}
},
'element.options.attrs.multiple': function(value, old) {
if (typeof old === 'undefined' || value === old) return
@ -285,6 +290,11 @@ export default {
},
resetDefaultValue(id) {
if (this.inDraw && this.manualModify && this.element.id === id) {
if (this.selectFirst) {
this.fillFirstValue()
this.firstChange(this.value)
return
}
this.value = this.fillValueDerfault()
this.changeValue(this.value)
}
@ -311,7 +321,7 @@ export default {
this.fillFirstValue()
this.$emit('filter-loaded', {
componentId: this.element.id,
val: this.value
val: (this.value && Array.isArray(this.value)) ? this.value.join(',') : this.value
})
}
},