feat: 整体pure,核心功能对接完成
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// 模拟后端动态生成路由
|
||||
import { defineFakeRoute } from "vite-plugin-fake-server/client";
|
||||
import { system, monitor, permission, frame, tabs } from "@/router/enums";
|
||||
import { system, monitor } from "@/router/enums";
|
||||
|
||||
/**
|
||||
* roles:页面级别权限,这里模拟二种 "admin"、"common"
|
||||
@@ -21,7 +21,7 @@ const systemManagementRouter = {
|
||||
name: "SystemUser",
|
||||
meta: {
|
||||
icon: "ri:admin-line",
|
||||
title: "menus.pureUser",
|
||||
title: "menus.pureUser"
|
||||
//roles: ["admin"]
|
||||
}
|
||||
},
|
||||
@@ -30,7 +30,7 @@ const systemManagementRouter = {
|
||||
name: "SystemRole",
|
||||
meta: {
|
||||
icon: "ri:admin-fill",
|
||||
title: "menus.pureRole",
|
||||
title: "menus.pureRole"
|
||||
//roles: ["admin"]
|
||||
}
|
||||
},
|
||||
@@ -39,7 +39,7 @@ const systemManagementRouter = {
|
||||
name: "SystemMenu",
|
||||
meta: {
|
||||
icon: "ep:menu",
|
||||
title: "menus.pureSystemMenu",
|
||||
title: "menus.pureSystemMenu"
|
||||
//roles: ["admin"]
|
||||
}
|
||||
},
|
||||
@@ -48,7 +48,7 @@ const systemManagementRouter = {
|
||||
name: "SystemDept",
|
||||
meta: {
|
||||
icon: "ri:git-branch-line",
|
||||
title: "menus.pureDept",
|
||||
title: "menus.pureDept"
|
||||
//roles: ["admin"]
|
||||
}
|
||||
},
|
||||
@@ -57,7 +57,7 @@ const systemManagementRouter = {
|
||||
name: "SystemPost",
|
||||
meta: {
|
||||
icon: "ant-design:deployment-unit-outlined",
|
||||
title: "menus.purePost",
|
||||
title: "menus.purePost"
|
||||
//roles: ["admin"]
|
||||
}
|
||||
}
|
||||
@@ -78,7 +78,7 @@ const systemMonitorRouter = {
|
||||
name: "OnlineUser",
|
||||
meta: {
|
||||
icon: "ri:user-voice-line",
|
||||
title: "menus.pureOnlineUser",
|
||||
title: "menus.pureOnlineUser"
|
||||
//roles: ["admin"]
|
||||
}
|
||||
},
|
||||
@@ -88,7 +88,7 @@ const systemMonitorRouter = {
|
||||
name: "LoginLog",
|
||||
meta: {
|
||||
icon: "ri:window-line",
|
||||
title: "menus.pureLoginLog",
|
||||
title: "menus.pureLoginLog"
|
||||
//roles: ["admin"]
|
||||
}
|
||||
},
|
||||
@@ -98,7 +98,7 @@ const systemMonitorRouter = {
|
||||
name: "OperationLog",
|
||||
meta: {
|
||||
icon: "ri:history-fill",
|
||||
title: "menus.pureOperationLog",
|
||||
title: "menus.pureOperationLog"
|
||||
//roles: ["admin"]
|
||||
}
|
||||
}
|
||||
@@ -114,220 +114,220 @@ const systemMonitorRouter = {
|
||||
// }
|
||||
]
|
||||
};
|
||||
|
||||
const permissionRouter = {
|
||||
path: "/permission",
|
||||
meta: {
|
||||
title: "menus.purePermission",
|
||||
icon: "ep:lollipop",
|
||||
rank: permission
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: "/permission/page/index",
|
||||
name: "PermissionPage",
|
||||
meta: {
|
||||
title: "menus.purePermissionPage",
|
||||
//roles: ["admin", "common"]
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "/permission/button",
|
||||
meta: {
|
||||
title: "menus.purePermissionButton",
|
||||
//roles: ["admin", "common"]
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: "/permission/button/router",
|
||||
component: "permission/button/index",
|
||||
name: "PermissionButtonRouter",
|
||||
meta: {
|
||||
title: "menus.purePermissionButtonRouter",
|
||||
auths: [
|
||||
"permission:btn:add",
|
||||
"permission:btn:edit",
|
||||
"permission:btn:delete"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "/permission/button/login",
|
||||
component: "permission/button/perms",
|
||||
name: "PermissionButtonLogin",
|
||||
meta: {
|
||||
title: "menus.purePermissionButtonLogin"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
const frameRouter = {
|
||||
path: "/iframe",
|
||||
meta: {
|
||||
icon: "ri:links-fill",
|
||||
title: "menus.pureExternalPage",
|
||||
rank: frame
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: "/iframe/embedded",
|
||||
meta: {
|
||||
title: "menus.pureEmbeddedDoc"
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: "/iframe/colorhunt",
|
||||
name: "FrameColorHunt",
|
||||
meta: {
|
||||
title: "menus.pureColorHuntDoc",
|
||||
frameSrc: "https://colorhunt.co/",
|
||||
keepAlive: true,
|
||||
//roles: ["admin", "common"]
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "/iframe/uigradients",
|
||||
name: "FrameUiGradients",
|
||||
meta: {
|
||||
title: "menus.pureUiGradients",
|
||||
frameSrc: "https://uigradients.com/",
|
||||
keepAlive: true,
|
||||
//roles: ["admin", "common"]
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "/iframe/ep",
|
||||
name: "FrameEp",
|
||||
meta: {
|
||||
title: "menus.pureEpDoc",
|
||||
frameSrc: "https://element-plus.org/zh-CN/",
|
||||
keepAlive: true,
|
||||
//roles: ["admin", "common"]
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "/iframe/tailwindcss",
|
||||
name: "FrameTailwindcss",
|
||||
meta: {
|
||||
title: "menus.pureTailwindcssDoc",
|
||||
frameSrc: "https://tailwindcss.com/docs/installation",
|
||||
keepAlive: true,
|
||||
//roles: ["admin", "common"]
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "/iframe/vue3",
|
||||
name: "FrameVue",
|
||||
meta: {
|
||||
title: "menus.pureVueDoc",
|
||||
frameSrc: "https://cn.vuejs.org/",
|
||||
keepAlive: true,
|
||||
//roles: ["admin", "common"]
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "/iframe/vite",
|
||||
name: "FrameVite",
|
||||
meta: {
|
||||
title: "menus.pureViteDoc",
|
||||
frameSrc: "https://cn.vitejs.dev/",
|
||||
keepAlive: true,
|
||||
//roles: ["admin", "common"]
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "/iframe/pinia",
|
||||
name: "FramePinia",
|
||||
meta: {
|
||||
title: "menus.purePiniaDoc",
|
||||
frameSrc: "https://pinia.vuejs.org/zh/index.html",
|
||||
keepAlive: true,
|
||||
//roles: ["admin", "common"]
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "/iframe/vue-router",
|
||||
name: "FrameRouter",
|
||||
meta: {
|
||||
title: "menus.pureRouterDoc",
|
||||
frameSrc: "https://router.vuejs.org/zh/",
|
||||
keepAlive: true,
|
||||
//roles: ["admin", "common"]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: "/iframe/external",
|
||||
meta: {
|
||||
title: "menus.pureExternalDoc"
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: "/external",
|
||||
name: "https://pure-admin.github.io/pure-admin-doc",
|
||||
meta: {
|
||||
title: "menus.pureExternalLink",
|
||||
//roles: ["admin", "common"]
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "/pureUtilsLink",
|
||||
name: "https://pure-admin-utils.netlify.app/",
|
||||
meta: {
|
||||
title: "menus.pureUtilsLink",
|
||||
//roles: ["admin", "common"]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
const tabsRouter = {
|
||||
path: "/tabs",
|
||||
meta: {
|
||||
icon: "ri:bookmark-2-line",
|
||||
title: "menus.pureTabs",
|
||||
rank: tabs
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: "/tabs/index",
|
||||
name: "Tabs",
|
||||
meta: {
|
||||
title: "menus.pureTabs",
|
||||
//roles: ["admin", "common"]
|
||||
}
|
||||
},
|
||||
// query 传参模式
|
||||
{
|
||||
path: "/tabs/query-detail",
|
||||
name: "TabQueryDetail",
|
||||
meta: {
|
||||
// 不在menu菜单中显示
|
||||
showLink: false,
|
||||
activePath: "/tabs/index",
|
||||
//roles: ["admin", "common"]
|
||||
}
|
||||
},
|
||||
// params 传参模式
|
||||
{
|
||||
path: "/tabs/params-detail/:id",
|
||||
component: "params-detail",
|
||||
name: "TabParamsDetail",
|
||||
meta: {
|
||||
// 不在menu菜单中显示
|
||||
showLink: false,
|
||||
activePath: "/tabs/index",
|
||||
//roles: ["admin", "common"]
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
//
|
||||
// const permissionRouter = {
|
||||
// path: "/permission",
|
||||
// meta: {
|
||||
// title: "menus.purePermission",
|
||||
// icon: "ep:lollipop",
|
||||
// rank: permission
|
||||
// },
|
||||
// children: [
|
||||
// {
|
||||
// path: "/permission/page/index",
|
||||
// name: "PermissionPage",
|
||||
// meta: {
|
||||
// title: "menus.purePermissionPage"
|
||||
// //roles: ["admin", "common"]
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// path: "/permission/button",
|
||||
// meta: {
|
||||
// title: "menus.purePermissionButton"
|
||||
// //roles: ["admin", "common"]
|
||||
// },
|
||||
// children: [
|
||||
// {
|
||||
// path: "/permission/button/router",
|
||||
// component: "permission/button/index",
|
||||
// name: "PermissionButtonRouter",
|
||||
// meta: {
|
||||
// title: "menus.purePermissionButtonRouter",
|
||||
// auths: [
|
||||
// "permission:btn:add",
|
||||
// "permission:btn:edit",
|
||||
// "permission:btn:delete"
|
||||
// ]
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// path: "/permission/button/login",
|
||||
// component: "permission/button/perms",
|
||||
// name: "PermissionButtonLogin",
|
||||
// meta: {
|
||||
// title: "menus.purePermissionButtonLogin"
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
// ]
|
||||
// };
|
||||
//
|
||||
// const frameRouter = {
|
||||
// path: "/iframe",
|
||||
// meta: {
|
||||
// icon: "ri:links-fill",
|
||||
// title: "menus.pureExternalPage",
|
||||
// rank: frame
|
||||
// },
|
||||
// children: [
|
||||
// {
|
||||
// path: "/iframe/embedded",
|
||||
// meta: {
|
||||
// title: "menus.pureEmbeddedDoc"
|
||||
// },
|
||||
// children: [
|
||||
// {
|
||||
// path: "/iframe/colorhunt",
|
||||
// name: "FrameColorHunt",
|
||||
// meta: {
|
||||
// title: "menus.pureColorHuntDoc",
|
||||
// frameSrc: "https://colorhunt.co/",
|
||||
// keepAlive: true
|
||||
// //roles: ["admin", "common"]
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// path: "/iframe/uigradients",
|
||||
// name: "FrameUiGradients",
|
||||
// meta: {
|
||||
// title: "menus.pureUiGradients",
|
||||
// frameSrc: "https://uigradients.com/",
|
||||
// keepAlive: true
|
||||
// //roles: ["admin", "common"]
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// path: "/iframe/ep",
|
||||
// name: "FrameEp",
|
||||
// meta: {
|
||||
// title: "menus.pureEpDoc",
|
||||
// frameSrc: "https://element-plus.org/zh-CN/",
|
||||
// keepAlive: true
|
||||
// //roles: ["admin", "common"]
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// path: "/iframe/tailwindcss",
|
||||
// name: "FrameTailwindcss",
|
||||
// meta: {
|
||||
// title: "menus.pureTailwindcssDoc",
|
||||
// frameSrc: "https://tailwindcss.com/docs/installation",
|
||||
// keepAlive: true
|
||||
// //roles: ["admin", "common"]
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// path: "/iframe/vue3",
|
||||
// name: "FrameVue",
|
||||
// meta: {
|
||||
// title: "menus.pureVueDoc",
|
||||
// frameSrc: "https://cn.vuejs.org/",
|
||||
// keepAlive: true
|
||||
// //roles: ["admin", "common"]
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// path: "/iframe/vite",
|
||||
// name: "FrameVite",
|
||||
// meta: {
|
||||
// title: "menus.pureViteDoc",
|
||||
// frameSrc: "https://cn.vitejs.dev/",
|
||||
// keepAlive: true
|
||||
// //roles: ["admin", "common"]
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// path: "/iframe/pinia",
|
||||
// name: "FramePinia",
|
||||
// meta: {
|
||||
// title: "menus.purePiniaDoc",
|
||||
// frameSrc: "https://pinia.vuejs.org/zh/index.html",
|
||||
// keepAlive: true
|
||||
// //roles: ["admin", "common"]
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// path: "/iframe/vue-router",
|
||||
// name: "FrameRouter",
|
||||
// meta: {
|
||||
// title: "menus.pureRouterDoc",
|
||||
// frameSrc: "https://router.vuejs.org/zh/",
|
||||
// keepAlive: true
|
||||
// //roles: ["admin", "common"]
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// path: "/iframe/external",
|
||||
// meta: {
|
||||
// title: "menus.pureExternalDoc"
|
||||
// },
|
||||
// children: [
|
||||
// {
|
||||
// path: "/external",
|
||||
// name: "https://pure-admin.github.io/pure-admin-doc",
|
||||
// meta: {
|
||||
// title: "menus.pureExternalLink"
|
||||
// //roles: ["admin", "common"]
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// path: "/pureUtilsLink",
|
||||
// name: "https://pure-admin-utils.netlify.app/",
|
||||
// meta: {
|
||||
// title: "menus.pureUtilsLink"
|
||||
// //roles: ["admin", "common"]
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
// ]
|
||||
// };
|
||||
//
|
||||
// const tabsRouter = {
|
||||
// path: "/tabs",
|
||||
// meta: {
|
||||
// icon: "ri:bookmark-2-line",
|
||||
// title: "menus.pureTabs",
|
||||
// rank: tabs
|
||||
// },
|
||||
// children: [
|
||||
// {
|
||||
// path: "/tabs/index",
|
||||
// name: "Tabs",
|
||||
// meta: {
|
||||
// title: "menus.pureTabs"
|
||||
// //roles: ["admin", "common"]
|
||||
// }
|
||||
// },
|
||||
// // query 传参模式
|
||||
// {
|
||||
// path: "/tabs/query-detail",
|
||||
// name: "TabQueryDetail",
|
||||
// meta: {
|
||||
// // 不在menu菜单中显示
|
||||
// showLink: false,
|
||||
// activePath: "/tabs/index"
|
||||
// //roles: ["admin", "common"]
|
||||
// }
|
||||
// },
|
||||
// // params 传参模式
|
||||
// {
|
||||
// path: "/tabs/params-detail/:id",
|
||||
// component: "params-detail",
|
||||
// name: "TabParamsDetail",
|
||||
// meta: {
|
||||
// // 不在menu菜单中显示
|
||||
// showLink: false,
|
||||
// activePath: "/tabs/index"
|
||||
// //roles: ["admin", "common"]
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
// };
|
||||
|
||||
export default defineFakeRoute([
|
||||
{
|
||||
@@ -336,7 +336,7 @@ export default defineFakeRoute([
|
||||
response: () => {
|
||||
return [
|
||||
systemManagementRouter,
|
||||
systemMonitorRouter,
|
||||
systemMonitorRouter
|
||||
//permissionRouter,
|
||||
// frameRouter,
|
||||
// tabsRouter
|
||||
|
||||
Reference in New Issue
Block a user