|
@@ -1,7 +1,7 @@
|
|
/*
|
|
/*
|
|
* @Author: your name
|
|
* @Author: your name
|
|
* @Date: 2021-09-03 14:28:27
|
|
* @Date: 2021-09-03 14:28:27
|
|
- * @LastEditTime: 2022-01-05 09:22:09
|
|
|
|
|
|
+ * @LastEditTime: 2022-03-11 18:01:43
|
|
* @LastEditors: Please set LastEditors
|
|
* @LastEditors: Please set LastEditors
|
|
* @Description: In User Settings Edit
|
|
* @Description: In User Settings Edit
|
|
* @FilePath: /MedicalWisdomCheckSys/src/app.tsx
|
|
* @FilePath: /MedicalWisdomCheckSys/src/app.tsx
|
|
@@ -64,6 +64,7 @@ export async function getInitialState(): Promise<{
|
|
currentUser?: API.CurrentUserData;
|
|
currentUser?: API.CurrentUserData;
|
|
logo?: string;
|
|
logo?: string;
|
|
isDev?: boolean,
|
|
isDev?: boolean,
|
|
|
|
+ spacicalPageParamsType?:any[];
|
|
goSetting?: boolean,// 设置栏触发
|
|
goSetting?: boolean,// 设置栏触发
|
|
resetPasswordHandle?: (formData: any) => Promise<boolean>,
|
|
resetPasswordHandle?: (formData: any) => Promise<boolean>,
|
|
fetchUserMenu?: () => Promise<menuDataItemType[]>,
|
|
fetchUserMenu?: () => Promise<menuDataItemType[]>,
|
|
@@ -327,10 +328,44 @@ export const layout: RunTimeLayoutConfig = ({ initialState,setInitialState }) =>
|
|
}
|
|
}
|
|
|
|
|
|
if (currentUser) {
|
|
if (currentUser) {
|
|
- const data: menuDataItemType[] = await getMenus();
|
|
|
|
|
|
+ const data: any[] = await getMenus();
|
|
|
|
|
|
if(data){
|
|
if(data){
|
|
await setInitialState(t=>({...t,menu:data}));
|
|
await setInitialState(t=>({...t,menu:data}));
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ *
|
|
|
|
+ * 菜单跳转报表临时处理,后期统一换成中台调用
|
|
|
|
+ */
|
|
|
|
+ const getVFromTree = (data:any[], key: string) => {
|
|
|
|
+ let result: any[] = [];
|
|
|
|
+ function looper(data: any[], key: string) {
|
|
|
|
+ data.forEach((t) => {
|
|
|
|
+ if (t[key] && t[key] != 0) {
|
|
|
|
+ //非一般页面
|
|
|
|
+ result.push({
|
|
|
|
+ contentType: t[key],
|
|
|
|
+ path: t['path'],
|
|
|
|
+ reportId: t['reportId'],
|
|
|
|
+ url: t['youshuUrl'],
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ if (t.children && t.children.length > 0) {
|
|
|
|
+ looper(t.children, key);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ looper(data, key);
|
|
|
|
+ return result;
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ const _menu = getVFromTree(data, 'contentType');
|
|
|
|
+
|
|
|
|
+ setInitialState((t) => ({ ...t, spacicalPageParamsType: _menu }));
|
|
|
|
+
|
|
|
|
+ /////////////////////////////--------临时处理----------///////////////////////////////////////////////
|
|
|
|
+
|
|
return mappingIcon(data);
|
|
return mappingIcon(data);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|