import Home from "./views/Home.vue";
import Progress from "./views/Progress.vue";
import Users from "./views/Users.vue";
import Group from "./views/Group.vue";

const routes = [
  {
    path: "progress",
    name: "Progress",
    component: Progress,
    meta: {
      title: "进度"
    }
  },
  {
    path: "users",
    name: "Users",
    component: Users,
    meta: {
      title: "用户管理"
    }
  },
  {
    path: "group",
    name: "Group",
    component: Group,
    meta: {
      title: "分档分组"
    }
  }
];

export const navs = routes.map(item => {
  return {
    name: item.name,
    title: item.meta.title
  };
});

export default [
  {
    path: "/admin/:workId(\\d+)/subject",
    name: "SubjectHome",
    component: Home,
    redirect: { name: "Progress" },
    children: routes
  }
];
