module-menu 0.2.6 → 0.2.7

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.7",
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>
@@ -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);
@@ -115,7 +123,7 @@ const ModuleMenu = ({ sysName, stash }) => {
115
123
  // 跳转首页
116
124
  const toHomePage = (index) => {
117
125
  if (index === 0) {
118
- window.location.href = '/#/index';
126
+ window.location.href = !stash ? '/#/index' : '/dataadmin/#/index';
119
127
  }
120
128
  };
121
129
  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}