|
|
|
@ -16,9 +16,11 @@ const route = router.currentRoute
|
|
|
|
|
|
|
|
|
|
const { isUIAllowed } = useRoles() |
|
|
|
|
|
|
|
|
|
const { isMobileMode } = useGlobal() |
|
|
|
|
const { project } = storeToRefs(useProject()) |
|
|
|
|
|
|
|
|
|
const { projectPageTab } = storeToRefs(useConfigStore()) |
|
|
|
|
|
|
|
|
|
const activeKey = ref<'allTable' | 'collaborator' | 'data-source'>('allTable') |
|
|
|
|
const { isMobileMode } = useGlobal() |
|
|
|
|
|
|
|
|
|
const baseSettingsState = ref('') |
|
|
|
|
|
|
|
|
@ -27,21 +29,21 @@ watch(
|
|
|
|
|
(newVal, oldVal) => { |
|
|
|
|
if (newVal && newVal !== oldVal) { |
|
|
|
|
if (newVal === 'collaborator') { |
|
|
|
|
activeKey.value = 'collaborator' |
|
|
|
|
projectPageTab.value = 'collaborator' |
|
|
|
|
} else if (newVal === 'data-source') { |
|
|
|
|
activeKey.value = 'data-source' |
|
|
|
|
projectPageTab.value = 'data-source' |
|
|
|
|
} else { |
|
|
|
|
activeKey.value = 'allTable' |
|
|
|
|
projectPageTab.value = 'allTable' |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
{ immediate: true }, |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
watch(activeKey, () => { |
|
|
|
|
if (activeKey.value) { |
|
|
|
|
watch(projectPageTab, () => { |
|
|
|
|
if (projectPageTab.value) { |
|
|
|
|
navigateToProjectPage({ |
|
|
|
|
page: activeKey.value as any, |
|
|
|
|
page: projectPageTab.value as any, |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
@ -75,17 +77,17 @@ watch(
|
|
|
|
|
height: 'calc(100% - var(--topbar-height))', |
|
|
|
|
}" |
|
|
|
|
> |
|
|
|
|
<a-tabs v-model:activeKey="activeKey" class="w-full"> |
|
|
|
|
<a-tabs v-model:activeKey="projectPageTab" class="w-full"> |
|
|
|
|
<a-tab-pane key="allTable"> |
|
|
|
|
<template #tab> |
|
|
|
|
<div class="tab-title" data-testid="proj-view-tab__all-tables"> |
|
|
|
|
<NcLayout /> |
|
|
|
|
<div>{{ $t('labels.allTables') }}</div> |
|
|
|
|
<div |
|
|
|
|
class="flex pl-1.25 px-1.5 py-0.75 rounded-md text-xs" |
|
|
|
|
class="tab-info" |
|
|
|
|
:class="{ |
|
|
|
|
'bg-primary-selected': activeKey === 'allTable', |
|
|
|
|
'bg-gray-50': activeKey !== 'allTable', |
|
|
|
|
'bg-primary-selected': projectPageTab === 'allTable', |
|
|
|
|
'bg-gray-50': projectPageTab !== 'allTable', |
|
|
|
|
}" |
|
|
|
|
> |
|
|
|
|
{{ activeTables.length }} |
|
|
|
@ -111,6 +113,16 @@ watch(
|
|
|
|
|
<div class="tab-title" data-testid="proj-view-tab__data-sources"> |
|
|
|
|
<GeneralIcon icon="database" /> |
|
|
|
|
<div>{{ $t('labels.dataSources') }}</div> |
|
|
|
|
<div |
|
|
|
|
v-if="project.bases?.length" |
|
|
|
|
class="tab-info" |
|
|
|
|
:class="{ |
|
|
|
|
'bg-primary-selected': projectPageTab === 'data-source', |
|
|
|
|
'bg-gray-50': projectPageTab !== 'data-source', |
|
|
|
|
}" |
|
|
|
|
> |
|
|
|
|
{{ project.bases.length - 1 }} |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
<DashboardSettingsDataSources v-model:state="baseSettingsState" /> |
|
|
|
@ -137,4 +149,8 @@ watch(
|
|
|
|
|
:deep(.ant-tabs-tab-active .tab-title) { |
|
|
|
|
@apply text-primary; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.tab-info { |
|
|
|
|
@apply flex pl-1.25 px-1.5 py-0.75 rounded-md text-xs; |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|