2023-12-25 17:25:33 +08:00
|
|
|
import Mock from 'mockjs'
|
2023-11-30 11:34:39 +08:00
|
|
|
import { SUCCESS_CODE } from '@/constants'
|
2023-08-05 17:43:24 +08:00
|
|
|
|
2023-12-10 10:11:14 +08:00
|
|
|
const timeout = 1000
|
2023-08-05 17:43:24 +08:00
|
|
|
|
|
|
|
export default [
|
|
|
|
// 列表接口
|
|
|
|
{
|
2023-11-29 15:34:17 +08:00
|
|
|
url: '/mock/menu/list',
|
2023-12-10 10:11:14 +08:00
|
|
|
method: 'get',
|
|
|
|
timeout,
|
|
|
|
response: () => {
|
2023-08-05 17:43:24 +08:00
|
|
|
return {
|
2023-11-30 11:34:39 +08:00
|
|
|
code: SUCCESS_CODE,
|
2023-08-05 17:43:24 +08:00
|
|
|
data: {
|
2023-09-18 16:34:08 +08:00
|
|
|
list: [
|
|
|
|
{
|
|
|
|
path: '/dashboard',
|
|
|
|
component: '#',
|
|
|
|
redirect: '/dashboard/analysis',
|
|
|
|
name: 'Dashboard',
|
2023-12-25 17:25:33 +08:00
|
|
|
status: Mock.Random.integer(0, 1),
|
2023-09-18 16:34:08 +08:00
|
|
|
id: 1,
|
2023-11-12 11:37:28 +08:00
|
|
|
type: 0,
|
|
|
|
parentId: undefined,
|
2023-10-14 10:43:04 +08:00
|
|
|
title: '首页',
|
2023-09-18 16:34:08 +08:00
|
|
|
meta: {
|
|
|
|
title: '首页',
|
|
|
|
icon: 'ant-design:dashboard-filled',
|
|
|
|
alwaysShow: true
|
|
|
|
},
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: 'analysis',
|
|
|
|
component: 'views/Dashboard/Analysis',
|
|
|
|
name: 'Analysis',
|
2023-12-25 17:25:33 +08:00
|
|
|
status: Mock.Random.integer(0, 1),
|
2023-09-18 16:34:08 +08:00
|
|
|
id: 2,
|
2023-11-12 11:37:28 +08:00
|
|
|
type: 1,
|
|
|
|
parentId: 1,
|
2023-10-14 10:43:04 +08:00
|
|
|
title: '分析页',
|
2023-11-12 11:37:28 +08:00
|
|
|
permissionList: [
|
|
|
|
{
|
|
|
|
label: '新增',
|
|
|
|
value: 'add'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '编辑',
|
|
|
|
value: 'edit'
|
|
|
|
}
|
|
|
|
],
|
2023-09-18 16:34:08 +08:00
|
|
|
meta: {
|
|
|
|
title: '分析页',
|
2023-11-12 11:37:28 +08:00
|
|
|
noCache: true,
|
|
|
|
permission: ['add', 'edit']
|
2023-09-18 16:34:08 +08:00
|
|
|
}
|
2023-08-05 17:43:24 +08:00
|
|
|
},
|
2023-09-18 16:34:08 +08:00
|
|
|
{
|
|
|
|
path: 'workplace',
|
|
|
|
component: 'views/Dashboard/Workplace',
|
|
|
|
name: 'Workplace',
|
2023-12-25 17:25:33 +08:00
|
|
|
status: Mock.Random.integer(0, 1),
|
2023-09-18 16:34:08 +08:00
|
|
|
id: 3,
|
2023-11-12 11:37:28 +08:00
|
|
|
type: 1,
|
|
|
|
parentId: 1,
|
2023-10-14 10:43:04 +08:00
|
|
|
title: '工作台',
|
2023-11-12 11:37:28 +08:00
|
|
|
permissionList: [
|
|
|
|
{
|
|
|
|
label: '新增',
|
|
|
|
value: 'add'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '编辑',
|
|
|
|
value: 'edit'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '删除',
|
|
|
|
value: 'delete'
|
|
|
|
}
|
|
|
|
],
|
2023-09-18 16:34:08 +08:00
|
|
|
meta: {
|
|
|
|
title: '工作台',
|
|
|
|
noCache: true
|
2023-08-05 17:43:24 +08:00
|
|
|
}
|
2023-09-18 16:34:08 +08:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/external-link',
|
|
|
|
component: '#',
|
|
|
|
meta: {
|
|
|
|
title: '文档',
|
|
|
|
icon: 'clarity:document-solid'
|
2023-08-05 17:43:24 +08:00
|
|
|
},
|
2023-09-18 16:34:08 +08:00
|
|
|
name: 'ExternalLink',
|
2023-12-25 17:25:33 +08:00
|
|
|
status: Mock.Random.integer(0, 1),
|
2023-09-18 16:34:08 +08:00
|
|
|
id: 4,
|
2023-11-12 11:37:28 +08:00
|
|
|
type: 0,
|
|
|
|
parentId: undefined,
|
|
|
|
title: '文档',
|
2023-09-18 16:34:08 +08:00
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: 'https://element-plus-admin-doc.cn/',
|
|
|
|
name: 'DocumentLink',
|
2023-12-25 17:25:33 +08:00
|
|
|
status: Mock.Random.integer(0, 1),
|
2023-09-18 16:34:08 +08:00
|
|
|
id: 5,
|
2023-11-12 11:37:28 +08:00
|
|
|
type: 1,
|
|
|
|
parentId: 4,
|
2023-10-14 10:43:04 +08:00
|
|
|
title: '文档',
|
2023-09-18 16:34:08 +08:00
|
|
|
meta: {
|
|
|
|
title: '文档'
|
2023-08-05 17:43:24 +08:00
|
|
|
}
|
2023-09-18 16:34:08 +08:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/level',
|
|
|
|
component: '#',
|
|
|
|
redirect: '/level/menu1/menu1-1/menu1-1-1',
|
|
|
|
name: 'Level',
|
2023-12-25 17:25:33 +08:00
|
|
|
status: Mock.Random.integer(0, 1),
|
2023-09-18 16:34:08 +08:00
|
|
|
id: 6,
|
2023-11-12 11:37:28 +08:00
|
|
|
type: 0,
|
|
|
|
parentId: undefined,
|
2023-10-14 10:43:04 +08:00
|
|
|
title: '菜单',
|
2023-09-18 16:34:08 +08:00
|
|
|
meta: {
|
|
|
|
title: '菜单',
|
|
|
|
icon: 'carbon:skill-level-advanced'
|
2023-08-05 17:43:24 +08:00
|
|
|
},
|
2023-09-18 16:34:08 +08:00
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: 'menu1',
|
|
|
|
name: 'Menu1',
|
|
|
|
component: '##',
|
2023-12-25 17:25:33 +08:00
|
|
|
status: Mock.Random.integer(0, 1),
|
2023-09-18 16:34:08 +08:00
|
|
|
id: 7,
|
2023-11-12 11:37:28 +08:00
|
|
|
type: 0,
|
|
|
|
parentId: 6,
|
2023-10-14 10:43:04 +08:00
|
|
|
title: '菜单1',
|
2023-11-12 11:37:28 +08:00
|
|
|
redirect: '/level/menu1/menu1-1/menu1-1-1',
|
2023-09-18 16:34:08 +08:00
|
|
|
meta: {
|
|
|
|
title: '菜单1'
|
|
|
|
},
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: 'menu1-1',
|
|
|
|
name: 'Menu11',
|
|
|
|
component: '##',
|
2023-12-25 17:25:33 +08:00
|
|
|
status: Mock.Random.integer(0, 1),
|
2023-09-18 16:34:08 +08:00
|
|
|
id: 8,
|
2023-11-12 11:37:28 +08:00
|
|
|
type: 0,
|
|
|
|
parentId: 7,
|
2023-10-14 10:43:04 +08:00
|
|
|
title: '菜单1-1',
|
2023-11-12 11:37:28 +08:00
|
|
|
redirect: '/level/menu1/menu1-1/menu1-1-1',
|
2023-09-18 16:34:08 +08:00
|
|
|
meta: {
|
|
|
|
title: '菜单1-1',
|
|
|
|
alwaysShow: true
|
2023-08-05 17:43:24 +08:00
|
|
|
},
|
2023-09-18 16:34:08 +08:00
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: 'menu1-1-1',
|
|
|
|
name: 'Menu111',
|
|
|
|
component: 'views/Level/Menu111',
|
2023-12-25 17:25:33 +08:00
|
|
|
status: Mock.Random.integer(0, 1),
|
2023-09-18 16:34:08 +08:00
|
|
|
id: 9,
|
2023-11-12 11:37:28 +08:00
|
|
|
type: 1,
|
|
|
|
parentId: 8,
|
2023-10-14 10:43:04 +08:00
|
|
|
title: '菜单1-1-1',
|
2023-09-18 16:34:08 +08:00
|
|
|
meta: {
|
|
|
|
title: '菜单1-1-1'
|
|
|
|
}
|
2023-08-05 17:43:24 +08:00
|
|
|
}
|
2023-09-18 16:34:08 +08:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'menu1-2',
|
|
|
|
name: 'Menu12',
|
|
|
|
component: 'views/Level/Menu12',
|
2023-12-25 17:25:33 +08:00
|
|
|
status: Mock.Random.integer(0, 1),
|
2023-09-18 16:34:08 +08:00
|
|
|
id: 10,
|
2023-11-12 11:37:28 +08:00
|
|
|
type: 1,
|
|
|
|
parentId: 7,
|
2023-10-14 10:43:04 +08:00
|
|
|
title: '菜单1-2',
|
2023-09-18 16:34:08 +08:00
|
|
|
meta: {
|
|
|
|
title: '菜单1-2'
|
2023-08-05 17:43:24 +08:00
|
|
|
}
|
|
|
|
}
|
2023-09-18 16:34:08 +08:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'menu2',
|
|
|
|
name: 'Menu2Demo',
|
|
|
|
component: 'views/Level/Menu2',
|
2023-12-25 17:25:33 +08:00
|
|
|
status: Mock.Random.integer(0, 1),
|
2023-09-18 16:34:08 +08:00
|
|
|
id: 11,
|
2023-11-12 11:37:28 +08:00
|
|
|
type: 1,
|
|
|
|
parentId: 6,
|
2023-10-14 10:43:04 +08:00
|
|
|
title: '菜单2',
|
2023-09-18 16:34:08 +08:00
|
|
|
meta: {
|
|
|
|
title: '菜单2'
|
2023-08-05 17:43:24 +08:00
|
|
|
}
|
2023-09-18 16:34:08 +08:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/example',
|
|
|
|
component: '#',
|
|
|
|
redirect: '/example/example-dialog',
|
|
|
|
name: 'Example',
|
2023-12-25 17:25:33 +08:00
|
|
|
status: Mock.Random.integer(0, 1),
|
2023-09-18 16:34:08 +08:00
|
|
|
id: 12,
|
2023-11-12 11:37:28 +08:00
|
|
|
type: 0,
|
|
|
|
parentId: undefined,
|
2023-10-14 10:43:04 +08:00
|
|
|
title: '综合示例',
|
2023-09-18 16:34:08 +08:00
|
|
|
meta: {
|
|
|
|
title: '综合示例',
|
|
|
|
icon: 'ep:management',
|
|
|
|
alwaysShow: true
|
2023-08-05 17:43:24 +08:00
|
|
|
},
|
2023-09-18 16:34:08 +08:00
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: 'example-dialog',
|
|
|
|
component: 'views/Example/Dialog/ExampleDialog',
|
|
|
|
name: 'ExampleDialog',
|
2023-12-25 17:25:33 +08:00
|
|
|
status: Mock.Random.integer(0, 1),
|
2023-09-18 16:34:08 +08:00
|
|
|
id: 13,
|
2023-11-12 11:37:28 +08:00
|
|
|
type: 1,
|
|
|
|
parentId: 12,
|
2023-10-14 10:43:04 +08:00
|
|
|
title: '综合示例-弹窗',
|
2023-11-12 11:37:28 +08:00
|
|
|
permissionList: [
|
|
|
|
{
|
|
|
|
label: '新增',
|
|
|
|
value: 'add'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '编辑',
|
|
|
|
value: 'edit'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '删除',
|
|
|
|
value: 'delete'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '查看',
|
|
|
|
value: 'view'
|
|
|
|
}
|
|
|
|
],
|
2023-09-18 16:34:08 +08:00
|
|
|
meta: {
|
2023-11-12 11:37:28 +08:00
|
|
|
title: '综合示例-弹窗'
|
2023-09-18 16:34:08 +08:00
|
|
|
}
|
2023-08-05 17:43:24 +08:00
|
|
|
},
|
2023-09-18 16:34:08 +08:00
|
|
|
{
|
|
|
|
path: 'example-page',
|
|
|
|
component: 'views/Example/Page/ExamplePage',
|
|
|
|
name: 'ExamplePage',
|
2023-12-25 17:25:33 +08:00
|
|
|
status: Mock.Random.integer(0, 1),
|
2023-09-18 16:34:08 +08:00
|
|
|
id: 14,
|
2023-11-12 11:37:28 +08:00
|
|
|
type: 1,
|
|
|
|
parentId: 12,
|
2023-10-14 10:43:04 +08:00
|
|
|
title: '综合示例-页面',
|
2023-11-12 11:37:28 +08:00
|
|
|
permissionList: [
|
|
|
|
{
|
|
|
|
label: '新增',
|
|
|
|
value: 'edit'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '编辑',
|
|
|
|
value: 'edit'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '删除',
|
|
|
|
value: 'delete'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '查看',
|
|
|
|
value: 'view'
|
|
|
|
}
|
|
|
|
],
|
2023-09-18 16:34:08 +08:00
|
|
|
meta: {
|
2023-11-12 11:37:28 +08:00
|
|
|
title: '综合示例-页面'
|
2023-09-18 16:34:08 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'example-add',
|
|
|
|
component: 'views/Example/Page/ExampleAdd',
|
|
|
|
name: 'ExampleAdd',
|
2023-12-25 17:25:33 +08:00
|
|
|
status: Mock.Random.integer(0, 1),
|
2023-09-18 16:34:08 +08:00
|
|
|
id: 15,
|
2023-11-12 11:37:28 +08:00
|
|
|
type: 1,
|
|
|
|
parentId: 12,
|
2023-10-14 10:43:04 +08:00
|
|
|
title: '综合示例-新增',
|
2023-09-18 16:34:08 +08:00
|
|
|
meta: {
|
|
|
|
title: '综合示例-新增',
|
|
|
|
noTagsView: true,
|
|
|
|
noCache: true,
|
|
|
|
hidden: true,
|
|
|
|
showMainRoute: true,
|
2023-11-12 11:37:28 +08:00
|
|
|
activeMenu: '/example/example-page'
|
2023-09-18 16:34:08 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'example-edit',
|
|
|
|
component: 'views/Example/Page/ExampleEdit',
|
|
|
|
name: 'ExampleEdit',
|
2023-12-25 17:25:33 +08:00
|
|
|
status: Mock.Random.integer(0, 1),
|
2023-09-18 16:34:08 +08:00
|
|
|
id: 16,
|
2023-11-12 11:37:28 +08:00
|
|
|
type: 1,
|
|
|
|
parentId: 12,
|
2023-10-14 10:43:04 +08:00
|
|
|
title: '综合示例-编辑',
|
2023-09-18 16:34:08 +08:00
|
|
|
meta: {
|
|
|
|
title: '综合示例-编辑',
|
|
|
|
noTagsView: true,
|
|
|
|
noCache: true,
|
|
|
|
hidden: true,
|
|
|
|
showMainRoute: true,
|
2023-11-12 11:37:28 +08:00
|
|
|
activeMenu: '/example/example-page'
|
2023-09-18 16:34:08 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'example-detail',
|
|
|
|
component: 'views/Example/Page/ExampleDetail',
|
|
|
|
name: 'ExampleDetail',
|
2023-12-25 17:25:33 +08:00
|
|
|
status: Mock.Random.integer(0, 1),
|
2023-09-18 16:34:08 +08:00
|
|
|
id: 17,
|
2023-11-12 11:37:28 +08:00
|
|
|
type: 1,
|
|
|
|
parentId: 12,
|
2023-10-14 10:43:04 +08:00
|
|
|
title: '综合示例-详情',
|
2023-09-18 16:34:08 +08:00
|
|
|
meta: {
|
|
|
|
title: '综合示例-详情',
|
|
|
|
noTagsView: true,
|
|
|
|
noCache: true,
|
|
|
|
hidden: true,
|
|
|
|
showMainRoute: true,
|
2023-11-12 11:37:28 +08:00
|
|
|
activeMenu: '/example/example-page'
|
2023-08-05 17:43:24 +08:00
|
|
|
}
|
2023-09-18 16:34:08 +08:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
2023-08-05 17:43:24 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-11-29 15:34:17 +08:00
|
|
|
]
|