const _import = (path) => (r) =>
  require.ensure([], () => r(require("../views/" + path + ".vue")));

export const constantRouterMap = [
  {
    path: "/login",
    // component: login,
    component: _import("login/login"),
    meta: {
      name: "登录",
      noCache: true,
    },
  },
  /*{
    path: "/",
    redirect: "/home",
    hidden: true,
  },*/
];

export const frameIn = [
  {
    path: "/",
    component: _import("main/index"),
    children: [
      {
        path: "",
        name: "home",
        component: _import("home/index"),
        meta: {
          name: "首页",
        },
        icon: "icon-shouye",
      },
      {
        path: "searchContent",
        name: "searchContent",
        component: _import("home/searchContent/index"),
        meta: {
          name: "搜索结果",
        },
        icon: "icon-shouye",
      },
      {
        path: "medicalGuide",
        name: "medicalGuide",
        component: _import("home/medicalGuide/index"),
        meta: {
          name: "就医指南",
        },
        icon: "icon-shouye",
      },
      {
        path: "hospitalOverview",
        name: "hospitalOverview",
        component: _import("home/hospitalOverview/index"),
        meta: {
          name: "医院概况",
        },
        icon: "icon-shouye",
      },
      {
        path: "departmentIntroduction",
        name: "departmentIntroduction",
        component: _import("home/medicalCare/departmentIntroduction/index"),
        meta: {
          name: "科室介绍",
        },
        icon: "icon-shouye",
      },
      {
        path: "experts",
        name: "experts",
        component: _import("home/medicalCare/experts/index"),
        meta: {
          name: "专家介绍",
        },
        icon: "icon-shouye",
      },
      {
        path: "medicalInsuranceWindow",
        name: "medicalInsuranceWindow",
        component: _import("home/medicalCare/medicalInsuranceWindow/index"),
        meta: {
          name: "医保之窗",
        },
        icon: "icon-shouye",
      },
      {
        path: "hospitalNews",
        name: "hospitalNews",
        component: _import("home/medicalNews/hospitalNews/index"),
        meta: {
          name: "医院动态",
        },
        icon: "icon-shouye",
      },
      {
        path: "noticeAnnouncement",
        name: "noticeAnnouncement",
        component: _import("home/medicalNews/noticeAnnouncement/index"),
        meta: {
          name: "通知公告",
        },
        icon: "icon-shouye",
      },
      {
        path: "healthGarden",
        name: "healthGarden",
        component: _import("home/medicalNews/healthGarden/index"),
        meta: {
          name: "健康园地",
        },
        icon: "icon-shouye",
      },
      {
        path: "famousDoctor",
        name: "famousDoctor",
        component: _import("home/medicalNews/famousDoctor/index"),
        meta: {
          name: "名医有约",
        },
        icon: "icon-shouye",
      },
      {
        path: "talentRecruitment",
        name: "talentRecruitment",
        component: _import("home/talentRecruitment/index"),
        meta: {
          name: "人才招聘",
        },
        icon: "icon-shouye",
      },
    ],
  },
  {
    path: "/admin",
    component: _import("admin/layout/index"),
    children: [
      {
        path: "content",
        name: "content",
        component: _import("admin/content/index"),
        meta: {
          name: "内容管理",
          jurisdiction: "CMS",
          parentSelf: {
            name: "content",
            title: "内容管理",
          },
        },
        icon: "icon-neirongguanli",
      },
      {
        path: "addContent",
        name: "addContent",
        component: _import("admin/content/detail"),
        meta: {
          name: "新增内容",
          jurisdiction: "CMS",
          parent: {
            name: "content",
            title: "内容管理",
          },
        },
        hidden: true,
      },
      {
        path: "editContent",
        name: "editContent",
        component: _import("admin/content/detail"),
        meta: {
          name: "编辑内容",
          jurisdiction: "CMS",
          parent: {
            name: "content",
            title: "内容管理",
          },
        },
        hidden: true,
      },
      {
        path: "contentDetail",
        name: "contentDetail",
        component: _import("admin/content/detail"),
        meta: {
          name: "内容详情",
          jurisdiction: "CMS",
          parent: {
            name: "content",
            title: "内容管理",
          },
        },
        hidden: true,
      },
      {
        path: "advertisingSpace",
        name: "advertisingSpace",
        component: _import("admin/advertisingSpace/index"),
        meta: {
          name: "广告位管理",
          jurisdiction: "ASM",
          parentSelf: {
            name: "advertisingSpace",
            title: "广告位管理",
          },
        },
        icon: "icon-guanggaoweiguanli",
      },
      {
        path: "hospitalInformation",
        name: "hospitalInformation",
        component: _import("admin/hospitalInformation/index"),
        meta: {
          name: "医院信息管理",
          jurisdiction: "HIM",
          parentSelf: {
            name: "hospitalInformation",
            title: "医院信息管理",
          },
        },
        icon: "icon-yiyuanxinxiguanli",
      },
      {
        path: "user",
        name: "user",
        component: _import("admin/user/index"),
        meta: {
          name: "系统用户管理",
          jurisdiction: "WFM",
          parentSelf: {
            name: "user",
            title: "系统用户管理",
          },
        },
        icon: "icon-xitong-yonghuguanli",
      },
      {
        path: "addUser",
        name: "addUser",
        component: _import("admin/user/detail"),
        meta: {
          name: "新增员工",
          jurisdiction: "WFM",
          parent: {
            name: "user",
            title: "系统用户管理",
          },
        },
        hidden: true,
      },
      {
        path: "editUser",
        name: "editUser",
        component: _import("admin/user/detail"),
        meta: {
          name: "编辑员工",
          jurisdiction: "WFM",
          parent: {
            name: "user",
            title: "系统用户管理",
          },
        },
        hidden: true,
      },
      {
        path: "userDetail",
        name: "userDetail",
        component: _import("admin/user/detail"),
        meta: {
          name: "员工详情",
          jurisdiction: "WFM",
          parent: {
            name: "user",
            title: "系统用户管理",
          },
        },
        hidden: true,
      },

      {
        path: "departmentManagement",
        name: "departmentManagement",
        component: _import("admin/departmentManagement/index"),
        meta: {
          name: "科室管理",
          jurisdiction: "DM",
          parentSelf: {
            name: "departmentManagement",
            title: "科室管理",
          },
        },
        icon: "icon-keshiguanli-",
      },
      {
        path: "departmentManagementDetail",
        name: "departmentManagementDetail",
        component: _import("admin/departmentManagement/info"),
        meta: {
          name: "科室详情",
          jurisdiction: "DM",
          parent: {
            name: "departmentManagement",
            title: "科室管理",
          },
        },
        hidden: true,
      },

      {
        path: "expertManagement",
        name: "expertManagement",
        component: _import("admin/expertManagement/index"),
        meta: {
          name: "专家管理",
          jurisdiction: "EM",
          parentSelf: {
            name: "expertManagement",
            title: "专家管理",
          },
        },
        icon: "icon-zhuanjiaguanli",
      },
      {
        path: "expertDetail",
        name: "expertDetail",
        component: _import("admin/expertManagement/info"),
        meta: {
          name: "专家详情",
          jurisdiction: "EM",
          parent: {
            name: "expertManagement",
            title: "专家管理",
          },
        },
        hidden: true,
      },
    ],
  },
];
export default [...constantRouterMap];
export const menuRouter = [...constantRouterMap, ...frameIn];
