339 lines
7.3 KiB
TypeScript
339 lines
7.3 KiB
TypeScript
/**
|
|
* 菜单路由 Mock 数据
|
|
* 用于开发阶段模拟后端返回的菜单数据
|
|
*/
|
|
|
|
export interface MockMenuRoute {
|
|
path: string;
|
|
name?: string;
|
|
component?: string;
|
|
meta?: {
|
|
title?: string;
|
|
icon?: string;
|
|
requiresAuth?: boolean;
|
|
roles?: string[];
|
|
[key: string]: any;
|
|
};
|
|
children?: MockMenuRoute[];
|
|
}
|
|
|
|
/**
|
|
* Mock 菜单数据
|
|
* 根据实际后端接口返回的数据格式进行配置
|
|
*/
|
|
export const mockMenuData: MockMenuRoute[] = [
|
|
{
|
|
path: "/home",
|
|
name: "Home",
|
|
component: "Home", // 对应 @/pages/Home/index.vue
|
|
meta: {
|
|
title: "首页",
|
|
icon: "HomeFilled",
|
|
requiresAuth: true,
|
|
roles: ["admin", "user"],
|
|
},
|
|
},
|
|
{
|
|
name: "business",
|
|
path: "/business",
|
|
meta: {
|
|
title: "商机管理",
|
|
icon: "",
|
|
requiresAuth: true,
|
|
roles: ["admin", "user"],
|
|
},
|
|
children: [
|
|
{
|
|
name: "clue",
|
|
path: "clue",
|
|
component: "@/pages/BackBackstageManage/organization/index.vue",
|
|
meta: {
|
|
title: "线索管理",
|
|
icon: "",
|
|
requiresAuth: true,
|
|
roles: ["admin", "user"],
|
|
},
|
|
|
|
},
|
|
{
|
|
name: "customer",
|
|
path: "customer",
|
|
component: "@/pages/BackstageManage/organization/index.vue",
|
|
meta: {
|
|
title: "客户管理",
|
|
icon: "",
|
|
requiresAuth: true,
|
|
roles: ["admin", "user"],
|
|
},
|
|
},
|
|
{
|
|
name: "studio",
|
|
path: "studio",
|
|
component: "@/pages/BackstageManage/organization/index.vue",
|
|
meta: {
|
|
title: "游戏与工作室",
|
|
icon: "",
|
|
requiresAuth: true,
|
|
roles: ["admin", "user"],
|
|
},
|
|
},
|
|
{
|
|
name: "businessmanage",
|
|
path: "businessmanage",
|
|
component: "@/pages/BackstageManage/organization/index.vue",
|
|
meta: {
|
|
title: "商机管理",
|
|
icon: "",
|
|
requiresAuth: true,
|
|
roles: ["admin", "user"],
|
|
},
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: "contract",
|
|
path: "/contract",
|
|
meta: {
|
|
title: "合同管理",
|
|
icon: "",
|
|
requiresAuth: true,
|
|
roles: ["admin", "user"],
|
|
},
|
|
children: [
|
|
{
|
|
name: "income",
|
|
path: "income",
|
|
component: "@/pages/BackstageManage/organization/index.vue",
|
|
meta: {
|
|
title: "收入合同",
|
|
icon: "",
|
|
requiresAuth: true,
|
|
roles: ["admin", "user"],
|
|
},
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: "project",
|
|
path: "/project",
|
|
meta:{
|
|
title: "项目管理",
|
|
icon: "",
|
|
requiresAuth: true,
|
|
roles: ["admin", "user"],
|
|
},
|
|
children: [
|
|
{
|
|
name: "requirement",
|
|
path: "requirement",
|
|
component: "@/pages/BackstageManage/organization/index.vue",
|
|
meta: {
|
|
title: "需求管理",
|
|
icon: "",
|
|
requiresAuth: true,
|
|
roles: ["admin", "user"],
|
|
},
|
|
},
|
|
{
|
|
name: "projectmanage",
|
|
path: "projectmanage",
|
|
component: "@/pages/BackstageManage/organization/index.vue",
|
|
meta: {
|
|
title: "项目管理",
|
|
icon: "",
|
|
requiresAuth: true,
|
|
roles: ["admin", "user"],
|
|
},
|
|
},
|
|
{
|
|
name: "task",
|
|
path: "task",
|
|
component: "@/pages/BackstageManage/organization/index.vue",
|
|
meta: {
|
|
title: "任务管理",
|
|
icon: "",
|
|
requiresAuth: true,
|
|
roles: ["admin", "user"],
|
|
},
|
|
},
|
|
{
|
|
name: "work",
|
|
path: "work",
|
|
component: "@/pages/BackstageManage/organization/index.vue",
|
|
meta: {
|
|
title: "工时管理",
|
|
icon: "",
|
|
requiresAuth: true,
|
|
roles: ["admin", "user"],
|
|
},
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: "team",
|
|
path: "/team",
|
|
meta:{
|
|
title: "团队管理",
|
|
icon: "",
|
|
requiresAuth: true,
|
|
roles: ["admin", "user"],
|
|
},
|
|
children: [],
|
|
},
|
|
{
|
|
name: "recruit",
|
|
path: "/recruit",
|
|
meta:{
|
|
title: "招聘管理",
|
|
icon: "",
|
|
requiresAuth: true,
|
|
roles: ["admin", "user"],
|
|
},
|
|
children: [
|
|
{
|
|
name: "resume",
|
|
path: "resume",
|
|
component: "@/pages/BackstageManage/organization/index.vue",
|
|
meta: {
|
|
title: "流程管理",
|
|
icon: "",
|
|
requiresAuth: true,
|
|
roles: ["admin", "user"],
|
|
},
|
|
},
|
|
{
|
|
name: "push",
|
|
path: "push",
|
|
component: "@/pages/BackstageManage/organization/index.vue",
|
|
meta: {
|
|
title: "推送管理",
|
|
icon: "",
|
|
requiresAuth: true,
|
|
roles: ["admin", "user"],
|
|
},
|
|
|
|
},
|
|
{
|
|
name: "job",
|
|
path: "job",
|
|
component: "@/pages/BackstageManage/organization/index.vue",
|
|
meta: {
|
|
title: "主场岗位",
|
|
icon: "",
|
|
requiresAuth: true,
|
|
roles: ["admin", "user"],
|
|
},
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: "dashboard",
|
|
title: "dashboard",
|
|
path: "/stage",
|
|
meta: {
|
|
title: "后台管理",
|
|
icon: "",
|
|
requiresAuth: true,
|
|
roles: ["admin", "user"],
|
|
},
|
|
children: [
|
|
{
|
|
path: "flow",
|
|
name: "flow",
|
|
component: "@/pages/BackstageManage/organization/index.vue",
|
|
meta: {
|
|
title: "流程管理",
|
|
icon: "",
|
|
requiresAuth: true,
|
|
roles: ["admin", "user"],
|
|
},
|
|
},
|
|
{
|
|
name: "organization",
|
|
component: "@/pages/BackstageManage/organization/index.vue",
|
|
path: "organization",
|
|
meta: {
|
|
title: "组织管理",
|
|
icon: "",
|
|
requiresAuth: true,
|
|
roles: ["admin", "user"],
|
|
},
|
|
},
|
|
{
|
|
name: "personnel",
|
|
path: "personnel",
|
|
component: "@/pages/BackstageManage/organization/index.vue",
|
|
meta: {
|
|
title: "人员管理",
|
|
icon: "",
|
|
requiresAuth: true,
|
|
roles: ["admin", "user"],
|
|
},
|
|
},
|
|
{
|
|
name: "permission",
|
|
path: "permission",
|
|
component: "@/pages/BackstageManage/organization/index.vue",
|
|
meta: {
|
|
title: "权限管理",
|
|
icon: "",
|
|
requiresAuth: true,
|
|
roles: ["admin", "user"],
|
|
}
|
|
},
|
|
{
|
|
name: "dict",
|
|
path: "dict",
|
|
component: "@/pages/BackstageManage/dict/index.vue",
|
|
meta: {
|
|
title: "字典管理",
|
|
icon: "",
|
|
requiresAuth: true,
|
|
roles: ["admin", "user"],
|
|
}
|
|
},
|
|
],
|
|
},
|
|
];
|
|
|
|
|
|
export const mockBackendMenuData = [
|
|
{
|
|
"name": "字典管理",
|
|
"code": "dict",
|
|
"icon": "OfficeBuilding",
|
|
},
|
|
{
|
|
"name": "组织管理",
|
|
"code": "origanization",
|
|
"icon": "OfficeBuilding",
|
|
},
|
|
{
|
|
"name": "人员管理",
|
|
"code": "personnel",
|
|
"icon": "OfficeBuilding",
|
|
},
|
|
{
|
|
"name": "权限管理",
|
|
"code": "permission",
|
|
"icon": "OfficeBuilding",
|
|
},
|
|
{
|
|
"name": "流程管理",
|
|
"code": "flow",
|
|
"icon": "OfficeBuilding",
|
|
}
|
|
]
|
|
|
|
/**
|
|
* 获取 Mock 菜单数据的响应格式
|
|
* 模拟后端接口返回的数据结构
|
|
*/
|
|
export const getMockMenuResponse = () => {
|
|
return {
|
|
code: 0,
|
|
data: mockMenuData,
|
|
msg: "获取菜单成功",
|
|
};
|
|
};
|