mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-02-03 10:58:43 +08:00
fix(mock): menu list api loss type
field
This commit is contained in:
parent
b69dcd79d7
commit
41854121f3
@ -22,7 +22,7 @@ const roleList = (() => {
|
|||||||
const result: any[] = [];
|
const result: any[] = [];
|
||||||
for (let index = 0; index < 4; index++) {
|
for (let index = 0; index < 4; index++) {
|
||||||
result.push({
|
result.push({
|
||||||
id: `${index}`,
|
id: index + 1,
|
||||||
orderNo: `${index + 1}`,
|
orderNo: `${index + 1}`,
|
||||||
roleName: ['超级管理员', '管理员', '文章管理员', '普通用户'][index],
|
roleName: ['超级管理员', '管理员', '文章管理员', '普通用户'][index],
|
||||||
roleValue: '@first',
|
roleValue: '@first',
|
||||||
@ -72,6 +72,7 @@ const menuList = (() => {
|
|||||||
id: `${index}`,
|
id: `${index}`,
|
||||||
icon: ['ion:layers-outline', 'ion:git-compare-outline', 'ion:tv-outline'][index],
|
icon: ['ion:layers-outline', 'ion:git-compare-outline', 'ion:tv-outline'][index],
|
||||||
component: 'LAYOUT',
|
component: 'LAYOUT',
|
||||||
|
type: '0',
|
||||||
menuName: ['Dashboard', '权限管理', '功能'][index],
|
menuName: ['Dashboard', '权限管理', '功能'][index],
|
||||||
permission: '',
|
permission: '',
|
||||||
orderNo: index + 1,
|
orderNo: index + 1,
|
||||||
@ -82,6 +83,7 @@ const menuList = (() => {
|
|||||||
for (let j = 0; j < 4; j++) {
|
for (let j = 0; j < 4; j++) {
|
||||||
children.push({
|
children.push({
|
||||||
id: `${index}-${j}`,
|
id: `${index}-${j}`,
|
||||||
|
type: '1',
|
||||||
menuName: ['菜单1', '菜单2', '菜单3', '菜单4'][j],
|
menuName: ['菜单1', '菜单2', '菜单3', '菜单4'][j],
|
||||||
icon: 'ion:document',
|
icon: 'ion:document',
|
||||||
permission: ['menu1:view', 'menu2:add', 'menu3:update', 'menu4:del'][index],
|
permission: ['menu1:view', 'menu2:add', 'menu3:update', 'menu4:del'][index],
|
||||||
@ -95,7 +97,33 @@ const menuList = (() => {
|
|||||||
createTime: '@datetime',
|
createTime: '@datetime',
|
||||||
'status|1': ['0', '1'],
|
'status|1': ['0', '1'],
|
||||||
parentMenu: `${index}`,
|
parentMenu: `${index}`,
|
||||||
children: undefined,
|
children: (() => {
|
||||||
|
const children: any[] = [];
|
||||||
|
for (let k = 0; k < 4; k++) {
|
||||||
|
children.push({
|
||||||
|
id: `${index}-${j}-${k}`,
|
||||||
|
type: '2',
|
||||||
|
menuName: '按钮' + (j + 1) + '-' + (k + 1),
|
||||||
|
icon: '',
|
||||||
|
permission:
|
||||||
|
['menu1:view', 'menu2:add', 'menu3:update', 'menu4:del'][index] +
|
||||||
|
':btn' +
|
||||||
|
(k + 1),
|
||||||
|
component: [
|
||||||
|
'/dashboard/welcome/index',
|
||||||
|
'/dashboard/analysis/index',
|
||||||
|
'/dashboard/workbench/index',
|
||||||
|
'/dashboard/test/index',
|
||||||
|
][j],
|
||||||
|
orderNo: j + 1,
|
||||||
|
createTime: '@datetime',
|
||||||
|
'status|1': ['0', '1'],
|
||||||
|
parentMenu: `${index}-${j}`,
|
||||||
|
children: undefined,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return children;
|
||||||
|
})(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return children;
|
return children;
|
||||||
|
Loading…
Reference in New Issue
Block a user