import {Routes} from '@angular/router';
import {LoginGuard} from './shared/common/loginGuard';
import {AppComponent} from './app.component';
import {JhiLoginModalComponent} from './shared';
import {JhiMainComponent} from './layouts';
import {HomeComponent} from './home/home.component';
import {SignalComponent} from './shared/signal/signal.component';
import {MineComponent} from './mine/mine.component';
import {AssetManageComponent} from './infomationResource/asset-manage/asset-manage.component';
import {CheckAuthComponent} from './shared/check-auth/check-auth.component';
import {alarmRoute} from './alarm/alarm.route';
import {analysisRoute} from './analysis/analysis.route';
import {businessRoute} from './business/business.route';
import {infomationResourceRoute} from './infomationResource/informationResource.route';
import {knowladgeRoute} from './knowladge/knowladge.route';
import {netTopologyRoute} from './netTopology/netTopology.route';
import {overAllRoute} from './overAll/overAll.route';
import {perforManageRoute} from './perforManage/perforManage.route';
import {projectManageRoute} from './project-manager/projectManage.route';
import {systemRoute} from './system/system.route';
import {systemChangeRoute} from './system-change/systemChange.route';
import {workRoute} from './work/work.route';
import {overviewRoute} from './overview/overview.route';
import {earlyWarningRoute} from './early-warning/earlyWarning.route';
import {infomationProjectRoute} from './information-project/information-project.route';

export const route: Routes = [
    {path: '', redirectTo: 'app/main/home', pathMatch: 'prefix'},  //空路由定向
    {
        path: 'app', component: AppComponent,
        children: [
            {path: 'signal', component: SignalComponent},
            {path: 'login', component: JhiLoginModalComponent},
            {path: 'checkAuth', component: CheckAuthComponent, data: {breadcrumb: '校验权限'},},
            {
                path: 'main', component: JhiMainComponent, canActivate: [LoginGuard], data: {breadcrumb: '首页'},
                children: [
                    alarmRoute,
                    analysisRoute,
                    businessRoute,
                    infomationResourceRoute,
                    knowladgeRoute,
                    netTopologyRoute,
                    overAllRoute,
                    perforManageRoute,
                    projectManageRoute,
                    systemRoute,
                    systemChangeRoute,
                    workRoute,
                    overviewRoute,
                    earlyWarningRoute,
                    infomationProjectRoute,
                    {path: 'home', component: HomeComponent, data: {breadcrumb: '首页'},},
                    {path: 'assetManage', component: AssetManageComponent, data: {breadcrumb: '资产管理'},},
                    {path: 'mine', component: MineComponent, data: {breadcrumb: '菜单栏'},},
                ]
            },
        ]
    },
    {path: '**', redirectTo: 'app/main/home', pathMatch: 'full'},   //未找到的路由 重定向
];
