module-menu 0.3.28 → 0.3.30

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.
Files changed (21) hide show
  1. package/package.json +1 -1
  2. package/src/.umi/.cache/babel-loader/05da2ac7ce847f4ac142081bde816ecf.json.gz +0 -0
  3. package/src/.umi/.cache/babel-loader/0f6549b9d10294232b89da8657360277.json.gz +0 -0
  4. package/src/.umi/.cache/babel-loader/23b18f784e32600454794b2bc362f616.json.gz +0 -0
  5. package/src/.umi/.cache/babel-loader/26d77603e66f6933c2dc1d0e465e6608.json.gz +0 -0
  6. package/src/.umi/.cache/babel-loader/3ec5be4c29da5d1bd06763e648760136.json.gz +0 -0
  7. package/src/.umi/.cache/babel-loader/63806f9f0b8dc5e716b1990dfa732c6c.json.gz +0 -0
  8. package/src/.umi/.cache/babel-loader/666e69cb2b37533879036f47ada34243.json.gz +0 -0
  9. package/src/.umi/.cache/babel-loader/80ff595ed07f19f8e201070c1a532ee6.json.gz +0 -0
  10. package/src/.umi/.cache/babel-loader/8576178075465b8523afb6faba1bb689.json.gz +0 -0
  11. package/src/.umi/.cache/babel-loader/976e4042042336ab582d7efa11aa30ec.json.gz +0 -0
  12. package/src/.umi/.cache/babel-loader/9acb2738363df2d92994bf7905ebd605.json.gz +0 -0
  13. package/src/.umi/.cache/babel-loader/ae22022b77a9646d4362586a54b3648a.json.gz +0 -0
  14. package/src/.umi/.cache/babel-loader/be6e223e0841645799fe57c7a263605c.json.gz +0 -0
  15. package/src/.umi/.cache/babel-loader/caed628a77c5223738c833fd65e11e3c.json.gz +0 -0
  16. package/src/.umi/.cache/babel-loader/eaacb308e00b7984b48e9772681599e6.json.gz +0 -0
  17. package/src/.umi/.cache/babel-loader/ed6d6139ccb9513b5ce61369e2824a3c.json.gz +0 -0
  18. package/src/pages/ModuleMenu/index.jsx +37 -0
  19. package/src/pages/ModuleUser/index.jsx +1 -1
  20. package/src/pages/index.jsx +14 -2
  21. package/src/pages/util/axios.js +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "module-menu",
3
- "version": "0.3.28",
3
+ "version": "0.3.30",
4
4
  "description": "城市大数据平台公共头部及尾部",
5
5
  "main": "src/pages/index.jsx",
6
6
  "scripts": {
@@ -26,11 +26,47 @@ const ModuleMenu = ({ sysName, stash = '' }) => {
26
26
  const [showMenuList, setshowMenuList] = useState(false);
27
27
  const [menuList, setMenuList] = useState([]);
28
28
  const [canOperatExchange, setCanOperatExchange] = useState(false); //是否具有政务共享平台权限
29
+ const menuRef = useRef(null);
30
+ const hideTimerRef = useRef(null);
31
+
32
+ const handleMouseEnter = () => {
33
+ if (hideTimerRef.current) {
34
+ clearTimeout(hideTimerRef.current);
35
+ hideTimerRef.current = null;
36
+ }
37
+ setshowMenuList(true);
38
+ };
39
+
40
+ const handleMouseLeave = () => {
41
+ hideTimerRef.current = setTimeout(() => {
42
+ setshowMenuList(false);
43
+ }, 100);
44
+ };
45
+
29
46
  useEffect(() => {
30
47
  localStorage.setItem('stash', stash);
31
48
  getSessionMenu();
32
49
  }, []);
50
+ useEffect(() => {
51
+ const handleClickOutside = (event) => {
52
+ if (menuRef.current && !menuRef.current.contains(event.target)) {
53
+ setshowMenuList(false);
54
+ }
55
+ };
56
+
57
+ document.addEventListener('mousedown', handleClickOutside);
58
+ return () => {
59
+ document.removeEventListener('mousedown', handleClickOutside);
60
+ };
61
+ }, []);
33
62
 
63
+ useEffect(() => {
64
+ return () => {
65
+ if (hideTimerRef.current) {
66
+ clearTimeout(hideTimerRef.current);
67
+ }
68
+ };
69
+ }, []);
34
70
  const getSessionMenu = () => {
35
71
  if (['integration', 'LNRD', 'HBJK'].includes(stash)) {
36
72
  Axios(
@@ -444,6 +480,7 @@ const ModuleMenu = ({ sysName, stash = '' }) => {
444
480
  'menuIcon',
445
481
  )}
446
482
  onMouseOver={() => setshowMenuList(true)}
483
+ onMouseOut={() => setshowMenuList(false)}
447
484
  style={{
448
485
  // backgroundImage: `url(${menuIconSrc})`,
449
486
  backgroundRepeat: 'no-repeat',
@@ -232,7 +232,7 @@ const ModuleUser = ({ stash = '', isBigDataFoundationPlatform = false, PZCS = fa
232
232
  {haveAppSystemPermission && (
233
233
  <Menu.Item
234
234
  key="appSystem"
235
- onClick={() => handleClickmenu('/dataadmin/#/appSystem/index')}
235
+ onClick={() => handleClickmenu(PZCS ? '/dataadmin/#/appManager/index' : '/dataadmin/#/appSystem/index')}
236
236
  >
237
237
  <img
238
238
  src={AppSystemSrc}
@@ -1,6 +1,18 @@
1
1
  import ModuleMenu from './ModuleMenu';
2
2
  import ModuleUser from './ModuleUser';
3
3
  import Footer from './Footer';
4
+
4
5
  export { ModuleMenu, ModuleUser, Footer };
5
- // 开发环境,手动打开,并且屏蔽上面的导出
6
- // export default ModuleMenu;
6
+
7
+ export default function IndexPage() {
8
+ return (
9
+ <div>
10
+ <ModuleMenu stash="integration" />
11
+ <ModuleUser stash="integration" PZCS={true} />
12
+ <div style={{ padding: '50px', marginTop: '100px' }}>
13
+ <h1>测试页面</h1>
14
+ <p>ModuleMenu 组件已加载</p>
15
+ </div>
16
+ </div>
17
+ );
18
+ }
@@ -5,7 +5,7 @@ import getStore from './userInfo';
5
5
  import { checkToken } from './permessionUtils';
6
6
  import CONSTANT from './constant';
7
7
 
8
- let tokenValue = '4f4862b5fe06405a894323a8f95ea2c7';
8
+ let tokenValue = '4e564b370fc8400982358cd88e73a566';
9
9
  // 轻量级tokenInSessionStor存在(GZW跳/data-platform/#/login,否则/#/login),一体化tokenInSessionStor不存在
10
10
  const tokenInSessionStor = window.sessionStorage.getItem(
11
11
  'bigdata-access_token',