import Vue from 'vue'
import VueRouter from 'vue-router'

const home=()=> import('../components/home.vue')
const submitworkorder=()=> import('../components/submitworkorder.vue')  //提交工单
const submitworkorderChoose=()=> import('../components/submitworkorderChoose.vue')  //提交工单-选择对应工单
const submitworkorderCreate=()=> import('../components/submitworkorderCreate.vue')  //提交工单-创建工单
const commonproblem=()=> import('../components/commonproblem.vue')      //常见问题
const commonproblemDetails=()=> import('../components/commonproblemDetails.vue')      //常见问题详情页
const Login=()=> import('../components/Login.vue')
const main=()=> import('../components/main.vue')
const ManagementLogin=()=> import('../components/ManagementLogin.vue')  //后台管理登录
const ManagementHome=()=> import('../components/ManagementHome.vue')    //后台管理主页
const Register=()=> import('../components/Register.vue')    //注册
const WorkBench=()=> import('../components/ManagementSystem/WorkBench.vue')  //工作台
const AllWorkOrder=()=> import('../components/ManagementSystem/AllWorkOrder.vue')    //所有工单
const WorkOrderList=()=> import('../components/ManagementSystem/WorkOrderList.vue') //工单列表 
const ManagementMyWorkOrder=()=> import('../components/ManagementSystem/ManagementMyWorkOrder.vue') //管理系统我的工单
const WorkOrderModel=()=> import('../components/ManagementSystem/WorkOrderModel.vue')    //工单模型
const ClassificationManagement=()=> import('../components/ManagementSystem/ClassificationManagement.vue') //分类管理
const Managers=()=> import('../components/ManagementSystem/Managers.vue') //管理员列表
const UserGroup=()=> import('../components/UserGroup.vue') //用户组列表
const NodeManagement=()=> import('../components/ManagementSystem/NodeManagement.vue') //节点管理
const ReplyPhrase=()=> import('../components/ManagementSystem/ReplyPhrase.vue') //回复短语MyWorkOrder
const MyWorkOrder=()=> import('../components/MyWorkOrder.vue') //我的工单
const MyWorkOrderDetails=()=> import('../components/MyWorkOrderDetails.vue') //我的工单详情页


Vue.use(VueRouter)

const router = new VueRouter({
    routes :[
        {
            path:'',
            redirect:'/home'
        },
        {
            path:'/Login',
            component:Login
        }
        ,
        {
            path:'/main',
            component:main,
            children:[
                {
                    path:'/submitworkorder',
                    component:submitworkorder
                },  {
                    path:'/home',
                    component:home  
                },  {
                    path:'/commonproblem',
                    component:commonproblem
                }, {
                    path:'/MyWorkOrder',
                    component:MyWorkOrder
                }, {
                    path:'/commonproblemDetails',
                    component:commonproblemDetails
                },{
                    path:'/MyWorkOrderDetails',
                    component:MyWorkOrderDetails
                },
                {
                    path:'/submitworkorderChoose',
                    component:submitworkorderChoose
                }, {
                    path:'/submitworkorderCreate',
                    component:submitworkorderCreate
                },
            ]
        },
        {
            path:'/ManagementLogin',
            component:ManagementLogin
        }
        ,
        {
            path:'/ManagementHome',
            component:ManagementHome,
            children:[
                {
                    path:'',
                    redirect:'/WorkBench'
                },
                {
                    path:'/WorkBench',
                    component:WorkBench
                }, {
                    path:'/AllWorkOrder',
                    component:AllWorkOrder
                },{
                    path:'/WorkOrderList',
                    component:WorkOrderList
                },{
                    path:'/ManagementMyWorkOrder',
                    component:ManagementMyWorkOrder
                },{
                    path:'/WorkOrderModel',
                    component:WorkOrderModel
                },{
                    path:'/ClassificationManagement',
                    component:ClassificationManagement
                },{
                    path:'/Managers',
                    component:Managers
                },{
                    path:'/UserGroup',
                    component:UserGroup
                },{
                    path:'/NodeManagement',
                    component:NodeManagement
                },{
                    path:'/ReplyPhrase',
                    component:ReplyPhrase
                },
            ]
        },
        {
            path:'/Register',
            component:Register
        }
    ],
    mode:'history'
})

export default router