module-menu 0.2.25 → 0.2.27
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,4 +1,4 @@
|
|
|
1
|
-
export const menuList = (stash) => [
|
|
1
|
+
export const menuList = (stash = '') => [
|
|
2
2
|
{
|
|
3
3
|
name: '首页',
|
|
4
4
|
url: require('../../assets/home.svg'),
|
|
@@ -10,7 +10,7 @@ export const menuList = (stash) => [
|
|
|
10
10
|
children: [
|
|
11
11
|
{
|
|
12
12
|
childName: '数据集成',
|
|
13
|
-
path: stash ? '/datacollect' : '/datacollection',
|
|
13
|
+
path: stash === 'integration' ? '/datacollect' : '/datacollection',
|
|
14
14
|
url: require('../../assets/datacollection_slogo.svg'),
|
|
15
15
|
},
|
|
16
16
|
],
|
|
@@ -21,7 +21,7 @@ export const menuList = (stash) => [
|
|
|
21
21
|
children: [
|
|
22
22
|
{
|
|
23
23
|
childName: '数据治理',
|
|
24
|
-
path: stash ? '/datamanage' : '/dataManager',
|
|
24
|
+
path: stash === 'integration' ? '/datamanage' : '/dataManager',
|
|
25
25
|
url: require('../../assets/datamanager_slogo.svg'),
|
|
26
26
|
},
|
|
27
27
|
{
|
|
@@ -31,7 +31,7 @@ export const menuList = (stash) => [
|
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
childName: '数据质量',
|
|
34
|
-
path: stash ? '/quality' : '/quality/',
|
|
34
|
+
path: stash === 'integration' ? '/quality' : '/quality/',
|
|
35
35
|
url: require('../../assets/quality_slogo.svg'),
|
|
36
36
|
},
|
|
37
37
|
],
|
|
@@ -42,7 +42,7 @@ export const menuList = (stash) => [
|
|
|
42
42
|
children: [
|
|
43
43
|
{
|
|
44
44
|
childName: '离线开发',
|
|
45
|
-
path: stash ? '/datadev' : '/datadev/',
|
|
45
|
+
path: stash === 'integration' ? '/datadev' : '/datadev/',
|
|
46
46
|
url: require('../../assets/datadev_slogo.svg'),
|
|
47
47
|
},
|
|
48
48
|
{
|
|
@@ -55,7 +55,7 @@ export const menuList = (stash) => [
|
|
|
55
55
|
{
|
|
56
56
|
name: '数据共享',
|
|
57
57
|
url: require('../../assets/ic_shujukaifang_m.svg'),
|
|
58
|
-
children: stash
|
|
58
|
+
children: stash === 'integration'
|
|
59
59
|
? [
|
|
60
60
|
{
|
|
61
61
|
childName: '数据服务',
|
|
@@ -74,7 +74,7 @@ export const menuList = (stash) => [
|
|
|
74
74
|
},
|
|
75
75
|
{
|
|
76
76
|
childName: '目录管理',
|
|
77
|
-
path: '/
|
|
77
|
+
path: '/catalog',
|
|
78
78
|
url: require('../../assets/muluguanli_slogo.png'),
|
|
79
79
|
},
|
|
80
80
|
{
|
|
@@ -84,17 +84,17 @@ export const menuList = (stash) => [
|
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
86
|
childName: '供需对接',
|
|
87
|
-
path: '/
|
|
87
|
+
path: '/supply-and-demand-docking',
|
|
88
88
|
url: require('../../assets/gongxuduijie_slogo.png'),
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
91
|
childName: '数据直达',
|
|
92
|
-
path: '/
|
|
92
|
+
path: '/cascade',
|
|
93
93
|
url: require('../../assets/jilianguanl_slogo.png'),
|
|
94
94
|
},
|
|
95
95
|
{
|
|
96
96
|
childName: '综合评价系统',
|
|
97
|
-
path: '/
|
|
97
|
+
path: '/evaluate',
|
|
98
98
|
url: require('../../assets/ic_pingjia.png'),
|
|
99
99
|
},
|
|
100
100
|
]
|
|
@@ -130,7 +130,7 @@ export const menuList = (stash) => [
|
|
|
130
130
|
{
|
|
131
131
|
name: '公共模块',
|
|
132
132
|
url: require('../../assets/ic_gonggongmokuai_m.svg'),
|
|
133
|
-
children: stash
|
|
133
|
+
children: stash === 'integration'
|
|
134
134
|
? [
|
|
135
135
|
{
|
|
136
136
|
childName: '运维中心',
|
|
@@ -162,7 +162,34 @@ export const menuList = (stash) => [
|
|
|
162
162
|
url: require('../../assets/ic_zonglan.png'),
|
|
163
163
|
},
|
|
164
164
|
]
|
|
165
|
-
:
|
|
165
|
+
: (stash === 'GZW'?
|
|
166
|
+
[
|
|
167
|
+
{
|
|
168
|
+
childName: '运维中心',
|
|
169
|
+
path: '/operate',
|
|
170
|
+
url: require('../../assets/operate_slogo.svg'),
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
childName: '系统管理',
|
|
174
|
+
path: '/data-platform/#/admin/user/index',
|
|
175
|
+
url: require('../../assets/admin_slogo.svg'),
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
childName: '工单管理',
|
|
179
|
+
url: require('../../assets/workorder_slogo.svg'),
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
childName: '消息中心',
|
|
183
|
+
path: '/alert',
|
|
184
|
+
url: require('../../assets/alert_slogo.svg'),
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
childName: '数据安全',
|
|
188
|
+
path: '/datasecurity',
|
|
189
|
+
url: require('../../assets/datasecurity_slogo.png'),
|
|
190
|
+
},
|
|
191
|
+
] :
|
|
192
|
+
[
|
|
166
193
|
{
|
|
167
194
|
childName: '运维中心',
|
|
168
195
|
path: '/operate',
|
|
@@ -187,7 +214,7 @@ export const menuList = (stash) => [
|
|
|
187
214
|
path: '/datasecurity',
|
|
188
215
|
url: require('../../assets/datasecurity_slogo.png'),
|
|
189
216
|
},
|
|
190
|
-
],
|
|
217
|
+
]),
|
|
191
218
|
},
|
|
192
219
|
];
|
|
193
220
|
export const menuIconSrc = require('../../assets/menuIcon.svg');
|
|
@@ -5,8 +5,14 @@ import HeaderDropdown from '../ModuleUser/HeaderDropdown';
|
|
|
5
5
|
import Axios from '../util/axios';
|
|
6
6
|
import _ from 'lodash';
|
|
7
7
|
import './index.less';
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
/*
|
|
9
|
+
*stash:
|
|
10
|
+
一体化 integration
|
|
11
|
+
轻量级 不传
|
|
12
|
+
轻量级-国资委 GZW
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
const ModuleMenu = ({ sysName, stash = '' }) => {
|
|
10
16
|
const [sessionMenu, setSessionMenu] = useState([]);
|
|
11
17
|
const [showMenuList, setshowMenuList] = useState(false);
|
|
12
18
|
const [menuList, setMenuList] = useState([]);
|
|
@@ -17,18 +23,7 @@ const ModuleMenu = ({ sysName, stash }) => {
|
|
|
17
23
|
}, []);
|
|
18
24
|
|
|
19
25
|
const getSessionMenu = () => {
|
|
20
|
-
if
|
|
21
|
-
const menuObj = JSON.parse(sessionStorage.getItem('bigdata-menu'));
|
|
22
|
-
let menuGet = menuObj?.content || [];
|
|
23
|
-
setSessionMenu(menuGet);
|
|
24
|
-
const menuLists = getNewMenuList(menuGet);
|
|
25
|
-
setMenuList(menuLists);
|
|
26
|
-
let exchangeInfo =
|
|
27
|
-
menuGet && menuGet.find((item) => item.path === '/exchange');
|
|
28
|
-
if (exchangeInfo) {
|
|
29
|
-
setCanOperatExchange(true);
|
|
30
|
-
}
|
|
31
|
-
} else {
|
|
26
|
+
if(stash === 'integration'){
|
|
32
27
|
Axios(
|
|
33
28
|
'get',
|
|
34
29
|
'/admin-api/system/user/get-user-menu-List?menuName=数据平台',
|
|
@@ -55,6 +50,17 @@ const ModuleMenu = ({ sysName, stash }) => {
|
|
|
55
50
|
}
|
|
56
51
|
})
|
|
57
52
|
.catch((e) => console.log('e', e));
|
|
53
|
+
}else{
|
|
54
|
+
const menuObj = JSON.parse(sessionStorage.getItem('bigdata-menu'));
|
|
55
|
+
let menuGet = menuObj?.content || [];
|
|
56
|
+
setSessionMenu(menuGet);
|
|
57
|
+
const menuLists = getNewMenuList(menuGet);
|
|
58
|
+
setMenuList(menuLists);
|
|
59
|
+
let exchangeInfo =
|
|
60
|
+
menuGet && menuGet.find((item) => item.path === '/exchange');
|
|
61
|
+
if (exchangeInfo) {
|
|
62
|
+
setCanOperatExchange(true);
|
|
63
|
+
}
|
|
58
64
|
}
|
|
59
65
|
};
|
|
60
66
|
|
|
@@ -161,7 +167,7 @@ const ModuleMenu = ({ sysName, stash }) => {
|
|
|
161
167
|
// 跳转首页
|
|
162
168
|
const toHomePage = (index) => {
|
|
163
169
|
if (index === 0) {
|
|
164
|
-
window.location.href =
|
|
170
|
+
window.location.href = stash === 'integration'? '/dataadmin/#/index' : (stash === 'GZW' ? '/data-platform/#/index' : '/#/index')
|
|
165
171
|
}
|
|
166
172
|
};
|
|
167
173
|
const getNewMenuList = (menuGet) => {
|
|
@@ -12,25 +12,20 @@ import Axios from '../util/axios';
|
|
|
12
12
|
import getStore, { getUserName } from '../util/userInfo';
|
|
13
13
|
import './index.less';
|
|
14
14
|
// stash存在则为一体化,否则为轻量级
|
|
15
|
-
const ModuleUser = ({ stash }) => {
|
|
15
|
+
const ModuleUser = ({ stash = '' }) => {
|
|
16
16
|
const [tenantList, setTenantList] = useState([]);
|
|
17
17
|
const [haveAppSystemPermission, setHaveAppSystemPermission] = useState(false);
|
|
18
18
|
useEffect(() => {
|
|
19
|
-
if (stash) {
|
|
19
|
+
if (stash === 'integration') {
|
|
20
20
|
getTenantList();
|
|
21
21
|
allSystemList();
|
|
22
22
|
}
|
|
23
23
|
}, []);
|
|
24
24
|
const handleClickmenu = (url) => {
|
|
25
25
|
window.location.href = url;
|
|
26
|
-
};
|
|
26
|
+
};
|
|
27
27
|
const handleClickSysManage = () => {
|
|
28
|
-
if
|
|
29
|
-
const menuList = getStore({name: 'menu'});
|
|
30
|
-
const sysManagePath= menuList?.find(item=>item.name === '权限管理').children[0].path
|
|
31
|
-
window.location.href = '/#'+ sysManagePath
|
|
32
|
-
// '/#/admin/user/index';
|
|
33
|
-
} else {
|
|
28
|
+
if(stash === 'integration'){
|
|
34
29
|
Axios('get', '/admin-api/system/auth/homePage', '', {})
|
|
35
30
|
.then((res) => {
|
|
36
31
|
if (res.data.code === 0) {
|
|
@@ -40,6 +35,10 @@ const ModuleUser = ({ stash }) => {
|
|
|
40
35
|
}
|
|
41
36
|
})
|
|
42
37
|
.catch((e) => console.log('e', e));
|
|
38
|
+
}else{
|
|
39
|
+
const menuList = getStore({name: 'menu'});
|
|
40
|
+
const sysManagePath= menuList?.find(item=>item.name === '权限管理').children[0].path
|
|
41
|
+
window.location.href = stash === 'GZW' ? '/data-platform/#'+ sysManagePath : '/#'+ sysManagePath
|
|
43
42
|
}
|
|
44
43
|
};
|
|
45
44
|
const {
|
|
@@ -50,20 +49,20 @@ const ModuleUser = ({ stash }) => {
|
|
|
50
49
|
AppSystemSrc,
|
|
51
50
|
} = userMenuIcon;
|
|
52
51
|
|
|
53
|
-
const isHaveSystemManagementPermission = stash
|
|
52
|
+
const isHaveSystemManagementPermission = (stash === 'integration')
|
|
54
53
|
? true
|
|
55
54
|
: getStore({ name: 'isHaveSystemManagementPermission' });
|
|
56
|
-
const DEFAULT_LOGOUT_URL =
|
|
55
|
+
const DEFAULT_LOGOUT_URL = (stash === 'integration') ? '/admin-ui/login' : (stash === 'GZW'? '/data-platform/#/login' : '/#/login');
|
|
57
56
|
|
|
58
57
|
// 跳转服务门户
|
|
59
58
|
const jumpToExterHome = () => {
|
|
60
59
|
handleClickmenu('/admin-ui/data-share-portal/homePage');
|
|
61
60
|
};
|
|
62
61
|
|
|
63
|
-
const curTenantId = stash
|
|
62
|
+
const curTenantId = stash === 'integration'
|
|
64
63
|
? getStore({ name: 'tenantId' }) && parseInt(getStore({ name: 'tenantId' }))
|
|
65
64
|
: '';
|
|
66
|
-
const curTenantName = stash ? getStore({ name: 'tenantName' }) : '';
|
|
65
|
+
const curTenantName = stash === 'integration' ? getStore({ name: 'tenantName' }) : '';
|
|
67
66
|
|
|
68
67
|
const getTenantList = () => {
|
|
69
68
|
Axios('get', '/admin-api/system/user/getUserTenant', '', {})
|
|
@@ -111,10 +110,10 @@ const ModuleUser = ({ stash }) => {
|
|
|
111
110
|
|
|
112
111
|
// 退出登录
|
|
113
112
|
const logout = () => {
|
|
114
|
-
|
|
115
|
-
? '/auth/
|
|
116
|
-
: '/
|
|
117
|
-
const logouType =
|
|
113
|
+
const logoutUrl = (stash === 'integration')
|
|
114
|
+
? '/admin-api/system/auth/logout'
|
|
115
|
+
: (stash === 'GZW' ? '/data-platform/auth/token/logout' : '/auth/token/logout');
|
|
116
|
+
const logouType = (stash === 'integration') ? 'post' : 'delete';
|
|
118
117
|
Axios(logouType, logoutUrl, '', {})
|
|
119
118
|
.then(() => {
|
|
120
119
|
console.log('退出登录接口调用成功');
|
|
@@ -156,9 +155,9 @@ const ModuleUser = ({ stash }) => {
|
|
|
156
155
|
key="personalCenter"
|
|
157
156
|
onClick={() =>
|
|
158
157
|
handleClickmenu(
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
158
|
+
stash === 'integration' ?
|
|
159
|
+
'/admin-ui/data-share-portal/personal/info':
|
|
160
|
+
(stash === 'GZW'? '/data-platform/#/info/index' : '/#/info/index')
|
|
162
161
|
)
|
|
163
162
|
}
|
|
164
163
|
>
|
|
@@ -167,7 +166,7 @@ const ModuleUser = ({ stash }) => {
|
|
|
167
166
|
alt=""
|
|
168
167
|
style={{ marginRight: '10px', marginTop: '-3px' }}
|
|
169
168
|
/>
|
|
170
|
-
<span>{
|
|
169
|
+
<span>{stash === 'integration' ? '用户中心' : '个人中心'}</span>
|
|
171
170
|
</Menu.Item>
|
|
172
171
|
{isHaveSystemManagementPermission && (
|
|
173
172
|
<Menu.Item key="systemManage" onClick={handleClickSysManage}>
|
|
@@ -205,7 +204,7 @@ const ModuleUser = ({ stash }) => {
|
|
|
205
204
|
|
|
206
205
|
return (
|
|
207
206
|
<div className="right">
|
|
208
|
-
{stash && [
|
|
207
|
+
{stash === 'integration' && [
|
|
209
208
|
<Button type="link" onClick={jumpToExterHome}>
|
|
210
209
|
服务门户
|
|
211
210
|
</Button>,
|
package/src/pages/util/axios.js
CHANGED
|
@@ -4,7 +4,7 @@ import baseCof from './config';
|
|
|
4
4
|
import getStore from './userInfo';
|
|
5
5
|
import { checkToken} from './permessionUtils';
|
|
6
6
|
|
|
7
|
-
let tokenValue='
|
|
7
|
+
let tokenValue='a39090d9-bf94-4342-9a1d-1b885cc5385b';
|
|
8
8
|
// tokenInSessionStor存在为一体化,不存在为轻量级
|
|
9
9
|
const tokenInSessionStor = window.sessionStorage.getItem('bigdata-access_token');
|
|
10
10
|
const DEFAULT_LOGOUT_URL = tokenInSessionStor? '/#/login':'/admin-ui/login'
|
|
@@ -93,14 +93,14 @@ function Axios(method, api, params, map) {
|
|
|
93
93
|
let httpDefult;
|
|
94
94
|
// 几个外部特殊接口
|
|
95
95
|
// 退出登录
|
|
96
|
-
if(api
|
|
96
|
+
if(api.includes('/auth/token/logout')){
|
|
97
97
|
httpDefult = {
|
|
98
98
|
method: method,
|
|
99
99
|
url: `${baseCof.baseSever}${api}`,
|
|
100
100
|
params: params,
|
|
101
101
|
...map,
|
|
102
102
|
};
|
|
103
|
-
} else if (api
|
|
103
|
+
} else if (api.includes('/admin/social/logoutUri')) {
|
|
104
104
|
httpDefult = {
|
|
105
105
|
method: method,
|
|
106
106
|
url: `${baseCof.baseSever}${api}`,
|