import Vue from "vue";
import Router from "vue-router";

Vue.use(Router);
import Layout from "@/components/Layout/layout.vue";
const login = () => import("@/views/login.vue");

// 项目管理
import projectApply from "@/page/projectManagement/projectApply/index";
import projectView from "@/page/projectManagement/projectView/index";
import projectDownload from "@/page/projectManagement/projectDownload/index";
import projectMonthly from "@/page/projectManagement/projectMonthly/index";
import dashboard from "@/views/dashboard/index";
import userinfo from "@/page/login/userInfo";
const inspection = "/inspection";
const projectManagement = "/projectmanage";

//仓储设备设施
import cssbtzjsglIndex from "@/page/ccsbss/cssbtzjsgl/index"
import ccsstzjsglIndex from "@/page/ccsbss/ccsstzjsgl/index"

/** 项目管理start **/
const projectManage = [
  {
    path: `${projectManagement}/projectApply`,
    name: "projectApply",
    component: projectApply,
    meta: {
      title: "项目申请条件"
    }
  },
  {
    path: `${projectManagement}/projectView`,
    name: "projectView",
    component: projectView,
    meta: {
      title: "项目立项查看"
    }
  },
  {
    path: `${projectManagement}/projectDownload`,
    name: "projectDownload",
    component: projectDownload,
    meta: {
      title: "项目模板下载"
    }
  },
  {
    path: `${projectManagement}/projectMonthly`,
    name: "projectMonthly",
    component: projectMonthly,
    meta: {
      title: "项目进度月报截止时间"
    }
  }
];
/** 项目管理end **/

//
const ccsbss = [{
			//仓储设备投资建设管理
			path: "/projectmanage/ccsbss/cssbtzjsgl",
			name: "cssbtzjsglIndex",
			meta: {
				title: "仓储设备投资建设管理",
			},
			component: cssbtzjsglIndex,
		},
		{
			//仓储设施投资建设管理
			path: "/projectmanage/ccsbss/ccsstzjsgl",
			name: "ccsstzjsglIndex",
			meta: {
				title: "仓储设备投资建设管理",
			},
			component: ccsstzjsglIndex,
		}]

export default new Router({
  // mode:'history',
  routes: [
    {
      path: "/login",
      name: "login",
      component: login
    },
    {
      path: `/`,
      component: Layout,
      redirect: `${projectManagement}/projectApply`,
      name: "首页",
      hidden: true,
      // meta: {
      // 	title: '内蒙自治区企业管理平台',
      // 	icon: 'example'
      // },
      children: [
        {
          path: `${projectManagement}/projectApply`,
          component: projectApply,
          name: "首页",
          meta: {
            title: "",
            icon: "example"
          }
        },
        ...projectManage,
        ...ccsbss
      ]
    },
    {
      path: `${projectManagement}/userinfo`,
      name: "userinfo",
      component: userinfo
    },
    // {
    //   path: "/",
    //   component: () => import("@/page/index"),
    //   children: [
    //     {
    //       path: "/",
    //       name: "layout",
    //       component: () => import("@/page/Layout/layout.vue"),
    //       children: [...projectManage]
    //     }
    //   ]
    // }
  ]
});
