tntd 1.3.65 → 1.4.1
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/.eslintignore +2 -1
- package/babel.config.js +2 -2
- package/dist/0645cf743e4e44ca9da321d689897f07.png +0 -0
- package/dist/09db77de0c24fa0f45f8a5cf299a3d11.png +0 -0
- package/dist/1.tntd.js +12 -0
- package/dist/1d0b52448de217857b270af807e9360d.png +0 -0
- package/dist/25d78d77c9c2f0d403e5d899ceb5b1ef.png +0 -0
- package/dist/27fa44ff0c98e1594d79b73045aabedf.png +0 -0
- package/dist/2c95075adb68d6131b59cae9fa554ec2.png +0 -0
- package/dist/377c871d922a25c773a9e7c2f42ed7c0.png +0 -0
- package/dist/3d901589b40bd56ff1fde2bbb700bfe1.png +0 -0
- package/dist/4abe481e130d7be0574e45573de8beb7.png +0 -0
- package/dist/95ee2260a509cd630d89c5367ed1973b.png +0 -0
- package/dist/b9dd5ff3622296fbee51ed68f4bca1bf.png +0 -0
- package/dist/bd2921989f9296089ba58efb7a76f3ef.png +0 -0
- package/dist/stats.json +45855 -0
- package/dist/tntd.css +1 -0
- package/dist/tntd.js +15 -0
- package/es/ArrayInput/README.md +129 -0
- package/es/ArrayInput/icon.js +24 -0
- package/es/ArrayInput/index.js +274 -0
- package/es/ArrayInput/index.less +20 -0
- package/es/AuthContext.js +4 -0
- package/es/Columns/README.md +149 -0
- package/es/Columns/index.js +82 -0
- package/es/Columns/index.less +75 -0
- package/es/DevelopmentLogin/LoginModal.js +117 -0
- package/es/DevelopmentLogin/README.md +49 -0
- package/es/DevelopmentLogin/index.js +40 -0
- package/es/Ellipsis/README.md +104 -0
- package/es/Ellipsis/Svg/CopySVG.js +63 -0
- package/es/Ellipsis/Svg/TickSVG.js +41 -0
- package/es/Ellipsis/index.js +139 -0
- package/es/Ellipsis/index.less +56 -0
- package/es/Handle/README.md +104 -0
- package/es/Handle/index.js +86 -0
- package/es/Handle/index.less +9 -0
- package/es/Icon/README.md +119 -0
- package/es/Icon/fonts/demo.css +539 -0
- package/es/Icon/fonts/demo_index.html +3345 -0
- package/es/Icon/fonts/iconfont.css +569 -0
- package/es/Icon/fonts/iconfont.eot +0 -0
- package/es/Icon/fonts/iconfont.js +41 -0
- package/es/Icon/fonts/iconfont.json +975 -0
- package/es/Icon/fonts/iconfont.svg +440 -0
- package/es/Icon/fonts/iconfont.ttf +0 -0
- package/es/Icon/fonts/iconfont.woff +0 -0
- package/es/Icon/fonts/iconfont.woff2 +0 -0
- package/es/Icon/iconList.js +1 -0
- package/es/Icon/index.js +26 -0
- package/es/Icon/index.less +9 -0
- package/es/Img/Contain.js +69 -0
- package/es/Img/Cover.js +126 -0
- package/es/Img/README.md +131 -0
- package/es/Img/index.js +76 -0
- package/es/Layout/ActionsContext.js +3 -0
- package/es/Layout/AppList.js +223 -0
- package/es/Layout/Application.js +113 -0
- package/es/Layout/Avatar.js +112 -0
- package/es/Layout/CompatibleLanguage.js +177 -0
- package/es/Layout/EnterpriseLayout/Avatar.js +138 -0
- package/es/Layout/EnterpriseLayout/Language.js +81 -0
- package/es/Layout/EnterpriseLayout/Theme.js +75 -0
- package/es/Layout/EnterpriseLayout/index.js +31 -0
- package/es/Layout/GlobalNavigation/NavigationPopup.js +396 -0
- package/es/Layout/GlobalNavigation/index.js +137 -0
- package/es/Layout/Header.js +95 -0
- package/es/Layout/HeaderActions.js +105 -0
- package/es/Layout/HeaderNavs.js +93 -0
- package/es/Layout/HeaderTabs.js +264 -0
- package/es/Layout/Iconfont.js +4 -0
- package/es/Layout/Language.js +81 -0
- package/es/Layout/Layout.js +232 -0
- package/es/Layout/Logo.js +86 -0
- package/es/Layout/OrgAppList.js +304 -0
- package/es/Layout/README.md +783 -0
- package/es/Layout/SideMenu.js +338 -0
- package/es/Layout/Theme.js +105 -0
- package/es/Layout/checkAuth.js +29 -0
- package/es/Layout/createActions.js +39 -0
- package/es/Layout/images/avatar/empty.png +0 -0
- package/es/Layout/images/avatar/female1.png +0 -0
- package/es/Layout/images/avatar/female2.png +0 -0
- package/es/Layout/images/avatar/female3.png +0 -0
- package/es/Layout/images/avatar/female4.png +0 -0
- package/es/Layout/images/avatar/female5.png +0 -0
- package/es/Layout/images/avatar/female6.png +0 -0
- package/es/Layout/images/avatar/male1.png +0 -0
- package/es/Layout/images/avatar/male2.png +0 -0
- package/es/Layout/images/avatar/male3.png +0 -0
- package/es/Layout/images/avatar/male4.png +0 -0
- package/es/Layout/images/avatar/male5.png +0 -0
- package/es/Layout/images/avatar/male6.png +0 -0
- package/es/Layout/images/index.js +35 -0
- package/es/Layout/images/logo/baldur.svg +14 -0
- package/es/Layout/images/logo/bi.svg +14 -0
- package/es/Layout/images/logo/bridge.svg +15 -0
- package/es/Layout/images/logo/convert.svg +18 -0
- package/es/Layout/images/logo/dataocean.svg +31 -0
- package/es/Layout/images/logo/default.svg +19 -0
- package/es/Layout/images/logo/dispatch.svg +14 -0
- package/es/Layout/images/logo/graph.svg +26 -0
- package/es/Layout/images/logo/handle.svg +10 -0
- package/es/Layout/images/logo/indicator.svg +41 -0
- package/es/Layout/images/logo/kafka.svg +12 -0
- package/es/Layout/images/logo/logo-custom.svg +13 -0
- package/es/Layout/images/logo/model.svg +17 -0
- package/es/Layout/images/logo/mysql.svg +15 -0
- package/es/Layout/images/logo/orion.svg +24 -0
- package/es/Layout/images/logo/salaxy.svg +11 -0
- package/es/Layout/images/logo/storage.svg +16 -0
- package/es/Layout/images/logo/tnt_cli_identify.svg +19 -0
- package/es/Layout/images/logo/turing.svg +35 -0
- package/es/Layout/images/theme/theme1.svg +35 -0
- package/es/Layout/images/theme/theme2.svg +33 -0
- package/es/Layout/index.js +122 -0
- package/es/Layout/paaslayout/CompactSideMenu.js +167 -0
- package/es/Layout/paaslayout/Header.js +77 -0
- package/es/Layout/paaslayout/Logo.js +22 -0
- package/es/Layout/paaslayout/SideMenu.js +168 -0
- package/es/Layout/paaslayout/index.js +233 -0
- package/es/Layout/storage.js +47 -0
- package/es/Layout/utils.js +136 -0
- package/es/LoadingButton/README.md +75 -0
- package/es/LoadingButton/index.js +43 -0
- package/es/Modal/README.md +59 -0
- package/es/Modal/index.js +94 -0
- package/es/Modal/index.less +86 -0
- package/es/Page/Box.js +72 -0
- package/es/Page/README.md +180 -0
- package/es/Page/index.js +165 -0
- package/es/Page/index.less +144 -0
- package/es/Page/utils.js +23 -0
- package/es/QueryForm/Field/Checkbox.js +19 -0
- package/es/QueryForm/Field/Select.js +78 -0
- package/es/QueryForm/Field/SelectInput.js +88 -0
- package/es/QueryForm/Field/fieldsMap.js +27 -0
- package/es/QueryForm/Field/index.js +155 -0
- package/es/QueryForm/README.md +512 -0
- package/es/QueryForm/createActions.js +53 -0
- package/es/QueryForm/index.js +376 -0
- package/es/QueryForm/index.less +133 -0
- package/es/QueryForm/useForm.js +7 -0
- package/es/QueryListScene/List.js +376 -0
- package/es/QueryListScene/QueryForm.js +166 -0
- package/es/QueryListScene/QueryListScene.js +76 -0
- package/es/QueryListScene/README.md +790 -0
- package/es/QueryListScene/Title.js +12 -0
- package/es/QueryListScene/Toolbar.js +20 -0
- package/es/QueryListScene/createActions.js +72 -0
- package/es/QueryListScene/index.js +19 -0
- package/es/QueryListScene/index.less +97 -0
- package/es/QueryListScene/useActions.js +7 -0
- package/es/Select/DropDownWrap.js +116 -0
- package/es/Select/README.md +68 -0
- package/es/Select/index.js +618 -0
- package/es/Table/README.md +109 -0
- package/es/Table/ResizableTable/index.js +108 -0
- package/es/Table/ResizableTable/index.less +36 -0
- package/es/Table/index.js +33 -0
- package/es/Title/README.md +106 -0
- package/es/Title/index.js +40 -0
- package/es/Title/index.less +170 -0
- package/es/index.js +19 -0
- package/es/locale.js +60 -0
- package/package.json +1 -1
- package/doc-scripts.config.js +0 -37
- package/doc-scripts.renderer.js +0 -11
- package/docs/README.md +0 -1643
|
@@ -0,0 +1,783 @@
|
|
|
1
|
+
## Layout外框架组件
|
|
2
|
+
### 代码演示
|
|
3
|
+
#### 初始化数据
|
|
4
|
+
```jsx
|
|
5
|
+
import { createGlobalStyle } from 'styled-components';
|
|
6
|
+
import 'antd/dist/antd.css';
|
|
7
|
+
|
|
8
|
+
const GlobalStyle = createGlobalStyle`
|
|
9
|
+
.site-body {
|
|
10
|
+
.ichYgh {
|
|
11
|
+
padding: 0;
|
|
12
|
+
overflow: visible;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
16
|
+
|
|
17
|
+
const icons = [
|
|
18
|
+
"setting",
|
|
19
|
+
"puzzle",
|
|
20
|
+
"plus",
|
|
21
|
+
"minus",
|
|
22
|
+
"selfhood",
|
|
23
|
+
"zhuanzhang",
|
|
24
|
+
"shoukuan",
|
|
25
|
+
"jizhang",
|
|
26
|
+
"database",
|
|
27
|
+
"system",
|
|
28
|
+
"pm",
|
|
29
|
+
"zhibiao",
|
|
30
|
+
"workflow",
|
|
31
|
+
"network",
|
|
32
|
+
"tongji",
|
|
33
|
+
"jianmo",
|
|
34
|
+
"deal-type",
|
|
35
|
+
"org",
|
|
36
|
+
"limit",
|
|
37
|
+
"role",
|
|
38
|
+
"user-group",
|
|
39
|
+
"yunwei",
|
|
40
|
+
"permission",
|
|
41
|
+
"guanjia",
|
|
42
|
+
"pingfen",
|
|
43
|
+
"spider",
|
|
44
|
+
"tag",
|
|
45
|
+
"model",
|
|
46
|
+
"yuce",
|
|
47
|
+
"celve1",
|
|
48
|
+
"check",
|
|
49
|
+
"access",
|
|
50
|
+
"loan",
|
|
51
|
+
"case",
|
|
52
|
+
"entry"
|
|
53
|
+
];
|
|
54
|
+
const menus = [
|
|
55
|
+
{
|
|
56
|
+
code: 'dadicasesearch1',
|
|
57
|
+
enName: 'dadicasesearch1',
|
|
58
|
+
icon: 'home',
|
|
59
|
+
menuName: '案件检索1',
|
|
60
|
+
path: '/orion/case/relation1',
|
|
61
|
+
code: 'relation1'
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
children: new Array(16).fill({
|
|
65
|
+
code: 'dadicasesearch',
|
|
66
|
+
enName: 'dadicasesearch',
|
|
67
|
+
icon: 'home',
|
|
68
|
+
menuName: '案件检索',
|
|
69
|
+
path: '/orion/case/relation'
|
|
70
|
+
}).map((item, index) => ({
|
|
71
|
+
...item,
|
|
72
|
+
code: `${item.code}-${index}`,
|
|
73
|
+
menuName: `${item.menuName}-${index}`,
|
|
74
|
+
path: `${item.path}${index}`
|
|
75
|
+
})),
|
|
76
|
+
code: 'casegraph',
|
|
77
|
+
enName: 'casegraph',
|
|
78
|
+
groupIcon: 'setting',
|
|
79
|
+
groupName: '案件分析'
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
children: [
|
|
83
|
+
{
|
|
84
|
+
code: 'taglist',
|
|
85
|
+
enName: 'taglist',
|
|
86
|
+
icon: 'home',
|
|
87
|
+
menuName: '标签管理',
|
|
88
|
+
path: 'http://baidu.com/orion/tag/list'
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
code: 'tagdata',
|
|
92
|
+
enName: 'tagdata',
|
|
93
|
+
icon: 'layer-color',
|
|
94
|
+
menuName: '打标数据管理abc',
|
|
95
|
+
path: '/orion/tag/datalist'
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
children: [
|
|
99
|
+
{
|
|
100
|
+
code: 'taglist11',
|
|
101
|
+
enName: 'taglist11',
|
|
102
|
+
icon: 'home',
|
|
103
|
+
menuName: '标签管理11',
|
|
104
|
+
path: '/orion/tag/list11',
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
code: 'taglist22',
|
|
108
|
+
enName: 'taglist22',
|
|
109
|
+
icon: 'home',
|
|
110
|
+
menuName: '标签管理22',
|
|
111
|
+
path: '/orion/tag/list22',
|
|
112
|
+
}
|
|
113
|
+
],
|
|
114
|
+
code: 'tagmm-g',
|
|
115
|
+
enName: 'tagmm-g',
|
|
116
|
+
groupIcon: 'tag',
|
|
117
|
+
groupName: '标签分组',
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
children: [
|
|
121
|
+
{
|
|
122
|
+
code: 'tagdata11',
|
|
123
|
+
enName: 'tagdata11',
|
|
124
|
+
icon: 'home',
|
|
125
|
+
menuName: '数据管理11',
|
|
126
|
+
path: '/orion/tagdata/list11',
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
code: 'tagdata22',
|
|
130
|
+
enName: 'tagdata22',
|
|
131
|
+
icon: 'home',
|
|
132
|
+
menuName: '数据管理22',
|
|
133
|
+
path: '/orion/tagdata/list22',
|
|
134
|
+
}
|
|
135
|
+
],
|
|
136
|
+
code: 'tagdata-g',
|
|
137
|
+
enName: 'tagdata-g',
|
|
138
|
+
groupIcon: 'tag',
|
|
139
|
+
groupName: '标签数据分组',
|
|
140
|
+
}
|
|
141
|
+
],
|
|
142
|
+
code: 'tagmm',
|
|
143
|
+
enName: 'tagmm',
|
|
144
|
+
groupIcon: 'tag',
|
|
145
|
+
groupName: '标签管理3'
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
children: [
|
|
149
|
+
{
|
|
150
|
+
code: 'QX0101',
|
|
151
|
+
enName: 'Organization Manage',
|
|
152
|
+
icon: 'org',
|
|
153
|
+
menuName: '机构管理\t',
|
|
154
|
+
path: '/bridge/permission/organization'
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
code: 'QX0102',
|
|
158
|
+
enName: 'Role Manage',
|
|
159
|
+
icon: 'role',
|
|
160
|
+
menuName: '角色管理',
|
|
161
|
+
path: '/bridge/permission/role'
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
code: 'QX0103',
|
|
165
|
+
enName: 'User Manage',
|
|
166
|
+
icon: 'user-group',
|
|
167
|
+
menuName: '用户管理',
|
|
168
|
+
path: '/bridge/permission/user'
|
|
169
|
+
}
|
|
170
|
+
],
|
|
171
|
+
code: 'permission',
|
|
172
|
+
enName: 'Permission Manage',
|
|
173
|
+
groupIcon: 'user-group',
|
|
174
|
+
groupName: '权限管理'
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
children: [
|
|
178
|
+
{
|
|
179
|
+
code: 'QX0201',
|
|
180
|
+
enName: 'Function Register',
|
|
181
|
+
icon: 'python',
|
|
182
|
+
menuName: '功能注册',
|
|
183
|
+
path: '/bridge/system/register'
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
code: 'QX0202',
|
|
187
|
+
enName: 'Solution',
|
|
188
|
+
icon: 'python',
|
|
189
|
+
menuName: '解决方案',
|
|
190
|
+
path: '/bridge/system/solution'
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
code: 'QX0203',
|
|
194
|
+
enName: 'System Configuration',
|
|
195
|
+
icon: 'Python',
|
|
196
|
+
menuName: '系统设置',
|
|
197
|
+
path: '/bridge/system/startup'
|
|
198
|
+
}
|
|
199
|
+
],
|
|
200
|
+
code: 'QX0203',
|
|
201
|
+
enName: 'System Configuration',
|
|
202
|
+
groupIcon: 'puzzle',
|
|
203
|
+
groupName: '解决方案'
|
|
204
|
+
}
|
|
205
|
+
];
|
|
206
|
+
|
|
207
|
+
const userInfo = {
|
|
208
|
+
account: 'admin',
|
|
209
|
+
avatar: 'male1',
|
|
210
|
+
lang: 'cn',
|
|
211
|
+
layout: 'default',
|
|
212
|
+
theme: 'default',
|
|
213
|
+
userName: '超级管理员',
|
|
214
|
+
uuid: 'c693e0ec0a2e4bf8b71eef8152d88a29'
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
Object.assign(window, {
|
|
218
|
+
store: {
|
|
219
|
+
menus,
|
|
220
|
+
userInfo
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
ReactDOM.render(
|
|
225
|
+
<GlobalStyle />,
|
|
226
|
+
document.getElementById('root')
|
|
227
|
+
);
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
#### 全家桶模式(新)
|
|
231
|
+
```jsx
|
|
232
|
+
import React, { useContext } from 'react';
|
|
233
|
+
import ReactDOM from 'react-dom';
|
|
234
|
+
import { Layout, QueryListScene } from 'tntd';
|
|
235
|
+
|
|
236
|
+
const { menus, userInfo } = window.store;
|
|
237
|
+
const { AuthContext } = Layout;
|
|
238
|
+
const onMenuChange = param => {
|
|
239
|
+
console.log('onMenuChange:', param);
|
|
240
|
+
};
|
|
241
|
+
const onMenuSelect = param => {
|
|
242
|
+
console.log('onMeneMenuSelectChange:', param);
|
|
243
|
+
};
|
|
244
|
+
const onLanguageChange = language => {
|
|
245
|
+
console.log('onLanguageChange:', language);
|
|
246
|
+
};
|
|
247
|
+
const onThemeChange = theme => {
|
|
248
|
+
console.log('onThemeChange:', theme);
|
|
249
|
+
};
|
|
250
|
+
const onAppChange = param => {
|
|
251
|
+
console.log('onAppChange', param);
|
|
252
|
+
};
|
|
253
|
+
const onLogoClick = () => {
|
|
254
|
+
console.log('logo click');
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
ReactDOM.render(
|
|
258
|
+
<Layout
|
|
259
|
+
// logo={<img src="" />}
|
|
260
|
+
logo="xxxx"
|
|
261
|
+
name="私有云全家桶"
|
|
262
|
+
enName="Private Cloud"
|
|
263
|
+
config={{
|
|
264
|
+
globalNavigation: true,
|
|
265
|
+
theme:true,
|
|
266
|
+
language: true
|
|
267
|
+
}}
|
|
268
|
+
appList={[
|
|
269
|
+
{ key: 'movie', name: '电影图谱', children: [{ key: 'movie1', name: 'subitem' }] },
|
|
270
|
+
{ key: 'enterprise', name: '企业图谱' }
|
|
271
|
+
]}
|
|
272
|
+
userInfo={userInfo}
|
|
273
|
+
selectedMenuKey="tagdata"
|
|
274
|
+
menus={menus}
|
|
275
|
+
onMenuChange={onMenuChange}
|
|
276
|
+
onMenuSelect={onMenuSelect}
|
|
277
|
+
onLanguageChange={onLanguageChange}
|
|
278
|
+
onThemeChange={onThemeChange}
|
|
279
|
+
onAppChange={onAppChange}
|
|
280
|
+
onLogoClick={onLogoClick}
|
|
281
|
+
onLogout={() => alert('do logout')}
|
|
282
|
+
>
|
|
283
|
+
<AuthContext.Consumer>
|
|
284
|
+
{
|
|
285
|
+
auth => {
|
|
286
|
+
window.auth = auth;
|
|
287
|
+
console.log('window.auth...', auth('dadicasesearch'))
|
|
288
|
+
return <QueryListScene title="Page Title"></QueryListScene>;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
</AuthContext.Consumer>
|
|
292
|
+
</Layout>,
|
|
293
|
+
document.getElementById('root')
|
|
294
|
+
)
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
#### 全家桶模式(多页签)
|
|
298
|
+
```jsx
|
|
299
|
+
import React, { useContext, useState } from 'react';
|
|
300
|
+
import ReactDOM from 'react-dom';
|
|
301
|
+
import { Layout, QueryListScene } from 'tntd';
|
|
302
|
+
|
|
303
|
+
const { menus, userInfo } = window.store;
|
|
304
|
+
const { HeaderTabs } = Layout;
|
|
305
|
+
|
|
306
|
+
const LayoutTabsDemo = () => {
|
|
307
|
+
const selectedMenu = menus[2].children[1];
|
|
308
|
+
const [tabs, setTabs] = useState([{ ...selectedMenu, key: selectedMenu.code, name: selectedMenu.menuName }]);
|
|
309
|
+
const [activeTab, setActiveTab] = useState(tabs[0]);
|
|
310
|
+
const [appList,setAppList] = useState([]);
|
|
311
|
+
const [orgAppList,setOrgAppList] = useState([]);
|
|
312
|
+
const onMenuChange = param => {
|
|
313
|
+
console.log('onMenuChange:', param);
|
|
314
|
+
};
|
|
315
|
+
const onMenuSelect = param => {
|
|
316
|
+
console.log('onMeneMenuSelectChange:', param);
|
|
317
|
+
const { data } = param;
|
|
318
|
+
|
|
319
|
+
const currentTab = tabs.find(({ key }) => key === data.code);
|
|
320
|
+
|
|
321
|
+
if (currentTab) {
|
|
322
|
+
setActiveTab(currentTab);
|
|
323
|
+
} else {
|
|
324
|
+
const newTabs = [...tabs, { ...data, key: data.code, name: data.menuName }];
|
|
325
|
+
setTabs(newTabs);
|
|
326
|
+
setActiveTab(newTabs[newTabs.length - 1]);
|
|
327
|
+
}
|
|
328
|
+
};
|
|
329
|
+
const onTabChange = tab => {
|
|
330
|
+
setActiveTab(tab);
|
|
331
|
+
};
|
|
332
|
+
const onTabClose = (tab, tabs, activeTab) => {
|
|
333
|
+
setTabs(tabs);
|
|
334
|
+
setActiveTab(activeTab);
|
|
335
|
+
}
|
|
336
|
+
const onLanguageChange = language => {
|
|
337
|
+
console.log('onLanguageChange:', language);
|
|
338
|
+
};
|
|
339
|
+
const onThemeChange = theme => {
|
|
340
|
+
console.log('onThemeChange:', theme);
|
|
341
|
+
};
|
|
342
|
+
const onAppChange = param => {
|
|
343
|
+
console.log('onAppChange', param);
|
|
344
|
+
};
|
|
345
|
+
const onLogoClick = () => {
|
|
346
|
+
console.log('logo click');
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
return (
|
|
350
|
+
<Layout
|
|
351
|
+
type="enterprise"
|
|
352
|
+
logo="xxxx"
|
|
353
|
+
name="私有云全家桶"
|
|
354
|
+
enName="Private Cloud"
|
|
355
|
+
config={{
|
|
356
|
+
globalNavigation: true,
|
|
357
|
+
theme: true,
|
|
358
|
+
language:true
|
|
359
|
+
}}
|
|
360
|
+
orgTreeConfig={true}
|
|
361
|
+
orgList = {{
|
|
362
|
+
'uuid':'da435225387f40dd80f7757d712c999b',
|
|
363
|
+
'gmtCreate':1625820797000,
|
|
364
|
+
'gmtModified':1625820797000,
|
|
365
|
+
'code':'s',
|
|
366
|
+
'level':1,
|
|
367
|
+
'name':'szx',
|
|
368
|
+
'children': [
|
|
369
|
+
{
|
|
370
|
+
'uuid':'73efa4a6be2541cb9226c6c40c12d076',
|
|
371
|
+
'gmtCreate':1625820807000,
|
|
372
|
+
'gmtModified':1625820807000,
|
|
373
|
+
'code':'1',
|
|
374
|
+
'level':2,
|
|
375
|
+
'parentUuid':'da435225387f40dd80f7757d712c999b',
|
|
376
|
+
'name':'活动撒活动啊活动撒后发多少分活动啊等候骚的撒后发多少大号双方都撒哈佛的撒哈佛大事好大红花都送啊',
|
|
377
|
+
'children': [
|
|
378
|
+
{
|
|
379
|
+
'uuid':'019c7af784c4481491975eb46e362bcf',
|
|
380
|
+
'gmtCreate':1625820823000,
|
|
381
|
+
'gmtModified':1625820823000,
|
|
382
|
+
'code':'2',
|
|
383
|
+
'level':3,
|
|
384
|
+
'parentUuid':'73efa4a6be2541cb9226c6c40c12d076',
|
|
385
|
+
'name':'szx2',
|
|
386
|
+
'children': [
|
|
387
|
+
{
|
|
388
|
+
'uuid':'01997af784c4481491975eb46e362bcf',
|
|
389
|
+
'gmtCreate':1625820823000,
|
|
390
|
+
'gmtModified':1625820823000,
|
|
391
|
+
'code':'2',
|
|
392
|
+
'level':4,
|
|
393
|
+
'parentUuid':'73efa4a6be2541cb9226c6c40c12d076',
|
|
394
|
+
'name':'szx4'
|
|
395
|
+
}
|
|
396
|
+
]
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
'uuid':'83cf61ad78cd440aaec3b101ee76c789',
|
|
400
|
+
'gmtCreate':1626058346000,
|
|
401
|
+
'gmtModified':1626058346000,
|
|
402
|
+
'code':'3',
|
|
403
|
+
'level':3,
|
|
404
|
+
'parentUuid':'73efa4a6be2541cb9226c6c40c12d076',
|
|
405
|
+
'name':'szx3'
|
|
406
|
+
}
|
|
407
|
+
]
|
|
408
|
+
}
|
|
409
|
+
]
|
|
410
|
+
}}
|
|
411
|
+
onOrgChange={(org)=>{
|
|
412
|
+
setOrgAppList([
|
|
413
|
+
{ key: 'movie2', name: '电影图谱' },
|
|
414
|
+
{ key: 'enterprise2', name: '企业图谱' }
|
|
415
|
+
])
|
|
416
|
+
}}
|
|
417
|
+
orgAppShow={true}
|
|
418
|
+
orgAppList={orgAppList}
|
|
419
|
+
appList={appList}
|
|
420
|
+
userInfo={userInfo}
|
|
421
|
+
selectedMenuKey={activeTab.key}
|
|
422
|
+
collapseIconPlacement="bottom"
|
|
423
|
+
menus={menus}
|
|
424
|
+
headerTabs={<HeaderTabs
|
|
425
|
+
tabs={tabs}
|
|
426
|
+
selectedKey={activeTab.key}
|
|
427
|
+
onTabChange={onTabChange}
|
|
428
|
+
onTabClose={onTabClose}
|
|
429
|
+
appListVisible={true}
|
|
430
|
+
orgListVisible={false}
|
|
431
|
+
orgAppListVisible={false}
|
|
432
|
+
/>}
|
|
433
|
+
onMenuChange={onMenuChange}
|
|
434
|
+
onMenuSelect={onMenuSelect}
|
|
435
|
+
onLanguageChange={onLanguageChange}
|
|
436
|
+
onThemeChange={onThemeChange}
|
|
437
|
+
onAppChange={onAppChange}
|
|
438
|
+
onLogoClick={onLogoClick}
|
|
439
|
+
onLogout={() => alert('do logout')}
|
|
440
|
+
>
|
|
441
|
+
<QueryListScene title="Page Title"></QueryListScene>
|
|
442
|
+
</Layout>
|
|
443
|
+
);
|
|
444
|
+
};
|
|
445
|
+
|
|
446
|
+
ReactDOM.render(
|
|
447
|
+
<LayoutTabsDemo />,
|
|
448
|
+
document.getElementById('root')
|
|
449
|
+
)
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
#### 全家桶模式(旧)
|
|
453
|
+
```jsx
|
|
454
|
+
import React from 'react';
|
|
455
|
+
import ReactDOM from 'react-dom';
|
|
456
|
+
import { Layout, Icon, DevelopmentLogin } from 'tntd';
|
|
457
|
+
|
|
458
|
+
const { menus, userInfo } = window.store;
|
|
459
|
+
const { HeaderNavs, HeaderActionItem } = Layout;
|
|
460
|
+
const onMenuChange = param => {
|
|
461
|
+
console.log('onMenuChange:', param);
|
|
462
|
+
};
|
|
463
|
+
const onMenuSelect = param => {
|
|
464
|
+
console.log('onMenuMenuSelectChange:', param);
|
|
465
|
+
};
|
|
466
|
+
const onLanguageChange = language => {
|
|
467
|
+
console.log('onLanguageChange:', language);
|
|
468
|
+
};
|
|
469
|
+
const onThemeChange = theme => {
|
|
470
|
+
console.log('onThemeChange:', theme);
|
|
471
|
+
};
|
|
472
|
+
const onAppChange = param => {
|
|
473
|
+
console.log('onAppChange', param);
|
|
474
|
+
};
|
|
475
|
+
const onLogoClick = () => {
|
|
476
|
+
console.log('logo click');
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
ReactDOM.render(
|
|
480
|
+
<Layout
|
|
481
|
+
logo=""
|
|
482
|
+
name="私有云全家桶xxxx"
|
|
483
|
+
enName="Private Cloud"
|
|
484
|
+
// size="large"
|
|
485
|
+
compatible
|
|
486
|
+
appList={[
|
|
487
|
+
{ key: 'movie', name: '电影图谱' },
|
|
488
|
+
{ key: 'enterprise', name: '企业图谱' }
|
|
489
|
+
]}
|
|
490
|
+
userInfo={userInfo}
|
|
491
|
+
selectedMenuKey="tagdata"
|
|
492
|
+
menus={menus}
|
|
493
|
+
onBeforeMenuChange={params => {
|
|
494
|
+
console.log('onBeforeMenuChange...', params.data);
|
|
495
|
+
return params.data.path !== '/orion/tag/list';
|
|
496
|
+
}}
|
|
497
|
+
onMenuChange={onMenuChange}
|
|
498
|
+
onMenuSelect={onMenuSelect}
|
|
499
|
+
onLanguageChange={onLanguageChange}
|
|
500
|
+
onThemeChange={onThemeChange}
|
|
501
|
+
onAppChange={onAppChange}
|
|
502
|
+
onLogoClick={onLogoClick}
|
|
503
|
+
extraHeaderActions={[
|
|
504
|
+
<HeaderActionItem key="help" onClick={() => console.log('Help')}>
|
|
505
|
+
<DevelopmentLogin
|
|
506
|
+
signIn={userInfo => new Promise(resolve => {
|
|
507
|
+
setTimeout(() => {
|
|
508
|
+
resolve({ tdToken: '_td_token_', userId: '_uid_' });
|
|
509
|
+
}, 100);
|
|
510
|
+
})}
|
|
511
|
+
/>
|
|
512
|
+
</HeaderActionItem>
|
|
513
|
+
]}
|
|
514
|
+
>
|
|
515
|
+
</Layout>,
|
|
516
|
+
document.getElementById('root')
|
|
517
|
+
)
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
#### 全家桶Paas模式
|
|
521
|
+
```jsx
|
|
522
|
+
import React, { useState } from 'react';
|
|
523
|
+
import ReactDOM from 'react-dom';
|
|
524
|
+
import { Radio } from 'antd';
|
|
525
|
+
import { Layout } from 'tntd';
|
|
526
|
+
|
|
527
|
+
const DemoPage = props => {
|
|
528
|
+
const { menus, userInfo } = window.store;
|
|
529
|
+
const [menuAlignMode, setMenuAlignMode] = useState('side');
|
|
530
|
+
|
|
531
|
+
const onApplicationChange = appKey => {
|
|
532
|
+
console.log('onApplicationChange:', appKey);
|
|
533
|
+
};
|
|
534
|
+
const onLanguageChange = language => {
|
|
535
|
+
console.log('onLanguageChange...', language);
|
|
536
|
+
};
|
|
537
|
+
const onLogout = () => {
|
|
538
|
+
console.log('onLogout...');
|
|
539
|
+
};
|
|
540
|
+
// 头部导航菜单切换事件(menuAlignMode 为 top 时才有该回调函数)
|
|
541
|
+
const onHeaderNavChange = navItem => {
|
|
542
|
+
console.log('onHeaderNavChange', navItem);
|
|
543
|
+
};
|
|
544
|
+
|
|
545
|
+
return (
|
|
546
|
+
<>
|
|
547
|
+
<div>
|
|
548
|
+
<Radio.Group
|
|
549
|
+
value={menuAlignMode}
|
|
550
|
+
onChange={evt => setMenuAlignMode(evt.target.value)}
|
|
551
|
+
>
|
|
552
|
+
<Radio.Button value="side">侧边栏菜单</Radio.Button>
|
|
553
|
+
<Radio.Button value="top">顶部导航菜单</Radio.Button>
|
|
554
|
+
</Radio.Group>
|
|
555
|
+
</div>
|
|
556
|
+
<Layout
|
|
557
|
+
type="paas"
|
|
558
|
+
menuAlignMode={menuAlignMode}
|
|
559
|
+
compatible
|
|
560
|
+
// size="large"
|
|
561
|
+
appKey="orion"
|
|
562
|
+
logo=""
|
|
563
|
+
name="私有云全家桶"
|
|
564
|
+
enName="Private Cloud"
|
|
565
|
+
userInfo={userInfo}
|
|
566
|
+
menus={menus}
|
|
567
|
+
// menuAlignMode 为 top 时才有该回调函数
|
|
568
|
+
onHeaderNavChange={onHeaderNavChange}
|
|
569
|
+
onBeforeMenuChange={(menuInfo, currentMenuKey) => {
|
|
570
|
+
console.log('onBeforeMenuChange...', menuInfo);
|
|
571
|
+
if (menuInfo.key === 'tagdata') {
|
|
572
|
+
alert('特殊处理,禁止选中菜单')
|
|
573
|
+
return false;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
return true;
|
|
577
|
+
}}
|
|
578
|
+
onApplicationChange={onApplicationChange}
|
|
579
|
+
onLanguageChange={onLanguageChange}
|
|
580
|
+
onLogout={onLogout}
|
|
581
|
+
>
|
|
582
|
+
</Layout>
|
|
583
|
+
</>
|
|
584
|
+
);
|
|
585
|
+
};
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
ReactDOM.render(
|
|
589
|
+
<DemoPage />,
|
|
590
|
+
document.getElementById('root')
|
|
591
|
+
)
|
|
592
|
+
```
|
|
593
|
+
|
|
594
|
+
|
|
595
|
+
#### Paas模式 - 自定义菜单
|
|
596
|
+
```jsx
|
|
597
|
+
import React, { useState } from 'react';
|
|
598
|
+
import ReactDOM from 'react-dom';
|
|
599
|
+
import styled from 'styled-components';
|
|
600
|
+
import { Menu, Layout as AntLayout } from 'antd';
|
|
601
|
+
import { Layout, Icon } from 'tntd';
|
|
602
|
+
|
|
603
|
+
const { HeaderNavs, HeaderActionItem } = Layout;
|
|
604
|
+
const { Sider } = AntLayout;
|
|
605
|
+
const { menus, userInfo } = window.store;
|
|
606
|
+
const navs = [
|
|
607
|
+
{
|
|
608
|
+
name: '数据开发',
|
|
609
|
+
key: '/dataocean/',
|
|
610
|
+
menus: [
|
|
611
|
+
{ name: '作业开发', key: 'home' },
|
|
612
|
+
{ name: '资源管理', key: 'resource' },
|
|
613
|
+
{ name: '函数管理', key: 'func' }
|
|
614
|
+
]
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
name: '数据管理',
|
|
618
|
+
key: '/dataocean/dm',
|
|
619
|
+
menus: [
|
|
620
|
+
{ name: '数据管理概览', key: 'overview' },
|
|
621
|
+
{ name: '数据查找', key: 'search' },
|
|
622
|
+
{ name: '我的表管理', key: 'table' }
|
|
623
|
+
]
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
name: '运维中心',
|
|
627
|
+
key: '/dataocean/jm',
|
|
628
|
+
menus: [
|
|
629
|
+
{ name: '数据管理概览', key: 'jm1' },
|
|
630
|
+
{ name: '数据查找', key: 'jm2' },
|
|
631
|
+
{ name: '我的表管理', key: 'jm3' }
|
|
632
|
+
]
|
|
633
|
+
},
|
|
634
|
+
{
|
|
635
|
+
name: '系统管理',
|
|
636
|
+
key: '/dataocean/system',
|
|
637
|
+
menus: [
|
|
638
|
+
{ name: '数据管理概览', key: 'system1' },
|
|
639
|
+
{ name: '数据查找', key: 'system2' },
|
|
640
|
+
{ name: '我的表管理', key: 'system3' }
|
|
641
|
+
]
|
|
642
|
+
}
|
|
643
|
+
];
|
|
644
|
+
|
|
645
|
+
const SideMenu = props => {
|
|
646
|
+
const [collapsed, setCollapsed] = useState(false);
|
|
647
|
+
const { selectedNav } = props;
|
|
648
|
+
const MenuTitleBlock = styled.div`
|
|
649
|
+
margin: 0 24px;
|
|
650
|
+
padding-right: 8px;
|
|
651
|
+
line-height: 60px;
|
|
652
|
+
height: 60px;
|
|
653
|
+
vertical-align: middle;
|
|
654
|
+
border-bottom: 1px solid #e8e8e8;
|
|
655
|
+
font-size: 16px;
|
|
656
|
+
i {
|
|
657
|
+
float: right;
|
|
658
|
+
line-height: 60px;
|
|
659
|
+
cursor: pointer;
|
|
660
|
+
}
|
|
661
|
+
`;
|
|
662
|
+
|
|
663
|
+
console.log('collapsed...', collapsed);
|
|
664
|
+
|
|
665
|
+
return (
|
|
666
|
+
<Sider width={216} theme="light" collapsed={collapsed}>
|
|
667
|
+
<MenuTitleBlock>
|
|
668
|
+
{
|
|
669
|
+
!collapsed && selectedNav.name
|
|
670
|
+
}
|
|
671
|
+
<Icon
|
|
672
|
+
type={collapsed ? 'menu-unfold' : 'menu-fold'}
|
|
673
|
+
onClick={() => {
|
|
674
|
+
setCollapsed(!collapsed);
|
|
675
|
+
}}
|
|
676
|
+
/>
|
|
677
|
+
</MenuTitleBlock>
|
|
678
|
+
<Menu
|
|
679
|
+
defaultSelectedKeys={selectedNav.menus[0].key}
|
|
680
|
+
mode="inline"
|
|
681
|
+
theme="light"
|
|
682
|
+
>
|
|
683
|
+
{
|
|
684
|
+
(selectedNav.menus || []).map(menu => (
|
|
685
|
+
<Menu.Item key={menu.key}>
|
|
686
|
+
<Icon type="chart-pie-alt" />
|
|
687
|
+
<span>{menu.name}</span>
|
|
688
|
+
</Menu.Item>
|
|
689
|
+
))
|
|
690
|
+
}
|
|
691
|
+
</Menu>
|
|
692
|
+
</Sider>
|
|
693
|
+
);
|
|
694
|
+
};
|
|
695
|
+
|
|
696
|
+
const PaasLayout = props => {
|
|
697
|
+
const [selectedNav, setSelectedNav] = useState(navs[0]);
|
|
698
|
+
const onNavChange = nav => {
|
|
699
|
+
setSelectedNav(nav);
|
|
700
|
+
};
|
|
701
|
+
|
|
702
|
+
return (
|
|
703
|
+
<Layout
|
|
704
|
+
type="paas"
|
|
705
|
+
compatible
|
|
706
|
+
// size="large"
|
|
707
|
+
appKey="orion"
|
|
708
|
+
logo=""
|
|
709
|
+
name="私有云全家桶"
|
|
710
|
+
enName="Private Cloud"
|
|
711
|
+
userInfo={userInfo}
|
|
712
|
+
menus={menus}
|
|
713
|
+
config={{
|
|
714
|
+
language: false,
|
|
715
|
+
// theme: false
|
|
716
|
+
}}
|
|
717
|
+
headerNavs={
|
|
718
|
+
<HeaderNavs navs={navs} onChange={onNavChange} />
|
|
719
|
+
}
|
|
720
|
+
extraHeaderActions={[
|
|
721
|
+
<HeaderActionItem key="help" onClick={() => alert('Help')}>
|
|
722
|
+
<Icon type="zhibiao" />
|
|
723
|
+
</HeaderActionItem>,
|
|
724
|
+
<HeaderActionItem key="mail" onClick={() => alert('Mail')}>
|
|
725
|
+
<Icon type="guanjia" />
|
|
726
|
+
</HeaderActionItem>
|
|
727
|
+
]}
|
|
728
|
+
sideMenu={<SideMenu selectedNav={selectedNav} />}
|
|
729
|
+
>
|
|
730
|
+
{props.children}
|
|
731
|
+
</Layout>
|
|
732
|
+
);
|
|
733
|
+
};
|
|
734
|
+
|
|
735
|
+
ReactDOM.render(
|
|
736
|
+
<PaasLayout>
|
|
737
|
+
PaasLayout
|
|
738
|
+
</PaasLayout>,
|
|
739
|
+
document.getElementById('root')
|
|
740
|
+
)
|
|
741
|
+
```
|
|
742
|
+
|
|
743
|
+
### API
|
|
744
|
+
#### Layout
|
|
745
|
+
|
|
746
|
+
| 属性名称 | 属性说明 | 类型 | 默认值 | 是否必须 |
|
|
747
|
+
| :------------------ | :----------------------------------------------------------------------------------------------------------- | :--------------- | :---------------------------------------------------------------- | :----------------------------- |
|
|
748
|
+
| type | Layout类型,全家桶风格、Paas风格;default | string | default | 否 |
|
|
749
|
+
| size | Layout里面header,菜单等高度尺寸设置,目前是不设置或设置为large,large是老的样式 | string | default | 否 |
|
|
750
|
+
| compatible | 兼容模式,新的全家桶设计样式与现有的不一致,为了保证老的项目过渡,需要保持原有的全家桶风格则设置 | boolean | false | 否 |
|
|
751
|
+
| isEmptyLayout | 该参数控制是否使用空layout,不显示框架的header和sideMenu | boolean | false | 否 |
|
|
752
|
+
| appKey | 当前应用的前缀,如 图谱 orion, 机器学习 turing, 解决方案中path的前缀,type=paas才需要 | string | 无 | 否 |
|
|
753
|
+
| logo | 应用的logo, 如果对应的应用logo图片有内置在layout组件中则,传对应应用的key即可,否则传React Component、string | React Component | 无 | 是 |
|
|
754
|
+
| name | 应用名称 | string | 无 | 是 |
|
|
755
|
+
| enName | 应用名称英文名称 | string | 无 | 否(需要支持英文模式则需要传) |
|
|
756
|
+
| userInfo | 用户信息,统一登录用户信息数据直接传过来 | Object | 无 | 否 |
|
|
757
|
+
| selectedMenuKey | 激活菜单选中,目前是用menuTree中的code作为标识 | string | menus[0].children[0] | 否 |
|
|
758
|
+
| menus | 菜单信息,解决方案中menuTree接口获取的菜单数据直接传过来 | Array | 无 | 否 |
|
|
759
|
+
| formatMenuPath | 点击菜单默认跳转的路径是菜单数据中的path字段,如果有需要动态添加参数的场景可传入此函数进行处理 | Function | 无 | 否 |
|
|
760
|
+
| changeRouter | 当前子应用内路由跳转逻辑,目前业务传path => history.push(path)即可 | Function | path => window.history.pushState(menuInfo, 'menuName', path) | 否 |
|
|
761
|
+
| config | 功能配置信息,主题(theme)、语言切换(language)、用户头像(avatar)、应用切换(application)、全局导航(globalNavigation) | Object | { theme: true, language: true, avatar: true, application: false, globalNavigation: false } | 否 |
|
|
762
|
+
| extendMap | 解决方案中配置的显示信息,由解决方案菜单树接口中下发该字段,主要配置Layout类型、支持语言、主题切换配置、菜单布局方式、全局导航功能开启,如果和config中的某些功能配置相同,取config中的配置值Object.assign({}, extendMap, config)| Object | 无 | 否 |
|
|
763
|
+
| headerNavs | 头部导航组件,如果有需要可以在头部区域加导航 | React Component | 无 | 否 |
|
|
764
|
+
| extraHeaderActions | 头部右上角一些额外操作项,主要适用于一些定制化场景 | Array、ReactNode | 无 | 否 |
|
|
765
|
+
| sideMenu | 侧边栏菜单组件,有自定义侧边栏菜单的场景时可用 | ReactNode | 无 | 否 |
|
|
766
|
+
| onMenuChange | 菜单切换回调事件 | Function | 无 | 否 |
|
|
767
|
+
| onBeforeMenuChange | 菜单切换前回调事件(return false则可以禁止默认行为) | Function | 无 | 否 |
|
|
768
|
+
| onMenuSelect | 菜单选中回调事件 | Function | 无 | 否 |
|
|
769
|
+
| onThemeChange | 主题切换回调事件 | Function | 无 | 否 |
|
|
770
|
+
| onLanguageChange | 语言切换回调事件 | Function | 无 | 否 |
|
|
771
|
+
| onApplicationChange | 应用切换回调事件 | Function | 无 | 否 |
|
|
772
|
+
| onLogoClick | logo区域点击事件 | Function | 无 | 否 |
|
|
773
|
+
| onLogout | 退出登录事件 | Function | 跳转登录页面 | 否 |
|
|
774
|
+
| onCollapseChange | 左侧菜单树收起/展开变化事件件 | Function | | 否 |
|
|
775
|
+
|
|
776
|
+
|
|
777
|
+
#### HeaderNavs
|
|
778
|
+
| 属性名称 | 属性说明 | 类型 | 默认值 | 是否必须 |
|
|
779
|
+
| :---------- | :-------------------------------------------------------------- | :------- | :---------- | :------- |
|
|
780
|
+
| navs | 导航数据,格式[{ name: "看板", key: "/dashboard" }], key要求唯一 | Array | 无 | 是 |
|
|
781
|
+
| selectedKey | 指定选中的导航 | String | navs[0].key | 否 |
|
|
782
|
+
| onChange | 导航变化事件回调函数onChange(Object: selectedNav) | Function | 无 | 否 |
|
|
783
|
+
| onSelect | 选中导航事件回调函数onSelect(Object: selectedNav) | Function | 无 | 否 |
|