import Vue from 'vue' import Router from 'vue-router' Vue.use(Router) /* Layout */ import Layout from '@/layout/index.vue' import ParentView from '@/components/ParentView' import ApiAdmin from '@/views/integrationApi/apiAdmin' /** * Note: 路由配置项 * * hidden: true // 当设置 true 的时候该路由不会再侧边栏出现 如401,login等页面,或者如一些编辑页面/edit/1 * alwaysShow: true // 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式--如组件页面 * // 只有一个时,会将那个子路由当做根路由显示在侧边栏--如引导页面 * // 若你想不管路由下面的 children 声明的个数都显示你的根路由 * // 你可以设置 alwaysShow: true,这样它就会忽略之前定义的规则,一直显示根路由 * redirect: noRedirect // 当设置 noRedirect 的时候该路由在面包屑导航中不可被点击 * name:'router-name' // 设定路由的名字,一定要填写不然使用时会出现各种问题 * query: '{"id": 1, "name": "ry"}' // 访问路由的默认传递参数 * roles: ['admin', 'common'] // 访问路由的角色权限 * permissions: ['a:a:a', 'b:b:b'] // 访问路由的菜单权限 * meta : { noCache: true // 如果设置为true,则不会被 缓存(默认 false) title: 'title' // 设置该路由在侧边栏和面包屑中展示的名字 icon: 'svg-name' // 设置该路由的图标,对应路径src/assets/icons/svg breadcrumb: false // 如果设置为false,则不会在breadcrumb面包屑中显示 activeMenu: '/system/user' // 当路由设置了该属性,则会高亮相对应的侧边栏。 } */ // 公共路由 export const constantRoutes = [{ path: '/redirect', component: Layout, hidden: true, children: [{ path: '/redirect/:path(.*)', component: () => import('@/views/redirect') }] }, { path: '/apiLogs', component: () => import('@/views/apiLogs/index.vue'), hidden: true }, { path: '/apiLogsError', component: () => import('@/views/apiLogsError/index.vue'), hidden: true }, { path: '/login', component: () => import('@/views/login'), hidden: true }, { path: '/test', component: () => import('@/views/test'), hidden: true }, { path: '/register', component: () => import('@/views/register/index'), hidden: true }, { path: '/systemInit', // name: "databaseIndex", component: () => import('@/views/systemInit/index'), hidden: true }, { path: '/404', component: () => import('@/views/error/404'), hidden: true }, { path: '/401', component: () => import('@/views/error/401'), hidden: true }, // { // path: "/contractAssistant", // component: () => import("@/views/contractAssistant"), // hidden: true, // }, { path: '', component: Layout, redirect: 'index', children: [{ path: 'index', component: () => import('@/views/index_v2'), name: 'Index', meta: { title: '首页', icon: 'dashboard', affix: true } }, { path: 'notFound', component: () => import('@/views/notFound'), name: 'notFound', meta: { title: '404', icon: 'dashboard' // affix: true, } }, { path: "Workbench", component: () => import("@/views/newVersionView/Workbench/index"), name: "Workbench", meta: { title: "工作台", icon: "dashboard", }, }, { path: "MasterDataCenter", component: () => import("@/views/newVersionView/MasterDataCenter/index"), name: "MasterDataCenter", meta: { title: "主数据中心", icon: "dashboard", }, }, { path: "ApplicationCenter", component: () => import("@/views/newVersionView/ApplicationCenter/index"), name: "ApplicationCenter", meta: { title: "应用管理", icon: "dashboard", }, }, { path: "IntegrationTaskCenter", component: () => import("@/views/newVersionView/IntegrationTaskCenter/index"), name: "IntegrationTaskCenter", meta: { title: "集成任务", icon: "dashboard", }, }, { path: "businessCenter", component: () => import("@/views/newVersionView/businessCenter/index"), name: "businessCenter", meta: { title: "业务中心", icon: "dashboard", }, }, ] }, { path: '/user', component: Layout, hidden: true, redirect: 'Profile', children: [{ path: 'Profile', // component: () => import('@/views/system/user/personalCenter/index'), component: () => import( '@/views/systemSettings/userSettings/PersonnelSettings/personalCenter/index' ), name: 'Profile', meta: { title: '个人中心', icon: 'user' } }] }, // { // path: "/integrationOption", // component: Layout, // name: "integrationOption", // redirect: "dataOption", // meta: { // title: "主数据中心", // icon: "documentation", // }, // children: [ // { // path: "dataOption", // component: () => import("@/views/integrationOption/index.vue"), // name: "dataOption", // meta: { // title: "主数据中心", // }, // }, // ], // }, // { // path: "/applicationList", // component: Layout, // name: "applicationList", // redirect: "applicationListAdmin", // meta: { // title: "应用列表", // icon: "el-icon-s-home", // }, // children: [ // { // path: "applicationListAdmin", // component: () => import("@/views/applicationList/index.vue"), // name: "applicationListAdmin", // meta: { // title: "应用列表", // }, // }, // { // path: "settingMenu", // component: () => import("@/views/applicationList/settingMenu.vue"), // name: "settingMenu", // redirect: 'settingMenu/applicationEdit', // hidden: true, // meta: { // title: "应用设置", // hidden: true, // }, // children: [ // { // path: "applicationEdit", // component: () => import("@/views/applicationList/masterDataAdd.vue"), // name: "applicationEdit", // hidden: true, // meta: { // title: "应用编辑", // hidden: true, // }, // }, // { // path: "exploit", // component: () => import("@/views/applicationList/exploit"), // name: "exploit", // hidden: true, // meta: { // title: "开发管理", // hidden: true, // }, // }, // { // path: "authority", // component: () => import("@/views/applicationList/authority"), // name: "authority", // hidden: true, // meta: { // title: "权限管理", // hidden: true, // // }, // }, // { // path: "appApiAdmin", // name: "appApiAdmin", // component: () => import("@/views/applicationList/apiList/apiAdmin"), // meta: { // title: "API管理", // hidden: true // } // }, // { // path: "inserterAdmin", // name: "inserterAdmin", // component: () => import("@/views/applicationList/inserterAdmin"), // meta: { // title: "插件管理", // hidden: true, // } // }, // { // path: "appApiadd", // name: "appApiAdd", // redirect: "", // hidden: "true", // component: () => import("@/views/applicationList/apiList/apiAdd"), // meta: { // title: "API新增", // // }, // }, // { // path: "appApiview", // name: "appApiView", // hidden: "true", // component: () => import("@/views/applicationList/apiList/apiView"), // meta: { // title: "API查看" // } // }, // ] // }, // { // path: "applicationAdd", // component: () => import("@/views/applicationList/masterDataAdd.vue"), // name: "applicationAdd", // hidden: true, // meta: { // title: "应用新增", // hidden: true, // }, // }, // ], // }, // { // path: "/scene", // component: Layout, // name: "scene", // redirect: "", // meta: { // title: "集成场景", // icon: "documentation", // }, // children: [ // { // path: "", // component: () => import("@/views/intergrationOptionScene/index.vue"), // name: "sceneAdmin", // meta: { // title: "集成场景", // }, // }, // { // path: "add", // component: () => import("@/views/intergrationOptionScene/sceneAdd.vue"), // name: "sceneAdd", // meta: { // hidden: true, // title: "新建场景", // }, // }, // ], // }, // { // path: "/receipts", // component: Layout, // name: "receipts", // redirect: "", // meta: { // title: "凭证制单", // icon: "documentation", // }, // children: [ // { // path: "", // component: () => import("@/views/receiptsPage/index.vue"), // name: "receiptsAwait", // meta: { // title: "待制单", // }, // }, // { // path: "/finish", // component: () => import("@/views/receiptsPage/finish.vue"), // name: "receiptsFinish", // meta: { // title: "已制单", // }, // }, // { // path: "/unFinish", // component: () => import("@/views/receiptsPage/unFinish.vue"), // name: "receiptsUnFinish", // meta: { // title: "不制单", // }, // }, // { // path: "/search", // component: () => import("@/views/receiptsPage/search.vue"), // name: "receiptsSearch", // meta: { // title: "凭证查询", // }, // }, // ], // }, // { // path: "/task", // component: Layout, // name: "task", // redirect: "", // meta: { // title: "集成任务管理", // icon: "documentation", // }, // children: [ // { // path: "", // component: () => import("@/views/intergrationTask/index.vue"), // name: "taskAdmin", // meta: { // title: "集成任务部署", // }, // }, // { // path: "add", // component: () => import("@/views/intergrationTask/taskAdd.vue"), // name: "taskAdd", // meta: { // hidden: true, // title: "新建任务", // }, // }, // { // path: "monitoring", // component: () => import("@/views/intergrationTask/monitoring.vue"), // name: "taskMonitoring", // meta: { // title: "集成任务监控", // }, // }, // { // path: "living", // component: () => import("@/views/intergrationTask/living.vue"), // name: "taskLiving", // meta: { // title: "集成任务实例", // }, // }, // { // path: "logdata", // component: () => import("@/views/intergrationTask/logData.vue"), // name: "taskLogData", // meta: { // title: "集成任务日志", // }, // }, // { // path: "livingview", // component: () => import("@/views/intergrationTask/livingViewPage.vue"), // name: "taskLivingView", // meta: { // hidden: true, // title: "实例查看", // }, // }, // { // path: "logsview", // component: () => import("@/views/intergrationTask/logsViewPage.vue"), // name: "taskLogsView", // meta: { // hidden: true, // title: "日志查看", // }, // }, // ], // }, // { // path: "/integrationApi", // component: Layout, // name: "integrationApi", // redirect: "apiOption", // meta: { // title: "集成api配置", // icon: "documentation", // }, // children: [ // { // path: "apiOption", // component: () => import("@/views/integrationApi/index.vue"), // name: "apiOption", // redirect: "", // meta: { // title: "集成api配置", // }, // children: [ // { // path: "", // name: "apiAdmin", // component: () => import("@/views/integrationApi/apiAdmin"), // meta: { // title: "API管理" // } // }, // { // path: "apiadd", // name: "apiAdd", // redirect: "", // hidden: "true", // component: () => import("@/views/integrationApi/apiAdd"), // meta: { // title: "API新增", // }, // }, // { // path: "apiview", // name: "apiView", // hidden: "true", // component: () => import("@/views/integrationApi/apiView"), // meta: { // title: "API查看" // } // }, // ] // }, // ], // }, // { // path: "/tool", // component: Layout, // meta: { // title: "测试", // icon: "documentation", // }, // children: [ // { // path: "gen", // component: () => import("@/views/tool/gen/index"), // name: "gen", // meta: { // title: "代码生成", // }, // }, // { // path: "build", // component: () => import("@/views/tool/build/index"), // name: "build", // meta: { // title: "表单构建", // }, // }, // ], // }, // { // path: "", // component: Layout, // redirect: "newContract", // children: [ // { // path: "/contractManagement/salesContract/newContract", // component: () => // import("@/views/contractManagement/salesContract/newContract"), // name: "NewContract", // meta: { // title: "新增合同", // icon: "documentation", // keepAlive: true, // }, // }, // { // path: "contractManagement/salesContract/editContract", // component: () => // import("@/views/contractManagement/salesContract/editContract/index"), // name: "EditContract", // meta: { // title: "编辑合同", // icon: "documentation", // keepAlive: true, // }, // }, // { // path: "/contractManagement/salesContract/addReplication", // component: () => // import( // "@/views/contractManagement/salesContract/addReplication/index" // ), // name: "AddReplication", // meta: { // title: "新增合同(复制)", // icon: "documentation", // }, // }, // { // path: "/contractManagement/salesContract/changeContract", // component: () => // import( // "@/views/contractManagement/salesContract/changeContract/index" // ), // name: "ChangeContract", // meta: { // title: "变更合同", // icon: "documentation", // }, // }, // { // path: "/contractManagement/salesContract/addEditChange", // component: () => // import( // "@/views/contractManagement/salesContract/addEditChange/index" // ), // name: "AddEditChange", // meta: { // title: "", // icon: "documentation", // }, // }, // ], // }, // { // path: "/contractManagement", // name: "ContractManagement", // hidden: true, // alwaysShow: true, // component: Layout, // meta: { // title: "合同管理", // icon: "documentation", // noCache: false // }, // children: [ // { // path: "salesContract", // name: "SalesContract", // hidden: false, // redirect: "noRedirect", // component: ParentView, // alwaysShow: true, // meta: { // title: "销售合同", // icon: "documentation", // noCache: false // }, // children: [ // { // path: "newContract", // component: () => // import( // "@/views/contractManagement/salesContract/newContract/index" // ), // name: "NewContract", // meta: { // title: "新增合同", // icon: "documentation", // noCache: false // }, // }, // { // path: "editContract", // component: () => // import( // "@/views/contractManagement/salesContract/editContract/index" // ), // name: "EditContract", // meta: { // title: "编辑合同", // noCache: false // }, // }, // { // path: "addReplication", // component: () => // import( // "@/views/contractManagement/salesContract/addReplication/index" // ), // name: "AddReplication", // meta: { // title: "新增合同(复制)", // icon: "documentation", // noCache: false // }, // }, // ], // }, // ], // }, // { // path: "/contractManagement", // component: Layout, // meta: { // title: "合同管理", // icon: "documentation", // }, // children: [ // { // path: "salesContract", // component: () => import("@/views/contractManagement/salesContract"), // name: "salesContract", // meta: { // title: "销售合同", // icon: "documentation", // }, // children: [ // { // path: "newContract", // component: () => // import( // "@/views/contractManagement/salesContract/newContract/index" // ), // name: "newContract", // meta: { // title: "新增合同", // icon: "documentation", // }, // }, // { // path: "editContract", // component: () => // import( // "@/views/contractManagement/salesContract/editContract/index" // ), // name: "editContract", // meta: { // title: "编辑合同", // }, // }, // { // path: "addReplication", // component: () => // import( // "@/views/contractManagement/salesContract/addReplication/index" // ), // name: "addReplication", // meta: { // title: "新增合同(复制)", // icon: "documentation", // }, // }, // ], // }, // ], // }, // { // path: "/edit", // component: () => import("@/views/systemSettings/viewList/edit"), // hidden: true, // }, // { // path: '/codeGenerator', // component: Layout, // meta: { // title: '代码生成器', // icon: 'documentation' // }, // children: [{ // path: 'documentManagement', // component: () => import('@/views/systemMaintenance/documentManagement/index'), // name: 'documentManagement', // meta: { // title: '单据管理', // icon: 'documentation' // }, // }, // ] // }, // 系统维护 // { // path: '/systemMaintenance', // component: Layout, // meta: { // title: '系统维护', // icon: 'documentation' // }, // children: [ // { // path: 'menuManagementOld', // component: () => import('@/views/systemMaintenance/menuManagement/index'), // name: 'menuManagementOld', // meta: { // title: '菜单管理old', // icon: 'documentation' // }, // }, // // { // // path: 'buttonManagement', // // component: () => import('@/views/systemMaintenance/buttonManagement/index'), // // name: 'buttonManagement', // // meta: { // // title: '按钮管理', // // icon: 'documentation' // // }, // // }, { // // path: 'operationLog', // // component: () => import('@/views/systemMaintenance/operationLog/index'), // // name: 'operationLog', // // meta: { // // title: '操作日志', // // icon: 'documentation' // // }, // // }, // // { // // path: 'iconLibrary', // // component: () => import('@/views/systemMaintenance/iconLibrary/index'), // // name: 'iconLibrary', // // meta: { // // title: '图标库', // // icon: 'documentation' // // }, // // }, // // { // // path: 'InterfaceLog', // // component: () => import('@/views/systemMaintenance/InterfaceLog/index'), // // name: 'InterfaceLog', // // meta: { // // title: '接口日志', // // icon: 'documentation' // // }, // // } // ], // }, // { // path: '/systemSettings', // name: 'SystemSettings', // component: Layout, // hidden: false, // redirect: "noRedirect", // alwaysShow: true, // meta: { // title: '系统配置', // icon: 'documentation', // noCache: false, // }, // children: [ // { // path: 'userSettings', // component: ParentView, // name: 'UserSettings', // hidden: false, // redirect: "noRedirect", // alwaysShow: true, // meta: { // title: '用户管理', // icon: 'documentation', // noCache: false, // }, // children: [{ // path: 'roleSettings', // component: () => import('@/views/systemSettings/userSettings/roleSettings/index'), // name: 'Role', // meta: { // title: '角色设置', // icon: 'documentation' // }, // }, // { // path: 'PersonnelSettings', // component: () => import( // '@/views/systemSettings/userSettings/PersonnelSettings/index'), // name: 'PersonnelSettings', // meta: { // title: '人员管理', // icon: 'documentation' // }, // }, // { // path: 'userInformation', // hidden: false, // component: () => import( // '@/views/systemSettings/userSettings/userInformation/index'), // name: 'UserInformation', // meta: { // title: '用户信息', // icon: 'documentation', // noCache: false, // }, // }, // ], // }, // // { // // path: 'organization', // // component: () => import('@/views/systemSettings/organization/index'), // // name: 'organization', // // meta: { // // title: '组织机构', // // icon: 'documentation' // // }, // // }, // { // path: 'jurisdictionManage', // component: () => import('@/views/systemSettings/jurisdictionManage/index'), // meta: { // title: '权限管理', // icon: 'documentation' // }, // children: [{ // path: 'userJurisdiction', // component: () => import( // '@/views/systemSettings/jurisdictionManage/userJurisdiction/index'), // name: 'userJurisdiction', // meta: { // title: '用户权限', // icon: 'documentation' // }, // }, // { // path: 'roleJurisdiction', // component: () => import( // '@/views/systemSettings/jurisdictionManage/roleJurisdiction/index'), // name: 'roleJurisdiction', // meta: { // title: '角色权限-暂未', // icon: 'documentation' // }, // }, // ], // }, // { // path: 'timing', // component: () => import('@/views/systemSettings/timing/index'), // name: 'Timing', // meta: { // title: '定时任务', // icon: 'documentation' // }, // }, // { // path: 'dataDictionary', // component: () => import('@/views/systemSettings/dataDictionary'), // name: 'dataDictionary', // meta: { // title: '数据字典', // icon: 'documentation' // }, // }, // ], // }, // { // path: '/fileManagement', // component: Layout, // meta: { // title: '档案管理', // icon: 'documentation' // }, // children: [{ // path: 'userFileManagement', // component: () => import('@/views/fileManagement/userFileManagement/index'), // name: 'userFileManagement', // meta: { // title: '客户档案', // icon: 'documentation' // } // }, // { // path: 'supplierManagement', // component: () => import('@/views/fileManagement/supplierManagement/index'), // name: 'supplierManagement', // meta: { // title: '供应商档案', // icon: 'documentation' // } // }, // { // path: 'inventoryManagement', // component: () => import('@/views/fileManagement/inventoryManagement/index'), // name: 'inventoryManagement', // meta: { // title: '存货档案', // icon: 'documentation' // }, // } // ] // }, // 合同管理 // { // path: '/contractManagement', // component: Layout, // meta: { // title: '合同管理', // icon: 'documentation' // }, // children: [{ // path: 'salesContract', // component: () => import('@/views/contractManagement/salesContract'), // name: 'salesContract', // meta: { // title: '销售合同', // icon: 'documentation' // }, // children: [{ // path: 'newContract', // component: () => import( // '@/views/contractManagement/salesContract/newContract/index'), // name: 'newContract', // meta: { // title: '新增合同', // icon: 'documentation' // }, // }, // { // path: 'seeContract', // component: () => import( // '@/views/contractManagement/salesContract/seeContract/index'), // name: 'seeContract', // meta: { // title: '查看合同', // icon: 'documentation' // }, // }, // { // path: 'changeContract', // component: () => import( // '@/views/contractManagement/salesContract/changeContract/index'), // name: 'changeContract', // meta: { // title: '合同变更', // icon: 'documentation' // }, // }, // { // path: 'listContract', // component: () => import( // '@/views/contractManagement/salesContract/listContract/index'), // name: 'listContract', // meta: { // title: '合同清单', // icon: 'documentation' // }, // } // ] // }, ], // }, // { // path: '/tool', // component: Layout, // meta: { // title: '系统工具', // icon: 'documentation' // }, // children: [{ // path: 'tool', // component: () => import('@/views/tool/gen/index'), // name: 'tool', // meta: { // title: '代码生成', // icon: 'documentation' // } // }, { // path: 'build', // component: () => import('@/views/tool/build/index'), // name: 'build', // meta: { // title: '表单构建', // icon: 'documentation' // } // }] // }, ] // 动态路由,基于用户权限动态去加载 export const dynamicRoutes = [{ path: '/tool/gen-edit', component: Layout, hidden: true, permissions: ['tool:gen:edit'], children: [{ path: 'index/:tableId(\\d+)', // component: () => import('@/views/tool/gen/editTable'), // component: () => import('@/views/tool/gen/index'), name: 'GenEdit', meta: { title: '修改生成配置', activeMenu: '/tool/gen' } }] }] // 防止连续点击多次路由报错 let routerPush = Router.prototype.push Router.prototype.push = function push(location) { return routerPush.call(this, location).catch((err) => err) } export default new Router({ mode: 'hash', // 去掉url中的# scrollBehavior: () => ({ y: 0 }), routes: constantRoutes })