|
@@ -1,7 +1,7 @@
|
|
|
-import { RouteRecordRaw } from "vue-router";
|
|
|
-import { defineStore } from "pinia";
|
|
|
-import { constantRoutes } from "@/router";
|
|
|
-import { store } from "@/store";
|
|
|
+import {RouteRecordRaw} from "vue-router";
|
|
|
+import {defineStore} from "pinia";
|
|
|
+import {constantRoutes} from "@/router";
|
|
|
+import {store} from "@/store";
|
|
|
|
|
|
const modules = import.meta.glob("../../views/**/**.vue");
|
|
|
// 不同角色,不同首页
|
|
@@ -13,13 +13,13 @@ const adminRoutes: RouteRecordRaw[] = JSON.parse(
|
|
|
{
|
|
|
path: "/",
|
|
|
redirect: "/areaboard",
|
|
|
- meta: { hidden: true, name: "Home" },
|
|
|
+ meta: {hidden: true, name: "Home"},
|
|
|
},
|
|
|
{
|
|
|
path: "/areaboard",
|
|
|
component: "AdminIndex",
|
|
|
redirect: "/areaboard/index",
|
|
|
- meta: { title: "区域级数据看板", name: "Dashboard" },
|
|
|
+ meta: {title: "区域级数据看板", name: "Dashboard"},
|
|
|
children: [
|
|
|
{
|
|
|
path: "index",
|
|
@@ -42,13 +42,13 @@ const schoolRoutes: RouteRecordRaw[] = JSON.parse(
|
|
|
{
|
|
|
path: "/",
|
|
|
redirect: "/dashboard",
|
|
|
- meta: { hidden: true, name: "Home" },
|
|
|
+ meta: {hidden: true, name: "Home"},
|
|
|
},
|
|
|
{
|
|
|
path: "/dashboard",
|
|
|
component: "SchoolIndex",
|
|
|
redirect: "/dashboard/index",
|
|
|
- meta: { title: "数据看板", name: "Dashboard" },
|
|
|
+ meta: {title: "数据看板", name: "Dashboard"},
|
|
|
children: [
|
|
|
{
|
|
|
path: "index",
|
|
@@ -76,7 +76,7 @@ const schoolRoutes: RouteRecordRaw[] = JSON.parse(
|
|
|
path: "/grade",
|
|
|
component: "SchoolIndex",
|
|
|
redirect: "/grade/index",
|
|
|
- meta: { title: "班级管理", name: "ClassManage" },
|
|
|
+ meta: {title: "班级管理", name: "ClassManage"},
|
|
|
children: [
|
|
|
{
|
|
|
path: "index",
|
|
@@ -95,7 +95,7 @@ const schoolRoutes: RouteRecordRaw[] = JSON.parse(
|
|
|
path: "/teacher",
|
|
|
component: "SchoolIndex",
|
|
|
redirect: "/teacher/index",
|
|
|
- meta: { title: "教师管理", name: "TeacherManage" },
|
|
|
+ meta: {title: "教师管理", name: "TeacherManage"},
|
|
|
children: [
|
|
|
{
|
|
|
path: "index",
|
|
@@ -114,7 +114,7 @@ const schoolRoutes: RouteRecordRaw[] = JSON.parse(
|
|
|
path: "/student",
|
|
|
component: "SchoolIndex",
|
|
|
redirect: "/student/index",
|
|
|
- meta: { title: "学生管理", name: "StudentManage" },
|
|
|
+ meta: {title: "学生管理", name: "StudentManage"},
|
|
|
children: [
|
|
|
{
|
|
|
path: "index",
|
|
@@ -130,7 +130,7 @@ const schoolRoutes: RouteRecordRaw[] = JSON.parse(
|
|
|
{
|
|
|
path: "result",
|
|
|
component: "student/result",
|
|
|
- meta: { title: "训练效果分析", name: "StudentResult", hidden: true },
|
|
|
+ meta: {title: "训练效果分析", name: "StudentResult", hidden: true},
|
|
|
},
|
|
|
// {
|
|
|
// path: "download",
|
|
@@ -142,13 +142,13 @@ const schoolRoutes: RouteRecordRaw[] = JSON.parse(
|
|
|
{
|
|
|
path: "/download/student/result",
|
|
|
component: "student/download",
|
|
|
- meta: { title: "下载报告预览", name: "StudentDownload", hidden: true },
|
|
|
+ meta: {title: "下载报告预览", name: "StudentDownload", hidden: true},
|
|
|
},
|
|
|
{
|
|
|
path: "/equipment",
|
|
|
component: "SchoolIndex",
|
|
|
redirect: "/equipment/index",
|
|
|
- meta: { title: "设备管理", name: "EquipmentManage" },
|
|
|
+ meta: {title: "设备管理", name: "EquipmentManage"},
|
|
|
children: [
|
|
|
{
|
|
|
path: "index",
|
|
@@ -167,7 +167,7 @@ const schoolRoutes: RouteRecordRaw[] = JSON.parse(
|
|
|
path: "/training",
|
|
|
component: "SchoolIndex",
|
|
|
redirect: "/training/index",
|
|
|
- meta: { title: "训练管理", name: "TrainingManage" },
|
|
|
+ meta: {title: "训练管理", name: "TrainingManage"},
|
|
|
children: [
|
|
|
{
|
|
|
path: "index",
|
|
@@ -183,7 +183,7 @@ const schoolRoutes: RouteRecordRaw[] = JSON.parse(
|
|
|
{
|
|
|
path: "result",
|
|
|
component: "training/result",
|
|
|
- meta: { title: "报告详情", name: "TrainingResult", hidden: true },
|
|
|
+ meta: {title: "报告详情", name: "TrainingResult", hidden: true},
|
|
|
},
|
|
|
],
|
|
|
},
|
|
@@ -191,7 +191,7 @@ const schoolRoutes: RouteRecordRaw[] = JSON.parse(
|
|
|
path: "/evaluation",
|
|
|
component: "SchoolIndex",
|
|
|
redirect: "/evaluation/index",
|
|
|
- meta: { title: "测评数据看板", name: "EvaluateManage" },
|
|
|
+ meta: {title: "测评数据看板", name: "EvaluateManage"},
|
|
|
children: [
|
|
|
{
|
|
|
path: "index",
|
|
@@ -219,7 +219,7 @@ const filterAsyncRoutes = (routes: RouteRecordRaw[], role: string | null) => {
|
|
|
const asyncRoutes: RouteRecordRaw[] = [];
|
|
|
|
|
|
routes.forEach((route) => {
|
|
|
- const tmpRoute = { ...route }; // ES6扩展运算符复制新对象
|
|
|
+ const tmpRoute = {...route}; // ES6扩展运算符复制新对象
|
|
|
|
|
|
if (tmpRoute.component?.toString() == "SchoolIndex") {
|
|
|
tmpRoute.component = Layout;
|
|
@@ -279,7 +279,7 @@ export const usePermissionStore = defineStore("permission", () => {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
- return { routes, setRoutes, generateRoutes };
|
|
|
+ return {routes, setRoutes, generateRoutes};
|
|
|
});
|
|
|
|
|
|
// 非setup
|