多维表格
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

42 lines
1.0 KiB

<script setup lang="ts">
import type { NcButtonSize } from '~/lib'
const props = defineProps<{
activeWorkspaceId?: string | undefined
modal?: boolean
type?: string
isOpen: boolean
size?: NcButtonSize
centered?: boolean
}>()
const { isUIAllowed } = useUIPermission()
const { orgRoles, workspaceRoles } = useRoles()
const projectStore = useProject()
const { isSharedBase } = storeToRefs(projectStore)
const workspaceStore = useWorkspace()
const { activeWorkspaceId: _activeWorkspaceId } = storeToRefs(workspaceStore)
const projectCreateDlg = ref(false)
const size = computed(() => props.size || 'small')
const centered = computed(() => props.centered ?? true)
</script>
<template>
<NcButton
v-if="isUIAllowed('projectCreate', false, workspaceRoles ?? orgRoles) && !isSharedBase"
type="text"
:size="size"
:centered="centered"
@click="projectCreateDlg = true"
>
<slot />
<WorkspaceCreateProjectDlg v-model="projectCreateDlg" />
</NcButton>
</template>
<style scoped></style>