|
|
@ -1,7 +1,6 @@ |
|
|
|
<script setup lang="ts"> |
|
|
|
<script setup lang="ts"> |
|
|
|
import { message } from 'ant-design-vue' |
|
|
|
import { message } from 'ant-design-vue' |
|
|
|
import tinycolor from 'tinycolor2' |
|
|
|
import tinycolor from 'tinycolor2' |
|
|
|
import { useI18n } from 'vue-i18n' |
|
|
|
|
|
|
|
import { |
|
|
|
import { |
|
|
|
computed, |
|
|
|
computed, |
|
|
|
definePageMeta, |
|
|
|
definePageMeta, |
|
|
@ -14,26 +13,26 @@ import { |
|
|
|
ref, |
|
|
|
ref, |
|
|
|
useClipboard, |
|
|
|
useClipboard, |
|
|
|
useGlobal, |
|
|
|
useGlobal, |
|
|
|
|
|
|
|
useI18n, |
|
|
|
useProject, |
|
|
|
useProject, |
|
|
|
useRoute, |
|
|
|
useRoute, |
|
|
|
useTabs, |
|
|
|
useTabs, |
|
|
|
useUIPermission, |
|
|
|
useUIPermission, |
|
|
|
} from '#imports' |
|
|
|
} from '#imports' |
|
|
|
import { TabType } from '~/composables' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
definePageMeta({ |
|
|
|
definePageMeta({ |
|
|
|
hideHeader: true, |
|
|
|
hideHeader: true, |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const route = useRoute() |
|
|
|
const { t } = useI18n() |
|
|
|
|
|
|
|
|
|
|
|
const router = useRouter() |
|
|
|
const route = useRoute() |
|
|
|
|
|
|
|
|
|
|
|
const { appInfo, token, signOut, signedIn, user } = useGlobal() |
|
|
|
const { appInfo, token, signOut, signedIn, user } = useGlobal() |
|
|
|
|
|
|
|
|
|
|
|
const { project, loadProject, loadTables, isSharedBase, loadProjectMetaInfo, projectMetaInfo, saveTheme } = useProject() |
|
|
|
const { project, isSharedBase, loadProjectMetaInfo, projectMetaInfo, saveTheme } = useProject() |
|
|
|
|
|
|
|
|
|
|
|
const { addTab, clearTabs } = useTabs() |
|
|
|
const { clearTabs } = useTabs() |
|
|
|
|
|
|
|
|
|
|
|
const { isUIAllowed } = useUIPermission() |
|
|
|
const { isUIAllowed } = useUIPermission() |
|
|
|
|
|
|
|
|
|
|
@ -62,27 +61,11 @@ const logout = () => { |
|
|
|
navigateTo('/signin') |
|
|
|
navigateTo('/signin') |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
onKeyStroke( |
|
|
|
|
|
|
|
'Escape', |
|
|
|
|
|
|
|
() => { |
|
|
|
|
|
|
|
dropdownOpen.value = false |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ eventName: 'keydown' }, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
clearTabs() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function toggleDialog(value?: boolean, key?: string) { |
|
|
|
function toggleDialog(value?: boolean, key?: string) { |
|
|
|
dialogOpen.value = value ?? !dialogOpen.value |
|
|
|
dialogOpen.value = value ?? !dialogOpen.value |
|
|
|
openDialogKey.value = key |
|
|
|
openDialogKey.value = key |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
await loadProject() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await loadTables() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { t } = useI18n() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleThemeColor = async (mode: 'swatch' | 'primary' | 'accent', color: string) => { |
|
|
|
const handleThemeColor = async (mode: 'swatch' | 'primary' | 'accent', color: string) => { |
|
|
|
switch (mode) { |
|
|
|
switch (mode) { |
|
|
|
case 'swatch': { |
|
|
|
case 'swatch': { |
|
|
@ -117,10 +100,6 @@ const handleThemeColor = async (mode: 'swatch' | 'primary' | 'accent', color: st |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!route.params.type && isUIAllowed('teamAndAuth')) { |
|
|
|
|
|
|
|
addTab({ type: TabType.AUTH, title: t('title.teamAndAuth') }) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const copyProjectInfo = async () => { |
|
|
|
const copyProjectInfo = async () => { |
|
|
|
try { |
|
|
|
try { |
|
|
|
await loadProjectMetaInfo() |
|
|
|
await loadProjectMetaInfo() |
|
|
@ -150,11 +129,15 @@ const copyAuthToken = async () => { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** If v1 url found navigate to corresponding new url */ |
|
|
|
onKeyStroke( |
|
|
|
const { type, name, view } = route.query |
|
|
|
'Escape', |
|
|
|
if (type && name) { |
|
|
|
() => { |
|
|
|
router.replace(`/nc/${route.params.projectId}/${type}/${name}${view ? `/${view}` : ''}`) |
|
|
|
dropdownOpen.value = false |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
{ eventName: 'keydown' }, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
clearTabs() |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
|