Merge pull request #7472 from dataease/pr@dev@fix_select_filter_first

fix: 文本下拉过滤器关闭首项后再开启默认值无效
This commit is contained in:
fit2cloud-chenyw 2023-12-29 14:36:35 +08:00 committed by GitHub
commit 32d0c33c1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -164,8 +164,10 @@ export default {
'defaultValueStr': function(value, old) {
if (value === old) return
this.$nextTick(() => {
this.value = this.fillValueDerfault()
this.changeValue(value)
if (!this.selectFirst) {
this.value = this.fillValueDerfault()
this.changeValue(value)
}
})
},
'element.options.attrs.fieldId': function(value, old) {
@ -363,8 +365,8 @@ export default {
const id = ele.id
const eleVal = ele.options.value.toString()
if (this.inDraw && this.manualModify && this.element.id === id) {
if (this.selectFirst) {
this.fillFirstValue()
if (ele.options.attrs.selectFirst) {
this.fillFirstValue(true)
this.firstChange(this.value)
return
}
@ -503,8 +505,8 @@ export default {
}
return this.value.split(',')
},
fillFirstValue() {
if (!this.selectFirst) {
fillFirstValue(isSelectFirst) {
if (!this.selectFirst && !isSelectFirst) {
return
}
let defaultV = this.data[0].id