module-menu 0.2.41 → 0.2.44

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,6 +1,6 @@
1
1
  {
2
2
  "name": "module-menu",
3
- "version": "0.2.41",
3
+ "version": "0.2.44",
4
4
  "description": "城市大数据平台公共头部及尾部",
5
5
  "main": "src/pages/index.jsx",
6
6
  "scripts": {
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -15,6 +15,11 @@ export const menuList = (stash = '') => [
15
15
  // url: require('../../assets/datacollection_slogo.svg'),
16
16
  url: stash !=='LNRD' ? require('../../assets/datacollection_slogo.svg') : require('../../assets/datacollection_slogo_LNRD.svg'),
17
17
  },
18
+ {
19
+ childName: "数据填报",
20
+ path: "/datafill",
21
+ url: require('../../assets/dataApp/datafill.png'),
22
+ }
18
23
  ],
19
24
  },
20
25
  {
@@ -40,6 +45,11 @@ export const menuList = (stash = '') => [
40
45
  // url: require('../../assets/quality_slogo.svg'),
41
46
  url: stash !=='LNRD' ? require('../../assets/quality_slogo.svg') : require('../../assets/quality_slogo_LNRD.svg'),
42
47
  },
48
+ {
49
+ childName: "指标管理",
50
+ path: "/indicator",
51
+ url: require('../../assets/dataApp/indicator.png'),
52
+ },
43
53
  ],
44
54
  },
45
55
  {
@@ -108,12 +118,6 @@ export const menuList = (stash = '') => [
108
118
  // url: require('../../assets/jilianguanl_slogo.png'),
109
119
  url: stash !=='LNRD' ? require('../../assets/jilianguanl_slogo.png') : require('../../assets/jilianguanl_slogo_LNRD.svg'),
110
120
  },
111
- {
112
- childName: '综合评价系统',
113
- path: '/evaluate',
114
- // url: require('../../assets/ic_pingjia.png'),
115
- url: stash !=='LNRD' ? require('../../assets/ic_pingjia.png') : require('../../assets/ic_pingjia_LNRD.svg'),
116
- },
117
121
  ]
