forked from huge/frontEnd/hugeOA

Mr Ke
2020-10-20 6bf92751fe8dfa0624285268968a1fd7a8a7e7e5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/* eslint-disable */
/**liuwh
 * 5/26/2020, 4:44:40 PM
 * doc comment for the file goes here
 */
 
/** Happy Coding */
import React, { ReactNode, ReactEventHandler, Component, useEffect, useState } from 'react';
import { Switch, Route, Redirect } from 'react-router-dom';
 
// 引进页面(pages)
//oa菜单
import Workbench from '../module/oa/index/workbench'; //首页--工作台
import System from '../module/oa/index/System'; //首页--工作制度
import Announcement from '../module/oa/index/Announcement'; //全部通知
import DocumentEdit from '../module/oa/document/DocumentEdit'; //新建文档
import DocumentDetail from '../module/oa/document/DocumentDetail'; //文档详情
import BrowseLog from '../module/oa/logManage/browseLog'; //浏览日志
import OperLog from '../module/oa/logManage/operLog'; //操作日志
import Rawler from '../module/oa/logManage/Rawler'; //爬虫词条管理
import Information from '../module/oa/personal/information'; //个人信息
import UserManage from '../components/oa/basicConfig/UserManage'; //用户管理
import MeritsOverview from '../module/oa/merits/meritsOverview';//绩效管理--绩效总览
import MeritsDetail from '../module/oa/merits/meritsDetail';//绩效管理--绩效详情
import MeritsDispose from '../module/oa/merits/meritsDispose';//绩效管理--绩效指标
import MeritsExamine from '../module/oa/merits/meritsExamine';//绩效管理--绩效考核
 
// 基础平台
import BaseUserManage from '../module/huge-base/UserManage'; //用户管理
import UserDetail from '../module/huge-base/UserDetail'; //用户管理--用户详情
import GroupManage from '../module/huge-base/GroupManage'; //组管理
import GroupDetail from '../module/huge-base/GroupDetail'; //组管理--组详情
import UnitManage from '../module/huge-base/UnitManage'; //组织管理--单位管理
import DepartmentManage from '../module/huge-base/DepartmentManage'; //组织管理--部门管理
import JobManage from '../module/huge-base/JobManage'; //组织管理--岗位管理
import AppServiceManage from '../module/huge-base/AppServiceManage'; //资源管理--应用服务管理
import AppServiceDetail from '../module/huge-base/AppServiceDetail'; //资源管理--应用服务管理详情
import ModulesManage from '../module/huge-base/ModulesManage'; //资源管理--模块管理
import FunctionManage from '../module/huge-base/FunctionManage'; //资源管理--功能管理
import RoleManage from '../module/huge-base/RoleManage'; //权限管理--角色管理
import RoleDetail from '../module/huge-base/RoleDetail'; //权限管理--角色管理详情
import AuthorityManage from '../module/huge-base/AuthorityManage';
 
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="/index/rules" component={System} />
            <Route path="/index" component={Workbench} />
            <Route path="/logManage/browseLog" component={BrowseLog} />
            <Route path="/logManage/operLog" component={OperLog} />
            <Route path="/logManage/rawler" component={Rawler} />
            <Route path="/personal/information" component={Information} />
            <Route path="/merits/meritsOverview/meritsDetail/:userId/:boolean/:meritsMonth" component={MeritsDetail} />
            <Route path="/merits/meritsOverview" component={MeritsOverview} />
            <Route path="/merits/meritsDispose" component={MeritsDispose} />
            <Route path="/merits/meritsExamine" component={MeritsDetail} />
 
            {
                renderUser &&
                <React.Fragment>
                    <Switch>
                        <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} />
                    </Switch>
                </React.Fragment>
            }
 
            <div>
 
            </div>
 
            <Route path="/" component={Workbench} />
            <Redirect from="/" to="/index" component={Workbench} />
        </Switch>
    )
}