/*各个路由模块的建立*/
import Home from "@/views/Home/Home";
import GlobalLayout from "@/layout/GlobalLayout";
import Login from "@/views/login/Login";
const SYSTEM_MANAGEMENT = "系统管理";
const SETTLEMENT_MANAGEMENT = "结算管理";
const DATAANALYSIS_MANAGEMENT="数据分析";
/*定义路径值*/
export const LOGIN_PATH = "/login";
export const HOME_PATH = "/";
export const APP_PATH = "/HomeApp";
/**
* 菜单配置
*
* 参数例子:
* {
* path: 路径,
* name: 名称,
* meta: {
* text: 左侧菜单栏显示文字,
* icon: 左侧菜单栏显示图标,
* pName: 父级菜单名称
* },
* hidden: 是否在菜单栏中隐藏,
* component: 组件(按需引入)
* }
*/
export const staticRoutesApp = [
{
path: APP_PATH,
name: "Home",
meta: {
text: "首页",
icon: "el-icon-tickets"
},
component: Home
},
{
path: "/order",
name: "Order",
meta: {
text: "订单管理",
icon: "el-icon-tickets"
},
component: () => import("@/views/order/Order")
},
{
path: "/task",
name: "Task",
meta: {
text: "任务管理",
icon: "el-icon-tickets"
},
component: () => import("@/views/task/Task")
},
{
path: "/content",
name: "Content",
meta: {
text: "内容管理",
icon: "el-icon-document-copy"
},
component: () => import("@/views/content/Content")
},
{
path: "/settlement",
name: "Settlement",
meta: {
text: "任务结算",
icon: "el-icon-document-copy",
pName: SETTLEMENT_MANAGEMENT
},
component: () => import("@/views/settlement/settlement/Settlement")
},
{
path: "/transaction",
name: "Transaction",
meta: {
text: "交易记录",
icon: "el-icon-document-copy",
pName: SETTLEMENT_MANAGEMENT
},
component: () => import("@/views/settlement/transaction/Transaction")
},
{
path: "/list",
name: "list",
meta: {
text: "数据列表页",
icon: "el-icon-document-copy",
pName: DATAANALYSIS_MANAGEMENT
},
component: () => import("@/views/Detaildata/DetailList/List")
},
{
path: "/list/analysis/:id",
name: "Analysis",
meta: {
text: "数据详情页",
pName: '数据列表页'
},
props: true,
hidden: true,
component: () => import("@/views/Detaildata/DetailEmpty/Empty")
},
{
path: "/app",
name: "app",
meta: {
text: "营销端页面",
icon: "el-icon-document-copy",
pName: DATAANALYSIS_MANAGEMENT
},
component: () => import("@/views/Detaildata/DetailApp/App")
},
{
path: "/pc",
name: "pc",
meta: {
text: "业务端页面",
icon: "el-icon-document-copy",
pName: DATAANALYSIS_MANAGEMENT
},
component: () => import("@/views/Detaildata/DetailPc/Pc")
},
{
path: "/user",
name: "User",
meta: {
text: "用户管理",
icon: "el-icon-user",
pName: SYSTEM_MANAGEMENT
},
component: () => import("@/views/system/user/UserList")
},
{
path: "/department",
name: "Department",
meta: {
text: "部门管理",
icon: "el-icon-user",
pName: SYSTEM_MANAGEMENT
},
component: () => import("@/views/system/department/Department.vue")
},
{
path: "/account",
name: "Account",
meta: {
text: "账号管理",
icon: "el-icon-user",
pName: SYSTEM_MANAGEMENT
},
component: () => import("@/views/system/account/Account.vue")
},
{
path: "/dictionary",
name: "Dictionary",
meta: {
text: "数据字典",
pName: SYSTEM_MANAGEMENT
},
component: () => import("@/views/system/dictionary/Dictionary")
},
];
export const staticRoutes = [
{
path: HOME_PATH,
name: "Home",
meta: {
text: "首页",
icon: "el-icon-tickets"
},
component: Home
},
{
path: "/order",
name: "Order",
meta: {
text: "订单管理",
icon: "el-icon-tickets"
},
component: () => import("@/views/order/Order")
},
{
path: "/task",
name: "Task",
meta: {
text: "任务管理",
icon: "el-icon-tickets"
},
component: () => import("@/views/task/Task")
},
{
path: "/content",
name: "Content",
meta: {
text: "内容管理",
icon: "el-icon-document-copy"
},
component: () => import("@/views/content/Content")
},
{
path: "/settlement",
name: "Settlement",
meta: {
text: "任务结算",
icon: "el-icon-document-copy",
pName: SETTLEMENT_MANAGEMENT
},
component: () => import("@/views/settlement/settlement/Settlement")
},
{
path: "/transaction",
name: "Transaction",
meta: {
text: "交易记录",
icon: "el-icon-document-copy",
pName: SETTLEMENT_MANAGEMENT
},
component: () => import("@/views/settlement/transaction/Transaction")
},
{
path: "/list",
name: "list",
meta: {
text: "数据列表页",
icon: "el-icon-document-copy",
pName: DATAANALYSIS_MANAGEMENT
},
component: () => import("@/views/Detaildata/DetailList/List")
},
{
path: "/list/analysis/:id",
name: "Analysis",
meta: {
text: "数据详情页",
pName: '数据列表页'
},
props: true,
hidden: true,
component: () => import("@/views/Detaildata/DetailEmpty/Empty")
},
{
path: "/app",
name: "app",
meta: {
text: "营销端页面",
icon: "el-icon-document-copy",
pName: DATAANALYSIS_MANAGEMENT
},
component: () => import("@/views/Detaildata/DetailApp/App")
},
{
path: "/pc",
name: "pc",
meta: {
text: "业务端页面",
icon: "el-icon-document-copy",
pName: DATAANALYSIS_MANAGEMENT
},
component: () => import("@/views/Detaildata/DetailPc/Pc")
},
{
path: "/user",
name: "User",
meta: {
text: "用户管理",
icon: "el-icon-user",
pName: SYSTEM_MANAGEMENT
},
component: () => import("@/views/system/user/UserList")
},
{
path: "/department",
name: "Department",
meta: {
text: "部门管理",
icon: "el-icon-user",
pName: SYSTEM_MANAGEMENT
},
component: () => import("@/views/system/department/Department.vue")
},
{
path: "/account",
name: "Account",
meta: {
text: "账号管理",
icon: "el-icon-user",
pName: SYSTEM_MANAGEMENT
},
component: () => import("@/views/system/account/Account.vue")
},
{
path: "/dictionary",
name: "Dictionary",
meta: {
text: "数据字典",
pName: SYSTEM_MANAGEMENT
},
component: () => import("@/views/system/dictionary/Dictionary")
},
];
/**
* 一级路由
*/
export const routes = [
{
path: "/",
component: GlobalLayout,
children: staticRoutes
},
{
path: APP_PATH,
component: () => import("@/layout/GlobalApp"),
children: staticRoutesApp
},
{
path: LOGIN_PATH,
name: "Login",
component: Login
},
{
path: "/404",
name: "404",
hidden: true,
component: () => import("@/views/404")
},
{
path: "*",
redirect: "/404",
hidden: true
}
];
/**
* 非路由菜单项图标
*/
export const iconMap = {
[SYSTEM_MANAGEMENT]: "el-icon-setting",
[SETTLEMENT_MANAGEMENT]: "el-icon-coin",
[DATAANALYSIS_MANAGEMENT]:"el-icon-setting"
};