|
|
@ -45,7 +45,7 @@ provide(SidebarTableInj, table) |
|
|
|
const { setMenuContext, openRenameTableDialog, duplicateTable } = inject(TreeViewInj)! |
|
|
|
const { setMenuContext, openRenameTableDialog, duplicateTable } = inject(TreeViewInj)! |
|
|
|
|
|
|
|
|
|
|
|
const { loadViews: _loadViews } = useViewsStore() |
|
|
|
const { loadViews: _loadViews } = useViewsStore() |
|
|
|
const { activeView, activeViewTitleOrId } = storeToRefs(useViewsStore()) |
|
|
|
const { activeView, activeViewTitleOrId, viewsByTable } = storeToRefs(useViewsStore()) |
|
|
|
const { isLeftSidebarOpen } = storeToRefs(useSidebarStore()) |
|
|
|
const { isLeftSidebarOpen } = storeToRefs(useSidebarStore()) |
|
|
|
|
|
|
|
|
|
|
|
// todo: temp |
|
|
|
// todo: temp |
|
|
@ -138,6 +138,27 @@ watch( |
|
|
|
const isTableOpened = computed(() => { |
|
|
|
const isTableOpened = computed(() => { |
|
|
|
return openedTableId.value === table.value?.id && (activeView.value?.is_default || !activeViewTitleOrId.value) |
|
|
|
return openedTableId.value === table.value?.id && (activeView.value?.is_default || !activeViewTitleOrId.value) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let tableTimeout: number |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
watch(openedTableId, () => { |
|
|
|
|
|
|
|
if (tableTimeout) { |
|
|
|
|
|
|
|
clearTimeout(tableTimeout) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (table.value.id !== openedTableId.value && isExpanded.value) { |
|
|
|
|
|
|
|
const views = viewsByTable.value.get(table.value.id!)?.filter((v) => !v.is_default) ?? [] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (views.length) return |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tableTimeout = setTimeout(() => { |
|
|
|
|
|
|
|
if (isExpanded.value) { |
|
|
|
|
|
|
|
isExpanded.value = false |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
clearTimeout(tableTimeout) |
|
|
|
|
|
|
|
}, 10000) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
|