Commit 41854121f3713dbde236afd3a416e9f27bd0c673
1 parent
b69dcd79
fix(mock): menu list api loss `type` field
Showing
1 changed file
with
30 additions
and
2 deletions
mock/demo/system.ts
@@ -22,7 +22,7 @@ const roleList = (() => { | @@ -22,7 +22,7 @@ const roleList = (() => { | ||
22 | const result: any[] = []; | 22 | const result: any[] = []; |
23 | for (let index = 0; index < 4; index++) { | 23 | for (let index = 0; index < 4; index++) { |
24 | result.push({ | 24 | result.push({ |
25 | - id: `${index}`, | 25 | + id: index + 1, |
26 | orderNo: `${index + 1}`, | 26 | orderNo: `${index + 1}`, |
27 | roleName: ['超级管理员', '管理员', '文章管理员', '普通用户'][index], | 27 | roleName: ['超级管理员', '管理员', '文章管理员', '普通用户'][index], |
28 | roleValue: '@first', | 28 | roleValue: '@first', |
@@ -72,6 +72,7 @@ const menuList = (() => { | @@ -72,6 +72,7 @@ const menuList = (() => { | ||
72 | id: `${index}`, | 72 | id: `${index}`, |
73 | icon: ['ion:layers-outline', 'ion:git-compare-outline', 'ion:tv-outline'][index], | 73 | icon: ['ion:layers-outline', 'ion:git-compare-outline', 'ion:tv-outline'][index], |
74 | component: 'LAYOUT', | 74 | component: 'LAYOUT', |
75 | + type: '0', | ||
75 | menuName: ['Dashboard', '权限管理', '功能'][index], | 76 | menuName: ['Dashboard', '权限管理', '功能'][index], |
76 | permission: '', | 77 | permission: '', |
77 | orderNo: index + 1, | 78 | orderNo: index + 1, |
@@ -82,6 +83,7 @@ const menuList = (() => { | @@ -82,6 +83,7 @@ const menuList = (() => { | ||
82 | for (let j = 0; j < 4; j++) { | 83 | for (let j = 0; j < 4; j++) { |
83 | children.push({ | 84 | children.push({ |
84 | id: `${index}-${j}`, | 85 | id: `${index}-${j}`, |
86 | + type: '1', | ||
85 | menuName: ['菜单1', '菜单2', '菜单3', '菜单4'][j], | 87 | menuName: ['菜单1', '菜单2', '菜单3', '菜单4'][j], |
86 | icon: 'ion:document', | 88 | icon: 'ion:document', |
87 | permission: ['menu1:view', 'menu2:add', 'menu3:update', 'menu4:del'][index], | 89 | permission: ['menu1:view', 'menu2:add', 'menu3:update', 'menu4:del'][index], |
@@ -95,7 +97,33 @@ const menuList = (() => { | @@ -95,7 +97,33 @@ const menuList = (() => { | ||
95 | createTime: '@datetime', | 97 | createTime: '@datetime', |
96 | 'status|1': ['0', '1'], | 98 | 'status|1': ['0', '1'], |
97 | parentMenu: `${index}`, | 99 | parentMenu: `${index}`, |
98 | - children: undefined, | 100 | + children: (() => { |
101 | + const children: any[] = []; | ||
102 | + for (let k = 0; k < 4; k++) { | ||
103 | + children.push({ | ||
104 | + id: `${index}-${j}-${k}`, | ||
105 | + type: '2', | ||
106 | + menuName: '按钮' + (j + 1) + '-' + (k + 1), | ||
107 | + icon: '', | ||
108 | + permission: | ||
109 | + ['menu1:view', 'menu2:add', 'menu3:update', 'menu4:del'][index] + | ||
110 | + ':btn' + | ||
111 | + (k + 1), | ||
112 | + component: [ | ||
113 | + '/dashboard/welcome/index', | ||
114 | + '/dashboard/analysis/index', | ||
115 | + '/dashboard/workbench/index', | ||
116 | + '/dashboard/test/index', | ||
117 | + ][j], | ||
118 | + orderNo: j + 1, | ||
119 | + createTime: '@datetime', | ||
120 | + 'status|1': ['0', '1'], | ||
121 | + parentMenu: `${index}-${j}`, | ||
122 | + children: undefined, | ||
123 | + }); | ||
124 | + } | ||
125 | + return children; | ||
126 | + })(), | ||
99 | }); | 127 | }); |
100 | } | 128 | } |
101 | return children; | 129 | return children; |