|
@@ -10,6 +10,9 @@ import { logoutHandle } from './global';
|
|
|
import { Platforms } from './constant';
|
|
|
import { SpacicalPageParamsType } from './typings';
|
|
|
|
|
|
+import Report from '@/pages/platform/setting/reports';
|
|
|
+import Static from '@/pages/platform/setting/static';
|
|
|
+
|
|
|
|
|
|
const loginPath = '/login';
|
|
|
|
|
@@ -34,7 +37,7 @@ type InitialStateType = {
|
|
|
openedSysLists?: TopBar.Tab[]; //当前已打开的系统列表
|
|
|
currentSelectedSys?: TopBar.Tab; //当前选中的tab
|
|
|
logout?: () => Promise<boolean>;
|
|
|
- childAppIsShowMenu?:boolean;
|
|
|
+ childAppIsShowMenu?: boolean;
|
|
|
spacicalPageParamsType?: SpacicalPageParamsType[];
|
|
|
getHospSubSystemListFunc?: () => Promise<any[]>;
|
|
|
};
|
|
@@ -105,11 +108,11 @@ const requestInterceptorsHandle = (url: string, options: RequestOptionsInit) =>
|
|
|
authHeader.token = token;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
return {
|
|
|
url: `/gateway${url}`,
|
|
|
- options: { ...options, interceptors: true, headers: authHeader,timeout:100000000, },
|
|
|
+ options: { ...options, interceptors: true, headers: authHeader, timeout: 100000000, },
|
|
|
};
|
|
|
};
|
|
|
|
|
@@ -123,7 +126,7 @@ const responseInterceptorsHandle = async (response: Response, options: RequestOp
|
|
|
msg?: string;
|
|
|
} = await response.clone().json();
|
|
|
|
|
|
-
|
|
|
+
|
|
|
if (_response.status == 200) {
|
|
|
if (_response.data) {
|
|
|
return _response.data;
|
|
@@ -138,7 +141,7 @@ const responseInterceptorsHandle = async (response: Response, options: RequestOp
|
|
|
};
|
|
|
} else {
|
|
|
notification.error({
|
|
|
- message:`${_response.msg}`,
|
|
|
+ message: `${_response.msg}`,
|
|
|
});
|
|
|
return false
|
|
|
}
|
|
@@ -164,8 +167,8 @@ const errorHandlerFunc = (error: ResponseErr) => {
|
|
|
|
|
|
try {
|
|
|
const { info } = error;
|
|
|
- const { errorCode , errorMessage } = info;
|
|
|
-
|
|
|
+ const { errorCode, errorMessage } = info;
|
|
|
+
|
|
|
if (errorCode == 499) {
|
|
|
//token过期
|
|
|
Modal.confirm({
|
|
@@ -248,8 +251,8 @@ export const qiankun = fetch('/config').then(() => ({
|
|
|
// },
|
|
|
{
|
|
|
name: 'budgetManaSystem', // 唯一 id
|
|
|
- entry: '//localhost:8001',
|
|
|
- //entry: '//120.27.235.181:5000/perform/', //开发
|
|
|
+ //entry: '//localhost:8001',
|
|
|
+ entry: '//120.27.235.181:5000/perform/', //开发
|
|
|
//entry: '//47.96.149.190:5000/perform/', //演示
|
|
|
},
|
|
|
{
|
|
@@ -260,7 +263,7 @@ export const qiankun = fetch('/config').then(() => ({
|
|
|
],
|
|
|
// 完整生命周期钩子请看 https://qiankun.umijs.org/zh/api/#registermicroapps-apps-lifecycles
|
|
|
lifeCycles: {
|
|
|
- afterMount: (props: any) => {},
|
|
|
+ afterMount: (props: any) => { },
|
|
|
},
|
|
|
// 支持更多的其他配置,详细看这里 https://qiankun.umijs.org/zh/api/#start-opts
|
|
|
}));
|
|
@@ -278,36 +281,50 @@ export function useQiankunStateForSlave() {
|
|
|
|
|
|
|
|
|
|
|
|
-//@/pages/platform/setting/reports/index
|
|
|
-export function patchRoutes({ routes }:{routes:any}) {
|
|
|
-
|
|
|
- const paths = [...new Array(100).keys()].map((a,index)=>({
|
|
|
- path: `/platform/setting/reports/${15+(index+1)}`,
|
|
|
- exact: true,
|
|
|
- component: require('@/pages/platform/setting/reports/index.tsx').default,
|
|
|
- }));
|
|
|
-
|
|
|
-
|
|
|
- const treeLoop = (treeData:any)=>{
|
|
|
- //console.log({treeData})
|
|
|
- if(treeData.path == '/platform'){
|
|
|
- paths.forEach((a:any)=>{
|
|
|
- treeData.routes.push(a);
|
|
|
- })
|
|
|
- return;
|
|
|
- }else{
|
|
|
- if(treeData.routes&&treeData.routes.length>0){
|
|
|
- treeData.routes.forEach((a:any)=>{
|
|
|
- treeLoop(a);
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
+// //@/pages/platform/setting/reports/index
|
|
|
+export function patchRoutes({ routes }: { routes: any }) {
|
|
|
+
|
|
|
+ const treeLoop = (treeData: any) => {
|
|
|
+
|
|
|
+ if (treeData.path == '/platform') {
|
|
|
+ if (treeData.routes) {
|
|
|
+ const paths = [...new Array(10).keys()].map((a, index) => ({
|
|
|
+ path: `${treeData.path == '/' ? '' : treeData.path}/reports/${index}`,
|
|
|
+ exact: true,
|
|
|
+ component: require('@/pages/platform/setting/reports/index.tsx').default,
|
|
|
+ }));
|
|
|
+
|
|
|
+ const lanhuPagePaths = [...new Array(10).keys()].map((a, index) => ({
|
|
|
+ path: `${treeData.path == '/' ? '' : treeData.path}/static/${index}`,
|
|
|
+ exact: true,
|
|
|
+ component:require('@/pages/platform/setting/static/index.tsx').default,
|
|
|
+ }));
|
|
|
+
|
|
|
+ //console.log({paths});
|
|
|
+
|
|
|
+ paths.forEach((a: any) => {
|
|
|
+ treeData.routes.push(a);
|
|
|
+ });
|
|
|
+
|
|
|
+ lanhuPagePaths.forEach((a: any) => {
|
|
|
+ treeData.routes.push(a);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (treeData.routes && treeData.routes.length > 0) {
|
|
|
+ treeData.routes.forEach((a: any) => {
|
|
|
+ treeLoop(a);
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
treeLoop(routes[0]);
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
export const layout = ({ initialState: { userData } }: { initialState: InitialStateType }): BasicLayoutProps => {
|
|
|
return {
|
|
|
headerRender: false,
|