审查视图

src/routes.js 15.3 KB
朱兆平 authored
1 2 3
import Login from './views/Login.vue'
import NotFound from './views/404.vue'
import Home from './views/Home.vue'
王勇 authored
4
import Main from './views/dashboard/index'
5 6 7
// import Table from './views/nav1/Table.vue'
import Role from './views/nav1/role.vue'
import Perm from './views/nav1/perm.vue'
8
import LOG from './views/nav1/Log.vue'
朱兆平 authored
9
import PreManifest from './views/agent/PreManifest.vue'
shenhailong authored
10 11
import Company from './views/nav1/company.vue'
import Department from './views/nav1/department.vue'
12
import Group from './views/nav1/groupcompany.vue'
朱兆平 authored
13 14
import Process from './views/hqpt/Process.vue'
import Job from './views/hqpt/Job.vue'
15
// import Form from './views/nav1/Form.vue'
16
17
18
import OrgManifest from './views/nmms/orgManifest.vue'
19 20 21 22 23 24 25 26
import ExitFlight from './views/nmms/ExitFlight.vue'
import ExitPre from './views/nmms/ExitPre.vue'
import ExitTidy from './views/nmms/ExitTidy.vue'
import ExitArrive from './views/nmms/ExitArrive.vue'
import ExitManifest from './views/nmms/ExitManifest.vue'
import ExitLoading from './views/nmms/ExitLoading.vue'
import ExitFlightDesc from './views/nmms/ExitFlightDesc.vue'
import LostLoad from './views/lostLoadChange/lostLoading.vue'
zhangFan authored
27 28
import LostLoadChange from './views/lostLoadChange/lostLoadChange.vue'
29 30 31 32 33 34 35 36 37
import OrigFlightList from './views/nmms_import/OrigFlightList.vue'
import EnterFlightInfo from './views/nmms_import/EnterFlightInfo.vue'
import OrigMaster from './views/nmms_import/OrigMaster.vue'
import EnterTally from './views/nmms_import/EnterFlightTally.vue'
import TallyMster from './views/nmms_import/TallyMster.vue'
import Waybill from './views/nmms_import/Waybill.vue'
import AllocateSearch from './views/nmms_import/AllocateSearch.vue'
import Importallocation from './views/nmms_import/Importallocation.vue'
import Allocatearrive from './views/nmms_import/Allocatearrive.vue'
38
import User from './views/nav1/user.vue'
朱兆平 authored
39 40 41 42
import Page4 from './views/nav2/Page4.vue'
import Page5 from './views/nav2/Page5.vue'
import Page6 from './views/nav3/Page6.vue'
import echarts from './views/charts/echarts.vue'
43 44 45
import SecrityInspection from './views/staff/security_inspection.vue'
import Key from './views/staff/key.vue'
import Maintain from './views/staff/maintain.vue'
46 47
import ComeCar from './views/staff/come_car.vue'
import OnDuty from './views/staff/on_duty.vue'
shenhailong authored
48
import WaterStationsPatrol from './views/water/water_stations_patrol.vue'
朱兆平 authored
49
import Location from './views/empt/Location.vue'
朱兆平 authored
50
51 52 53 54 55 56 57 58 59 60 61 62 63 64
//运输工具 通用业务申报
import Route from './views/airtransport/route.vue'
import Bill from './views/airtransport/bill.vue'
import Flight from './views/airtransport/flight.vue'
import Flightplan from './views/airtransport/flightplan.vue'
import Aircraft from './views/airtransport/aircraft.vue'
import Routeaircraft from './views/airtransport/routeaircraft'

