perf: select key when right click in browser tree

This commit is contained in:
Lykin 2024-01-11 23:55:03 +08:00
parent 1a6756905d
commit dbff8f9e79
1 changed files with 4 additions and 4 deletions

View File

@ -153,7 +153,7 @@ const menuOptions = {
], ],
} }
const handleSelectContextMenu = (key) => { const handleSelectContextMenu = (action) => {
contextMenuParam.show = false contextMenuParam.show = false
const selectedKey = get(selectedKeys.value, 0) const selectedKey = get(selectedKeys.value, 0)
if (selectedKey == null) { if (selectedKey == null) {
@ -163,7 +163,7 @@ const handleSelectContextMenu = (key) => {
const { db = 0, key: nodeKey, redisKey: rk = '', redisKeyCode: rkc, label } = node || {} const { db = 0, key: nodeKey, redisKey: rk = '', redisKeyCode: rkc, label } = node || {}
const redisKey = rkc || rk const redisKey = rkc || rk
const redisKeyName = !!rkc ? label : redisKey const redisKeyName = !!rkc ? label : redisKey
switch (key) { switch (action) {
case 'key_newkey': case 'key_newkey':
dialogStore.openNewKeyDialog(redisKey, props.server, db) dialogStore.openNewKeyDialog(redisKey, props.server, db)
break break
@ -226,7 +226,7 @@ const handleSelectContextMenu = (key) => {
break break
case 'more_action': case 'more_action':
default: default:
console.warn('TODO: handle context menu:' + key) console.warn('TODO: handle context menu:' + action)
} }
} }
@ -501,7 +501,7 @@ const nodeProps = ({ option }) => {
contextMenuParam.x = e.clientX contextMenuParam.x = e.clientX
contextMenuParam.y = e.clientY contextMenuParam.y = e.clientY
contextMenuParam.show = true contextMenuParam.show = true
// onUpdateSelectedKeys([option.key], [option]) onUpdateSelectedKeys([option.key], [option])
}) })
}, },
// onMouseover() { // onMouseover() {