Demo:节点右键菜单新增收起所有下级节点按钮

This commit is contained in:
街角小林 2024-11-08 17:19:05 +08:00
parent 15859e76b6
commit 4e6688e4e0
4 changed files with 11 additions and 1 deletions

View File

@ -123,6 +123,7 @@ export default {
copyFail: 'Copy fail',
number: 'Number child nodes',
expandNodeChild: 'Expand all sub nodes',
unExpandNodeChild: 'Un expand all sub nodes',
addToDo: 'Add toDo',
removeToDo: 'Remove toDo'
},

View File

@ -121,6 +121,7 @@ export default {
copyFail: '复制失败',
number: '编号其子节点',
expandNodeChild: '展开所有下级节点',
unExpandNodeChild: '收起所有下级节点',
addToDo: '添加待办',
removeToDo: '删除待办'
},

View File

@ -122,6 +122,7 @@ export default {
copyFail: '複製失敗',
number: '將其子節點編號',
expandNodeChild: '展開所有下級節點',
unExpandNodeChild: '收起所有下級節點',
addToDo: '添加待辦',
removeToDo: '刪除待辦'
},

View File

@ -56,6 +56,9 @@
<span class="name">{{ $t('contextmenu.moveDownNode') }}</span>
<span class="desc">Ctrl + </span>
</div>
<div class="item" @click="exec('UNEXPAND_ALL')">
<span class="name">{{ $t('contextmenu.unExpandNodeChild') }}</span>
</div>
<div class="item" @click="exec('EXPAND_ALL')">
<span class="name">{{ $t('contextmenu.expandNodeChild') }}</span>
</div>
@ -473,8 +476,12 @@ export default {
this.node
)
break
case 'UNEXPAND_ALL':
const uid = this.node ? this.node.uid : ''
this.$bus.$emit('execCommand', key, !uid, uid)
break
case 'EXPAND_ALL':
this.$bus.$emit('execCommand', key, this.node.uid)
this.$bus.$emit('execCommand', key, this.node ? this.node.uid : '')
break
default:
this.$bus.$emit('execCommand', key, ...args)