fix(grid): [grid] fix grid custom saas tree check event (#3210)

This commit is contained in:
gimmyhehe 2025-03-28 10:10:23 +08:00 committed by GitHub
parent 37e6b6dd95
commit 1680c53863
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 8 deletions

View File

@ -714,8 +714,10 @@ export default defineComponent({
this.hideOrShowColumns(false)
}
},
checkNode(node, data, checked) {
node.visible = checked
// treecheck
checkNode(node, data) {
const isCheck = data?.checkedNodes?.includes(node)
node.visible = isCheck
if (node.children && Array.isArray(node.children)) {
node.children.forEach((item) => {
@ -795,14 +797,14 @@ export default defineComponent({
column.order === 'asc'
? [this.opt.desc, this.opt.cancelSort]
: column.order === 'desc'
? [this.opt.asc, this.opt.cancelSort]
: [this.opt.asc, this.opt.desc]
? [this.opt.asc, this.opt.cancelSort]
: [this.opt.asc, this.opt.desc]
column.fixedOption =
column.fixed === 'left'
? [this.opt.right, this.opt.cancelFixed]
: column.fixed === 'right'
? [this.opt.left, this.opt.cancelFixed]
: [this.opt.left, this.opt.right]
? [this.opt.left, this.opt.cancelFixed]
: [this.opt.left, this.opt.right]
})
},
initSortingColumns(columns) {
@ -968,8 +970,8 @@ export default defineComponent({
column.order === 'asc'
? [this.opt.desc, this.opt.cancelSort]
: column.order === 'desc'
? [this.opt.asc, this.opt.cancelSort]
: [this.opt.asc, this.opt.desc]
? [this.opt.asc, this.opt.cancelSort]
: [this.opt.asc, this.opt.desc]
}
},
// TODO: vm dropdown