mirror of
https://github.com/certd/certd.git
synced 2026-05-14 12:07:32 +08:00
feat: 支持企业级管理模式,项目管理,细分权限
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import { request } from "/src/api/service";
|
||||
|
||||
export async function MyProjectList() {
|
||||
return await request({
|
||||
url: "/enterprise/project/list",
|
||||
method: "post",
|
||||
data: {},
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<template>
|
||||
<a-dropdown class="project-selector">
|
||||
<template #overlay>
|
||||
<a-menu @click="handleMenuClick">
|
||||
<a-menu-item v-for="item in projectStore.myProjects" :key="item.id">
|
||||
{{ item.name }}
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<div class="rounded pl-2 pr-2 px-2 py-1 flex-center flex pointer bg-accent h-10 button-text">
|
||||
{{ projectStore.currentProject?.name || "..." }}
|
||||
<DownOutlined class="ml-1" />
|
||||
</div>
|
||||
</a-dropdown>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onMounted } from "vue";
|
||||
import { useProjectStore } from "/@/store/project";
|
||||
defineOptions({
|
||||
name: "ProjectSelector",
|
||||
});
|
||||
|
||||
const projectStore = useProjectStore();
|
||||
onMounted(async () => {
|
||||
await projectStore.reload();
|
||||
});
|
||||
|
||||
function handleMenuClick({ key }: any) {
|
||||
projectStore.changeCurrentProject(key);
|
||||
}
|
||||
</script>
|
||||
<style lang="less">
|
||||
.project-selector {
|
||||
&.button-text {
|
||||
min-width: 100px;
|
||||
max-width: 150px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user