You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
crm-project/src/router/index.js

287 lines
8.7 KiB

3 years ago
/*
* @Author: your name
* @Date: 2021-09-15 16:08:34
* @LastEditTime: 2022-01-04 21:47:30
* @LastEditors: Lone
* @Description: In User Settings Edit
* @FilePath: \pro-email\src\router\index.js
*/
import Vue from "vue";
import VueRouter from "vue-router";
//info: 以下几行代码,修复点击跳转到同一路由地址报错。
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location, onResolve, onReject) {
if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
return originalPush.call(this, location).catch(err => err)
};
import Home from "../views/Home.vue";
import Login from "../views/Login.vue";
Vue.use(VueRouter);
const routes = [
{
path: "/home",
name: "Home",
component: Home,
},
{
path: "/about",
name: "About",
component: () =>import( "../views/About.vue"),
},
//以下是注册、登录、找回密码相关
{
path: "/",
redirect:'/login', // 设置默认打开的页面
// name: "Login",
// component: Login,
},
{
path: "/login",
name: "Login",
component: Login,
},
{
path: "/forgetPassword",
name: "ForgetPassword",
component: () =>
import("../views/ForgetPassword.vue"),
},
{
path: "/register",
name: "Register",
component: () =>
import("../views/Register.vue"),
},
{
path: "/main",
name: "Main",
component: () => import("../views/Main.vue"),
children: [
{
path: "/business",
name: "BusinessList",
redirect:'/business/BusinessTable', // 设置默认打开的页面
component: () => import("../views/BusinessList.vue"),
children: [
{
path: '/business/BusinessTable',
component: resolve => require(['@/components/Business/BusinessTable'], resolve),
},
{
path: '/business/flow',
component: resolve => require(['@/components/Business/Flow'], resolve),
},
{
path: '/business/addFlow',
component: resolve => require(['@/components/Business/AddFlow'], resolve),
},
{
path: '/business/editFlow',
component: resolve => require(['@/components/Business/EditFlow'], resolve),
},
{
path: '/business/BusinessProcess',
component: resolve => require(['@/components/Business/BusinessProcess'], resolve),
},
{
path: '/business/BusinessProcessDrag',
component: resolve => require(['@/components/Business/BusinessProcessDrag'], resolve),
},
{
path: '/business/BusinessCalendar',
component: resolve => require(['@/components/Calendar/CalendarView'], resolve),
},
{
path: '/business/BusinessPrediction',
component: resolve => require(['@/components/Business/BusinessPrediction'], resolve),
},
]
},
//客户
// {
// path: "/custList",
// name: "CustList",
// component: () =>
// import("../views/CustList.vue"),
// },
3 years ago
{
path: "/persons", //info: 重写的联络人模块, 2021.12.27
name: "Persons",
component: () => import("@/views/Persons/index"),
},
//邮件部分
{
path: "/importData",
name: "ImportData",
component: () => import("../components/ImportExport/ImportData.vue"),
},
{
path: "/importExcel",
name: "ImportExcel",
component: () => import("../components/ImportExport/ImportExcel.vue"),
},
{
path: "/calendarView",
name: "CalendarView",
component: () => import("../components/Calendar/CalendarView.vue"),
},
{
path: "/insightsChartList",
name: "InsightsChartList",
component: () => import("../views/InsightsChartList.vue"),
},
{
path: "/custLatent",
name: "CustLatent",
component: () => import("../components/Customer/CustLatent.vue"),
},
{
path: "/manageTags",
name: "ManageTags",
component: () => import("../components/Customer/ManageTags.vue"),
},
{
path: "/userProfile",
name: "UserProfile",
component: () => import("../components/Customer/UserProfile.vue"),
},
//活动
{
path: "/activities",
name: "ActivitiesList",
component: () => import("../views/activity/index"),
children: [
// {
// path: '/activities/Activities',
// component: resolve => require(['@/components/Calendar/Activities'], resolve),
// },
]
},
3 years ago
]
},
// {
// path: "/",
// name: "BusinessList",
// component: () =>
// import("../views/BusinessList.vue"),
// },
// {
// path: "/custList",
// name: "CustList",
// component: () =>
// import("../views/CustList.vue"),
// },
// {
// path: "/persionalSetList",
// name: "PersionalSetList",
// component: () =>
// import("../views/PersionalSetList.vue"),
// },
// {
// path: "/mail",
// name: "mail",
// component: () => import("../views/Mail.vue"),
// children: [
// {
// path: '/mail/detail/:id',
// component: resolve => require(['@/components/Mail/Detail'], resolve),
// },
// {
// path: '/mail/compose',
// component: resolve => require(['@/components/Mail/Compose'], resolve),
// },
// {
// path: '/mail/inbox',
// component: resolve => require(['@/components/Mail/Inbox'], resolve),
// },
// {
// path: '/mail/drafts',
// component: resolve => require(['@/components/Mail/Drafts'], resolve),
// },
// {
// path: '/mail/outbox',
// component: resolve => require(['@/components/Mail/Outbox'], resolve),
// },
// {
// path: '/mail/sent',
// component: resolve => require(['@/components/Mail/Sent'], resolve),
// },
// {
// path: '/mail/archive',
// component: resolve => require(['@/components/Mail/Archive'], resolve),
// },
// {
// path: '/mail',
// redirect: '/mail/inbox',
// }
// ]
// },
// {
// path: "/importData",
// name: "ImportData",
// component: () =>
// import("../components/ImportData.vue"),
// },
// {
// path: "/calendarView",
// name: "CalendarView",
// component: () =>
// import("../components/Calendar/CalendarView.vue"),
// },
// {
// path: "/activitiesList",
// name: "ActivitiesList",
// component: () =>
// import("../views/ActivitiesList.vue"),
// },
// {
// path: "/businessList",
// name: "BusinessList",
// component: () =>
// import("../views/BusinessList.vue"),
// },
// {
// path: "/insightsChartList",
// name: "InsightsChartList",
// component: () =>
// import("../views/InsightsChartList.vue"),
// },
// {
// path: "/custLatent",
// name: "CustLatent",
// component: () =>
// import("../components/Customer/CustLatent.vue"),
// },
// {
// path: "/manageTags",
// name: "ManageTags",
// component: () =>
// import("../components/Customer/ManageTags.vue"),
// },
// {
// path: "/messageList",
// name: "MessageList",
// component: () =>
// import("../views/Sns.vue"),
// },
// {
// path: "/userProfile",
// name: "UserProfile",
// component: () =>
// import("../components/Customer/UserProfile.vue"),
// },
];
const router = new VueRouter({
mode: "history",
base: process.env.BASE_URL,
routes,
});
export default router;