//通用业务查询
import queryRoute from './views/airtransport/queryRoute.vue'
import queryBill from './views/airtransport/queryBill.vue'
import queryFlight from './views/airtransport/queryFlight.vue'
import queryFlightplan from './views/airtransport/queryFlightplan.vue'
import queryAircraft from './views/airtransport/queryAircraft.vue'
小范 authored
65 66 67 68 69 70 71 72 73 74 75 76 77
import queryRouteaircraft from './views/airtransport/queryRouteaircraft.vue'
import arrival from './views/airtransport/arrival.vue'
import confirmatory from './views/airtransport/confirmatory.vue'
import queryArrival from './views/airtransport/queryArrival.vue'
import queryConfirmatory from './views/airtransport/queryConfirmatory.vue'
import configure from './views/airtransport/configure.vue'
import queryConfigure from './views/airtransport/queryConfigure.vue'
import departure from './views/airtransport/departure.vue'
import declare from './views/airtransport/declare.vue'
import queryDeparture from './views/airtransport/queryDeparture.vue'
import queryDeclare from './views/airtransport/queryDeclare.vue'
import outConfigure from './views/airtransport/outConfigure.vue'
import queryFlightConfigure from './views/airtransport/queryFlightConfigure.vue'
78 79 80 81 82 83 84 85
// 消息控制中心
import Server from './views/bus/Server.vue'
import VirtualHost from './views/bus/VirtualHost.vue'
import Exchange from './views/bus/Exchange.vue'
import RoutingKey from './views/bus/RoutingKey.vue'
import Queue from './views/bus/Queue.vue'
import MessageNote from './views/bus/MessageNote.vue'
import UserMessageBinding from './views/bus/UserMessageBinding.vue'
86 87 88
import UserInfo from "./views/bus/UserInfo.vue"
import QueueView from "./views/bus/view/QueueView.vue"
import ExchangeView from "./views/bus/view/ExchangeView.vue"
王勇 authored
89
import ElasticSearchInfo from "./views/bus/ElasticSearchInfo.vue"
90
朱兆平 authored
91 92 93 94
let routes = [
    {
        path: '/login',
        component: Login,
95
        name: '登录',
朱兆平 authored
96 97 98 99 100
        hidden: true
    },
    {
        path: '/404',
        component: NotFound,
101
        name: '错误',
朱兆平 authored
102 103 104 105
        hidden: true
    },
    {
        path: '/',
106 107 108 109
        redirect: '/login',
    },
    {
        path: '/',
朱兆平 authored
110
        component: Home,
111
        name: '主页',
112 113
        leaf: true,
        iconCls: 'el-icon-menu',
朱兆平 authored
114
        children: [
115
            {path: '/main', component: Main, name: '首页'},
116 117
        ]
    },
118 119 120 121 122 123 124 125 126 127
    // {
    //     path: '/',
    //     component: Home,
    //     name: '主页',
    //     leaf: true,
    //     iconCls: 'el-icon-menu',
    //     children: [
    //         {path: '/main', component: Main, name: '首页'},
    //     ]
    // },
128 129
    // { path: '/test', component: Main },
    {
130
        path: '/admin',
131
        component: Home,
132
        name: '系统设置',
133 134
        iconCls: 'el-icon-setting',//图标样式class
        children: [
135 136 137 138 139 140 141
            {path: '/user', component: User, name: '用户管理'},
            {path: '/role', component: Role, name: '组织机构'},
            {path: '/perm', component: Perm, name: '权限管理'},
            {path: '/log', component: LOG, name: '系统日志'},
            {path: '/department', component: Department, name: '部门管理'},
            {path: '/company', component: Company, name: '公司管理'},
            {path: '/group', component: Group, name: '集团管理'}
142 143
        ]
    },
144
145
    {
146
        path: '/bus',
147
        component: Home,
148 149
        name: '消息控制中心',
        iconCls: 'el-icon-message',
150
        children: [
王勇 authored
151
            {path: '/userInfo', component: UserInfo, name: '用户关系管理'},
152 153 154
            {path: '/server', component: Server, name: '服务器管理'},
            {path: '/host', component: VirtualHost, name: '虚拟主机管理'},
            {path: '/queue', component: Queue, name: '队列管理'},
155
            {path: '/exchange', component: Exchange, name: '交换机管理'},
156 157 158
            {path: '/routing', component: RoutingKey, name: '路由键管理'},
            {path: '/umb', component: UserMessageBinding, name: '配置管理'},
            {path: '/note', component: MessageNote, name: '消息记录管理'},
王勇 authored
159
            {path: '/es', component: ElasticSearchInfo, name: 'ES信息管理'},
160 161
        ]
    },
162
163 164 165 166 167 168 169 170 171 172 173
    {
        path: '/bus/view',
        component: Home,
        name: '消息监控中心',
        iconCls: 'el-icon-view',
        children: [
            {path: '/queueView', component: QueueView, name: '队列监控'},
            {path: '/exchangeView', component: ExchangeView, name: '交换机监控'},
        ]
    },
小范 authored
174
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321
    // {
    //     path: '/guestService',
    //     component: Home,
    //     name: '客服系统',
    //     iconCls: 'fa fa-id-card-o',
    //     children: [
    //         { path: '/process', component: Process, name: '工单管理' },
    //         { path: '/job', component: Job, name: '任务管理' },
    //         {path: '/pre1', component: PreManifest, name: '预配'},
    //     ]
    // },
    // {
    //     path: '/output',
    //     component: Home,
    //     name: '出港业务申报',
    //     iconCls: 'el-icon-collection',
    //     children: [
    //         {path: '/flight', component: ExitFlight, name: '出港航班申报'},
    //         {path: '/manifest', component: ExitManifest, name: '出港运单申报'},
    //         {path: '/pre', component: ExitPre, name: '出港预配舱单'},
    //         {path: '/arrive', component: ExitArrive, name: '出港运抵'},
    //         {path: '/loadingView', component: ExitFlightDesc, name: '出港航班信息'},
    //         {path: '/loading', component: ExitLoading, name: '出港装载'},
    //         {path: '/tidy', component: ExitTidy, name: '出港理货'}
    //     ]
    // },
    // {
    //     path: '/nmms2',
    //     component: Home,
    //     name: '进港业务申报',
    //     iconCls: 'fa fa-id-card-o',
    //     children: [
    //         { path: '/orig', component: OrigFlightList, name: '进港航班申报' },
    //         {path:'/waybill',component:Waybill,name:'进港运单申报'},
    //         {path:'/allocateSearch',component:AllocateSearch,name:'运单分拨申报'},
    //         { path: '/enter', component: EnterFlightInfo, name: '原始舱单'},
    //         { path:'/origmaster',component:OrigMaster,name:'进港原始舱单'},
    //         {path:'/entertall',component:EnterTally,name:'进港理货'},
    //         {path:'/tallymaster',component:TallyMster,name:'进港理货舱单'},
    //         {path:'/importallocation',component:Importallocation,name:'进港分拨'},
    //         {path:'/allocatearrive',component:Allocatearrive,name:'分拨运抵'},
    //     ]
    // },
    // {
    //     path: '/lost',
    //     component: Home,
    //     name: '落装改配申报',
    //     iconCls:'el-icon-goods',
    //     children:[
    //         {path:'/lostLoad',component:LostLoad,name:'落装业务申报'},
    //         {path:'/lostLoadChange',component:LostLoadChange,name:'改配业务申报'}
    //
    //     ]
    // },
    // {
    //     path: '/airtransport',
    //     component: Home,
    //     name: '通用业务申报',
    //     iconCls:'el-icon-goods',
    //     children:[
    //         {path:'/route',component:Route,name:'航线申报'},
    //         {path:'/bill',component:Bill,name:'单据申报'},
    //         {path:'/flights',component:Flight,name:'航班申报'},
    //         {path:'/flightplan',component:Flightplan,name:'当日飞行计划'},
    //         {path:'/aircraft',component:Aircraft,name:'通用航空器申报'},
    //         {path:'/routeaircraft',component:Routeaircraft,name:'航线航空器申报'},
    //     ]
    // },
    // {
    //     path: '/querytransport',
    //     component: Home,
    //     name: '通用业务查询',
    //     iconCls:'el-icon-goods',
    //     children:[
    //         {path:'/queryRoute',component:queryRoute,name:'航线查询'},
    //         {path:'/queryBill',component:queryBill,name:'单据查询'},
    //         {path:'/queryFlights',component:queryFlight,name:'航班查询'},
    //         {path:'/queryFlightplan',component:queryFlightplan,name:'当日飞行计划查询'},
    //         {path:'/queryAircraft',component:queryAircraft,name:'通用航空器查询'},
    //         {path:'/queryRouteaircraft',component:queryRouteaircraft,name:'航线航空器查询'},
    //     ]
    // },
    // {
    //     path: '/input',
    //     component: Home,
    //     name: '进港航班申报',
    //     iconCls:'el-icon-goods',
    //     children:[
    //         {path:'/arrival',component:arrival,name:'进港预报申报'},
    //         {path:'/confirmatory',component:confirmatory,name:'进港确报申报'},
    //         {path:'/queryArrival',component:queryArrival,name:'进港预报查询'},
    //         {path:'/queryConfirmatory',component:queryConfirmatory,name:'进港确报查询'},
    //         {path:'/configure',component:configure,name:'进港航班配置'},
    //         {path:'/queryConfigure',component:queryConfigure,name:'航班配置查询'},
    //     ]
    // },
    // {
    //     path: '/out',
    //     component: Home,
    //     name: '出港航班申报',
    //     iconCls:'el-icon-goods',
    //     children:[
    //         {path:'/departure',component:departure,name:'出港预报申报'},
    //         {path:'/declare',component:declare,name:'出港确报申报'},
    //         {path:'/queryDeparture',component:queryDeparture,name:'出港预报查询'},
    //         {path:'/queryDeclare',component:queryDeclare,name:'出港确报查询'},
    //         {path:'/outConfigure',component:outConfigure,name:'出港航班配置'},
    //         {path:'/queryFlightConfigure',component:queryFlightConfigure,name:'航班配置查询'},
    //     ]
    // },
    //
    // {
    //     path: '/empt',
    //     component: Home,
    //     name: '能源管理',
    //     iconCls: 'fa fa-id-card-o',
    //     children: [
    //         { path: '/location', component: Location, name: '能源缴费' },
    //     ]
    // },
    // {
    //     path: '/satff',
    //     component: Home,
    //     name: '生活保障部门',
    //     iconCls: 'fa fa-id-card-o',
    //     children: [
    //         { path: '/security_inspection', component: SecrityInspection, name: '职工公寓安全巡视管理' },
    //         { path: '/key', component: Key, name: '职工公寓备用钥匙使用登记管理' },
    //         { path: '/maintain', component: Maintain, name: '职工公寓设施设备维修记录管理' },
    //         { path: '/come_car', component: ComeCar, name: '职工公寓外来人员车辆登记管理' },
    //         { path: '/on_duty', component: OnDuty, name: '职工公寓值班巡视记录管理' },
    //     ]
    // },
    // {
    //     path: '/water_heating_chamber',
    //     component: Home,
    //     name: '水暖室',
    //     iconCls: 'fa fa-address-card',
    //     // leaf: true,//只有一个节点
    //     children: [
    //         { path: '/water_stations_patrol', component: WaterStationsPatrol, name: '二水厂-水站巡视记录单管理' },
    //         // { path: '/page6', component: Page6, name: '水质量检测' },
    //         // { path: '/page6', component: Page6, name: '污水站' },
    //         // { path: '/page6', component: Page6, name: '一水厂' },
    //         // { path: '/page6', component: Page6, name: '综合楼空调站' },
    //     ]
    // },
322 323 324 325 326 327 328 329 330
    // {
    //     path: '/',
    //     component: Home,
    //     name: 'Charts',
    //     iconCls: 'fa fa-bar-chart',
    //     children: [
    //         {path: '/echarts', component: echarts, name: 'echarts'}
    //     ]
    // },
朱兆平 authored
331 332 333
    {
        path: '*',
        hidden: true,
334
        redirect: {path: '/404'}
朱兆平 authored
335 336
    }
];
337
let initRouters = routes.concat();
338 339
let setUserMenus = function (list) {
    routes = list;
340 341 342 343 344
}
/**
 * 处理登陆后的账号对应的菜单
 * @param menuList
 */
345
let handleMenuList = function (router, menu) {
346 347 348 349 350 351 352 353 354 355 356 357
    var _self = this;
    var routerName = "";
    router.forEach(function (v_router) {
        routerName = v_router.name;
        menu.forEach(function (v_menu) {
            //查找返回的目录列表是否包含路由名称,有就返回匹配到的元素,没有就移除
            let result = menu.find(item => {
                return item.name === routerName;
            });

            //匹配到继续判断是否子元素,有子元素继续递归
            if (result) {
358 359
                if (v_router.children) {
                    _self.handleMenuList(v_router.children, result.children);
360 361
                }
                //没有则可以移除
362 363
            } else {
                router.splice(router.findIndex(itm => itm.name === routerName), 1);
364 365 366
            }
        })
    });
367 368
}
export default {
369
    routes, setUserMenus, handleMenuList, initRouters
370
};