|
@@ -6,34 +6,34 @@ import {
|
6
|
6
|
MenuFoldOutlined,
|
7
|
7
|
MenuUnfoldOutlined,
|
8
|
8
|
PieChartOutlined,
|
9
|
|
-} from '@ant-design/icons';
|
10
|
|
-import { Navigate } from 'react-router-dom';
|
11
|
|
-import AuthLayout from '@/layouts/AuthLayout';
|
12
|
|
-import Container from '@/layouts/Container';
|
13
|
|
-import Login from '@/pages/login';
|
14
|
|
-import Page404 from '@/pages/404';
|
15
|
|
-import Home from '@/pages/sample/home';
|
16
|
|
-import BasicForm from '@/pages/sample/form';
|
17
|
|
-import BasicTable from '@/pages/sample/table';
|
18
|
|
-import GuaranteeTaskList from '@/pages/guaranteeTask';
|
19
|
|
-import GuaranteeTaskEdit from '@/pages/guaranteeTask/Edit';
|
20
|
|
-import GuaranteeTaskPrint from '@/pages/guaranteeTask/print';
|
21
|
|
-import DishList from '@/pages/dish/list';
|
22
|
|
-import DishEdit from '@/pages/dish/edit';
|
23
|
|
-import PackageList from '@/pages/package/List';
|
24
|
|
-import StockList from '@/pages/stock/list';
|
25
|
|
-import StockEdit from '@/pages/stock/edit';
|
26
|
|
-import StockInOut from '@/pages/stock/outAndIn';
|
27
|
|
-import StockLog from '@/pages/stock/stockLog';
|
28
|
|
-import StockClassificationList from '@/pages/stockClassification/list';
|
29
|
|
-import StockClassificationEdit from '@/pages/stockClassification/edit';
|
30
|
|
-import RotationChartList from '@/pages/rotationChart/list';
|
31
|
|
-import RotationChartEdit from '@/pages/rotationChart/edit';
|
32
|
|
-import RotationChartIntroduction from '@/pages/rotationChart/introduction';
|
33
|
|
-import Roles from '@/pages/roles/index';
|
34
|
|
-import RegulationList from '@/regulation';
|
35
|
|
-import UserList from '@/pages/user';
|
36
|
|
-import UserEdit from '@/pages/user/Edit';
|
|
9
|
+} from "@ant-design/icons";
|
|
10
|
+import { Navigate } from "react-router-dom";
|
|
11
|
+import AuthLayout from "@/layouts/AuthLayout";
|
|
12
|
+import Container from "@/layouts/Container";
|
|
13
|
+import Login from "@/pages/login";
|
|
14
|
+import Page404 from "@/pages/404";
|
|
15
|
+import Home from "@/pages/sample/home";
|
|
16
|
+import BasicForm from "@/pages/sample/form";
|
|
17
|
+import BasicTable from "@/pages/sample/table";
|
|
18
|
+import GuaranteeTaskList from "@/pages/guaranteeTask";
|
|
19
|
+import GuaranteeTaskEdit from "@/pages/guaranteeTask/Edit";
|
|
20
|
+import GuaranteeTaskPrint from "@/pages/guaranteeTask/print";
|
|
21
|
+import DishList from "@/pages/dish/list";
|
|
22
|
+import DishEdit from "@/pages/dish/edit";
|
|
23
|
+import PackageList from "@/pages/package";
|
|
24
|
+import StockList from "@/pages/stock/list";
|
|
25
|
+import StockEdit from "@/pages/stock/edit";
|
|
26
|
+import StockInOut from "@/pages/stock/outAndIn";
|
|
27
|
+import StockLog from "@/pages/stock/stockLog";
|
|
28
|
+import StockClassificationList from "@/pages/stockClassification/list";
|
|
29
|
+import StockClassificationEdit from "@/pages/stockClassification/edit";
|
|
30
|
+import RotationChartList from "@/pages/rotationChart/list";
|
|
31
|
+import RotationChartEdit from "@/pages/rotationChart/edit";
|
|
32
|
+import RotationChartIntroduction from "@/pages/rotationChart/introduction";
|
|
33
|
+import Roles from "@/pages/roles/index";
|
|
34
|
+import RegulationList from "@/regulation";
|
|
35
|
+import UserList from "@/pages/user";
|
|
36
|
+import UserEdit from "@/pages/user/Edit";
|
37
|
37
|
import PurchasePlanList from "@/pages/purchase/plan/list";
|
38
|
38
|
import PurchasePlanEdit from "@/pages/purchase/plan/edit";
|
39
|
39
|
import PurchaseBillEdit from "@/pages/purchase/bill/edit";
|
|
@@ -42,8 +42,8 @@ import EmergencyPlanList from "@/pages/cms/emergencyPlan/list";
|
42
|
42
|
import EmergencyPlanEdit from "@/pages/cms/emergencyPlan/edit";
|
43
|
43
|
import EmergencyPlanDetail from "@/pages/cms/emergencyPlan/detail";
|
44
|
44
|
import FilesList from "@/pages/cms/files/list";
|
45
|
|
-import MessageList from '@/pages/message';
|
46
|
|
-import MessageDetail from '@/pages/message/detail';
|
|
45
|
+import MessageList from "@/pages/message";
|
|
46
|
+import MessageDetail from "@/pages/message/detail";
|
47
|
47
|
|
48
|
48
|
/**
|
49
|
49
|
* meta 用来扩展自定义数据数据
|
|
@@ -58,151 +58,158 @@ import MessageDetail from '@/pages/message/detail';
|
58
|
58
|
|
59
|
59
|
export const authRoutes = [
|
60
|
60
|
{
|
61
|
|
- path: 'task',
|
|
61
|
+ path: "task",
|
62
|
62
|
element: <Container />,
|
63
|
63
|
meta: {
|
64
|
|
- title: '军供任务',
|
|
64
|
+ title: "军供任务",
|
65
|
65
|
icon: <AppstoreOutlined />,
|
66
|
66
|
},
|
67
|
67
|
children: [
|
68
|
68
|
{
|
69
|
69
|
index: true,
|
70
|
|
- element: <Navigate to='guaranteeTask' replace />,
|
|
70
|
+ element: <Navigate to="guaranteeTask" replace />,
|
71
|
71
|
},
|
72
|
72
|
{
|
73
|
|
- path: 'guaranteeTask',
|
|
73
|
+ path: "guaranteeTask",
|
74
|
74
|
element: <GuaranteeTaskList />,
|
75
|
75
|
meta: {
|
76
|
|
- title: '军供通报',
|
|
76
|
+ title: "军供通报",
|
77
|
77
|
},
|
78
|
78
|
},
|
79
|
79
|
{
|
80
|
|
- path: 'guaranteeTask/edit',
|
|
80
|
+ path: "guaranteeTask/edit",
|
81
|
81
|
element: <GuaranteeTaskEdit />,
|
82
|
82
|
meta: {
|
83
|
|
- title: '任务配置',
|
|
83
|
+ title: "任务配置",
|
84
|
84
|
},
|
85
|
85
|
},
|
86
|
86
|
{
|
87
|
|
- path: 'guaranteeTask/print',
|
|
87
|
+ path: "guaranteeTask/print",
|
88
|
88
|
element: <GuaranteeTaskPrint />,
|
89
|
89
|
meta: {
|
90
|
90
|
hideInMenu: true,
|
91
|
91
|
noLayout: true,
|
92
|
|
- target: '_blank',
|
93
|
|
- title: '任务执行',
|
|
92
|
+ target: "_blank",
|
|
93
|
+ title: "任务执行",
|
94
|
94
|
},
|
95
|
|
- }
|
96
|
|
- ]
|
|
95
|
+ },
|
|
96
|
+ {
|
|
97
|
+ path: "guaranteeTask/print",
|
|
98
|
+ element: <GuaranteeTaskPrint />,
|
|
99
|
+ meta: {
|
|
100
|
+ title: "任务评价",
|
|
101
|
+ },
|
|
102
|
+ },
|
|
103
|
+ ],
|
97
|
104
|
},
|
98
|
105
|
{
|
99
|
|
- path: 'material',
|
|
106
|
+ path: "material",
|
100
|
107
|
element: <Container />,
|
101
|
108
|
meta: {
|
102
|
|
- title: '物资管理',
|
|
109
|
+ title: "物资管理",
|
103
|
110
|
icon: <AppstoreOutlined />,
|
104
|
111
|
},
|
105
|
112
|
children: [
|
106
|
113
|
{
|
107
|
114
|
index: true,
|
108
|
|
- element: <Navigate to='dish/list' replace />,
|
|
115
|
+ element: <Navigate to="dish/list" replace />,
|
109
|
116
|
},
|
110
|
117
|
{
|
111
|
|
- path: 'dish/list',
|
|
118
|
+ path: "dish/list",
|
112
|
119
|
element: <DishList />,
|
113
|
120
|
meta: {
|
114
|
|
- title: '菜肴管理',
|
|
121
|
+ title: "菜肴管理",
|
115
|
122
|
},
|
116
|
123
|
},
|
117
|
124
|
{
|
118
|
|
- path: 'dish/edit',
|
|
125
|
+ path: "dish/edit",
|
119
|
126
|
element: <DishEdit />,
|
120
|
127
|
meta: {
|
121
|
128
|
hideInMenu: true,
|
122
|
|
- title: '菜肴维护',
|
|
129
|
+ title: "菜肴维护",
|
123
|
130
|
},
|
124
|
131
|
},
|
125
|
132
|
{
|
126
|
|
- path: 'package/list',
|
|
133
|
+ path: "package/list",
|
127
|
134
|
element: <PackageList />,
|
128
|
135
|
meta: {
|
129
|
|
- title: '套餐管理',
|
|
136
|
+ title: "套餐管理",
|
130
|
137
|
},
|
131
|
138
|
},
|
132
|
|
- ]
|
|
139
|
+ ],
|
133
|
140
|
},
|
134
|
141
|
{
|
135
|
|
- path: 'stock',
|
|
142
|
+ path: "stock",
|
136
|
143
|
element: <Container />,
|
137
|
144
|
meta: {
|
138
|
|
- title: '库存管理',
|
|
145
|
+ title: "库存管理",
|
139
|
146
|
icon: <AppstoreOutlined />,
|
140
|
147
|
},
|
141
|
148
|
children: [
|
142
|
149
|
{
|
143
|
150
|
index: true,
|
144
|
|
- element: <Navigate to='list' replace />,
|
|
151
|
+ element: <Navigate to="list" replace />,
|
145
|
152
|
},
|
146
|
153
|
{
|
147
|
|
- path: 'list',
|
|
154
|
+ path: "list",
|
148
|
155
|
element: <StockList />,
|
149
|
156
|
meta: {
|
150
|
|
- title: '库存列表',
|
|
157
|
+ title: "库存列表",
|
151
|
158
|
},
|
152
|
159
|
},
|
153
|
160
|
{
|
154
|
|
- path: 'add',
|
|
161
|
+ path: "add",
|
155
|
162
|
element: <StockEdit />,
|
156
|
163
|
meta: {
|
157
|
|
- title: '库存维护',
|
|
164
|
+ title: "库存维护",
|
158
|
165
|
},
|
159
|
166
|
},
|
160
|
167
|
],
|
161
|
168
|
},
|
162
|
169
|
{
|
163
|
|
- path: 'cms',
|
|
170
|
+ path: "cms",
|
164
|
171
|
element: <Container />,
|
165
|
172
|
meta: {
|
166
|
|
- title: '公告文件',
|
|
173
|
+ title: "公告文件",
|
167
|
174
|
},
|
168
|
175
|
children: [
|
169
|
176
|
{
|
170
|
177
|
index: true,
|
171
|
|
- element: <Navigate to='rotationChart/list' replace />,
|
|
178
|
+ element: <Navigate to="rotationChart/list" replace />,
|
172
|
179
|
},
|
173
|
180
|
{
|
174
|
|
- path: 'station',
|
|
181
|
+ path: "station",
|
175
|
182
|
element: null,
|
176
|
183
|
meta: {
|
177
|
|
- title: '本站信息',
|
|
184
|
+ title: "本站信息",
|
178
|
185
|
},
|
179
|
186
|
},
|
180
|
187
|
{
|
181
|
|
- path: 'rotationChart/list',
|
|
188
|
+ path: "rotationChart/list",
|
182
|
189
|
element: <RotationChartList />,
|
183
|
190
|
meta: {
|
184
|
|
- title: '公告内容',
|
|
191
|
+ title: "公告内容",
|
185
|
192
|
},
|
186
|
193
|
},
|
187
|
194
|
{
|
188
|
|
- path: 'rotationChart/add',
|
|
195
|
+ path: "rotationChart/add",
|
189
|
196
|
element: <RotationChartEdit />,
|
190
|
197
|
meta: {
|
191
|
|
- title: '公告维护',
|
|
198
|
+ title: "公告维护",
|
192
|
199
|
},
|
193
|
200
|
},
|
194
|
201
|
{
|
195
|
|
- path: 'rotationChart/introduction',
|
|
202
|
+ path: "rotationChart/introduction",
|
196
|
203
|
element: <RotationChartIntroduction />,
|
197
|
204
|
meta: {
|
198
|
|
- title: '本站信息简介',
|
|
205
|
+ title: "本站信息简介",
|
199
|
206
|
},
|
200
|
207
|
},
|
201
|
208
|
{
|
202
|
|
- path: 'regulation',
|
|
209
|
+ path: "regulation",
|
203
|
210
|
element: null,
|
204
|
211
|
meta: {
|
205
|
|
- title: '规章制度',
|
|
212
|
+ title: "规章制度",
|
206
|
213
|
},
|
207
|
214
|
},
|
208
|
215
|
{
|
|
@@ -236,86 +243,85 @@ export const authRoutes = [
|
236
|
243
|
title: "文件管理",
|
237
|
244
|
},
|
238
|
245
|
},
|
239
|
|
-
|
240
|
246
|
],
|
241
|
247
|
},
|
242
|
248
|
{
|
243
|
|
- path: 'static',
|
|
249
|
+ path: "static",
|
244
|
250
|
element: <Container />,
|
245
|
251
|
meta: {
|
246
|
|
- title: '数据分析',
|
|
252
|
+ title: "数据分析",
|
247
|
253
|
},
|
248
|
254
|
},
|
249
|
255
|
{
|
250
|
|
- path: 'system',
|
|
256
|
+ path: "system",
|
251
|
257
|
element: <Container />,
|
252
|
258
|
meta: {
|
253
|
|
- title: '系统管理',
|
|
259
|
+ title: "系统管理",
|
254
|
260
|
},
|
255
|
261
|
children: [
|
256
|
262
|
{
|
257
|
263
|
index: true,
|
258
|
|
- element: <Navigate to='stockClassification/list' replace />,
|
|
264
|
+ element: <Navigate to="stockClassification/list" replace />,
|
259
|
265
|
},
|
260
|
266
|
{
|
261
|
|
- path: 'stockClassification/list',
|
|
267
|
+ path: "stockClassification/list",
|
262
|
268
|
element: <StockClassificationList />,
|
263
|
269
|
meta: {
|
264
|
|
- title: '库存分类',
|
|
270
|
+ title: "库存分类",
|
265
|
271
|
},
|
266
|
272
|
},
|
267
|
273
|
{
|
268
|
|
- path: 'stockClassification/edit',
|
|
274
|
+ path: "stockClassification/edit",
|
269
|
275
|
element: <StockClassificationEdit />,
|
270
|
276
|
meta: {
|
271
|
|
- title: '库存分类维护',
|
|
277
|
+ title: "库存分类维护",
|
272
|
278
|
hideInMenu: true,
|
273
|
279
|
},
|
274
|
280
|
},
|
275
|
281
|
{
|
276
|
|
- path: 'log',
|
|
282
|
+ path: "log",
|
277
|
283
|
element: <StockLog />,
|
278
|
284
|
meta: {
|
279
|
|
- title: '操作日志',
|
|
285
|
+ title: "操作日志",
|
280
|
286
|
},
|
281
|
287
|
},
|
282
|
288
|
{
|
283
|
|
- path: 'roles',
|
|
289
|
+ path: "roles",
|
284
|
290
|
element: <Roles />,
|
285
|
291
|
meta: {
|
286
|
|
- title: '角色管理',
|
|
292
|
+ title: "角色管理",
|
287
|
293
|
},
|
288
|
294
|
},
|
289
|
295
|
{
|
290
|
|
- path: 'user',
|
|
296
|
+ path: "user",
|
291
|
297
|
element: <UserList />,
|
292
|
298
|
meta: {
|
293
|
|
- title: '用户管理',
|
|
299
|
+ title: "用户管理",
|
294
|
300
|
},
|
295
|
301
|
},
|
296
|
302
|
{
|
297
|
|
- path: 'user/edit',
|
|
303
|
+ path: "user/edit",
|
298
|
304
|
element: <UserEdit />,
|
299
|
305
|
meta: {
|
300
|
306
|
hideInMenu: true,
|
301
|
|
- title: '系统用户编辑',
|
|
307
|
+ title: "系统用户编辑",
|
302
|
308
|
},
|
303
|
309
|
},
|
304
|
310
|
{
|
305
|
|
- path: 'message',
|
|
311
|
+ path: "message",
|
306
|
312
|
element: <MessageList />,
|
307
|
313
|
meta: {
|
308
|
|
- title: '消息列表',
|
|
314
|
+ title: "消息列表",
|
309
|
315
|
},
|
310
|
316
|
},
|
311
|
317
|
{
|
312
|
|
- path: 'message/detail',
|
|
318
|
+ path: "message/detail",
|
313
|
319
|
element: <MessageDetail />,
|
314
|
320
|
meta: {
|
315
|
|
- title: '消息详情',
|
|
321
|
+ title: "消息详情",
|
316
|
322
|
hideInMenu: true,
|
317
|
323
|
},
|
318
|
|
- }
|
|
324
|
+ },
|
319
|
325
|
],
|
320
|
326
|
},
|
321
|
327
|
{
|
|
@@ -368,7 +374,7 @@ export const authRoutes = [
|
368
|
374
|
},
|
369
|
375
|
{
|
370
|
376
|
path: "inStore/edit",
|
371
|
|
- element: <PurchaseInStoreEdit />,
|
|
377
|
+ element: <PurchaseInStoreEdit />,
|
372
|
378
|
meta: {
|
373
|
379
|
title: "采购入库维护",
|
374
|
380
|
hideInMenu: true,
|
|
@@ -376,11 +382,11 @@ export const authRoutes = [
|
376
|
382
|
},
|
377
|
383
|
],
|
378
|
384
|
},
|
379
|
|
-]
|
|
385
|
+];
|
380
|
386
|
|
381
|
387
|
export const defaultRoutes = [
|
382
|
388
|
{
|
383
|
|
- path: '/',
|
|
389
|
+ path: "/",
|
384
|
390
|
element: <AuthLayout />,
|
385
|
391
|
children: [
|
386
|
392
|
{
|
|
@@ -388,30 +394,30 @@ export const defaultRoutes = [
|
388
|
394
|
element: <Home />,
|
389
|
395
|
},
|
390
|
396
|
{
|
391
|
|
- path: 'home',
|
|
397
|
+ path: "home",
|
392
|
398
|
element: <Home />,
|
393
|
399
|
meta: {
|
394
|
|
- title: '首页',
|
|
400
|
+ title: "首页",
|
395
|
401
|
icon: <DesktopOutlined />,
|
396
|
402
|
},
|
397
|
403
|
},
|
398
|
404
|
{
|
399
|
|
- path: '*',
|
400
|
|
- element: <Page404 />
|
401
|
|
- }
|
|
405
|
+ path: "*",
|
|
406
|
+ element: <Page404 />,
|
|
407
|
+ },
|
402
|
408
|
],
|
403
|
409
|
},
|
404
|
410
|
{
|
405
|
|
- path: '/login',
|
|
411
|
+ path: "/login",
|
406
|
412
|
element: <Login />,
|
407
|
413
|
},
|
408
|
414
|
{
|
409
|
|
- path: '*',
|
410
|
|
- element: <Page404 />
|
411
|
|
- }
|
|
415
|
+ path: "*",
|
|
416
|
+ element: <Page404 />,
|
|
417
|
+ },
|
412
|
418
|
];
|
413
|
419
|
|
414
|
|
-export function mergeAuthRoutes (r1, r2) {
|
|
420
|
+export function mergeAuthRoutes(r1, r2) {
|
415
|
421
|
const r = r1.slice();
|
416
|
422
|
const children = r1[0].children.slice();
|
417
|
423
|
r[0].children = children.concat(r2);
|
|
@@ -421,21 +427,22 @@ export function mergeAuthRoutes (r1, r2) {
|
421
|
427
|
// 全部路由
|
422
|
428
|
export const routes = mergeAuthRoutes(defaultRoutes, authRoutes);
|
423
|
429
|
|
424
|
|
-function getPath(parent = '/', current = '') {
|
425
|
|
- if (current.indexOf('/') === 0 || current.indexOf('http') === 0) return current;
|
426
|
|
- return `${parent}/${current}`.replace(/\/\//g, '/');
|
|
430
|
+function getPath(parent = "/", current = "") {
|
|
431
|
+ if (current.indexOf("/") === 0 || current.indexOf("http") === 0)
|
|
432
|
+ return current;
|
|
433
|
+ return `${parent}/${current}`.replace(/\/\//g, "/");
|
427
|
434
|
}
|
428
|
435
|
|
429
|
436
|
// 路由数组, 一维数组
|
430
|
437
|
export const routeArr = (() => {
|
431
|
|
- const flatten = (routes, parentPath = '/') => {
|
|
438
|
+ const flatten = (routes, parentPath = "/") => {
|
432
|
439
|
return routes.reduce((acc, route) => {
|
433
|
440
|
const path = getPath(parentPath, route.path);
|
434
|
441
|
const children = route.children ? flatten(route.children, path) : [];
|
435
|
|
-
|
|
442
|
+
|
436
|
443
|
return acc.concat([{ ...route, path }].concat(children));
|
437
|
444
|
}, []);
|
438
|
|
- }
|
|
445
|
+ };
|
439
|
446
|
|
440
|
447
|
return flatten(routes);
|
441
|
448
|
})();
|