Merge pull request #2332 from dataease/pr@dev@fix_tree_single_multi_switch

fix: 树过滤器单多模式切换
This commit is contained in:
fit2cloud-chenyw 2022-05-27 12:35:53 +08:00 committed by GitHub
commit 75c1bc62cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -140,8 +140,24 @@ export default {
}
this.show = false
this.$nextTick(() => {
// this.value = value ? [] : null
this.show = true
this.$nextTick(() => {
const defaultV = this.element.options.value === null ? '' : this.element.options.value.toString()
if (value) {
if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') {
this.value = []
} else {
this.value = defaultV.split(',')
}
} else {
if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') {
this.value = ''
} else {
this.value = defaultV.split(',')[0]
}
}
this.$refs.deSelectTree && this.$refs.deSelectTree.treeDataUpdateFun(this.datas)
})
})