|
|
|
@ -1,7 +1,13 @@
|
|
|
|
|
<script lang="ts" setup> |
|
|
|
|
import { useTitle } from '@vueuse/core' |
|
|
|
|
import NcLayout from '~icons/nc-icons/layout' |
|
|
|
|
const { openedProject } = storeToRefs(useBases()) |
|
|
|
|
import { isEeUI } from '#imports' |
|
|
|
|
|
|
|
|
|
const basesStore = useBases() |
|
|
|
|
|
|
|
|
|
const { getProjectUsers } = basesStore |
|
|
|
|
|
|
|
|
|
const { openedProject, activeProjectId, baseUserCount } = storeToRefs(basesStore) |
|
|
|
|
const { activeTables } = storeToRefs(useTablesStore()) |
|
|
|
|
const { activeWorkspace, workspaceUserCount } = storeToRefs(useWorkspace()) |
|
|
|
|
|
|
|
|
@ -26,6 +32,23 @@ const { isMobileMode } = useGlobal()
|
|
|
|
|
|
|
|
|
|
const baseSettingsState = ref('') |
|
|
|
|
|
|
|
|
|
const userCount = isEeUI ? workspaceUserCount : baseUserCount |
|
|
|
|
|
|
|
|
|
const updateBaseUserCount = async () => { |
|
|
|
|
try { |
|
|
|
|
const { totalRows } = await getProjectUsers({ |
|
|
|
|
baseId: activeProjectId.value!, |
|
|
|
|
page: 1, |
|
|
|
|
searchText: undefined, |
|
|
|
|
limit: 20, |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
baseUserCount.value = totalRows |
|
|
|
|
} catch (e: any) { |
|
|
|
|
message.error(await extractSdkResponseErrorMsg(e)) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
watch( |
|
|
|
|
() => route.value.query?.page, |
|
|
|
|
(newVal, oldVal) => { |
|
|
|
@ -57,6 +80,17 @@ watch(projectPageTab, () => {
|
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
watch( |
|
|
|
|
() => route.value.params.baseId, |
|
|
|
|
(newVal, oldVal) => { |
|
|
|
|
if (newVal && oldVal === undefined) { |
|
|
|
|
updateBaseUserCount() |
|
|
|
|
} |
|
|
|
|
return |
|
|
|
|
}, |
|
|
|
|
{ immediate: true }, |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
watch( |
|
|
|
|
() => openedProject.value?.title, |
|
|
|
|
() => { |
|
|
|
@ -119,14 +153,14 @@ watch(
|
|
|
|
|
<GeneralIcon icon="users" class="!h-3.5 !w-3.5" /> |
|
|
|
|
<div>{{ $t('labels.members') }}</div> |
|
|
|
|
<div |
|
|
|
|
v-if="workspaceUserCount" |
|
|
|
|
v-if="userCount" |
|
|
|
|
class="tab-info" |
|
|
|
|
:class="{ |
|
|
|
|
'bg-primary-selected': projectPageTab === 'data-source', |
|
|
|
|
'bg-gray-50': projectPageTab !== 'data-source', |
|
|
|
|
'bg-primary-selected': projectPageTab === 'collaborator', |
|
|
|
|
'bg-gray-50': projectPageTab !== 'collaborator', |
|
|
|
|
}" |
|
|
|
|
> |
|
|
|
|
{{ workspaceUserCount }} |
|
|
|
|
{{ userCount }} |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|