/** @format */

import Layout from "@/layout";

export default [
  {
    path: "",
    component: Layout,
    redirect: "/application",
    children: [
      {
        path: "/application",
        name: "application",
        unique_name: "application",
        component: () => import("@/views/application/talentApplication/index"),
        meta: { title: "英才卡申请", icon: "dashboard", affix: true },
      },
    ],
  },
  {
    path: "",
    component: Layout,
    children: [
      {
        path: "/draftBox",
        name: "draftBox",
        unique_name: "draftBox",

        component: () => import("@/views/application/draftBox/index"),
        meta: { title: "草稿箱", icon: "dashboard" },
      },
    ],
  },

  {
    path: "",
    component: Layout,
    children: [
      {
        path: "/approval",
        name: "approval",
        unique_name: "approval",

        component: () => import("@/views/application/approval/index"),
        meta: { title: "正在审批", icon: "dashboard" },
      },
    ],
  },

  {
    path: "",
    component: Layout,
    children: [
      {
        path: "/material",
        name: "material",
        unique_name: "material",

        component: () => import("@/views/application/material/index"),
        meta: { title: "材料补正", icon: "dashboard" },
      },
    ],
  },

  {
    path: "",
    component: Layout,
    children: [
      {
        path: "/inadmissible",
        name: "inadmissible",
        unique_name: "inadmissible",

        component: () => import("@/views/application/inadmissible/index"),
        meta: { title: "不予受理", icon: "dashboard" },
      },
    ],
  },

  {
    path: "",
    component: Layout,
    children: [
      {
        path: "/approved",
        name: "approved",
        unique_name: "approved",

        component: () => import("@/views/application/approved/index"),
        meta: { title: "审批通过", icon: "dashboard" },
      },
    ],
  },
  {
    path: "",
    component: Layout,
    children: [
      {
        path: "/materialApplication",
        name: "materialApplication",
        component: () =>
          import("@/views/application/materialApplication/index"),
        hidden: true,
        meta: {
          noCache: true,
        },
        beforeEnter: (to, from, next) => {
          to.meta.title = to.query.type == "A" ? "英才A卡申请" : "英才B卡申请";
          next();
        },
        beforeRouteLeave: (to, from, next) => {
          next();
        },
      },
    ],
  },
  {
    path: "",
    component: Layout,
    children: [
      {
        path: "/user/profileword",
        name: "profileword",
        component: () => import("@/views/system/user/profile/index"),
        meta: {
          title: "修改密码",
          icon: "dashboard",
        },
      },
    ],
  },
];
