Files
td_official/src/utils/projectTeam.ts

27 lines
879 B
TypeScript
Raw Normal View History

2025-05-21 11:24:53 +08:00
import $cache from '@/plugins/cache';
//获取班组列表
import { listProjectTeam } from '@/api/project/projectTeam';
import { ProjectTeamVO } from '@/api/project/projectTeam/types';
2025-08-29 14:57:52 +08:00
import useUserStore from '@/store/modules/user';
2025-05-21 11:24:53 +08:00
export const getProjectTeam = async () => {
2025-08-29 14:57:52 +08:00
const isPermission = useUserStore().permissions.some((item) => item == 'project:team:list');
2025-08-29 15:08:26 +08:00
console.log(useUserStore().permissions);
if (!isPermission && useUserStore().permissions[0] != '*:*:*') return;
2025-08-29 14:57:52 +08:00
2025-05-21 11:24:53 +08:00
const { id } = $cache.local.getJSON('selectedProject');
const res = await listProjectTeam({
pageNum: 1,
pageSize: 20,
orderByColumn: 'createTime',
isAsc: 'desc',
projectId: id
});
2025-07-07 19:56:03 +08:00
2025-05-21 11:24:53 +08:00
const list = res.rows.map((projectTeam: ProjectTeamVO) => ({
value: projectTeam.id,
label: projectTeam.teamName
}));
$cache.local.setJSON('ProjectTeamList', list);
};