118
122
  : [
119
123
  {
@@ -140,10 +144,20 @@ export const menuList = (stash = '') => [
140
144
  children: [
141
145
  {
142
146
  childName: '数据标签',
143
- path: '',
147
+ path: '/datatag',
144
148
  // url: require('../../assets/datalabel_slogo.svg'),
145
149
  url: stash !=='LNRD' ? require('../../assets/datalabel_slogo.svg') : require('../../assets/datalabel_slogo_LNRD.svg'),
146
150
  },
151
+ {
152
+ childName: "数据可视化",
153
+ path: "/dataview",
154
+ url: require("../../assets/dataApp/dataview.png"),
155
+ },
156
+ {
157
+ childName: '综合评价系统',
158
+ path: '/evaluate',
159
+ url: stash !=='LNRD' ? require('../../assets/ic_pingjia.png') : require('../../assets/ic_pingjia_LNRD.svg'),
160
+ },
147
161
  ],
148
162
  },
149
163
  {
@@ -301,11 +315,11 @@ export const sysNameMap = (stash = '') => [
301
315
  // logoSrc: require('../../assets/datasharing_logo.svg'),
302
316
  logoSrc: stash !=='LNRD'? require('../../assets/datasharing_logo.svg'): require('../../assets/datasharing_logo_LNRD.svg'),
303
317
  },
304
- // {
305
- // sysName: 'dataManager',
306
- // title: '数据标签',
307
- // logoSrc: require('../../assets/datalabel_logo.svg'),
308
- // },
318
+ {
319
+ sysName: 'datatag',
320
+ title: '数据标签',
321
+ logoSrc: require('../../assets/biaoqian_logo.png'),
322
+ },
309
323
  {
310
324
  sysName: 'operate',
311
325
  title: '运维中心',
@@ -1,361 +1,384 @@
1
- import { useState, useEffect, useRef, useMemo } from 'react';
2
- import { Popconfirm, message, Popover } from 'antd';
3
- import { menuList as menuListInit, menuIconSrc, sysNameMap } from './constData';
4
- import HeaderDropdown from '../ModuleUser/HeaderDropdown';
5
- import Axios from '../util/axios';
6
- import _ from 'lodash';
7
- import './index.less';
8
- import cn from 'classnames'
9
- /*
10
- *stash:
11
- 一体化 integration
12
- 一体化 - 辽宁人大 LNRD
13
- 轻量级 不传
14
- 轻量级-国资委 GZW
15
- *
16
- */
17
- const ModuleMenu = ({ sysName, stash = '' }) => {
18
- const [sessionMenu, setSessionMenu] = useState([]);
19
- const [showMenuList, setshowMenuList] = useState(false);
20
- const [menuList, setMenuList] = useState([]);
21
- const [canOperatExchange, setCanOperatExchange] = useState(false); //是否具有政务共享平台权限
22
- useEffect(() => {
23
- localStorage.setItem('stash', stash)
24
- getSessionMenu();
25
- }, []);
26
-
27
- const getSessionMenu = () => {
28
- if(['integration', 'LNRD'].includes(stash)){
29
- Axios(
30
- 'get',
31
- '/admin-api/system/user/get-user-menu-List?menuName=数据平台',
32
- '',
33
- {},
34
- )
35
- .then((res) => {
36
- // const resD = JSON.parse(localStorage.getItem('moduleRoutes'))
37
- // let menuGet =
38
- // (resD?.map((item) => {
39
- // return {
40
- // ...item,
41
- // path:
42
- // item.path.indexOf('/') !== -1
43
- // ? item.path
44
- // : '/' + item.path,
45
- // };
46
- // })) ||
47
- // [];
48
- // console.log('menuGet', menuGet)
49
- // setSessionMenu(menuGet);
50
- // const menuLists = getNewMenuList(menuGet);
51
- // setMenuList(menuLists);
52
-
53
- if (res.data.code === 0) {
54
- let menuGet =
55
- (res.data.data &&
56
- res.data.data[0]?.routes?.map((item) => {
57
- return {
58
- ...item,
59
- path:
60
- item.path.indexOf('/') !== -1
61
- ? item.path
62
- : '/' + item.path,
63
- };
64
- })) ||
65
- [];
66
- console.log('menuGet', menuGet)
67
- setSessionMenu(menuGet);
68
- const menuLists = getNewMenuList(menuGet);
69
- setMenuList(menuLists);
70
- }
71
- })
72
- .catch((e) => console.log('e', e));
73
- }else{
74
- const menuObj = JSON.parse(sessionStorage.getItem('bigdata-menu'));
75
- let menuGet = menuObj?.content || [];
76
- setSessionMenu(menuGet);
77
- const menuLists = getNewMenuList(menuGet);
78
- setMenuList(menuLists);
79
- let exchangeInfo =
80
- menuGet && menuGet.find((item) => item.path === '/exchange');
81
- if (exchangeInfo) {
82
- setCanOperatExchange(true);
83
- }
84
- }
85
- };
86
-
87
- // 获取系统logo及title
88
- const getLogoAndTitle = () => {
89
- let sysInfo = sysNameMap(stash).find((item) => item.sysName === sysName);
90
- let logoAndTitle = { logoSrc: '', title: '' };
91
- if (sysInfo) {
92
- logoAndTitle.logoSrc = sysInfo.logoSrc;
93
- logoAndTitle.title = sysInfo.title;
94
- }
95
- return logoAndTitle;
96
- };
97
-
98
- // 跳转各个模块
99
- const toModulePage = (nameStr) => {
100
- if (!sessionMenu || sessionMenu.length === 0) {
101
- message.destroy();
102
- message.warning('没有获取到菜单列表,请联系管理员添加权限');
103
- return;
104
- }
105
-
106
- if (nameStr === '政务共享交换平台') {
107
- Axios('get', '/admin/social/logoutUri', '', {})
108
- .then((res) => {
109
- if (res.data.code === 0) {
110
- if (res.data.data.search('http') !== -1) {
111
- window.location.href = res.data.data;
112
- }
113
- } else {
114
- message.warning(res.data.msg || '获取信息失败');
115
- }
116
- })
117
- .catch((error) => {
118
- console.error('Error while logging out, error:', error);
119
- message.error('服务器错误,请稍后重试');
120
- });
121
- } else {
122
- if (nameStr === '平台运行总览') {
123
- window.open('/dataadmin/#/overview', '_blank');
124
- return;
125
- }
126
- let thirdPartyServiceJumpPath = ''; // 第三方服务跳转路径
127
- switch (nameStr) {
128
- case '数据集成':
129
- thirdPartyServiceJumpPath = '/datacollect/';
130
- break;
131
- case '数据治理':
132
- thirdPartyServiceJumpPath = '/datamanage/';
133
- break;
134
- case '元数据管理':
135
- thirdPartyServiceJumpPath = '/metadata/';
136
- break;
137
- case '数据质量':
138
- thirdPartyServiceJumpPath = '/quality/';
139
- break;
140
- case '离线开发':
141
- thirdPartyServiceJumpPath = '/datadev/';
142
- break;
143
- case '实时开发':
144
- thirdPartyServiceJumpPath = '/dataanalytic/';
145
- break;
146
- case '数据服务':
147
- thirdPartyServiceJumpPath = '/dataservice/';
148
- break;
149
- case '数据资产':
150
- thirdPartyServiceJumpPath = '/dataasset/';
151
- break;
152
- case '数据共享':
153
- thirdPartyServiceJumpPath = '/datasharing/';
154
- break;
155
- case '运维中心':
156
- thirdPartyServiceJumpPath = '/operate/';
157
- break;
158
- case '消息中心':
159
- thirdPartyServiceJumpPath = '/alert/';
160
- break;
161
- case '数据安全':
162
- thirdPartyServiceJumpPath = '/datasecurity/';
163
- break;
164
- case '目录管理':
165
- thirdPartyServiceJumpPath = '/admin-ui/catalog';
166
- break;
167
- case '资源管理':
168
- thirdPartyServiceJumpPath = '/admin-ui/resource/tableResource/list';
169
- break;
170
- case '供需对接':
171
- thirdPartyServiceJumpPath =
172
- '/admin-ui/supply-and-demand-docking/dataRequirement/propose/list';
173
- break;
174
- case '数据直达':
175
- thirdPartyServiceJumpPath = '/admin-ui/cascade';
176
- break;
177
- case '综合评价系统':
178
- thirdPartyServiceJumpPath = '/admin-ui/evaluate';
179
- break;
180
- default:
181
- break;
182
- }
183
- // 判断第三方服务是否有对应服务的菜单权限
184
- window.location.href = thirdPartyServiceJumpPath;
185
- }
186
- };
187
- // 跳转首页
188
- const toHomePage = (index) => {
189
- if (index === 0) {
190
- window.location.href = ['integration', 'LNRD'].includes(stash) ? '/dataadmin/#/index' : (stash === 'GZW' ? '/data-platform/#/index' : '/#/index')
191
- }
192
- };
193
- const getNewMenuList = (menuGet) => {
194
- let newMenuList = _.cloneDeep(menuListInit(stash));
195
- if (menuGet) {
196
- const pathList = menuGet.map((item) => item.path);
197
- // 过滤掉没有权限的子菜单(PS:如果模块下面子菜单都没有,则不显示该模块)
198
- for (let index = newMenuList.length - 1; index >= 0; index--) {
199
- const menuItem = newMenuList[index];
200
- for (
201
- let index_ch = menuItem.children.length - 1;
202
- index_ch >= 0;
203
- index_ch--
204
- ) {
205
- const child = menuItem.children[index_ch];
206
- if (!pathList.includes(child.path)) {
207
- newMenuList[index].children.splice(index_ch, 1);
208
- }
209
- }
210
- if (menuItem.children.length === 0 && menuItem.name !== '首页') {
211
- newMenuList.splice(index, 1);
212
- }
213
- }
214
- }
215
- return newMenuList;
216
- };
217
- const menu = menuList.map((item, index) => {
218
- return (
219
- <div
220
- key={item.name}
221
- className="cardLine"
222
- style={{
223
- height:
224
- item.children.length > 6
225
- ? '140px'
226
- : item.children.length > 3
227
- ? '90px'
228
- : '',
229
- }}
230
- >
231
- <div
232
- className="leftMenu"
233
- style={{
234
- height:
235
- item.children.length > 6
236
- ? '140px'
237
- : item.children.length > 3
238
- ? '96px'
239
- : '70px',
240
- lineHeight:
241
- item.children.length > 6
242
- ? '140px'
243
- : item.children.length > 3
244
- ? '45px'
245
- : '70px',
246
- }}
247
- >
248
- <img src={item.url} className={stash !== 'LNRD'? 'middle' : 'middle_LNRD'} />
249
- <span
250
- className={cn(stash !== 'LNRD'? 'middle' : 'middle_LNRD', 'textPad')}
251
- // className=`${{stash !== 'LNRD'? 'middle' : 'middle_LNRD'}} textPad`
252
- onClick={() => {
253
- toHomePage(index);
254
- }}
255
- >
256
- {item.name}
257
- </span>
258
- </div>
259
- <div
260
- className="rightMenu"
261
- style={{
262
- height:
263
- item.children.length > 6
264
- ? '140px'
265
- : item.children.length > 3
266
- ? '96px'
267
- : '70px',
268
- lineHeight:
269
- item.children.length > 6
270
- ? '45px'
271
- : item.children.length > 3
272
- ? '45px'
273
- : '70px',
274
- borderBottom:
275
- index === menuList.length - 1 ? '0px' : '1px solid #E9E9E9',
276
- }}
277
- >
278
- {index === 0 && canOperatExchange ? (
279
- <div key={'政务共享交换平台'}>
280
- <img
281
- src={require('../../assets/exchange_slogo.svg')}
282
- className="middle exchangeIcon"
283
- />
284
- <span
285
- className="middle exchangeCss"
286
- onClick={() => {
287
- toModulePage('政务共享交换平台');
288
- }}
289
- >
290
- 政务共享交换平台
291
- </span>
292
- </div>
293
- ) : (
294
- item.children.map((child, idx) => {
295
- return (
296
- <span key={child.childName}>
297
- <img src={child.url}
298
- className ={cn(stash !== 'LNRD'? 'middle': 'middle_LNRD', 'iconPad')}
299
- // className="middle iconPad"
300
- />
301
- <span
302
- className ={cn(stash !== 'LNRD'? 'childMenu' : 'childMenu_LNRD', stash !== 'LNRD'? 'middle' : 'middle_LNRD','textPad')}
303
- // className="childMenu textPad middle"
304
- onClick={() => {
305
- toModulePage(child.childName);
306
- }}
307
- >
308
- {child.childName}
309
- </span>
310
- </span>
311
- );
312
- })
313
- )}
314
- </div>
315
- </div>
316
- );
317
- });
318
-
319
- return (
320
- <div>
321
- <div className="menuPopupAndTitle">
322
- <div
323
- className={cn(stash !== 'LNRD'? 'menuIcon_size':'menuIcon_size_LNRD', 'menuIcon')}
324
- onMouseOver={() => setshowMenuList(true)}
325
- style={{
326
- // backgroundImage: `url(${menuIconSrc})`,
327
- backgroundRepeat: 'no-repeat',
328
- backgroundSize: '50%',
329
- backgroundPosition: 'center',
330
- backgroundColor: stash !== 'LNRD'? '#4091F7':'#EA1A1A',
331
- }}
332
- >
333
- <img src={menuIconSrc} className={cn(stash !== 'LNRD'? null:'menuIcon_img')}></img>
334
- </div>
335
- <div className={cn(stash !== 'LNRD'? 'menu_title_content_size':'menu_title_content_size_LNRD', 'menu_title_content')}
336
-
337
- >
338
- <img
339
- className="menu_title_content_img"
340
- src={getLogoAndTitle().logoSrc}
341
- alt="logo"
342
- />
343
- <span
344
- className={cn(stash !== 'LNRD'? 'menu_title_color':'menu_title_color_LNRD', 'menu_title')}
345
- // className="menu_title"
346
- >{getLogoAndTitle().title}</span>
347
- </div>
348
- </div>
349
- <div
350
- className={cn(stash !== 'LNRD'? 'menu_list_content_top':'menu_list_content_top_LNRD', 'menu_list_content')}
351
- // className="menu_list_content"
352
- style={{ display: showMenuList ? 'block' : 'none' }}
353
- onMouseOver={() => setshowMenuList(true)}
354
- onMouseOut={() => setshowMenuList(false)}
355
- >
356
- {menu}
357
- </div>
358
- </div>
359
- );
360
- };
361
- export default ModuleMenu;
1
+ import { useState, useEffect, useRef, useMemo } from 'react';
2
+ import { Popconfirm, message, Popover } from 'antd';
3
+ import { menuList as menuListInit, menuIconSrc, sysNameMap } from './constData';
4
+ import HeaderDropdown from '../ModuleUser/HeaderDropdown';
5
+ import { getInfoByName, getUrlByInfo } from './service.js'
6
+ import Axios from '../util/axios';
7
+ import _ from 'lodash';
8
+ import './index.less';
9
+ import cn from 'classnames'
10
+ /*
11
+ *stash:
12
+ 一体化 integration
13
+ 一体化 - 辽宁人大 LNRD
14
+ 轻量级 不传
15
+ 轻量级-国资委 GZW
16
+ *
17
+ */
18
+ const ModuleMenu = ({ sysName, stash = '' }) => {
19
+ const [sessionMenu, setSessionMenu] = useState([]);
20
+ const [showMenuList, setshowMenuList] = useState(false);
21
+ const [menuList, setMenuList] = useState([]);
22
+ const [canOperatExchange, setCanOperatExchange] = useState(false); //是否具有政务共享平台权限
23
+ useEffect(() => {
24
+ localStorage.setItem('stash', stash)
25
+ getSessionMenu();
26
+ }, []);
27
+
28
+ const getSessionMenu = () => {
29
+ if(['integration', 'LNRD'].includes(stash)){
30
+ Axios(
31
+ 'get',
32
+ '/admin-api/system/user/get-user-menu-List?menuName=数据平台',
33
+ '',
34
+ {},
35
+ )
36
+ .then((res) => {
37
+ // const resD = JSON.parse(localStorage.getItem('moduleRoutes'))
38
+ // let menuGet =
39
+ // (resD?.map((item) => {
40
+ // return {
41
+ // ...item,
42
+ // path:
43
+ // item.path.indexOf('/') !== -1
44
+ // ? item.path
45
+ // : '/' + item.path,
46
+ // };
47
+ // })) ||
48
+ // [];
49
+ // console.log('menuGet', menuGet)
50
+ // setSessionMenu(menuGet);
51
+ // const menuLists = getNewMenuList(menuGet);
52
+ // setMenuList(menuLists);
53
+
54
+ if (res.data.code === 0) {
55
+ let menuGet =
56
+ (res.data.data &&
57
+ res.data.data[0]?.routes?.map((item) => {
58
+ return {
59
+ ...item,
60
+ path:
61
+ item.path.indexOf('/') !== -1
62
+ ? item.path
63
+ : '/' + item.path,
64
+ };
65
+ })) ||
66
+ [];
67
+ console.log('menuGet', menuGet)
68
+ setSessionMenu(menuGet);
69
+ const menuLists = getNewMenuList(menuGet);
70
+ setMenuList(menuLists);
71
+ }
72
+ })
73
+ .catch((e) => console.log('e', e));
74
+ }else{
75
+ const menuObj = JSON.parse(sessionStorage.getItem('bigdata-menu'));
76
+ let menuGet = menuObj?.content || [];
77
+ setSessionMenu(menuGet);
78
+ const menuLists = getNewMenuList(menuGet);
79
+ setMenuList(menuLists);
80
+ let exchangeInfo =
81
+ menuGet && menuGet.find((item) => item.path === '/exchange');
82
+ if (exchangeInfo) {
83
+ setCanOperatExchange(true);
84
+ }
85
+ }
86
+ };
87
+
88
+ // 获取系统logo及title
89
+ const getLogoAndTitle = () => {
90
+ let sysInfo = sysNameMap(stash).find((item) => item.sysName === sysName);
91
+ let logoAndTitle = { logoSrc: '', title: '' };
92
+ if (sysInfo) {
93
+ logoAndTitle.logoSrc = sysInfo.logoSrc;
94
+ logoAndTitle.title = sysInfo.title;
95
+ }
96
+ return logoAndTitle;
97
+ };
98
+
99
+ const getUrl = async (name) => {
100
+ let res = null;
101
+ let obj = {}
102
+ res = await getInfoByName(name)
103
+ obj = {
104
+ clientId: res.data.data.clientId,
105
+ redirectUrl: encodeURIComponent(res.data.data.redirectUris[0]),
106
+ }
107
+ res = await getUrlByInfo(obj)
108
+ return res.data.data
109
+ },
110
+
111
+
112
+ // 跳转各个模块
113
+ const toModulePage = async (nameStr) => {
114
+ if (!sessionMenu || sessionMenu.length === 0) {
115
+ message.destroy();
116
+ message.warning('没有获取到菜单列表,请联系管理员添加权限');
117
+ return;
118
+ }
119
+
120
+ if (nameStr === '政务共享交换平台') {
121
+ Axios('get', '/admin/social/logoutUri', '', {})
122
+ .then((res) => {
123
+ if (res.data.code === 0) {
124
+ if (res.data.data.search('http') !== -1) {
125
+ window.location.href = res.data.data;
126
+ }
127
+ } else {
128
+ message.warning(res.data.msg || '获取信息失败');
129
+ }
130
+ })
131
+ .catch((error) => {
132
+ console.error('Error while logging out, error:', error);
133
+ message.error('服务器错误,请稍后重试');
134
+ });
135
+ } else {
136
+ if (nameStr === '平台运行总览') {
137
+ window.open('/dataadmin/#/overview', '_blank');
138
+ return;
139
+ }
140
+ let thirdPartyServiceJumpPath = ''; // 第三方服务跳转路径
141
+ switch (nameStr) {
142
+ case '数据集成':
143
+ thirdPartyServiceJumpPath = '/datacollect/';
144
+ break;
145
+ case '数据治理':
146
+ thirdPartyServiceJumpPath = '/datamanage/';
147
+ break;
148
+ case '元数据管理':
149
+ thirdPartyServiceJumpPath = '/metadata/';
150
+ break;
151
+ case '数据质量':
152
+ thirdPartyServiceJumpPath = '/quality/';
153
+ break;
154
+ case '离线开发':
155
+ thirdPartyServiceJumpPath = '/datadev/';
156
+ break;
157
+ case '实时开发':
158
+ thirdPartyServiceJumpPath = '/dataanalytic/';
159
+ break;
160
+ case '数据服务':
161
+ thirdPartyServiceJumpPath = '/dataservice/';
162
+ break;
163
+ case '数据资产':
164
+ thirdPartyServiceJumpPath = '/dataasset/';
165
+ break;
166
+ case '数据共享':
167
+ thirdPartyServiceJumpPath = '/datasharing/';
168
+ break;
169
+ case '运维中心':
170
+ thirdPartyServiceJumpPath = '/operate/';
171
+ break;
172
+ case '消息中心':
173
+ thirdPartyServiceJumpPath = '/alert/';
174
+ break;
175
+ case '数据安全':
176
+ thirdPartyServiceJumpPath = '/datasecurity/';
177
+ break;
178
+ case '目录管理':
179
+ thirdPartyServiceJumpPath = '/admin-ui/catalog';
180
+ break;
181
+ case '资源管理':
182
+ thirdPartyServiceJumpPath = '/admin-ui/resource/tableResource/list';
183
+ break;
184
+ case '供需对接':
185
+ thirdPartyServiceJumpPath =
186
+ '/admin-ui/supply-and-demand-docking/dataRequirement/propose/list';
187
+ break;
188
+ case '数据直达':
189
+ thirdPartyServiceJumpPath = '/admin-ui/cascade';
190
+ break;
191
+ case '综合评价系统':
192
+ thirdPartyServiceJumpPath = '/admin-ui/evaluate';
193
+ break;
194
+ case '数据标签':
195
+ thirdPartyServiceJumpPath = '/datatag/';
196
+ break;
197
+ case '数据可视化':
198
+ thirdPartyServiceJumpPath = await this.getUrl('dataview')
199
+ break;
200
+ case '数据填报':
201
+ thirdPartyServiceJumpPath = await this.getUrl('datafill')
202
+ break;
203
+ default:
204
+ break;
205
+ }
206
+ // 判断第三方服务是否有对应服务的菜单权限
207
+ window.location.href = thirdPartyServiceJumpPath;
208
+ }
209
+ };
210
+ // 跳转首页
211
+ const toHomePage = (index) => {
212
+ if (index === 0) {
213
+ window.location.href = ['integration', 'LNRD'].includes(stash) ? '/dataadmin/#/index' : (stash === 'GZW' ? '/data-platform/#/index' : '/#/index')
214
+ }
215
+ };
216
+ const getNewMenuList = (menuGet) => {
217
+ let newMenuList = _.cloneDeep(menuListInit(stash));
218
+ if (menuGet) {
219
+ const pathList = menuGet.map((item) => item.path);
220
+ // 过滤掉没有权限的子菜单(PS:如果模块下面子菜单都没有,则不显示该模块)
221
+ for (let index = newMenuList.length - 1; index >= 0; index--) {
222
+ const menuItem = newMenuList[index];
223
+ for (
224
+ let index_ch = menuItem.children.length - 1;
225
+ index_ch >= 0;
226
+ index_ch--
227
+ ) {
228
+ const child = menuItem.children[index_ch];
229
+ if (!pathList.includes(child.path)) {
230
+ newMenuList[index].children.splice(index_ch, 1);
231
+ }
232
+ }
233
+ if (menuItem.children.length === 0 && menuItem.name !== '首页') {
234
+ newMenuList.splice(index, 1);
235
+ }
236
+ }
237
+ }
238
+ return newMenuList;
239
+ };
240
+ const menu = menuList.map((item, index) => {
241
+ return (
242
+ <div
243
+ key={item.name}
244
+ className="cardLine"
245
+ style={{
246
+ height:
247
+ item.children.length > 6
248
+ ? '140px'
249
+ : item.children.length > 3
250
+ ? '90px'
251
+ : '',
252
+ }}
253
+ >
254
+ <div
255
+ className="leftMenu"
256
+ style={{
257
+ height:
258
+ item.children.length > 6
259
+ ? '140px'
260
+ : item.children.length > 3
261
+ ? '96px'
262
+ : '70px',
263
+ lineHeight:
264
+ item.children.length > 6
265
+ ? '140px'
266
+ : item.children.length > 3
267
+ ? '45px'
268
+ : '70px',
269
+ }}
270
+ >
271
+ <img src={item.url} className={stash !== 'LNRD'? 'middle' : 'middle_LNRD'} />
272
+ <span
273
+ className={cn(stash !== 'LNRD'? 'middle' : 'middle_LNRD', 'textPad')}
274
+ // className=`${{stash !== 'LNRD'? 'middle' : 'middle_LNRD'}} textPad`
275
+ onClick={() => {
276
+ toHomePage(index);
277
+ }}
278
+ >
279
+ {item.name}
280
+ </span>
281
+ </div>
282
+ <div
283
+ className="rightMenu"
284
+ style={{
285
+ height:
286
+ item.children.length > 6
287
+ ? '140px'
288
+ : item.children.length > 3
289
+ ? '96px'
290
+ : '70px',
291
+ lineHeight:
292
+ item.children.length > 6
293
+ ? '45px'
294
+ : item.children.length > 3
295
+ ? '45px'
296
+ : '70px',
297
+ borderBottom:
298
+ index === menuList.length - 1 ? '0px' : '1px solid #E9E9E9',
299
+ }}
300
+ >
301
+ {index === 0 && canOperatExchange ? (
302
+ <div key={'政务共享交换平台'}>
303
+ <img
304
+ src={require('../../assets/exchange_slogo.svg')}
305
+ className="middle exchangeIcon"
306
+ />
307
+ <span
308
+ className="middle exchangeCss"
309
+ onClick={() => {
310
+ toModulePage('政务共享交换平台');
311
+ }}
312
+ >
313
+ 政务共享交换平台
314
+ </span>
315
+ </div>
316
+ ) : (
317
+ item.children.map((child, idx) => {
318
+ return (
319
+ <span key={child.childName}>
320
+ <img src={child.url}
321
+ className ={cn(stash !== 'LNRD'? 'middle': 'middle_LNRD', 'iconPad')}
322
+ // className="middle iconPad"
323
+ />
324
+ <span
325
+ className ={cn(stash !== 'LNRD'? 'childMenu' : 'childMenu_LNRD', stash !== 'LNRD'? 'middle' : 'middle_LNRD','textPad')}
326
+ // className="childMenu textPad middle"
327
+ onClick={() => {
328
+ toModulePage(child.childName);
329
+ }}
330
+ >
331
+ {child.childName}
332
+ </span>
333
+ </span>
334
+ );
335
+ })
336
+ )}
337
+ </div>
338
+ </div>
339
+ );
340
+ });
341
+
342
+ return (
343
+ <div>
344
+ <div className="menuPopupAndTitle">
345
+ <div
346
+ className={cn(stash !== 'LNRD'? 'menuIcon_size':'menuIcon_size_LNRD', 'menuIcon')}
347
+ onMouseOver={() => setshowMenuList(true)}
348
+ style={{
349
+ // backgroundImage: `url(${menuIconSrc})`,
350
+ backgroundRepeat: 'no-repeat',
351
+ backgroundSize: '50%',
352
+ backgroundPosition: 'center',
353
+ backgroundColor: stash !== 'LNRD'? '#4091F7':'#EA1A1A'
354
+ }}
355
+ >
356
+ <img src={menuIconSrc} className={cn(stash !== 'LNRD'? null:'menuIcon_img')}></img>
357
+ </div>
358
+ <div className={cn(stash !== 'LNRD'? 'menu_title_content_size':'menu_title_content_size_LNRD', 'menu_title_content')}
359
+
360
+ >
361
+ <img
362
+ className="menu_title_content_img"
363
+ src={getLogoAndTitle().logoSrc}
364
+ alt="logo"
365
+ />
366
+ <span
367
+ className={cn(stash !== 'LNRD'? 'menu_title_color':'menu_title_color_LNRD', 'menu_title')}
368
+ // className="menu_title"
369
+ >{getLogoAndTitle().title}</span>
370
+ </div>
371
+ </div>
372
+ <div
373
+ className={cn(stash !== 'LNRD'? 'menu_list_content_top':'menu_list_content_top_LNRD', 'menu_list_content')}
374
+ // className="menu_list_content"
375
+ style={{ display: showMenuList ? 'block' : 'none' }}
376
+ onMouseOver={() => setshowMenuList(true)}
377
+ onMouseOut={() => setshowMenuList(false)}
378
+ >
379
+ {menu}
380
+ </div>
381
+ </div>
382
+ );
383
+ };
384
+ export default ModuleMenu;
@@ -0,0 +1,22 @@
1
+ import Axios from '../util/axios';
2
+
3
+ export function getInfoByName(name) {
4
+ return Axios(
5
+ 'get',
6
+ `/admin-api/system/oauth2-client/getByName?name=${name}`,
7
+ '',
8
+ {},
9
+ )
10
+ }
11
+
12
+ export function getUrlByInfo(obj) {
13
+ return Axios(
14
+ 'post',
15
+ `/admin-api/system/oauth2/authorize?response_type=code&client_id=${obj.clientId}&redirect_uri=${obj.redirectUrl}&auto_approve=true&scope=%7B"user.read":true%7D`,
16
+ '',
17
+ {},
18
+ )
19
+ }
20
+
21
+
22
+
@@ -2,4 +2,4 @@ import ModuleMenu from './ModuleMenu';
2
2
  import ModuleUser from './ModuleUser';
3
3
  import Footer from './Footer';
4
4
  export { ModuleMenu, ModuleUser, Footer };
5
- // export default ModuleUser;
5
+ // export default ModuleMenu;