first commiit

This commit is contained in:
2025-02-08 10:15:06 +08:00
parent 6815bd083b
commit 262bf41379
242 changed files with 19959 additions and 1 deletions

84
src/router/index.ts Normal file
View File

@@ -0,0 +1,84 @@
import type { App } from "vue";
import { createRouter, createWebHashHistory, type RouteRecordRaw } from "vue-router";
export const Layout = () => import("@/layout/index.vue");
// 静态路由
export const constantRoutes: RouteRecordRaw[] = [
{
path: "/redirect",
component: Layout,
meta: { hidden: true },
children: [
{
path: "/redirect/:path(.*)",
component: () => import("@/views/redirect/index.vue"),
},
],
},
{
path: "/login",
component: () => import("@/views/login/index.vue"),
meta: { hidden: true },
},
{
path: "/",
component: Layout,
redirect: "/index",
meta: {
title: "数据统计",
icon: "data_statistics",
},
children: [
{
path: "index",
component: () => import("@/views/data/index.vue"),
name: "index",
meta: {
title: "数据统计",
affix: false,
keepAlive: true,
},
},
{
path: "sales",
name: "sales",
component: () => import("@/views/data/sales.vue"),
meta: {
title: "销售统计",
affix: false,
keepAlive: true,
},
},
{
path: "401",
component: () => import("@/views/error/401.vue"),
meta: { hidden: true },
},
{
path: "404",
component: () => import("@/views/error/404.vue"),
meta: { hidden: true },
},
],
},
];
/**
* 创建路由
*/
const router = createRouter({
history: createWebHashHistory(),
routes: constantRoutes,
// 刷新时,滚动条位置还原
scrollBehavior: () => ({ left: 0, top: 0 }),
});
// 全局注册 router
export function setupRouter(app: App<Element>) {
app.use(router);
}
export default router;