提交 41854121 编写于 作者: 无木

fix(mock): menu list api loss `type` field

上级 b69dcd79
...@@ -22,7 +22,7 @@ const roleList = (() => { ...@@ -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 = (() => { ...@@ -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 = (() => { ...@@ -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 = (() => { ...@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册