diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index fcdc115..086d45c 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -28,7 +28,6 @@ const getSelectedProjectFromStorage = () => { const getProjectTeamListFromStorage = () => { const stored = $cache.local.getJSON('ProjectTeamList'); console.log('获取缓存的项目班组列表:', stored); - return stored ? stored : null; }; diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 3fcf274..da397cf 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -324,6 +324,7 @@ import { globalHeaders } from '@/utils/request'; import { to } from 'await-to-js'; import { getProjectByDeptId, getRoleList, optionselect } from '@/api/system/post'; import ShuttleFrame from '../../project/projectRelevancy/component/ShuttleFrame.vue'; +import { listProject } from '@/api/project/project'; const router = useRouter(); const { proxy } = getCurrentInstance() as ComponentInternalInstance; @@ -484,6 +485,8 @@ const getDeptTree = async () => { const res = await api.deptTreeSelect({ isShow: '1' }); deptOptions.value = res.data; enabledDeptOptions.value = filterDisabledDept(res.data); + const projectList = await listProject(); + projectOptions.value = projectList.rows; }; /** 过滤禁用的部门 */ @@ -672,8 +675,6 @@ const handleUpdate = async (row?: UserForm) => { form.value.projectRoles = data.projectRoles; form.value.password = ''; const roleList = await getRoleList(form.value.deptId); - const projectList = await getProjectByDeptId(form.value.deptId); - projectOptions.value = projectList.data; roleOptions.value = roleList.data; }; @@ -736,8 +737,6 @@ onMounted(() => { async function handleDeptChange(value: number | string) { const response = await optionselect(value); const roleList = await getRoleList(value); - const projectList = await getProjectByDeptId(value); - projectOptions.value = projectList.data; roleOptions.value = roleList.data; postOptions.value = response.data;