kn-cli 1.0.115 → 1.0.116
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import React from 'react';
|
|
3
|
-
// @ts-ignore
|
|
4
|
-
import MenuIcon from '@/components/menuIcon';
|
|
5
|
-
import PageTemplate from './pages/pageTemplate';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const Page1 = React.lazy(() => import('@/pages/demo/page1'));
|
|
9
|
-
const Page2 = React.lazy(() => import('@/pages/demo/page2'));
|
|
10
|
-
const Page3 = React.lazy(() => import('@/pages/demo/page3'));
|
|
11
|
-
|
|
12
|
-
const AuthUser = React.lazy(() => import('@/pages/auth/user'));
|
|
13
|
-
const AuthUserCreate = React.lazy(() => import('@/pages/auth/user/create'));
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* 自动计算菜单权限,使父级菜单权限包含所有子菜单的权限
|
|
18
|
-
* @param {RouteMenuItem} menu
|
|
19
|
-
* @returns {RouteMenuItem}
|
|
20
|
-
*/
|
|
21
|
-
export const UpdateAuth=(menu)=>{
|
|
22
|
-
if(menu.children){
|
|
23
|
-
|
|
24
|
-
let auths= menu.children.map(childMenu=>{
|
|
25
|
-
let _childMenu = UpdateAuth(childMenu);
|
|
26
|
-
if( Array.isArray(_childMenu.auth) ){
|
|
27
|
-
return [..._childMenu.auth];
|
|
28
|
-
}
|
|
29
|
-
return [];
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
if( Array.isArray(menu.auth) ){
|
|
33
|
-
|
|
34
|
-
menu.auth = [...menu.auth,...auths.flat()];
|
|
35
|
-
// @ts-ignore
|
|
36
|
-
menu.auth = [...new Set(menu.auth)];// 去重
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return menu;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export const LoadComponent=(lazyComponent)=>{
|
|
43
|
-
return React.createElement(lazyComponent)
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* @type {RouteMenuItem}
|
|
48
|
-
*/
|
|
49
|
-
const DASHBOARD={
|
|
50
|
-
name:'仪表盘',
|
|
51
|
-
url:'/',
|
|
52
|
-
component:LoadComponent(React.lazy(() => import('@/pages/home'))),
|
|
53
|
-
children:[
|
|
54
|
-
],
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* @type {RouteMenuItem}
|
|
58
|
-
*/
|
|
59
|
-
const DNA={
|
|
60
|
-
name:'基因库',
|
|
61
|
-
url:'/dna',
|
|
62
|
-
auth:true,
|
|
63
|
-
children:[
|
|
64
|
-
{
|
|
65
|
-
name: '父菜单1',
|
|
66
|
-
icon:<MenuIcon name='icon-dep'/>,
|
|
67
|
-
url: '/dna/parent',
|
|
68
|
-
auth:true,
|
|
69
|
-
children:[
|
|
70
|
-
{
|
|
71
|
-
component:<Page1 name='父菜单1-子菜单1'/>,
|
|
72
|
-
name:'子菜单1-1',
|
|
73
|
-
auth:true,
|
|
74
|
-
url:'/dna/parent/child1'
|
|
75
|
-
}
|
|
76
|
-
]
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
name: '父菜单2',
|
|
80
|
-
icon:<MenuIcon name='icon-dep'/>,
|
|
81
|
-
url: '/dna/parent2',
|
|
82
|
-
auth:true,
|
|
83
|
-
children:[
|
|
84
|
-
{
|
|
85
|
-
component:<Page2 name='父菜单2-子菜单1'/>,
|
|
86
|
-
name:'子菜单2-1',
|
|
87
|
-
auth:true,
|
|
88
|
-
url:'/dna/parent2/child1'
|
|
89
|
-
}
|
|
90
|
-
]
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
name: '父菜单3',
|
|
94
|
-
icon:<MenuIcon name='icon-dep'/>,
|
|
95
|
-
url: '/dna/parent3',
|
|
96
|
-
auth:true,
|
|
97
|
-
children:[
|
|
98
|
-
{
|
|
99
|
-
name:'子菜单3-1',
|
|
100
|
-
auth:true,
|
|
101
|
-
url:'/dna/parent3/child1',
|
|
102
|
-
children:[
|
|
103
|
-
{
|
|
104
|
-
component:<Page2 name='父菜单3-子菜单1-子子菜单1'/>,
|
|
105
|
-
name:'子菜单3-1-1',
|
|
106
|
-
auth:true,
|
|
107
|
-
url:'/dna/parent3/child1/child1'
|
|
108
|
-
}
|
|
109
|
-
]
|
|
110
|
-
}
|
|
111
|
-
]
|
|
112
|
-
},
|
|
113
|
-
],
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* @type {RouteMenuItem}
|
|
117
|
-
*/
|
|
118
|
-
const AUTH={
|
|
119
|
-
name:'控制室',
|
|
120
|
-
url:'/auth',
|
|
121
|
-
msgCount:12,
|
|
122
|
-
primaryId:'auth',
|
|
123
|
-
children:[
|
|
124
|
-
{
|
|
125
|
-
name: '用户',
|
|
126
|
-
component:<AuthUser />,
|
|
127
|
-
icon:<MenuIcon name='icon-user'/>,
|
|
128
|
-
url: '/auth/user',
|
|
129
|
-
auth:true,
|
|
130
|
-
primaryId:'authUser',
|
|
131
|
-
msgCount:0,
|
|
132
|
-
children:[
|
|
133
|
-
{
|
|
134
|
-
component:<AuthUserCreate />,
|
|
135
|
-
name:'新建用户',
|
|
136
|
-
url:'/auth/user/create',
|
|
137
|
-
hideMenu:true
|
|
138
|
-
}
|
|
139
|
-
]
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
name: '部门',
|
|
143
|
-
icon:<MenuIcon name='icon-dep'/>,
|
|
144
|
-
url: '/auth/dep',
|
|
145
|
-
auth:true,
|
|
146
|
-
children:[
|
|
147
|
-
{
|
|
148
|
-
component:<PageTemplate name='部门列表' />,
|
|
149
|
-
name:'部门列表',
|
|
150
|
-
url:'/auth/dep/list',
|
|
151
|
-
auth:true,
|
|
152
|
-
children:[
|
|
153
|
-
{
|
|
154
|
-
component:<PageTemplate name='部门详情' />,
|
|
155
|
-
name:'部门详情',
|
|
156
|
-
routeTemplate:'/auth/dep/detail/:id',
|
|
157
|
-
hideMenu:true,
|
|
158
|
-
auth:true,
|
|
159
|
-
}
|
|
160
|
-
]
|
|
161
|
-
},
|
|
162
|
-
|
|
163
|
-
]
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
name: '角色',
|
|
167
|
-
component:<PageTemplate name='角色' />,
|
|
168
|
-
icon:<MenuIcon name='icon-role'/>,
|
|
169
|
-
url: '/auth/role',
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
name: '操作记录',
|
|
173
|
-
component:<PageTemplate name='操作记录' />,
|
|
174
|
-
icon:<MenuIcon name='icon-log'/>,
|
|
175
|
-
url: '/auth/log',
|
|
176
|
-
msgCount:12,
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
name: '登录日志',
|
|
180
|
-
component:<PageTemplate name='登录日志' />,
|
|
181
|
-
icon:<MenuIcon name='icon-loginlog'/>,
|
|
182
|
-
url: '/auth/loginLog',
|
|
183
|
-
},
|
|
184
|
-
],
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
export default [UpdateAuth(DASHBOARD), UpdateAuth(DNA), UpdateAuth(AUTH) ];
|