|
|
@ -16,6 +16,7 @@ import { |
|
|
|
useDialog, |
|
|
|
useDialog, |
|
|
|
useNuxtApp, |
|
|
|
useNuxtApp, |
|
|
|
useProject, |
|
|
|
useProject, |
|
|
|
|
|
|
|
useRoute, |
|
|
|
useTable, |
|
|
|
useTable, |
|
|
|
useTabs, |
|
|
|
useTabs, |
|
|
|
useToggle, |
|
|
|
useToggle, |
|
|
@ -37,6 +38,8 @@ const { deleteTable } = useTable() |
|
|
|
|
|
|
|
|
|
|
|
const { isUIAllowed } = useUIPermission() |
|
|
|
const { isUIAllowed } = useUIPermission() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const route = useRoute() |
|
|
|
|
|
|
|
|
|
|
|
const [searchActive, toggleSearchActive] = useToggle() |
|
|
|
const [searchActive, toggleSearchActive] = useToggle() |
|
|
|
|
|
|
|
|
|
|
|
let key = $ref(0) |
|
|
|
let key = $ref(0) |
|
|
@ -219,13 +222,23 @@ const onSearchCloseIconClick = () => { |
|
|
|
toggleSearchActive(false) |
|
|
|
toggleSearchActive(false) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const isCreateTableAllowed = computed( |
|
|
|
|
|
|
|
() => |
|
|
|
|
|
|
|
isUIAllowed('table-create') && |
|
|
|
|
|
|
|
route.name !== 'index' && |
|
|
|
|
|
|
|
route.name !== 'index-index' && |
|
|
|
|
|
|
|
route.name !== 'index-index-create' && |
|
|
|
|
|
|
|
route.name !== 'index-index-create-external' && |
|
|
|
|
|
|
|
route.name !== 'index-user-index', |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
useEventListener(document, 'keydown', async (e: KeyboardEvent) => { |
|
|
|
useEventListener(document, 'keydown', async (e: KeyboardEvent) => { |
|
|
|
const cmdOrCtrl = isMac() ? e.metaKey : e.ctrlKey |
|
|
|
const cmdOrCtrl = isMac() ? e.metaKey : e.ctrlKey |
|
|
|
if (e.altKey && !e.shiftKey && !cmdOrCtrl) { |
|
|
|
if (e.altKey && !e.shiftKey && !cmdOrCtrl) { |
|
|
|
switch (e.keyCode) { |
|
|
|
switch (e.keyCode) { |
|
|
|
case 84: { |
|
|
|
case 84: { |
|
|
|
// ALT + T |
|
|
|
// ALT + T |
|
|
|
if (isUIAllowed('table-create') && !isDrawerOrModalExist()) { |
|
|
|
if (isCreateTableAllowed.value && !isDrawerOrModalExist()) { |
|
|
|
// prevent the key `T` is inputted to table title input |
|
|
|
// prevent the key `T` is inputted to table title input |
|
|
|
e.preventDefault() |
|
|
|
e.preventDefault() |
|
|
|
openTableCreateDialog() |
|
|
|
openTableCreateDialog() |
|
|
|