2024-07-11 11:00:51 +08:00
|
|
|
import {
|
2024-12-30 08:26:40 +08:00
|
|
|
createBrowserRouter,
|
|
|
|
IndexRouteObject,
|
|
|
|
Link,
|
|
|
|
NonIndexRouteObject,
|
2025-02-24 19:10:38 +08:00
|
|
|
useParams,
|
2024-07-11 11:00:51 +08:00
|
|
|
} from "react-router-dom";
|
2024-07-22 10:07:05 +08:00
|
|
|
import ErrorPage from "../app/error";
|
2024-12-30 08:26:40 +08:00
|
|
|
import LoginPage from "../app/login";
|
2025-01-03 09:24:46 +08:00
|
|
|
import HomePage from "../app/main/home/page";
|
2025-03-25 23:01:09 +08:00
|
|
|
import StaffMessage from "../app/main/staffinfo_show/page";
|
2025-03-12 08:23:33 +08:00
|
|
|
import MainLayout from "../app/main/layout/MainLayout";
|
2025-03-19 15:57:48 +08:00
|
|
|
import DailyPage from "../app/main/daily/page";
|
|
|
|
import Dashboard from "../app/main/home/page";
|
|
|
|
import WeekPlanPage from "../app/main/plan/weekplan/page";
|
2025-03-25 23:01:09 +08:00
|
|
|
import StaffInformation from "../app/main/staffinfo_write/page";
|
2025-03-21 10:55:44 +08:00
|
|
|
import DeptSettingPage from "../app/main/admin/deptsettingpage/page";
|
2025-03-25 12:54:26 +08:00
|
|
|
import { adminRoute } from "./admin-route";
|
|
|
|
import AdminLayout from "../components/layout/admin/AdminLayout";
|
|
|
|
import SystemLogPage from "../app/main/systemlog/SystemLogPage";
|
2024-09-10 10:31:24 +08:00
|
|
|
interface CustomIndexRouteObject extends IndexRouteObject {
|
2024-12-30 08:26:40 +08:00
|
|
|
name?: string;
|
|
|
|
breadcrumb?: string;
|
2024-09-10 10:31:24 +08:00
|
|
|
}
|
2024-12-30 08:26:40 +08:00
|
|
|
interface CustomIndexRouteObject extends IndexRouteObject {
|
|
|
|
name?: string;
|
|
|
|
breadcrumb?: string;
|
2024-09-10 10:31:24 +08:00
|
|
|
}
|
|
|
|
|
2024-12-30 08:26:40 +08:00
|
|
|
export interface CustomNonIndexRouteObject extends NonIndexRouteObject {
|
|
|
|
name?: string;
|
|
|
|
children?: CustomRouteObject[];
|
|
|
|
breadcrumb?: string;
|
|
|
|
handle?: {
|
|
|
|
crumb: (data?: any) => void;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
export type CustomRouteObject =
|
|
|
|
| CustomIndexRouteObject
|
|
|
|
| CustomNonIndexRouteObject;
|
|
|
|
export const routes: CustomRouteObject[] = [
|
|
|
|
{
|
|
|
|
path: "/",
|
|
|
|
errorElement: <ErrorPage />,
|
|
|
|
handle: {
|
|
|
|
crumb() {
|
|
|
|
return <Link to={"/"}>主页</Link>;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
children: [
|
2024-12-31 15:57:32 +08:00
|
|
|
{
|
2025-01-03 09:24:46 +08:00
|
|
|
element: <MainLayout></MainLayout>,
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
index: true,
|
2025-03-19 15:57:48 +08:00
|
|
|
element:<Dashboard></Dashboard>,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/staffinformation",
|
|
|
|
element: <StaffInformation></StaffInformation>,
|
2025-02-27 22:58:42 +08:00
|
|
|
},
|
2025-02-26 21:08:38 +08:00
|
|
|
{
|
2025-03-12 08:23:33 +08:00
|
|
|
path: "/staff",
|
|
|
|
element: <StaffMessage></StaffMessage>,
|
2024-12-30 08:26:40 +08:00
|
|
|
},
|
2025-03-20 23:09:41 +08:00
|
|
|
{
|
2025-03-25 12:54:26 +08:00
|
|
|
path: "/systemlog",
|
|
|
|
element: <SystemLogPage></SystemLogPage>,
|
2025-03-19 15:57:48 +08:00
|
|
|
},
|
|
|
|
{
|
2025-03-25 12:54:26 +08:00
|
|
|
path: "/admin",
|
|
|
|
element: <AdminLayout></AdminLayout>,
|
|
|
|
children:adminRoute.children
|
2025-03-19 15:57:48 +08:00
|
|
|
},
|
|
|
|
|
2024-12-30 08:26:40 +08:00
|
|
|
],
|
|
|
|
},
|
2025-03-12 08:23:33 +08:00
|
|
|
|
2024-12-30 08:26:40 +08:00
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/login",
|
|
|
|
breadcrumb: "登录",
|
|
|
|
element: <LoginPage></LoginPage>,
|
|
|
|
},
|
|
|
|
];
|
2024-09-09 18:48:07 +08:00
|
|
|
|
2024-09-10 10:31:24 +08:00
|
|
|
export const router = createBrowserRouter(routes);
|