From a4c7ad2404d2b0bcf173ce26dd8facfed02ec106 Mon Sep 17 00:00:00 2001 From: CODE <1650192445@qq.com> Date: Wed, 13 Dec 2023 11:55:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=89=E7=BA=A7=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/layout/components/sider/index.js | 22 +- web/client/src/sections/fillion/nav-item.js | 224 ++++++++++-------- 2 files changed, 146 insertions(+), 100 deletions(-) diff --git a/web/client/src/layout/components/sider/index.js b/web/client/src/layout/components/sider/index.js index b7b80315..3dca78dd 100644 --- a/web/client/src/layout/components/sider/index.js +++ b/web/client/src/layout/components/sider/index.js @@ -51,7 +51,7 @@ const Sider = props => { }); }, [items]) - + console.log(openKeys); return ( { setSelectedKeys(selectedKeys) }} onOpenChange={(ks) => { - setOpenKeys(ks.length > 1 ? [ks.pop()] : ks) + console.log(ks); + if (ks.length) { + let nextKs = [] + let lastKey = nextKs[nextKs.length - 1] + if (lastKey == 'organization') { + setOpenKeys[lastKey] + } else { + if (ks.length > 2) { + ks.splice(1, ks.length - 2) + } + setOpenKeys(ks) + } + setOpenKeys( + ks.length > 2 ? ks.slice(ks.length - 2) : ks + // ks.length > 1 ? [ks.pop()] : ks + ) + } else { + setOpenKeys([]) + } }} > {items} diff --git a/web/client/src/sections/fillion/nav-item.js b/web/client/src/sections/fillion/nav-item.js index cd1142da..761d0d82 100644 --- a/web/client/src/sections/fillion/nav-item.js +++ b/web/client/src/sections/fillion/nav-item.js @@ -4,117 +4,145 @@ import { Menu } from 'antd'; import { ReadOutlined } from '@ant-design/icons'; const SubMenu = Menu.SubMenu; export function getNavItem (user, dispatch) { - const isshow = user?.userResources?. - some(i => i.resourceId === 'OVERLOADMANAGE' || - i.resourceId === 'ROADMANAGE' || - i.resourceId === 'BRIDGEMANAGE' || - i.resourceId === 'MAINTENANCEMANAGE' || - i.resourceId === 'TRANSPORTATIONMANAGE' || - i.resourceId === 'CONSERVATIONMANAGE' || - i.resourceId === 'PUBLICTRANSPORTMANAGE' || - i.resourceId === 'FILEMANAGE' || - i.resourceId === 'PUBLICITYVIDEO' || - i.resourceId === 'FEEDBACKMANAGE' || - i.resourceId === 'REPORTMANAGE' || - i.resourceId === 'PATROLMANAGE' || - i.resourceId === 'ASSESSMANAGE' || - i.resourceId === 'VIDEOCENTER' || - i.resourceId === 'BUILDINGPROJECT' || - i.resourceId === 'MAINTENANCESPOTCHECK' || - i.resourceId === 'LUZHENG' || - i.resourceId === 'ADJUSTLOG' - ) + const isshow = user?.userResources?. + some(i => i.resourceId === 'OVERLOADMANAGE' || + i.resourceId === 'ROADMANAGE' || + i.resourceId === 'BRIDGEMANAGE' || + i.resourceId === 'MAINTENANCEMANAGE' || + i.resourceId === 'TRANSPORTATIONMANAGE' || + i.resourceId === 'CONSERVATIONMANAGE' || + i.resourceId === 'PUBLICTRANSPORTMANAGE' || + i.resourceId === 'FILEMANAGE' || + i.resourceId === 'PUBLICITYVIDEO' || + i.resourceId === 'FEEDBACKMANAGE' || + i.resourceId === 'REPORTMANAGE' || + i.resourceId === 'PATROLMANAGE' || + i.resourceId === 'ASSESSMANAGE' || + i.resourceId === 'VIDEOCENTER' || + i.resourceId === 'BUILDINGPROJECT' || + i.resourceId === 'MAINTENANCESPOTCHECK' || + i.resourceId === 'LUZHENG' || + i.resourceId === 'ADJUSTLOG' + ) - return ( - user?.username == 'SuperAdmin' || isshow ? - } title={'数据管理'}> - {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'OVERLOADMANAGE') ? + return ( + user?.username == 'SuperAdmin' || isshow ? + } title={'数据管理'}> + { + user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'REPORTMANAGE' || i.resourceId === 'BUILDINGPROJECT' || i.resourceId === 'FILEMANAGE') ? + + {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'REPORTMANAGE') ? + + 建设上报 + : ''} + {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'BUILDINGPROJECT') ? + + 在建项目 + : ''} + {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'FILEMANAGE') ? + + 档案管理 + : ''} + + : '' + } + + { + user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'VIDEOCENTER' || i.resourceId === 'LUZHENG' || i.resourceId === 'ROADMANAGE' || i.resourceId === 'BRIDGEMANAGE') ? + + {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'VIDEOCENTER') ? + + 视频中心 + : ''} + {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'LUZHENG') ? + + 路政管理 + : ''} + {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'ROADMANAGE') ? + + 道路管理 + : ''} + {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'BRIDGEMANAGE') ? + + 桥梁管理 + : ''} + + : '' + } + + { + user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'MAINTENANCEMANAGE' || i.resourceId === 'PATROLMANAGE' || i.resourceId === 'FEEDBACKMANAGE' || i.resourceId === 'CONSERVATIONMANAGE' || i.resourceId === 'MAINTENANCESPOTCHECK' || i.resourceId === 'ADJUSTLOG' || i.resourceId === 'ASSESSMANAGE') ? + + {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'MAINTENANCEMANAGE') ? + + 管养管理 + : ''} + {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'PATROLMANAGE') ? + + 巡查管理 + : ''} + {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'FEEDBACKMANAGE') ? + + 异常反馈 + : ''} + {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'CONSERVATIONMANAGE') ? + + 养护管理 + : ''} + {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'MAINTENANCESPOTCHECK') ? + + 养护抽查 + : ''} + {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'ADJUSTLOG') ? + + 调整日志 + : ''} + {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'ASSESSMANAGE') ? + + 考核评分 + : ''} + + : '' + } + + { + user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'TRANSPORTATIONMANAGE' || i.resourceId === 'PUBLICTRANSPORTMANAGE') ? + + {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'TRANSPORTATIONMANAGE') ? + + 运政管理 + : ''} + {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'PUBLICTRANSPORTMANAGE') ? + + 公交管理 + : ''} + + : '' + } + + {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'OVERLOADMANAGE') ? 治超管理 : ''} - {/* + {/* 任务管理 */} - {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'LUZHENG') ? - - 路政管理 - : ''} - {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'ROADMANAGE') ? - - 道路管理 - : ''} - {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'BRIDGEMANAGE') ? - - 桥梁管理 - : ''} - {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'MAINTENANCEMANAGE') ? - - 管养管理 - : ''} - {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'TRANSPORTATIONMANAGE') ? - - 运政管理 - : ''} - {/* + {/* 执法管理 */} - {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'CONSERVATIONMANAGE') ? - - 养护管理 - : ''} - {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'PATROLMANAGE') ? - - 巡查管理 - : ''} - {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'FEEDBACKMANAGE') ? - - 异常反馈 - : ''} - {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'REPORTMANAGE') ? - - 建设上报 - : ''} - {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'BUILDINGPROJECT') ? - - 在建项目 - : ''} - {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'PUBLICTRANSPORTMANAGE') ? - - 公交管理 - : ''} - {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'FILEMANAGE') ? - - 档案管理 - : ''} - {/* + {/* 视频管理 */} - {/* + {/* 接口管理 */} - {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'PUBLICITYVIDEO') ? - - 宣传视频 - : ''} - {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'ASSESSMANAGE') ? - - 考核评分 - : ''} - {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'VIDEOCENTER') ? - - 视频中心 - : ''} - {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'MAINTENANCESPOTCHECK') ? - - 养护抽查 - : ''} - {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'ADJUSTLOG') ? - - 调整日志 - : ''} - : null - ); + {user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'PUBLICITYVIDEO') ? + + 宣传视频 + : ''} + : null + ); }