This commit is contained in:
Chuck1sn
2025-05-14 10:16:48 +08:00
commit 3cd59337e7
220 changed files with 23768 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
import type { RouteRecordRaw } from "vue-router";
import { RouteName, RoutePath } from "../constants";
const authRoutes: RouteRecordRaw[] = [
{
path: RoutePath.HOME,
name: RouteName.HOME,
redirect: {
name: RouteName.LOGIN,
},
},
{
path: RoutePath.LOGIN,
name: RouteName.LOGIN,
component: () => import("../../views/LoginView.vue"),
},
];
export default authRoutes;

View File

@@ -0,0 +1,67 @@
import type { RouteRecordRaw } from "vue-router";
import Dashboard from "../../components/Dashboard.vue";
import OverView from "../../views/OverView.vue";
import { ROLE, RouteName, RoutePath } from "../constants";
import userManagementRoutes from "./user";
const dashboardRoutes: RouteRecordRaw = {
path: RoutePath.DASHBOARD,
name: RouteName.DASHBOARD,
component: Dashboard,
meta: {
requiresAuth: true,
},
children: [
{
path: RoutePath.OVERVIEW,
name: RouteName.OVERVIEW,
component: () => import("@/views/OverView.vue"),
meta: {
requiresAuth: true,
},
},
{
path: RoutePath.SETTINGS,
name: RouteName.SETTINGS,
component: () => import("@/views/SettingsView.vue"),
meta: {
requiresAuth: true,
},
},
...userManagementRoutes,
{
path: RoutePath.NOTFOUND,
name: RouteName.NOTFOUND,
component: () => import("@/views/NotFound.vue"),
},
{
path: RoutePath.SCHEDULERVIEW,
name: RouteName.SCHEDULERVIEW,
component: () => import("@/views/SchedulerView.vue"),
meta: {
requiresAuth: true,
hasRole: ROLE.ADMIN,
},
},
{
path: RoutePath.DEPARTMENTVIEW,
name: RouteName.DEPARTMENTVIEW,
component: () => import("@/views/DepartmentView.vue"),
meta: {
requiresAuth: true,
hasRole: ROLE.ADMIN,
},
},
{
path: RoutePath.POSITIONVIEW,
name: RouteName.POSITIONVIEW,
component: () => import("@/views/PositionView.vue"),
meta: {
requiresAuth: true,
hasRole: ROLE.ADMIN,
},
},
],
};
export default dashboardRoutes;

View File

@@ -0,0 +1,12 @@
import type { RouteRecordRaw } from "vue-router";
import { RouteName, RoutePath } from "../constants";
const errorRoutes: RouteRecordRaw[] = [
{
path: RoutePath.GLOBAL_NOTFOUND,
name: RouteName.GLOBAL_NOTFOUND,
component: () => import("../../views/NotFound.vue"),
},
];
export default errorRoutes;

View File

@@ -0,0 +1,70 @@
import type { RouteRecordRaw } from "vue-router";
import { ROLE, RouteName, RoutePath } from "../constants";
const userManagementRoutes: RouteRecordRaw[] = [
{
path: RoutePath.USERVIEW,
name: RouteName.USERVIEW,
component: () => import("@/views/UserView.vue"),
meta: {
requiresAuth: true,
hasRole: ROLE.ADMIN,
},
},
{
path: RoutePath.ROLEVIEW,
name: RouteName.ROLEVIEW,
component: () => import("@/views/RoleView.vue"),
meta: {
requiresAuth: true,
hasRole: ROLE.ADMIN,
},
},
{
path: RoutePath.BINDROLEVIEW,
name: RouteName.BINDROLEVIEW,
component: () => import("@/views/BindRoleView.vue"),
meta: {
requiresAuth: true,
hasRole: ROLE.ADMIN,
},
},
{
path: RoutePath.BINDDEPARTMENTVIEW,
name: RouteName.BINDDEPARTMENTVIEW,
component: () => import("@/views/BindDepartmentView.vue"),
meta: {
requiresAuth: true,
hasRole: ROLE.ADMIN,
},
},
{
path: RoutePath.BINDPERMISSIONVIEW,
name: RouteName.BINDPERMISSIONVIEW,
component: () => import("@/views/BindPermissionView.vue"),
meta: {
requiresAuth: true,
hasRole: ROLE.ADMIN,
},
},
{
path: RoutePath.PERMISSIONVIEW,
name: RouteName.PERMISSIONVIEW,
component: () => import("@/views/PermissionView.vue"),
meta: {
requiresAuth: true,
hasRole: ROLE.ADMIN,
},
},
{
path: RoutePath.BINDPOSITIONVIEW,
name: RouteName.BINDPOSITIONVIEW,
component: () => import("@/views/BindPositionView.vue"),
meta: {
requiresAuth: true,
hasRole: ROLE.ADMIN,
},
},
];
export default userManagementRoutes;