|
@@ -2,7 +2,7 @@
|
|
* @Author: code4eat awesomedema@gmail.com
|
|
* @Author: code4eat awesomedema@gmail.com
|
|
* @Date: 2022-12-14 14:14:32
|
|
* @Date: 2022-12-14 14:14:32
|
|
* @LastEditors: code4eat awesomedema@gmail.com
|
|
* @LastEditors: code4eat awesomedema@gmail.com
|
|
- * @LastEditTime: 2023-03-06 17:03:27
|
|
|
|
|
|
+ * @LastEditTime: 2023-03-22 15:21:18
|
|
* @FilePath: /BudgetManaSystem/src/app.ts
|
|
* @FilePath: /BudgetManaSystem/src/app.ts
|
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
*/
|
|
*/
|
|
@@ -26,7 +26,7 @@ import Icon, { createFromIconfontCN, NodeCollapseOutlined } from '@ant-design/ic
|
|
import { useModel } from '@umijs/max';
|
|
import { useModel } from '@umijs/max';
|
|
|
|
|
|
const IconFont = createFromIconfontCN({
|
|
const IconFont = createFromIconfontCN({
|
|
- scriptUrl: '//at.alicdn.com/t/c/font_3878861_38jfoefh4e6.js',
|
|
|
|
|
|
+ scriptUrl: '//at.alicdn.com/t/c/font_3878861_tw9yqguouab.js',
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
@@ -51,16 +51,16 @@ interface ResponseStructure {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-export async function getInitialState(): Promise<{ name?: string,isCollapsed:boolean }> {
|
|
|
|
|
|
+export async function getInitialState(): Promise<{ name?: string, isCollapsed: boolean }> {
|
|
|
|
|
|
new DevicePixelRatio().init();
|
|
new DevicePixelRatio().init();
|
|
|
|
|
|
- return {isCollapsed:false};
|
|
|
|
|
|
+ return { isCollapsed: false };
|
|
}
|
|
}
|
|
|
|
|
|
export const request: RequestConfig = {
|
|
export const request: RequestConfig = {
|
|
// 统一的请求设定
|
|
// 统一的请求设定
|
|
- timeout:100000000,
|
|
|
|
|
|
+ timeout: 100000000,
|
|
headers: { 'X-Requested-With': 'XMLHttpRequest' },
|
|
headers: { 'X-Requested-With': 'XMLHttpRequest' },
|
|
|
|
|
|
// 错误处理: umi@3 的错误处理方案。
|
|
// 错误处理: umi@3 的错误处理方案。
|
|
@@ -142,7 +142,7 @@ export const request: RequestConfig = {
|
|
responseInterceptors: [
|
|
responseInterceptors: [
|
|
(response: AxiosResponse) => {
|
|
(response: AxiosResponse) => {
|
|
// 拦截响应数据,进行个性化处理
|
|
// 拦截响应数据,进行个性化处理
|
|
- const { status, data: { success, status:code,errorMessage,data:respData }, config: { method } } = response;
|
|
|
|
|
|
+ const { status, data: { success, status: code, errorMessage, data: respData }, config: { method } } = response;
|
|
|
|
|
|
try {
|
|
try {
|
|
|
|
|
|
@@ -152,19 +152,19 @@ export const request: RequestConfig = {
|
|
if (method == 'post') {
|
|
if (method == 'post') {
|
|
|
|
|
|
if (code == 200) {
|
|
if (code == 200) {
|
|
-
|
|
|
|
|
|
+
|
|
return response.data.data == null ? {
|
|
return response.data.data == null ? {
|
|
success: true,
|
|
success: true,
|
|
data: true
|
|
data: true
|
|
} : response.data
|
|
} : response.data
|
|
-
|
|
|
|
- }else{
|
|
|
|
|
|
+
|
|
|
|
+ } else {
|
|
notification.error({
|
|
notification.error({
|
|
-
|
|
|
|
- message:'',
|
|
|
|
- description:errorMessage,
|
|
|
|
- placement:'topRight',
|
|
|
|
- icon:<></>
|
|
|
|
|
|
+
|
|
|
|
+ message: '',
|
|
|
|
+ description: errorMessage,
|
|
|
|
+ placement: 'topRight',
|
|
|
|
+ icon: <></>
|
|
})
|
|
})
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
@@ -172,21 +172,21 @@ export const request: RequestConfig = {
|
|
if (status != 200) {
|
|
if (status != 200) {
|
|
message.error('请求失败!');
|
|
message.error('请求失败!');
|
|
return false
|
|
return false
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
if (code == 200) {
|
|
if (code == 200) {
|
|
return response.data
|
|
return response.data
|
|
- }else{
|
|
|
|
-
|
|
|
|
|
|
+ } else {
|
|
|
|
+
|
|
notification.error({
|
|
notification.error({
|
|
- message:'',
|
|
|
|
- description:errorMessage,
|
|
|
|
- placement:'topRight',
|
|
|
|
- icon:<></>
|
|
|
|
- })
|
|
|
|
- return false;
|
|
|
|
|
|
+ message: '',
|
|
|
|
+ description: errorMessage,
|
|
|
|
+ placement: 'topRight',
|
|
|
|
+ icon: <></>
|
|
|
|
+ })
|
|
|
|
+ return false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
} else {
|
|
} else {
|
|
@@ -194,7 +194,7 @@ export const request: RequestConfig = {
|
|
}
|
|
}
|
|
|
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
- console.log({error});
|
|
|
|
|
|
+ console.log({ error });
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
]
|
|
@@ -233,18 +233,22 @@ const mappingIcon = (menuData: menuDataItemType[]) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-const imgNode = (props:any)=>{
|
|
|
|
- return <IconFont type='icon-shouye' {...props} />
|
|
|
|
|
|
+const imgNode = (props: any) => {
|
|
|
|
+ return <IconFont type='icon-shouye' {...props} />
|
|
};
|
|
};
|
|
-const fileIcon = (params:any)=>{
|
|
|
|
- return <IconFont type='icon-jixiaoguanli' />
|
|
|
|
|
|
+const fileIcon = (params: any) => {
|
|
|
|
+ return <IconFont type='icon-jixiaoguanli' />
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+const setting = (params: any) => {
|
|
|
|
+ return <IconFont type='icon-xitongshezhi' />
|
|
};
|
|
};
|
|
|
|
|
|
//布局配置
|
|
//布局配置
|
|
|
|
|
|
-export const layout = ({initialState, setInitialState}:{initialState:any,setInitialState:any}) => {
|
|
|
|
|
|
+export const layout = ({ initialState, setInitialState }: { initialState: any, setInitialState: any }) => {
|
|
|
|
|
|
- const {isCollapsed} = initialState;
|
|
|
|
|
|
+ const { isCollapsed } = initialState;
|
|
|
|
|
|
const onCollapse = (isCollapsed: boolean): void => {
|
|
const onCollapse = (isCollapsed: boolean): void => {
|
|
setInitialState({ ...initialState, isCollapsed }).then();
|
|
setInitialState({ ...initialState, isCollapsed }).then();
|
|
@@ -252,25 +256,25 @@ export const layout = ({initialState, setInitialState}:{initialState:any,setInit
|
|
|
|
|
|
|
|
|
|
return {
|
|
return {
|
|
- menuHeaderRender:false,
|
|
|
|
- token:{
|
|
|
|
|
|
+ menuHeaderRender: false,
|
|
|
|
+ token: {
|
|
sider: {
|
|
sider: {
|
|
|
|
|
|
colorMenuBackground: '#fff',
|
|
colorMenuBackground: '#fff',
|
|
- colorTextMenuActive:'#3376FE',
|
|
|
|
- colorTextMenuSelected:'#3376FE',
|
|
|
|
- colorTextMenuTitle:'#17181A',
|
|
|
|
- colorTextMenu:'#17181A',
|
|
|
|
|
|
+ colorTextMenuActive: '#3376FE',
|
|
|
|
+ colorTextMenuSelected: '#3376FE',
|
|
|
|
+ colorTextMenuTitle: '#17181A',
|
|
|
|
+ colorTextMenu: '#17181A',
|
|
// // colorBgMenuItemHover:'##f0f2f5',
|
|
// // colorBgMenuItemHover:'##f0f2f5',
|
|
- colorBgMenuItemSelected:'#F2F6FF',
|
|
|
|
-
|
|
|
|
|
|
+ colorBgMenuItemSelected: '#F2F6FF',
|
|
|
|
+
|
|
// colorBgMenuItemCollapsedHover:'#f0f2f5',
|
|
// colorBgMenuItemCollapsedHover:'#f0f2f5',
|
|
// //colorBgMenuItemCollapsedSelected:'blue'
|
|
// //colorBgMenuItemCollapsedSelected:'blue'
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
},
|
|
},
|
|
- siderWidth:200,
|
|
|
|
|
|
+ siderWidth: 200,
|
|
menu: {
|
|
menu: {
|
|
locale: false,
|
|
locale: false,
|
|
request: async () => {
|
|
request: async () => {
|
|
@@ -278,7 +282,7 @@ export const layout = ({initialState, setInitialState}:{initialState:any,setInit
|
|
{
|
|
{
|
|
path: '/home',
|
|
path: '/home',
|
|
name: '首页',
|
|
name: '首页',
|
|
- icon:<Icon component={imgNode} />,
|
|
|
|
|
|
+ icon: <Icon component={imgNode} />,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
path: '/budgetMana',
|
|
path: '/budgetMana',
|
|
@@ -311,36 +315,67 @@ export const layout = ({initialState, setInitialState}:{initialState:any,setInit
|
|
icon: '',
|
|
icon: '',
|
|
},
|
|
},
|
|
],
|
|
],
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ path: '/setting',
|
|
|
|
+ name: '系统设置',
|
|
|
|
+ icon: <Icon component={setting} />,
|
|
|
|
+ children: [
|
|
|
|
+ {
|
|
|
|
+ path: '/setting/baseSetting',
|
|
|
|
+ name: '基础设置',
|
|
|
|
+ icon:'',
|
|
|
|
+ children: [
|
|
|
|
+ {
|
|
|
|
+ path: '/setting/baseSetting/dicClassfication',
|
|
|
|
+ name: '业务字典分类管理',
|
|
|
|
+ icon: '',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ path: '/setting/baseSetting/businessDicMana',
|
|
|
|
+ name: '业务字典管理',
|
|
|
|
+ icon: '',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ path: '/setting/baseSetting/paramsMana',
|
|
|
|
+ name: '参数管理',
|
|
|
|
+ icon: '',
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
}
|
|
}
|
|
];
|
|
];
|
|
-
|
|
|
|
|
|
+
|
|
// console.log('mappingIcon(data)',mappingIcon(data));
|
|
// console.log('mappingIcon(data)',mappingIcon(data));
|
|
// return mappingIcon(data);
|
|
// return mappingIcon(data);
|
|
return data
|
|
return data
|
|
},
|
|
},
|
|
},
|
|
},
|
|
- onPageChange:(location: Location)=>{
|
|
|
|
- // console.log({location});
|
|
|
|
- // const {pathname} = location;
|
|
|
|
- // localStorage.setItem('currentPath',pathname);
|
|
|
|
|
|
+ onPageChange: (location: Location) => {
|
|
|
|
+ // console.log({location});
|
|
|
|
+ // const {pathname} = location;
|
|
|
|
+ // localStorage.setItem('currentPath',pathname);
|
|
},
|
|
},
|
|
- collapsedButtonRender:()=>{
|
|
|
|
- return (
|
|
|
|
- <div style={{position:'absolute',zIndex:10,right:17,bottom:12,
|
|
|
|
- display:'flex',justifyContent:'center',alignItems:'center',
|
|
|
|
- cursor:'pointer',width:24,height:24}} onClick={
|
|
|
|
- ()=>{
|
|
|
|
- onCollapse(isCollapsed?false:true);
|
|
|
|
- }
|
|
|
|
- }><IconFont className='menuCollapseIcon' type={isCollapsed?'icon-celanzhankai':'icon-celanshouqi'} /></div>
|
|
|
|
- )
|
|
|
|
|
|
+ collapsedButtonRender: () => {
|
|
|
|
+ return (
|
|
|
|
+ <div style={{
|
|
|
|
+ position: 'absolute', zIndex: 10, right: 17, bottom: 12,
|
|
|
|
+ display: 'flex', justifyContent: 'center', alignItems: 'center',
|
|
|
|
+ cursor: 'pointer', width: 24, height: 24
|
|
|
|
+ }} onClick={
|
|
|
|
+ () => {
|
|
|
|
+ onCollapse(isCollapsed ? false : true);
|
|
|
|
+ }
|
|
|
|
+ }><IconFont className='menuCollapseIcon' type={isCollapsed ? 'icon-celanzhankai' : 'icon-celanshouqi'} /></div>
|
|
|
|
+ )
|
|
},
|
|
},
|
|
- collapsed:isCollapsed,
|
|
|
|
|
|
+ collapsed: isCollapsed,
|
|
contentStyle: {
|
|
contentStyle: {
|
|
border: '16px solid #F7F9FC',
|
|
border: '16px solid #F7F9FC',
|
|
//height: '94.5vh', //以去除顶部导航高度
|
|
//height: '94.5vh', //以去除顶部导航高度
|
|
borderRadius: '22px',
|
|
borderRadius: '22px',
|
|
- background:'#F7F9FC',
|
|
|
|
|
|
+ background: '#F7F9FC',
|
|
// overflow:'scroll',
|
|
// overflow:'scroll',
|
|
// margin:'20px 20px'
|
|
// margin:'20px 20px'
|
|
},
|
|
},
|