NEZ-2048 fix: dashboard variable 下拉框 选中行为 优化

This commit is contained in:
zhangyu
2022-07-19 14:36:33 +08:00
parent 11c17db9f3
commit e5d219a60d
2 changed files with 22 additions and 5 deletions

View File

@@ -368,16 +368,19 @@ export default {
})
item.checked = item.checkAll ? allValue : []
item.isIndeterminate = false
this.$store.dispatch('dispatchVariablesArr', [...this.labelArr])
if (!item.multi) {
this.close()
this.$store.dispatch('dispatchVariablesArr', [...this.labelArr])
}
},
checkedChange (item, value) {
const checkedCount = value.length
item.checkAll = checkedCount === this.labelValue[item.name].length
item.isIndeterminate = checkedCount > 0 && checkedCount < this.labelValue[item.name].length
this.$store.dispatch('dispatchVariablesArr', [...this.labelArr])
},
selectLabelValue (item, value) {
item.checked = [value.value]
this.close()
this.$store.dispatch('dispatchVariablesArr', [...this.labelArr])
},
triggerVisible (item) {
@@ -387,6 +390,9 @@ export default {
},
close () {
this.labelArr.forEach((item) => {
if (item.visible && item.multi) {
this.$store.dispatch('dispatchVariablesArr', [...this.labelArr])
}
item.visible = false
})
}