revert: restore single-click to open table data in sidebar

This commit is contained in:
yavon007
2026-05-04 14:26:34 +08:00
parent e85f8bc6fd
commit a3396f1601
2 changed files with 4 additions and 10 deletions
+3 -9
View File
@@ -199,15 +199,10 @@ async function toggle() {
function onClick() {
const node = props.node;
const action = treeNodeRowAction(node.type, canExpand);
if (action === "toggle") {
toggle();
}
}
function onDblClick() {
const node = props.node;
if (node.type === "table" || node.type === "view") {
if (action === "open-data") {
openData();
} else if (action === "toggle") {
toggle();
}
}
@@ -772,7 +767,6 @@ const isDragging = computed(() =>
@mousedown="isDraggable ? startDrag($event, node.id, node.type) : undefined"
@mousemove="isDropTarget ? updateTarget($event, node.id, node.type) : undefined"
@mouseleave="clearTarget(node.id)"
@dblclick="onDblClick"
>
<div v-if="showDropBefore" class="absolute right-2 top-0 h-0.5 bg-primary rounded-full pointer-events-none" :style="{ left: paddingLeft }" />
<div v-if="showDropAfter" class="absolute right-2 bottom-0 h-0.5 bg-primary rounded-full pointer-events-none" :style="{ left: paddingLeft }" />
+1 -1
View File
@@ -6,7 +6,7 @@ const dataNodeTypes = new Set<TreeNodeType>(["table", "view"]);
const toggleLeafNodeTypes = new Set<TreeNodeType>(["redis-db", "mongo-collection"]);
export function treeNodeRowAction(type: TreeNodeType, canExpand: boolean): TreeNodeRowAction {
if (dataNodeTypes.has(type)) return "none";
if (dataNodeTypes.has(type)) return "open-data";
if (toggleLeafNodeTypes.has(type)) return "toggle";
if (canExpand) return "toggle";
return "none";