|
|
@ -23,6 +23,8 @@ const { deleteTable } = useTable() |
|
|
|
|
|
|
|
|
|
|
|
const { isUIAllowed } = useUIPermission() |
|
|
|
const { isUIAllowed } = useUIPermission() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const isLocked = inject('TreeViewIsLockedInj') |
|
|
|
|
|
|
|
|
|
|
|
const tablesById = $computed<Record<string, TableType>>(() => |
|
|
|
const tablesById = $computed<Record<string, TableType>>(() => |
|
|
|
tables?.value?.reduce((acc: Record<string, TableType>, table: TableType) => { |
|
|
|
tables?.value?.reduce((acc: Record<string, TableType>, table: TableType) => { |
|
|
|
acc[table.id as string] = table |
|
|
|
acc[table.id as string] = table |
|
|
@ -199,7 +201,11 @@ const activeTable = computed(() => { |
|
|
|
|
|
|
|
|
|
|
|
<div class="nc-tbl-title flex-1">{{ table.title }}</div> |
|
|
|
<div class="nc-tbl-title flex-1">{{ table.title }}</div> |
|
|
|
|
|
|
|
|
|
|
|
<a-dropdown v-if="isUIAllowed('table-rename') || isUIAllowed('table-delete')" :trigger="['click']" @click.stop> |
|
|
|
<a-dropdown |
|
|
|
|
|
|
|
v-if="!isLocked && (isUIAllowed('table-rename') || isUIAllowed('table-delete'))" |
|
|
|
|
|
|
|
:trigger="['click']" |
|
|
|
|
|
|
|
@click.stop |
|
|
|
|
|
|
|
> |
|
|
|
<MdiMenuIcon class="transition-opacity opacity-0 group-hover:opacity-100" /> |
|
|
|
<MdiMenuIcon class="transition-opacity opacity-0 group-hover:opacity-100" /> |
|
|
|
|
|
|
|
|
|
|
|
<template #overlay> |
|
|
|
<template #overlay> |
|
|
@ -209,7 +215,7 @@ const activeTable = computed(() => { |
|
|
|
v-t="['c:table:rename']" |
|
|
|
v-t="['c:table:rename']" |
|
|
|
class="!text-xs" |
|
|
|
class="!text-xs" |
|
|
|
@click="showRenameTableDlg(table)" |
|
|
|
@click="showRenameTableDlg(table)" |
|
|
|
><div>Rename</div></a-menu-item |
|
|
|
><div>{{ $t('general.rename') }}</div></a-menu-item |
|
|
|
> |
|
|
|
> |
|
|
|
|
|
|
|
|
|
|
|
<a-menu-item |
|
|
|
<a-menu-item |
|
|
@ -218,7 +224,7 @@ const activeTable = computed(() => { |
|
|
|
class="!text-xs" |
|
|
|
class="!text-xs" |
|
|
|
@click="deleteTable(table)" |
|
|
|
@click="deleteTable(table)" |
|
|
|
> |
|
|
|
> |
|
|
|
Delete</a-menu-item |
|
|
|
{{ $t('general.delete') }}</a-menu-item |
|
|
|
> |
|
|
|
> |
|
|
|
</a-menu> |
|
|
|
</a-menu> |
|
|
|
</template> |
|
|
|
</template> |
|
|
@ -238,7 +244,7 @@ const activeTable = computed(() => { |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<template #overlay> |
|
|
|
<template v-if="!isLocked" #overlay> |
|
|
|
<a-menu class="cursor-pointer"> |
|
|
|
<a-menu class="cursor-pointer"> |
|
|
|
<template v-if="contextMenuTarget.type === 'table'"> |
|
|
|
<template v-if="contextMenuTarget.type === 'table'"> |
|
|
|
<a-menu-item |
|
|
|
<a-menu-item |
|
|
|