module-menu 0.2.6 → 0.2.8

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.6",
3
+ "version": "0.2.8",
4
4
  "description": "城市大数据平台公共头部及尾部",
5
5
  "main": "src/pages/index.jsx",
6
6
  "scripts": {
@@ -0,0 +1 @@
1
+ <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1706754879161" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4232" width="16" height="16" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M511.8 155.1l313.9 126.7-314.9 128.1-313.9-126.7 314.9-128.1m0-86.2c-3.7 0-7.3 0.7-10.8 2.1L49.8 254.6c-25.2 10.2-25.2 47.3-0.1 57.5L500.2 494c3.4 1.4 7 2.1 10.7 2.1 3.7 0 7.3-0.7 10.8-2.1l451.2-183.6c25.2-10.2 25.2-47.3 0.1-57.5L522.4 71c-3.4-1.4-7-2.1-10.6-2.1z" p-id="4233" fill="#515151"></path><path d="M510.5 715.7c-8.6 0-17.3-1.7-25.5-5L54.3 536.9c-21-8.5-31.1-32.3-22.6-53.3S64.1 452.5 85 461l425.6 171.8 426.3-173.4c20.9-8.6 44.8 1.5 53.4 22.5 8.5 21-1.5 44.9-22.5 53.4L536.3 710.7c-8.3 3.3-17 5-25.8 5z" p-id="4234" fill="#515151"></path><path d="M512.7 955.1c-8.7 0-17.3-1.7-25.5-5L56.4 776.2c-21-8.5-31.1-32.3-22.6-53.3s32.4-31.1 53.3-22.7L512.7 872 939 698.6c20.9-8.5 44.8 1.5 53.4 22.5 8.5 21-1.6 44.8-22.5 53.4L538.4 950c-8.2 3.4-17 5.1-25.7 5.1z" p-id="4235" fill="#515151"></path></svg>
@@ -55,33 +55,56 @@ export const menuList = (stash) => [
55
55
  {
56
56
  name: '数据开放',
57
57
  url: require('../../assets/ic_shujukaifang_m.svg'),
58
- children: [
59
- {
60
- childName: '数据服务',
61
- path: '/dataservice',
62
- url: require('../../assets/dataservice_slogo.svg'),
63
- },
64
- {
65
- childName: '数据资产',
66
- path: '/dataasset',
67
- url: require('../../assets/dataasset_slogo.svg'),
68
- },
69
- {
70
- childName: '数据共享',
71
- path: '/datasharing',
72
- url: require('../../assets/datasharing_slogo.svg'),
73
- },
74
- {
75
- childName: '目录管理',
76
- path: '/muluguanli',
77
- url: require('../../assets/muluguanli_slogo.png'),
78
- },
79
- {
80
- childName: '资源管理',
81
- path: '/ziyuanguanli',
82
- url: require('../../assets/ziyuanguanli_slogo.png'),
83
- },
84
- ],
58
+ children: stash
59
+ ? [
60
+ {
61
+ childName: '数据服务',
62
+ path: '/dataservice',
63
+ url: require('../../assets/dataservice_slogo.svg'),
64
+ },
65
+ {
66
+ childName: '数据资产',
67
+ path: '/dataasset',
68
+ url: require('../../assets/dataasset_slogo.svg'),
69
+ },
70
+ {
71
+ childName: '数据共享',
72
+ path: '/datasharing',
73
+ url: require('../../assets/datasharing_slogo.svg'),
74
+ },
75
+ {
76
+ childName: '目录管理',
77
+ path: '/muluguanli',
78
+ url: require('../../assets/muluguanli_slogo.png'),
79
+ },
80
+ {
81
+ childName: '资源管理',
82
+ path: '/ziyuanguanli',
83
+ url: require('../../assets/ziyuanguanli_slogo.png'),
84
+ },
85
+ {
86
+ childName: '供需对接',
87
+ path: '/gongxuduijie',
88
+ url: require('../../assets/gongxuduijie_slogo.png'),
89
+ },
90
+ ]
91
+ : [
92
+ {
93
+ childName: '数据服务',
94
+ path: '/dataservice',
95
+ url: require('../../assets/dataservice_slogo.svg'),
96
+ },
97
+ {
98
+ childName: '数据资产',
99
+ path: '/dataasset',
100
+ url: require('../../assets/dataasset_slogo.svg'),
101
+ },
102
+ {
103
+ childName: '数据共享',
104
+ path: '/datasharing',
105
+ url: require('../../assets/datasharing_slogo.svg'),
106
+ },
107
+ ],
85
108
  },
86
109
  {
87
110
  name: '数据应用',
@@ -23,18 +23,26 @@ const ModuleMenu = ({ sysName, stash }) => {
23
23
  const menuLists = getNewMenuList(menuGet);
24
24
  setMenuList(menuLists);
25
25
  } else {
26
- Axios('get', '/admin-api/system/user/getUserMenusList', '', {})
26
+ Axios(
27
+ 'get',
28
+ '/admin-api/system/user/get-user-menu-List?menuName=数据平台',
29
+ '',
30
+ {},
31
+ )
27
32
  .then((res) => {
28
33
  if (res.data.code === 0) {
29
34
  let menuGet =
30
- res.data.data &&
31
- res.data.data.map((item) => {
32
- return {
33
- ...item,
34
- path:
35
- item.path.indexOf('/') !== -1 ? item.path : '/' + item.path,
36
- };
37
- });
35
+ (res.data.data &&
36
+ res.data.data[0]?.routes?.map((item) => {
37
+ return {
38
+ ...item,
39
+ path:
40
+ item.path.indexOf('/') !== -1
41
+ ? item.path
42
+ : '/' + item.path,
43
+ };
44
+ })) ||
45
+ [];
38
46
  setSessionMenu(menuGet);
39
47
  const menuLists = getNewMenuList(menuGet);
40
48
  setMenuList(menuLists);
@@ -106,6 +114,10 @@ const ModuleMenu = ({ sysName, stash }) => {
106
114
  case '资源管理':
107
115
  thirdPartyServiceJumpPath = '/admin-ui/resource/tableResource/list';
108
116
  break;
117
+ case '供需对接':
118
+ thirdPartyServiceJumpPath =
119
+ '/admin-ui/supply-and-demand-docking/dataRequirement/propose/list';
120
+ break;
109
121
  default:
110
122
  break;
111
123
  }
@@ -115,7 +127,7 @@ const ModuleMenu = ({ sysName, stash }) => {
115
127
  // 跳转首页
116
128
  const toHomePage = (index) => {
117
129
  if (index === 0) {
118
- window.location.href = '/#/index';
130
+ window.location.href = !stash ? '/#/index' : '/dataadmin/#/index';
119
131
  }
120
132
  };
121
133
  const getNewMenuList = (menuGet) => {
@@ -1,11 +1,8 @@
1
1
  // 图标位置
2
2
  export const userMenuIcon = {
3
- PersonalCenterSrc:require('../../assets/personalCenter.svg'),
4
- MessageCenterSrc:require('../../assets/messageCenter.svg'),
5
- SystemManageSrc:require('../../assets/systemManage.svg'),
6
- LogoutSrc:require('../../assets/logout.png'),
7
- }
8
- export const PersonalCenterSrc = require('../../assets/personalCenter.svg');
9
- export const MessageCenterSrc = require('../../assets/messageCenter.svg');
10
- export const SystemManageSrc = require('../../assets/systemManage.svg');
11
- export const LogoutSrc = require('../../assets/logout.png');
3
+ PersonalCenterSrc: require('../../assets/personalCenter.svg'),
4
+ MessageCenterSrc: require('../../assets/messageCenter.svg'),
5
+ SystemManageSrc: require('../../assets/systemManage.svg'),
6
+ LogoutSrc: require('../../assets/logout.png'),
7
+ AppSystemSrc: require('../../assets/appsystemSrc.svg'),
8
+ };
@@ -14,17 +14,24 @@ import './index.less';
14
14
  // stash存在则为一体化,否则为轻量级
15
15
  const ModuleUser = ({ stash }) => {
16
16
  const [tenantList, setTenantList] = useState([]);
17
+ const [haveAppSystemPermission, setHaveAppSystemPermission] = useState(false);
17
18
  useEffect(() => {
18
19
  if (stash) {
19
20
  getTenantList();
21
+ allSystemList();
20
22
  }
21
23
  }, []);
22
24
  const handleClickmenu = (url) => {
23
25
  window.location.href = url;
24
26
  };
25
27
 
26
- const { PersonalCenterSrc, MessageCenterSrc, SystemManageSrc, LogoutSrc } =
27
- userMenuIcon;
28
+ const {
29
+ PersonalCenterSrc,
30
+ MessageCenterSrc,
31
+ SystemManageSrc,
32
+ LogoutSrc,
33
+ AppSystemSrc,
34
+ } = userMenuIcon;
28
35
 
29
36
  const isHaveSystemManagementPermission = stash
30
37
  ? true
@@ -60,6 +67,31 @@ const ModuleUser = ({ stash }) => {
60
67
  })
61
68
  .catch((e) => console.log('e', e));
62
69
  };
70
+ const allSystemList = () => {
71
+ Axios(
72
+ 'get',
73
+ '/admin-api/system/user/get-user-menu-List?menuName=数据平台',
74
+ '',
75
+ {},
76
+ )
77
+ .then((res) => {
78
+ if (res.data.code === 0) {
79
+ let menuGet =
80
+ res.data.data &&
81
+ res.data.data[0]?.routes?.map((item) => {
82
+ return {
83
+ ...item,
84
+ path:
85
+ item.path.indexOf('/') !== -1 ? item.path : '/' + item.path,
86
+ };
87
+ });
88
+ let haveAppSystem_Permission =
89
+ menuGet?.some((item) => item.name === '应用系统配置') || false;
90
+ setHaveAppSystemPermission(haveAppSystem_Permission);
91
+ }
92
+ })
93
+ .catch((e) => console.log('e', e));
94
+ };
63
95
 
64
96
  // 退出登录
65
97
  const logout = () => {
@@ -139,6 +171,19 @@ const ModuleUser = ({ stash }) => {
139
171
  <span>系统管理</span>
140
172
  </Menu.Item>
141
173
  )}
174
+ {haveAppSystemPermission && (
175
+ <Menu.Item
176
+ key="appSystem"
177
+ onClick={() => handleClickmenu('/dataadmin/#/appSystem/index')}
178
+ >
179
+ <img
180
+ src={AppSystemSrc}
181
+ alt=""
182
+ style={{ marginRight: '10px', marginTop: '-3px' }}
183
+ />
184
+ <span>应用系统配置</span>
185
+ </Menu.Item>
186
+ )}
142
187
  <Menu.Item key="logout" onClick={() => logout()}>
143
188
  <img
144
189
  src={LogoutSrc}