| | |
| | | */ |
| | | |
| | | /** Happy Coding */ |
| | | import React, { ReactNode, ReactEventHandler, Component } from 'react'; |
| | | import React, { ReactNode, ReactEventHandler, Component, useEffect, useState } from 'react'; |
| | | import { Switch, Route, Redirect } from 'react-router-dom'; |
| | | |
| | | // 引进页面(pages) |
| | |
| | | import RoleDetail from '../module/huge-base/RoleDetail'; //权限管理--角色管理详情 |
| | | import AuthorityManage from '../module/huge-base/AuthorityManage'; |
| | | |
| | | export default function OaRouteDom({ }) { |
| | | export default function RouteDom({ }) { |
| | | const [renderUser, setRenderUser] = useState(false); |
| | | useEffect(() => { |
| | | let menu = window.localStorage.getItem('menu') ? JSON.parse(window.localStorage.getItem('menu')) : [];//获取权限菜单 |
| | | let administration = menu.find(({ moduleSymbol }) => moduleSymbol == 'administration'); |
| | | if (administration) { setRenderUser(true) } |
| | | }, []) |
| | | |
| | | return ( |
| | | <Switch> |
| | | |
| | | |
| | | <Route path="/document/create/:id?" component={DocumentEdit} /> |
| | | <Route path="/document/detail/:id" component={DocumentDetail} /> |
| | | <Route path="/index/workbench/announcement" component={Announcement} /> |
| | |
| | | <Route path="/merits/meritsDispose" component={MeritsDispose} /> |
| | | <Route path="/merits/meritsExamine" component={MeritsDetail} /> |
| | | |
| | | <Route path="/baseManage/user/Detail/:id/:flag" component={UserDetail} /> |
| | | <Route path="/baseManage/user" component={UserManage} /> |
| | | <Route path="/baseManage/group/Detail/:id/:flag" component={GroupDetail} /> |
| | | <Route path="/baseManage/group" component={GroupManage} /> |
| | | <Route path="/organizationMgt/unit" component={UnitManage} /> |
| | | <Route path="/organizationMgt/department" component={DepartmentManage} /> |
| | | <Route path="/organizationMgt/job" component={JobManage} /> |
| | | <Route path="/resourceMgt/appService/Detail/:id/:flag" component={AppServiceDetail} /> |
| | | <Route path="/resourceMgt/appService" component={AppServiceManage} /> |
| | | <Route path="/resourceMgt/modules" component={ModulesManage} /> |
| | | <Route path="/resourceMgt/function" component={FunctionManage} /> |
| | | <Route path="/organizationMgt/role/Detail/:id/:flag" component={RoleDetail} /> |
| | | <Route path="/authorityMgt/role" component={RoleManage} /> |
| | | <Route path="/authorityMgt/authority" component={AuthorityManage} /> |
| | | <Redirect from='/' to="/baseManage/user" component={UserManage} /> |
| | | { |
| | | renderUser && |
| | | <React.Fragment> |
| | | <Route path="/baseManage/user/Detail/:id/:flag" component={UserDetail} /> |
| | | <Route path="/baseManage/user" component={UserManage} /> |
| | | <Route path="/baseManage/group/Detail/:id/:flag" component={GroupDetail} /> |
| | | <Route path="/baseManage/group" component={GroupManage} /> |
| | | <Route path="/organizationMgt/unit" component={UnitManage} /> |
| | | <Route path="/organizationMgt/department" component={DepartmentManage} /> |
| | | <Route path="/organizationMgt/job" component={JobManage} /> |
| | | <Route path="/resourceMgt/appService/Detail/:id/:flag" component={AppServiceDetail} /> |
| | | <Route path="/resourceMgt/appService" component={AppServiceManage} /> |
| | | <Route path="/resourceMgt/modules" component={ModulesManage} /> |
| | | <Route path="/resourceMgt/function" component={FunctionManage} /> |
| | | <Route path="/organizationMgt/role/Detail/:id/:flag" component={RoleDetail} /> |
| | | <Route path="/authorityMgt/role" component={RoleManage} /> |
| | | <Route path="/authorityMgt/authority" component={AuthorityManage} /> |
| | | <Redirect from='/' to="/baseManage/user" component={UserManage} /> |
| | | </React.Fragment> |
| | | } |
| | | |
| | | <div> |
| | | |
| | | </div> |
| | | |
| | | <Route path="/" component={Workbench} /> |
| | | <Redirect from="/" to="/index" component={Workbench} /> |