|
@@ -531,9 +531,413 @@ const testList: string[] = [
|
|
|
|
|
|
const List: any[] = []
|
|
|
|
|
|
-const roleNames = ['超级管理员', '管理员', '普通用户', '游客', '测试用户']
|
|
|
+const roleNames = ['超级管理员', '管理员', '普通用户', '游客']
|
|
|
+const menus = [
|
|
|
+ [
|
|
|
+ {
|
|
|
+ path: '/dashboard',
|
|
|
+ component: '#',
|
|
|
+ redirect: '/dashboard/analysis',
|
|
|
+ name: 'Dashboard',
|
|
|
+ status: Mock.Random.integer(0, 1),
|
|
|
+ id: 1,
|
|
|
+ meta: {
|
|
|
+ title: '首页',
|
|
|
+ icon: 'ant-design:dashboard-filled',
|
|
|
+ alwaysShow: true
|
|
|
+ },
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ path: 'analysis',
|
|
|
+ component: 'views/Dashboard/Analysis',
|
|
|
+ name: 'Analysis',
|
|
|
+ status: Mock.Random.integer(0, 1),
|
|
|
+ id: 2,
|
|
|
+ meta: {
|
|
|
+ title: '分析页',
|
|
|
+ noCache: true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ path: 'workplace',
|
|
|
+ component: 'views/Dashboard/Workplace',
|
|
|
+ name: 'Workplace',
|
|
|
+ status: Mock.Random.integer(0, 1),
|
|
|
+ id: 3,
|
|
|
+ meta: {
|
|
|
+ title: '工作台',
|
|
|
+ noCache: true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ path: '/external-link',
|
|
|
+ component: '#',
|
|
|
+ meta: {
|
|
|
+ title: '文档',
|
|
|
+ icon: 'clarity:document-solid'
|
|
|
+ },
|
|
|
+ name: 'ExternalLink',
|
|
|
+ status: Mock.Random.integer(0, 1),
|
|
|
+ id: 4,
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ path: 'https://element-plus-admin-doc.cn/',
|
|
|
+ name: 'DocumentLink',
|
|
|
+ status: Mock.Random.integer(0, 1),
|
|
|
+ id: 5,
|
|
|
+ meta: {
|
|
|
+ title: '文档'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ path: '/level',
|
|
|
+ component: '#',
|
|
|
+ redirect: '/level/menu1/menu1-1/menu1-1-1',
|
|
|
+ name: 'Level',
|
|
|
+ status: Mock.Random.integer(0, 1),
|
|
|
+ id: 6,
|
|
|
+ meta: {
|
|
|
+ title: '菜单',
|
|
|
+ icon: 'carbon:skill-level-advanced'
|
|
|
+ },
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ path: 'menu1',
|
|
|
+ name: 'Menu1',
|
|
|
+ component: '##',
|
|
|
+ status: Mock.Random.integer(0, 1),
|
|
|
+ id: 7,
|
|
|
+ redirect: '/level/menu1/menu1-1/menu1-1-1',
|
|
|
+ meta: {
|
|
|
+ title: '菜单1'
|
|
|
+ },
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ path: 'menu1-1',
|
|
|
+ name: 'Menu11',
|
|
|
+ component: '##',
|
|
|
+ status: Mock.Random.integer(0, 1),
|
|
|
+ id: 8,
|
|
|
+ redirect: '/level/menu1/menu1-1/menu1-1-1',
|
|
|
+ meta: {
|
|
|
+ title: '菜单1-1',
|
|
|
+ alwaysShow: true
|
|
|
+ },
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ path: 'menu1-1-1',
|
|
|
+ name: 'Menu111',
|
|
|
+ component: 'views/Level/Menu111',
|
|
|
+ status: Mock.Random.integer(0, 1),
|
|
|
+ id: 9,
|
|
|
+ permission: ['edit', 'add', 'delete'],
|
|
|
+ meta: {
|
|
|
+ title: '菜单1-1-1',
|
|
|
+ permission: ['edit', 'add', 'delete']
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ path: 'menu1-2',
|
|
|
+ name: 'Menu12',
|
|
|
+ component: 'views/Level/Menu12',
|
|
|
+ status: Mock.Random.integer(0, 1),
|
|
|
+ id: 10,
|
|
|
+ permission: ['edit', 'add', 'delete'],
|
|
|
+ meta: {
|
|
|
+ title: '菜单1-2',
|
|
|
+ permission: ['edit', 'add', 'delete']
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ path: 'menu2',
|
|
|
+ name: 'Menu2Demo',
|
|
|
+ component: 'views/Level/Menu2',
|
|
|
+ status: Mock.Random.integer(0, 1),
|
|
|
+ id: 11,
|
|
|
+ permission: ['edit', 'add', 'delete'],
|
|
|
+ meta: {
|
|
|
+ title: '菜单2',
|
|
|
+ permission: ['edit', 'add', 'delete']
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ path: '/example',
|
|
|
+ component: '#',
|
|
|
+ redirect: '/example/example-dialog',
|
|
|
+ name: 'Example',
|
|
|
+ status: Mock.Random.integer(0, 1),
|
|
|
+ id: 12,
|
|
|
+ meta: {
|
|
|
+ title: '综合示例',
|
|
|
+ icon: 'ep:management',
|
|
|
+ alwaysShow: true
|
|
|
+ },
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ path: 'example-dialog',
|
|
|
+ component: 'views/Example/Dialog/ExampleDialog',
|
|
|
+ name: 'ExampleDialog',
|
|
|
+ status: Mock.Random.integer(0, 1),
|
|
|
+ id: 13,
|
|
|
+ permission: ['edit', 'add', 'delete'],
|
|
|
+ meta: {
|
|
|
+ title: '综合示例-弹窗',
|
|
|
+ permission: ['edit', 'add', 'delete']
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ path: 'example-page',
|
|
|
+ component: 'views/Example/Page/ExamplePage',
|
|
|
+ name: 'ExamplePage',
|
|
|
+ status: Mock.Random.integer(0, 1),
|
|
|
+ id: 14,
|
|
|
+ permission: ['edit', 'add', 'delete'],
|
|
|
+ meta: {
|
|
|
+ title: '综合示例-页面',
|
|
|
+ permission: ['edit', 'add', 'delete']
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ path: 'example-add',
|
|
|
+ component: 'views/Example/Page/ExampleAdd',
|
|
|
+ name: 'ExampleAdd',
|
|
|
+ status: Mock.Random.integer(0, 1),
|
|
|
+ id: 15,
|
|
|
+ permission: ['edit', 'add', 'delete'],
|
|
|
+ meta: {
|
|
|
+ title: '综合示例-新增',
|
|
|
+ noTagsView: true,
|
|
|
+ noCache: true,
|
|
|
+ hidden: true,
|
|
|
+ showMainRoute: true,
|
|
|
+ activeMenu: '/example/example-page',
|
|
|
+ permission: ['edit', 'add', 'delete']
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ path: 'example-edit',
|
|
|
+ component: 'views/Example/Page/ExampleEdit',
|
|
|
+ name: 'ExampleEdit',
|
|
|
+ status: Mock.Random.integer(0, 1),
|
|
|
+ id: 16,
|
|
|
+ permission: ['edit', 'add', 'delete'],
|
|
|
+ meta: {
|
|
|
+ title: '综合示例-编辑',
|
|
|
+ noTagsView: true,
|
|
|
+ noCache: true,
|
|
|
+ hidden: true,
|
|
|
+ showMainRoute: true,
|
|
|
+ activeMenu: '/example/example-page',
|
|
|
+ permission: ['edit', 'add', 'delete']
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ path: 'example-detail',
|
|
|
+ component: 'views/Example/Page/ExampleDetail',
|
|
|
+ name: 'ExampleDetail',
|
|
|
+ status: Mock.Random.integer(0, 1),
|
|
|
+ id: 17,
|
|
|
+ permission: ['edit', 'add', 'delete'],
|
|
|
+ meta: {
|
|
|
+ title: '综合示例-详情',
|
|
|
+ noTagsView: true,
|
|
|
+ noCache: true,
|
|
|
+ hidden: true,
|
|
|
+ showMainRoute: true,
|
|
|
+ activeMenu: '/example/example-page',
|
|
|
+ permission: ['edit', 'add', 'delete']
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ {
|
|
|
+ path: '/dashboard',
|
|
|
+ component: '#',
|
|
|
+ redirect: '/dashboard/analysis',
|
|
|
+ name: 'Dashboard',
|
|
|
+ status: Mock.Random.integer(0, 1),
|
|
|
+ id: 1,
|
|
|
+ meta: {
|
|
|
+ title: '首页',
|
|
|
+ icon: 'ant-design:dashboard-filled',
|
|
|
+ alwaysShow: true
|
|
|
+ },
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ path: 'analysis',
|
|
|
+ component: 'views/Dashboard/Analysis',
|
|
|
+ name: 'Analysis',
|
|
|
+ status: Mock.Random.integer(0, 1),
|
|
|
+ id: 2,
|
|
|
+ meta: {
|
|
|
+ title: '分析页',
|
|
|
+ noCache: true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ path: 'workplace',
|
|
|
+ component: 'views/Dashboard/Workplace',
|
|
|
+ name: 'Workplace',
|
|
|
+ status: Mock.Random.integer(0, 1),
|
|
|
+ id: 3,
|
|
|
+ meta: {
|
|
|
+ title: '工作台',
|
|
|
+ noCache: true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ {
|
|
|
+ path: '/external-link',
|
|
|
+ component: '#',
|
|
|
+ meta: {
|
|
|
+ title: '文档',
|
|
|
+ icon: 'clarity:document-solid'
|
|
|
+ },
|
|
|
+ name: 'ExternalLink',
|
|
|
+ status: Mock.Random.integer(0, 1),
|
|
|
+ id: 4,
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ path: 'https://element-plus-admin-doc.cn/',
|
|
|
+ name: 'DocumentLink',
|
|
|
+ status: Mock.Random.integer(0, 1),
|
|
|
+ id: 5,
|
|
|
+ meta: {
|
|
|
+ title: '文档'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ path: '/level',
|
|
|
+ component: '#',
|
|
|
+ redirect: '/level/menu1/menu1-1/menu1-1-1',
|
|
|
+ name: 'Level',
|
|
|
+ status: Mock.Random.integer(0, 1),
|
|
|
+ id: 6,
|
|
|
+ meta: {
|
|
|
+ title: '菜单',
|
|
|
+ icon: 'carbon:skill-level-advanced'
|
|
|
+ },
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ path: 'menu1',
|
|
|
+ name: 'Menu1',
|
|
|
+ component: '##',
|
|
|
+ status: Mock.Random.integer(0, 1),
|
|
|
+ id: 7,
|
|
|
+ redirect: '/level/menu1/menu1-1/menu1-1-1',
|
|
|
+ meta: {
|
|
|
+ title: '菜单1'
|
|
|
+ },
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ path: 'menu1-1',
|
|
|
+ name: 'Menu11',
|
|
|
+ component: '##',
|
|
|
+ status: Mock.Random.integer(0, 1),
|
|
|
+ id: 8,
|
|
|
+ redirect: '/level/menu1/menu1-1/menu1-1-1',
|
|
|
+ meta: {
|
|
|
+ title: '菜单1-1',
|
|
|
+ alwaysShow: true
|
|
|
+ },
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ path: 'menu1-1-1',
|
|
|
+ name: 'Menu111',
|
|
|
+ component: 'views/Level/Menu111',
|
|
|
+ status: Mock.Random.integer(0, 1),
|
|
|
+ id: 9,
|
|
|
+ permission: ['edit', 'add', 'delete'],
|
|
|
+ meta: {
|
|
|
+ title: '菜单1-1-1',
|
|
|
+ permission: ['edit', 'add', 'delete']
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ path: 'menu1-2',
|
|
|
+ name: 'Menu12',
|
|
|
+ component: 'views/Level/Menu12',
|
|
|
+ status: Mock.Random.integer(0, 1),
|
|
|
+ id: 10,
|
|
|
+ permission: ['edit', 'add', 'delete'],
|
|
|
+ meta: {
|
|
|
+ title: '菜单1-2',
|
|
|
+ permission: ['edit', 'add', 'delete']
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ path: 'menu2',
|
|
|
+ name: 'Menu2Demo',
|
|
|
+ component: 'views/Level/Menu2',
|
|
|
+ status: Mock.Random.integer(0, 1),
|
|
|
+ id: 11,
|
|
|
+ permission: ['edit', 'add', 'delete'],
|
|
|
+ meta: {
|
|
|
+ title: '菜单2',
|
|
|
+ permission: ['edit', 'add', 'delete']
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ {
|
|
|
+ path: '/example',
|
|
|
+ component: '#',
|
|
|
+ redirect: '/example/example-dialog',
|
|
|
+ name: 'Example',
|
|
|
+ status: Mock.Random.integer(0, 1),
|
|
|
+ id: 12,
|
|
|
+ meta: {
|
|
|
+ title: '综合示例',
|
|
|
+ icon: 'ep:management',
|
|
|
+ alwaysShow: true
|
|
|
+ },
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ path: 'example-detail',
|
|
|
+ component: 'views/Example/Page/ExampleDetail',
|
|
|
+ name: 'ExampleDetail',
|
|
|
+ status: Mock.Random.integer(0, 1),
|
|
|
+ id: 17,
|
|
|
+ permission: ['edit', 'add', 'delete'],
|
|
|
+ meta: {
|
|
|
+ title: '综合示例-详情',
|
|
|
+ noTagsView: true,
|
|
|
+ noCache: true,
|
|
|
+ hidden: true,
|
|
|
+ showMainRoute: true,
|
|
|
+ activeMenu: '/example/example-page',
|
|
|
+ permission: ['edit', 'add', 'delete']
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ]
|
|
|
+]
|
|
|
|
|
|
-for (let i = 0; i < 5; i++) {
|
|
|
+for (let i = 0; i < 4; i++) {
|
|
|
List.push(
|
|
|
Mock.mock({
|
|
|
id: toAnyString(),
|
|
@@ -542,7 +946,8 @@ for (let i = 0; i < 5; i++) {
|
|
|
role: '@first',
|
|
|
status: Mock.Random.integer(0, 1),
|
|
|
createTime: '@datetime',
|
|
|
- remark: '@cword(10, 15)'
|
|
|
+ remark: '@cword(10, 15)',
|
|
|
+ menu: menus[i]
|
|
|
})
|
|
|
)
|
|
|
}
|
|
@@ -573,7 +978,7 @@ export default [
|
|
|
code: code,
|
|
|
data: {
|
|
|
list: List,
|
|
|
- total: 5
|
|
|
+ total: 4
|
|
|
}
|
|
|
}
|
|
|
}
|