vben
2020-11-17 7a000366b92b942727dd2cd7c0aec193f8c1a7b0
提交 | 用户 | age
21e054 1 import type { AppRouteModule } from '/@/router/types';
V 2
3 import { PAGE_LAYOUT_COMPONENT } from '/@/router/constant';
4 import { ExceptionEnum } from '/@/enums/exceptionEnum';
5
6 const ExceptionPage = () => import('/@/views/sys/exception/Exception');
7
fc4666 8 const page: AppRouteModule = {
21e054 9   path: '/page-demo',
V 10   name: 'PageDemo',
11   component: PAGE_LAYOUT_COMPONENT,
12   redirect: '/page-demo/exception',
13   meta: {
14     icon: 'mdi:page-next-outline',
15     title: '页面',
16   },
17   children: [
0b6110 18     // =============================form start=============================
V 19     {
20       path: '/form',
21       name: 'FormPage',
22       redirect: '/page-demo/form/basic',
23       meta: {
24         title: '表单页',
25       },
26       children: [
27         {
28           path: 'basic',
29           name: 'FormBasicPage',
30           component: () => import('/@/views/demo/page/form/basic/index.vue'),
31           meta: {
32             title: '基础表单',
33           },
34         },
35         {
36           path: 'step',
37           name: 'FormStepPage',
38           component: () => import('/@/views/demo/page/form/step/index.vue'),
39           meta: {
40             title: '分步表单',
41           },
42         },
43         {
44           path: 'high',
45           name: 'FormHightPage',
46           component: () => import('/@/views/demo/page/form/high/index.vue'),
47           meta: {
48             title: '高级表单',
49           },
50         },
51       ],
52     },
53     // =============================form end=============================
7a0003 54     // =============================desc start=============================
V 55     {
56       path: '/desc',
57       name: 'DescPage',
58       redirect: '/page-demo/desc/basic',
59       meta: {
60         title: '详情页',
61       },
62       children: [
63         {
64           path: 'basic',
65           name: 'DescBasicPage',
66           component: () => import('/@/views/demo/page/desc/basic/index.vue'),
67           meta: {
68             title: '基础详情页',
69           },
70         },
71         {
72           path: 'high',
73           name: 'DescHighPage',
74           component: () => import('/@/views/demo/page/desc/high/index.vue'),
75           meta: {
76             title: '高级详情页',
77           },
78         },
79       ],
80     },
81     // =============================desc end=============================
0b6110 82
21e054 83     // =============================result start=============================
V 84     {
85       path: '/result',
86       name: 'ResultPage',
87       redirect: '/page-demo/result/success',
88       meta: {
89         title: '结果页',
90       },
91       children: [
92         {
93           path: 'success',
94           name: 'ResultSuccessPage',
95           component: () => import('/@/views/demo/page/result/success/index.vue'),
96           meta: {
97             title: '成功页',
98           },
99         },
100         {
101           path: 'fail',
102           name: 'ResultFailPage',
103           component: () => import('/@/views/demo/page/result/fail/index.vue'),
104           meta: {
105             title: '失败页',
106           },
107         },
108       ],
109     },
110     // =============================result end=============================
111
7a0003 112     // =============================account start=============================
V 113     {
114       path: '/account',
115       name: 'AccountPage',
116       redirect: '/page-demo/account/setting',
117       meta: {
118         title: '个人页',
119       },
120       children: [
121         {
122           path: 'center',
123           name: 'AccountCenterPage',
124           component: () => import('/@/views/demo/page/account/center/index.vue'),
125           meta: {
126             title: '个人中心',
127           },
128         },
129         {
130           path: 'setting',
131           name: 'AccountSettingPage',
132           component: () => import('/@/views/demo/page/account/setting/index.vue'),
133           meta: {
134             title: '个人设置',
135           },
136         },
137       ],
138     },
139     // =============================account end=============================
21e054 140     // =============================exception start=============================
V 141     {
142       path: '/exception',
143       name: 'ExceptionPage',
144       redirect: '/page-demo/exception/404',
145       meta: {
146         title: '异常页',
147       },
148       children: [
149         {
150           path: '403',
151           name: 'PageNotAccess',
152           component: ExceptionPage,
153           props: {
154             status: ExceptionEnum.PAGE_NOT_ACCESS,
155           },
156           meta: {
157             title: '403',
158             afterCloseLoading: true,
159           },
160         },
161         {
162           path: '404',
163           name: 'PageNotFound',
164           component: ExceptionPage,
165           props: {
166             status: ExceptionEnum.PAGE_NOT_FOUND,
167           },
168           meta: {
169             title: '404',
170             afterCloseLoading: true,
171           },
172         },
173         {
174           path: '500',
175           name: 'ServiceError',
176           component: ExceptionPage,
177           props: {
178             status: ExceptionEnum.ERROR,
179           },
180           meta: {
181             title: '500',
182             afterCloseLoading: true,
183           },
184         },
185         {
186           path: 'net-work-error',
187           name: 'NetWorkError',
188           component: ExceptionPage,
189           props: {
190             status: ExceptionEnum.NET_WORK_ERROR,
191           },
192           meta: {
193             title: '网络错误',
194             afterCloseLoading: true,
195           },
196         },
197         {
198           path: 'not-data',
199           name: 'NotData',
200           component: ExceptionPage,
201           props: {
202             status: ExceptionEnum.PAGE_NOT_DATA,
203           },
204           meta: {
205             title: '无数据',
206             afterCloseLoading: true,
207           },
208         },
209       ],
210     },
211     // =============================exception end=============================
212   ],
fc4666 213 };
V 214
215 export default page;