update 角色学科配置方法调用方式修改

This commit is contained in:
2026-02-03 20:52:17 +08:00
parent cd0c904402
commit 9e4bc0c2e8
5 changed files with 8 additions and 10 deletions

View File

@@ -31,8 +31,8 @@ watch(
onMounted(async () => {
await getAllDictDataFun();
await getRoleDisciplineFun();
getUserPermissionsFun();
getRoleDisciplineFun();
loading.value = false;
});
</script>

View File

@@ -31,8 +31,8 @@ const loading = ref(true);
onMounted(async () => {
await getAllDictDataFun();
await getRoleDisciplineFun();
getUserPermissionsFun();
getRoleDisciplineFun();
loading.value = false;
});
</script>

View File

@@ -13,8 +13,8 @@ const loading = ref(true);
onMounted(async () => {
await getAllDictDataFun();
await getRoleDisciplineFun();
getUserPermissionsFun();
getRoleDisciplineFun();
loading.value = false;
});
</script>

View File

@@ -41,15 +41,14 @@ export const getUserPermissionsFun = () => {
});
};
export const getRoleDisciplineFun = () => {
export const getRoleDisciplineFun = async () => {
const params = {
paramName: 'ROLE_DISCIPLINE',
};
querySystemParamConfigureApi(params).then((res: any) => {
if (res.code === 200) {
localStorage.setItem('ROLE_DISCIPLINE', JSON.stringify(res.data.values));
}
});
const res: any = await querySystemParamConfigureApi(params);
if (res.code === 200) {
localStorage.setItem('ROLE_DISCIPLINE', JSON.stringify(res.data.values));
}
};
/**

View File

@@ -24,7 +24,6 @@ export const getDisciplineByRole = (roleCodes: string | string[]) => {
const uniqueDisciplines = Array.from(new Set(allDisciplines));
const uniqueSimulationType = Array.from(new Set(allSimulationType));
return { simulationType: uniqueSimulationType, discipline: uniqueDisciplines };
// return { simulationType: [], discipline: [] };
} catch (error) {
console.error('获取失败:', error);
return { simulationType: [], discipline: [] };