module-menu 0.2.52-dev-hubjt.5 → 0.3.0
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.
|
@@ -1,262 +1,262 @@
|
|
|
1
|
-
import React, { Component, useEffect, useState } from 'react';
|
|
2
|
-
import { Popconfirm, message, Dropdown, Button, Select } from 'antd';
|
|
3
|
-
import { userMenuIcon } from './constData';
|
|
4
|
-
import {
|
|
5
|
-
HomeOutlined,
|
|
6
|
-
UserOutlined,
|
|
7
|
-
CaretDownOutlined,
|
|
8
|
-
} from '@ant-design/icons';
|
|
9
|
-
import { Spin, Menu, Avatar } from 'antd';
|
|
10
|
-
import HeaderDropdown from './HeaderDropdown';
|
|
11
|
-
import Axios from '../util/axios';
|
|
12
|
-
import getStore, { getUserName } from '../util/userInfo';
|
|
13
|
-
import './index.less';
|
|
14
|
-
import cn from 'classnames'
|
|
15
|
-
|
|
16
|
-
// stash存在则为一体化,否则为轻量级
|
|
17
|
-
const ModuleUser = ({ stash = '' }) => {
|
|
18
|
-
const [tenantList, setTenantList] = useState([]);
|
|
19
|
-
const [haveAppSystemPermission, setHaveAppSystemPermission] = useState(false);
|
|
20
|
-
useEffect(() => {
|
|
21
|
-
localStorage.setItem('stash', stash)
|
|
22
|
-
if (['integration', 'LNRD', 'HBJK'].includes(stash)) {
|
|
23
|
-
getTenantList();
|
|
24
|
-
allSystemList();
|
|
25
|
-
}
|
|
26
|
-
}, []);
|
|
27
|
-
const handleClickmenu = (url) => {
|
|
28
|
-
window.location.href = url;
|
|
29
|
-
};
|
|
30
|
-
const handleClickSysManage = () => {
|
|
31
|
-
if(['integration', 'LNRD', 'HBJK'].includes(stash)){
|
|
32
|
-
Axios('get', '/admin-api/system/auth/homePage', '', {})
|
|
33
|
-
.then((res) => {
|
|
34
|
-
if (res.data.code === 0) {
|
|
35
|
-
window.location.href = `/admin-ui${res.data.data.path}`;
|
|
36
|
-
} else {
|
|
37
|
-
message.warning(res.data.msg || '获取系统管理页面路由信息失败');
|
|
38
|
-
}
|
|
39
|
-
})
|
|
40
|
-
.catch((e) => console.log('e', e));
|
|
41
|
-
}else{
|
|
42
|
-
const menuList = getStore({name: 'menu'});
|
|
43
|
-
const sysManagePath= menuList?.find(item=>item.name === '权限管理').children[0].path
|
|
44
|
-
window.location.href = stash === 'GZW' ? '/data-platform/#'+ sysManagePath : '/#'+ sysManagePath
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
const {
|
|
48
|
-
PersonalCenterSrc,
|
|
49
|
-
MessageCenterSrc,
|
|
50
|
-
SystemManageSrc,
|
|
51
|
-
LogoutSrc,
|
|
52
|
-
AppSystemSrc,
|
|
53
|
-
} = userMenuIcon;
|
|
54
|
-
|
|
55
|
-
const isHaveSystemManagementPermission = (['integration', 'LNRD', 'HBJK'].includes(stash))
|
|
56
|
-
? true
|
|
57
|
-
: getStore({ name: 'isHaveSystemManagementPermission' });
|
|
58
|
-
const DEFAULT_LOGOUT_URL = (['integration', 'LNRD', 'HBJK'].includes(stash)) ? '/admin-ui/login' : (stash === 'GZW'? '/data-platform/#/login' : '/#/login');
|
|
59
|
-
|
|
60
|
-
// 跳转服务门户
|
|
61
|
-
const jumpToExterHome = () => {
|
|
62
|
-
handleClickmenu('/admin-ui/data-share-portal/homePage');
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
const curTenantId = ['integration', 'LNRD', 'HBJK'].includes(stash)
|
|
66
|
-
? getStore({ name: 'tenantId' }) && parseInt(getStore({ name: 'tenantId' }))
|
|
67
|
-
: '';
|
|
68
|
-
const curTenantName = ['integration', 'LNRD', 'HBJK'].includes(stash) ? getStore({ name: 'tenantName' }) : '';
|
|
69
|
-
|
|
70
|
-
const getTenantList = () => {
|
|
71
|
-
Axios('get', '/admin-api/system/user/getUserTenant', '', {})
|
|
72
|
-
.then((res) => {
|
|
73
|
-
if (res.data.code === 0) {
|
|
74
|
-
let tenantLists =
|
|
75
|
-
res.data.data &&
|
|
76
|
-
res.data.data.map((item) => {
|
|
77
|
-
return {
|
|
78
|
-
id: item.id,
|
|
79
|
-
value: item.id,
|
|
80
|
-
label: item.name,
|
|
81
|
-
};
|
|
82
|
-
});
|
|
83
|
-
setTenantList(tenantLists || []);
|
|
84
|
-
}
|
|
85
|
-
})
|
|
86
|
-
.catch((e) => console.log('e', e));
|
|
87
|
-
};
|
|
88
|
-
const allSystemList = () => {
|
|
89
|
-
Axios(
|
|
90
|
-
'get',
|
|
91
|
-
'/admin-api/system/user/get-user-menu-List?menuName=数据平台',
|
|
92
|
-
'',
|
|
93
|
-
{},
|
|
94
|
-
)
|
|
95
|
-
.then((res) => {
|
|
96
|
-
if (res.data.code === 0) {
|
|
97
|
-
let menuGet =
|
|
98
|
-
res.data.data &&
|
|
99
|
-
res.data.data[0]?.routes?.map((item) => {
|
|
100
|
-
return {
|
|
101
|
-
...item,
|
|
102
|
-
path:
|
|
103
|
-
item.path.indexOf('/') !== -1 ? item.path : '/' + item.path,
|
|
104
|
-
};
|
|
105
|
-
});
|
|
106
|
-
let haveAppSystem_Permission =
|
|
107
|
-
menuGet?.some((item) => item.name === '应用系统配置') || false;
|
|
108
|
-
setHaveAppSystemPermission(haveAppSystem_Permission);
|
|
109
|
-
}
|
|
110
|
-
})
|
|
111
|
-
.catch((e) => console.log('e', e));
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
// 退出登录
|
|
115
|
-
const logout = () => {
|
|
116
|
-
const logoutUrl = (['integration', 'LNRD', 'HBJK'].includes(stash))
|
|
117
|
-
? '/admin-api/system/auth/logout'
|
|
118
|
-
: (stash === 'GZW' ? '/data-platform/auth/token/logout' : '/auth/token/logout');
|
|
119
|
-
const logouType = (['integration', 'LNRD', 'HBJK'].includes(stash)) ? 'post' : 'delete';
|
|
120
|
-
Axios(logouType, logoutUrl, '', {})
|
|
121
|
-
.then(() => {
|
|
122
|
-
console.log('退出登录接口调用成功');
|
|
123
|
-
localStorage.clear();
|
|
124
|
-
sessionStorage.clear();
|
|
125
|
-
window.location.href = DEFAULT_LOGOUT_URL;
|
|
126
|
-
})
|
|
127
|
-
.catch((error) => {
|
|
128
|
-
console.error('Error while logging out, error:', error);
|
|
129
|
-
message.error('服务器错误,请稍后重试');
|
|
130
|
-
});
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
// 切换租户改缓存、调接口、刷界面
|
|
134
|
-
const handleChangeTenant = (e) => {
|
|
135
|
-
let token = getStore({ name: 'access_token' });
|
|
136
|
-
Axios('post', `/admin-api/system/auth/setRedisTokenOfTenant`, '', {
|
|
137
|
-
data: { token, tenantId: e },
|
|
138
|
-
})
|
|
139
|
-
.then((res) => {
|
|
140
|
-
if (res.data.code === 0) {
|
|
141
|
-
console.log('接口调用成功');
|
|
142
|
-
window.localStorage.setItem('curTenantId', e);
|
|
143
|
-
window.localStorage.setItem(
|
|
144
|
-
'curTenantName',
|
|
145
|
-
tenantList.find((item) => item.id === e)?.label,
|
|
146
|
-
);
|
|
147
|
-
window.location.reload();
|
|
148
|
-
} else {
|
|
149
|
-
message.warning(res.data.msg || '租户切换失败');
|
|
150
|
-
}
|
|
151
|
-
})
|
|
152
|
-
.catch((e) => console.log('e', e));
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
const menu = (
|
|
156
|
-
<Menu className="menu" selectedKeys={[]}>
|
|
157
|
-
<Menu.Item
|
|
158
|
-
key="personalCenter"
|
|
159
|
-
onClick={() =>
|
|
160
|
-
handleClickmenu(
|
|
161
|
-
['integration', 'LNRD', 'HBJK'].includes(stash) ?
|
|
162
|
-
'/admin-ui/data-share-portal/personal/info':
|
|
163
|
-
(stash === 'GZW'? '/data-platform/#/info/index' : '/#/info/index')
|
|
164
|
-
)
|
|
165
|
-
}
|
|
166
|
-
>
|
|
167
|
-
<img
|
|
168
|
-
src={PersonalCenterSrc}
|
|
169
|
-
alt=""
|
|
170
|
-
style={{ marginRight: '10px', marginTop: '-3px' }}
|
|
171
|
-
/>
|
|
172
|
-
<span>{['integration', 'LNRD', 'HBJK'].includes(stash) ? '用户中心' : '个人中心'}</span>
|
|
173
|
-
</Menu.Item>
|
|
174
|
-
{isHaveSystemManagementPermission && (
|
|
175
|
-
<Menu.Item key="systemManage" onClick={handleClickSysManage}>
|
|
176
|
-
<img
|
|
177
|
-
src={SystemManageSrc}
|
|
178
|
-
alt=""
|
|
179
|
-
style={{ marginRight: '10px', marginTop: '-3px' }}
|
|
180
|
-
/>
|
|
181
|
-
<span>系统管理</span>
|
|
182
|
-
</Menu.Item>
|
|
183
|
-
)}
|
|
184
|
-
{haveAppSystemPermission && (
|
|
185
|
-
<Menu.Item
|
|
186
|
-
key="appSystem"
|
|
187
|
-
onClick={() => handleClickmenu('/dataadmin/#/appSystem/index')}
|
|
188
|
-
>
|
|
189
|
-
<img
|
|
190
|
-
src={AppSystemSrc}
|
|
191
|
-
alt=""
|
|
192
|
-
style={{ marginRight: '10px', marginTop: '-3px' }}
|
|
193
|
-
/>
|
|
194
|
-
<span>应用系统配置</span>
|
|
195
|
-
</Menu.Item>
|
|
196
|
-
)}
|
|
197
|
-
<Menu.Item key="logout" onClick={() => logout()}>
|
|
198
|
-
<img
|
|
199
|
-
src={LogoutSrc}
|
|
200
|
-
alt=""
|
|
201
|
-
style={{ width: '15px', height: '15px', marginRight: '10px' }}
|
|
202
|
-
/>
|
|
203
|
-
<span>退出登录</span>
|
|
204
|
-
</Menu.Item>
|
|
205
|
-
</Menu>
|
|
206
|
-
);
|
|
207
|
-
|
|
208
|
-
return (
|
|
209
|
-
<div className={cn(stash !== 'LNRD'? 'right_size':'right_size_LNRD', 'right')}>
|
|
210
|
-
{['integration', 'LNRD', 'HBJK'].includes(stash) && [
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
<Select
|
|
216
|
-
defaultValue={curTenantId}
|
|
217
|
-
className={stash === 'LNRD'? 'right-select_LNRD': stash === 'HBJK'? 'right-select_HBJK' : 'right-select'}
|
|
218
|
-
style={{
|
|
219
|
-
width: 150,
|
|
220
|
-
border: 'none',
|
|
221
|
-
}}
|
|
222
|
-
onChange={handleChangeTenant}
|
|
223
|
-
options={tenantList}
|
|
224
|
-
/>,
|
|
225
|
-
]}
|
|
226
|
-
{getUserName() ? (
|
|
227
|
-
<HeaderDropdown overlay={menu}>
|
|
228
|
-
<span style={{ display: 'inline-block', marginLeft: '12px' }}>
|
|
229
|
-
<Avatar size="small" icon={<UserOutlined />} />
|
|
230
|
-
<span
|
|
231
|
-
style={{
|
|
232
|
-
marginLeft: '10px',
|
|
233
|
-
verticalAlign: '-2px',
|
|
234
|
-
fontSize: '16px',
|
|
235
|
-
fontWeight: '500',
|
|
236
|
-
// color: stash !== 'LNRD'? null: '#FFFFFF'
|
|
237
|
-
color: ['LNRD','HBJK'].includes(stash)? '#FFFFFF' : null
|
|
238
|
-
}}
|
|
239
|
-
>
|
|
240
|
-
{getUserName()}
|
|
241
|
-
</span>
|
|
242
|
-
<CaretDownOutlined
|
|
243
|
-
style={{ marginLeft: '10px', fontSize: '8px', color: ['LNRD','HBJK'].includes(stash)? '#FFFFFF': '#333333'}}
|
|
244
|
-
/>
|
|
245
|
-
</span>
|
|
246
|
-
</HeaderDropdown>
|
|
247
|
-
) : (
|
|
248
|
-
<Spin
|
|
249
|
-
size="small"
|
|
250
|
-
style={{
|
|
251
|
-
marginLeft: 8,
|
|
252
|
-
marginRight: 8,
|
|
253
|
-
lineHeight: '57px',
|
|
254
|
-
textAlign: 'center',
|
|
255
|
-
}}
|
|
256
|
-
/>
|
|
257
|
-
)}
|
|
258
|
-
</div>
|
|
259
|
-
);
|
|
260
|
-
};
|
|
261
|
-
|
|
262
|
-
export default ModuleUser;
|
|
1
|
+
import React, { Component, useEffect, useState } from 'react';
|
|
2
|
+
import { Popconfirm, message, Dropdown, Button, Select } from 'antd';
|
|
3
|
+
import { userMenuIcon } from './constData';
|
|
4
|
+
import {
|
|
5
|
+
HomeOutlined,
|
|
6
|
+
UserOutlined,
|
|
7
|
+
CaretDownOutlined,
|
|
8
|
+
} from '@ant-design/icons';
|
|
9
|
+
import { Spin, Menu, Avatar } from 'antd';
|
|
10
|
+
import HeaderDropdown from './HeaderDropdown';
|
|
11
|
+
import Axios from '../util/axios';
|
|
12
|
+
import getStore, { getUserName } from '../util/userInfo';
|
|
13
|
+
import './index.less';
|
|
14
|
+
import cn from 'classnames'
|
|
15
|
+
|
|
16
|
+
// stash存在则为一体化,否则为轻量级
|
|
17
|
+
const ModuleUser = ({ stash = '' }) => {
|
|
18
|
+
const [tenantList, setTenantList] = useState([]);
|
|
19
|
+
const [haveAppSystemPermission, setHaveAppSystemPermission] = useState(false);
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
localStorage.setItem('stash', stash)
|
|
22
|
+
if (['integration', 'LNRD', 'HBJK'].includes(stash)) {
|
|
23
|
+
getTenantList();
|
|
24
|
+
allSystemList();
|
|
25
|
+
}
|
|
26
|
+
}, []);
|
|
27
|
+
const handleClickmenu = (url) => {
|
|
28
|
+
window.location.href = url;
|
|
29
|
+
};
|
|
30
|
+
const handleClickSysManage = () => {
|
|
31
|
+
if(['integration', 'LNRD', 'HBJK'].includes(stash)){
|
|
32
|
+
Axios('get', '/admin-api/system/auth/homePage', '', {})
|
|
33
|
+
.then((res) => {
|
|
34
|
+
if (res.data.code === 0) {
|
|
35
|
+
window.location.href = `/admin-ui${res.data.data.path}`;
|
|
36
|
+
} else {
|
|
37
|
+
message.warning(res.data.msg || '获取系统管理页面路由信息失败');
|
|
38
|
+
}
|
|
39
|
+
})
|
|
40
|
+
.catch((e) => console.log('e', e));
|
|
41
|
+
}else{
|
|
42
|
+
const menuList = getStore({name: 'menu'});
|
|
43
|
+
const sysManagePath= menuList?.find(item=>item.name === '权限管理').children[0].path
|
|
44
|
+
window.location.href = stash === 'GZW' ? '/data-platform/#'+ sysManagePath : '/#'+ sysManagePath
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
const {
|
|
48
|
+
PersonalCenterSrc,
|
|
49
|
+
MessageCenterSrc,
|
|
50
|
+
SystemManageSrc,
|
|
51
|
+
LogoutSrc,
|
|
52
|
+
AppSystemSrc,
|
|
53
|
+
} = userMenuIcon;
|
|
54
|
+
|
|
55
|
+
const isHaveSystemManagementPermission = (['integration', 'LNRD', 'HBJK'].includes(stash))
|
|
56
|
+
? true
|
|
57
|
+
: getStore({ name: 'isHaveSystemManagementPermission' });
|
|
58
|
+
const DEFAULT_LOGOUT_URL = (['integration', 'LNRD', 'HBJK'].includes(stash)) ? '/admin-ui/login' : (stash === 'GZW'? '/data-platform/#/login' : '/#/login');
|
|
59
|
+
|
|
60
|
+
// 跳转服务门户
|
|
61
|
+
const jumpToExterHome = () => {
|
|
62
|
+
handleClickmenu('/admin-ui/data-share-portal/homePage');
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const curTenantId = ['integration', 'LNRD', 'HBJK'].includes(stash)
|
|
66
|
+
? getStore({ name: 'tenantId' }) && parseInt(getStore({ name: 'tenantId' }))
|
|
67
|
+
: '';
|
|
68
|
+
const curTenantName = ['integration', 'LNRD', 'HBJK'].includes(stash) ? getStore({ name: 'tenantName' }) : '';
|
|
69
|
+
|
|
70
|
+
const getTenantList = () => {
|
|
71
|
+
Axios('get', '/admin-api/system/user/getUserTenant', '', {})
|
|
72
|
+
.then((res) => {
|
|
73
|
+
if (res.data.code === 0) {
|
|
74
|
+
let tenantLists =
|
|
75
|
+
res.data.data &&
|
|
76
|
+
res.data.data.map((item) => {
|
|
77
|
+
return {
|
|
78
|
+
id: item.id,
|
|
79
|
+
value: item.id,
|
|
80
|
+
label: item.name,
|
|
81
|
+
};
|
|
82
|
+
});
|
|
83
|
+
setTenantList(tenantLists || []);
|
|
84
|
+
}
|
|
85
|
+
})
|
|
86
|
+
.catch((e) => console.log('e', e));
|
|
87
|
+
};
|
|
88
|
+
const allSystemList = () => {
|
|
89
|
+
Axios(
|
|
90
|
+
'get',
|
|
91
|
+
'/admin-api/system/user/get-user-menu-List?menuName=数据平台',
|
|
92
|
+
'',
|
|
93
|
+
{},
|
|
94
|
+
)
|
|
95
|
+
.then((res) => {
|
|
96
|
+
if (res.data.code === 0) {
|
|
97
|
+
let menuGet =
|
|
98
|
+
res.data.data &&
|
|
99
|
+
res.data.data[0]?.routes?.map((item) => {
|
|
100
|
+
return {
|
|
101
|
+
...item,
|
|
102
|
+
path:
|
|
103
|
+
item.path.indexOf('/') !== -1 ? item.path : '/' + item.path,
|
|
104
|
+
};
|
|
105
|
+
});
|
|
106
|
+
let haveAppSystem_Permission =
|
|
107
|
+
menuGet?.some((item) => item.name === '应用系统配置') || false;
|
|
108
|
+
setHaveAppSystemPermission(haveAppSystem_Permission);
|
|
109
|
+
}
|
|
110
|
+
})
|
|
111
|
+
.catch((e) => console.log('e', e));
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
// 退出登录
|
|
115
|
+
const logout = () => {
|
|
116
|
+
const logoutUrl = (['integration', 'LNRD', 'HBJK'].includes(stash))
|
|
117
|
+
? '/admin-api/system/auth/logout'
|
|
118
|
+
: (stash === 'GZW' ? '/data-platform/auth/token/logout' : '/auth/token/logout');
|
|
119
|
+
const logouType = (['integration', 'LNRD', 'HBJK'].includes(stash)) ? 'post' : 'delete';
|
|
120
|
+
Axios(logouType, logoutUrl, '', {})
|
|
121
|
+
.then(() => {
|
|
122
|
+
console.log('退出登录接口调用成功');
|
|
123
|
+
localStorage.clear();
|
|
124
|
+
sessionStorage.clear();
|
|
125
|
+
window.location.href = DEFAULT_LOGOUT_URL;
|
|
126
|
+
})
|
|
127
|
+
.catch((error) => {
|
|
128
|
+
console.error('Error while logging out, error:', error);
|
|
129
|
+
message.error('服务器错误,请稍后重试');
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
// 切换租户改缓存、调接口、刷界面
|
|
134
|
+
const handleChangeTenant = (e) => {
|
|
135
|
+
let token = getStore({ name: 'access_token' });
|
|
136
|
+
Axios('post', `/admin-api/system/auth/setRedisTokenOfTenant`, '', {
|
|
137
|
+
data: { token, tenantId: e },
|
|
138
|
+
})
|
|
139
|
+
.then((res) => {
|
|
140
|
+
if (res.data.code === 0) {
|
|
141
|
+
console.log('接口调用成功');
|
|
142
|
+
window.localStorage.setItem('curTenantId', e);
|
|
143
|
+
window.localStorage.setItem(
|
|
144
|
+
'curTenantName',
|
|
145
|
+
tenantList.find((item) => item.id === e)?.label,
|
|
146
|
+
);
|
|
147
|
+
window.location.reload();
|
|
148
|
+
} else {
|
|
149
|
+
message.warning(res.data.msg || '租户切换失败');
|
|
150
|
+
}
|
|
151
|
+
})
|
|
152
|
+
.catch((e) => console.log('e', e));
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
const menu = (
|
|
156
|
+
<Menu className="menu" selectedKeys={[]}>
|
|
157
|
+
<Menu.Item
|
|
158
|
+
key="personalCenter"
|
|
159
|
+
onClick={() =>
|
|
160
|
+
handleClickmenu(
|
|
161
|
+
['integration', 'LNRD', 'HBJK'].includes(stash) ?
|
|
162
|
+
'/admin-ui/data-share-portal/personal/info':
|
|
163
|
+
(stash === 'GZW'? '/data-platform/#/info/index' : '/#/info/index')
|
|
164
|
+
)
|
|
165
|
+
}
|
|
166
|
+
>
|
|
167
|
+
<img
|
|
168
|
+
src={PersonalCenterSrc}
|
|
169
|
+
alt=""
|
|
170
|
+
style={{ marginRight: '10px', marginTop: '-3px' }}
|
|
171
|
+
/>
|
|
172
|
+
<span>{['integration', 'LNRD', 'HBJK'].includes(stash) ? '用户中心' : '个人中心'}</span>
|
|
173
|
+
</Menu.Item>
|
|
174
|
+
{isHaveSystemManagementPermission && (
|
|
175
|
+
<Menu.Item key="systemManage" onClick={handleClickSysManage}>
|
|
176
|
+
<img
|
|
177
|
+
src={SystemManageSrc}
|
|
178
|
+
alt=""
|
|
179
|
+
style={{ marginRight: '10px', marginTop: '-3px' }}
|
|
180
|
+
/>
|
|
181
|
+
<span>系统管理</span>
|
|
182
|
+
</Menu.Item>
|
|
183
|
+
)}
|
|
184
|
+
{haveAppSystemPermission && (
|
|
185
|
+
<Menu.Item
|
|
186
|
+
key="appSystem"
|
|
187
|
+
onClick={() => handleClickmenu('/dataadmin/#/appSystem/index')}
|
|
188
|
+
>
|
|
189
|
+
<img
|
|
190
|
+
src={AppSystemSrc}
|
|
191
|
+
alt=""
|
|
192
|
+
style={{ marginRight: '10px', marginTop: '-3px' }}
|
|
193
|
+
/>
|
|
194
|
+
<span>应用系统配置</span>
|
|
195
|
+
</Menu.Item>
|
|
196
|
+
)}
|
|
197
|
+
<Menu.Item key="logout" onClick={() => logout()}>
|
|
198
|
+
<img
|
|
199
|
+
src={LogoutSrc}
|
|
200
|
+
alt=""
|
|
201
|
+
style={{ width: '15px', height: '15px', marginRight: '10px' }}
|
|
202
|
+
/>
|
|
203
|
+
<span>退出登录</span>
|
|
204
|
+
</Menu.Item>
|
|
205
|
+
</Menu>
|
|
206
|
+
);
|
|
207
|
+
|
|
208
|
+
return (
|
|
209
|
+
<div className={cn(stash !== 'LNRD'? 'right_size':'right_size_LNRD', 'right')}>
|
|
210
|
+
{['integration', 'LNRD', 'HBJK'].includes(stash) && [
|
|
211
|
+
<Button type="link" onClick={jumpToExterHome}
|
|
212
|
+
className={cn(stash === 'LNRD'? 'fwmh_color_LNRD': stash === 'HBJK'? 'fwmh_color_HBJK' : null)}>
|
|
213
|
+
服务门户
|
|
214
|
+
</Button>,
|
|
215
|
+
<Select
|
|
216
|
+
defaultValue={curTenantId}
|
|
217
|
+
className={stash === 'LNRD'? 'right-select_LNRD': stash === 'HBJK'? 'right-select_HBJK' : 'right-select'}
|
|
218
|
+
style={{
|
|
219
|
+
width: 150,
|
|
220
|
+
border: 'none',
|
|
221
|
+
}}
|
|
222
|
+
onChange={handleChangeTenant}
|
|
223
|
+
options={tenantList}
|
|
224
|
+
/>,
|
|
225
|
+
]}
|
|
226
|
+
{getUserName() ? (
|
|
227
|
+
<HeaderDropdown overlay={menu}>
|
|
228
|
+
<span style={{ display: 'inline-block', marginLeft: '12px' }}>
|
|
229
|
+
<Avatar size="small" icon={<UserOutlined />} />
|
|
230
|
+
<span
|
|
231
|
+
style={{
|
|
232
|
+
marginLeft: '10px',
|
|
233
|
+
verticalAlign: '-2px',
|
|
234
|
+
fontSize: '16px',
|
|
235
|
+
fontWeight: '500',
|
|
236
|
+
// color: stash !== 'LNRD'? null: '#FFFFFF'
|
|
237
|
+
color: ['LNRD','HBJK'].includes(stash)? '#FFFFFF' : null
|
|
238
|
+
}}
|
|
239
|
+
>
|
|
240
|
+
{getUserName()}
|
|
241
|
+
</span>
|
|
242
|
+
<CaretDownOutlined
|
|
243
|
+
style={{ marginLeft: '10px', fontSize: '8px', color: ['LNRD','HBJK'].includes(stash)? '#FFFFFF': '#333333'}}
|
|
244
|
+
/>
|
|
245
|
+
</span>
|
|
246
|
+
</HeaderDropdown>
|
|
247
|
+
) : (
|
|
248
|
+
<Spin
|
|
249
|
+
size="small"
|
|
250
|
+
style={{
|
|
251
|
+
marginLeft: 8,
|
|
252
|
+
marginRight: 8,
|
|
253
|
+
lineHeight: '57px',
|
|
254
|
+
textAlign: 'center',
|
|
255
|
+
}}
|
|
256
|
+
/>
|
|
257
|
+
)}
|
|
258
|
+
</div>
|
|
259
|
+
);
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
export default ModuleUser;
|