123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597 |
- import { createRouter, createWebHistory } from "vue-router";
- import store from "@/store";
- /**
- * 说明
- * meta中
- * keepAlive表示是否要缓存
- * isRoot代表是否为侧边栏组件用于处理面包屑数据
- * hasBack 控制是否有返回按钮
- */
- const routes=[
- {
- path: "/",
- name: "Layout",
- redirect:'/report/index',
- component: ()=>import("@/layout/Index.vue"),
- },
- //活动模块
- {
- path: "/activity",
- name: "Activity",
- redirect:'/activity/list',
- component: () => import("@/layout/Index.vue"),
- meta: {
- title:"活动"
- },
- children: [
- {
- path: "list",
- name: "ActivityList",
- component: () => import("@/views/activity/List.vue"),
- meta: {
- title: "活动",
- keepAlive:true,
- isRoot:true
- },
- },
- {
- path:'detail',//query: id(活动id)
- name:"ActivityDetail",
- component: () => import("@/views/activity/Detail.vue"),
- meta: {
- title: "活动详情",
- hasBack:true
- },
- },
- {
- path: "reportdetail",
- name: "ActivityReportDetail",
- component: () => import("@/views/activity/ReportDetail.vue"),
- meta: {
- title: "报告详情",
- hasBack:true
- }
- },
- {
- path: "chapterdetail",
- name: "ActivityChapterReportDetail",
- component: () => import("@/views/activity/ChapterDetail.vue"),
- meta: {
- title: "报告详情",
- hasBack:true
- }
- }
- ]
- },
- // 报告模块
- {
- path:'/report',
- name:'Report',
- redirect: '/report/classify',
- component: () => import("@/layout/Index.vue"),
- meta: {
- title:"研报"
- },
- children:[
- // 研报与首页区分开了 首页为原来的研报页面,现在的研报页面是分类 -- 2022/10/17
- {
- path: "index",
- name: "ReportIndex",
- component: () => import("@/views/report/Index.vue"),
- meta: {
- title: "首页",
- keepAlive:true,
- isRoot:true
- },
- },
- {
- path: "classify",
- name: "ReportClassify",
- component: () => import("@/views/report/Classify.vue"),
- meta: {
- title: "研报",
- keepAlive:false,
- isRoot:true
- },
- },
- {
- path: "search",
- name: "ReportSearch",
- component: () => import("@/views/report/Search.vue"),
- meta: {
- title: "研报搜索",
- keepAlive:true,
- isRoot:false,
- hasBack:true
- },
- },
- {
- path: "detail",
- name: "ReportDetail",
- component: () => import("@/views/report/Detail.vue"),
- meta: {
- title: "报告详情",
- keepAlive:false,
- isRoot:false,
- hasBack:true
- },
- },
- {
- path: "chapterdetail",
- name: "ReportChapterDetail",
- component: () => import("@/views/report/ChapterDetail.vue"),
- meta: {
- title: "报告详情",
- keepAlive:false,
- isRoot:false,
- hasBack:true
- },
- },
- {
- path: "list",
- name: "ReportList",
- component: () => import("@/views/report/List.vue"),
- meta: {
- title: "报告列表",
- keepAlive:true,
- isRoot:false,
- hasBack:true
- },
- },
- {
- path: "specialcolumnlist",
- name: "ReportSpecialColumnList",
- component: () => import("@/views/report/specialColumn/List.vue"),
- meta: {
- title: "专栏列表",
- keepAlive:true,
- isRoot:false,
- hasBack:true
- },
- },
- {
- path: "specialcolumndetail",
- name: "ReportSpecialColumnDetail",
- component: () => import("@/views/report/specialColumn/Detail.vue"),
- meta: {
- title: "专栏详情",
- keepAlive:true,
- isRoot:false,
- hasBack:true
- },
- },
- {
- path: "ficcserveintro",
- name: "FiccServeIntro",
- component: () => import("@/views/report/FiccIntroduce.vue"),
- meta: {
- title: "FICC服务介绍",
- keepAlive:false,
- isRoot:false,
- hasBack:true
- },
- },
- {
- path: "varietyreportlist",
- name: "VarietyReportList",
- component: () => import("@/views/report/reportForVariety/List.vue"),
- meta: {
- title: "报告列表",
- keepAlive:true,
- isRoot:false,
- hasBack:true
- },
- },
- {
- path: "previewPDF",
- name: "PreviewPDF",
- component: () => import("@/views/report/PreviewPDF.vue"),
- meta: {
- title: "预览报告",
- keepAlive:true,
- isRoot:false,
- hasBack:true
- },
- },
- {
- path: "disseminatePage",
- name: "disseminatePage",
- component: () => import("@/views/report/disseminatePage.vue"),
- meta: {
- title: "活动详情",
- keepAlive:true,
- isRoot:false,
- hasBack:true
- },
- }
- ]
- },
- {
- path: "/apply",
- name: "Apply",
- component: () => import("@/layout/Index.vue"),
- meta: {
- title:"申请试用"
- },
- children: [
- {
- path: "permission",// source来源(如:2) fromPage=来源页面(如:活动列表)
- name: "ApplyPermission",
- component: () => import("@/views/applyPermission/Apply.vue"),
- meta: {
- title: "申请试用",
- hasBack:true
- }
- },
- {
- path: "result",
- name: "ApplyPermissionResult",
- component: () => import("@/views/applyPermission/Result.vue"),
- meta: {
- title: "申请结果",
- hasBack:true
- }
- }
- ]
- },
- // 图库模块
- {
- path:'/chart',
- name:"Chart",
- component: () => import("@/layout/Index.vue"),
- meta:{
- title:"ETA图库"
- },
- children:[
- {
- path:"list",
- name:"ChartList",
- component:()=>import('@/views/chart/List.vue'),
- meta: {
- title: "ETA图库",
- keepAlive:true,
- isRoot:true
- }
- }
- ]
- },
- // 沙盘推演模块
- {
- path:'/sandBox',
- name:"sandBox",
- component: () => import("@/layout/Index.vue"),
- redirect:'/sandBox/list',
- meta:{
- title:"沙盘推演"
- },
- children:[
- {
- path:"list",
- name:"sandBoxList",
- component:()=>import('@/views/sandBox/List.vue'),
- meta: {
- title: "沙盘推演",
- keepAlive:true,
- isRoot:true
- }
- }
- ]
- },
- //问答模块
- {
- path: "/question",
- name: "Question",
- redirect:'/question/list',
- component: () => import("@/layout/Index.vue"),
- meta: {
- title:"问答"
- },
- children: [
- {
- path: "list",
- name: "QuestionList",
- component: () => import("@/views/question/List.vue"),
- meta: {
- title: "问答社区",
- keepAlive:true,
- isRoot:true
- }
- },{
- path: "mylist",
- name: "QuestionMyList",
- component: () => import("@/views/question/MyList.vue"),
- meta: {
- title: "我的问答",
- keepAlive:true,
- // isRoot:false
- isRoot:true
- }
- }
- ]
- },
- // 用户模块
- {
- path:'/user',
- name:"User",
- component: () => import("@/layout/Index.vue"),
- meta:{
- title:"用户"
- },
- children:[
- {
- path:"setinfo",
- name:"UserSetInfo",
- component:()=>import('@/views/user/SetUserInfo.vue'),
- meta: {
- title: "我的设置",
- keepAlive:false,
- isRoot:false,
- hasBack:true
- }
- }
- ]
- },
- //价格驱动
- {
- path: '/pricedriven',
- name: "priceDriven",
- component: () => import("@/layout/Index.vue"),
- meta: {
- title:"价格驱动"
- },
- children: [
- {
- path: "/pricedriven",
- name: "priceDrivenDeteail",
- component: () => import("@/views/priceDriven/detail.vue"),
- meta: {
- title: "价格驱动",
- keepAlive:false,
- isRoot:true
- },
- },
- ]
- },
- //视频社区模块
- {
- path:'/video',
- name:"Video",
- component: () => import("@/layout/Index.vue"),
- meta:{
- title:"视频社区"
- },
- children:[
- {
- path:"list",
- name:"VideoList",
- component:()=>import('@/views/video/List.vue'),
- meta: {
- title: "视频社区",
- keepAlive:true,
- isRoot:true
- }
- }
- ]
- },
- //语音播报模块
- {
- path:'/voice',
- name:"Voice",
- component: () => import("@/layout/Index.vue"),
- meta:{
- title:"语音播报"
- },
- children:[
- {
- path:"list",
- name:"VoiceList",
- component:()=>import('@/views/voice/List.vue'),
- meta: {
- title: "语音播报",
- keepAlive:true,
- isRoot:true
- }
- },
- {
- path:"mine",
- name:"VoiceMine",
- component:()=>import('@/views/voice/Mine.vue'),
- meta: {
- title: "我的语音",
- keepAlive:true,
- isRoot:true
- }
- },
- {
- path:"detail",
- name:"VoiceDetail",
- component:()=>import('@/views/voice/Detail.vue'),
- meta: {
- title: "语音详情",
- keepAlive:false,
- isRoot:false,
- hasBack:true
- }
- }
- ]
- },
- //路演视频模块
- {
- path:'/roadshow',
- name:"RoadShow",
- component: () => import("@/layout/Index.vue"),
- meta:{
- title:"线上路演"
- },
- children:[
- {
- path:"video/list",
- name:"RoadShowVideoList",
- component:()=>import('@/views/roadShow/video/List.vue'),
- meta: {
- title: "线上路演",
- keepAlive:true,
- isRoot:true
- }
- }
- ]
- },
- // 我的图库模块
- {
- path:"/mychart",
- name: "MyChart",
- component: () => import("@/layout/Index.vue"),
- meta: {
- title:"我的图库"
- },
- children:[
- {
- path:"list",
- name:"MyChartList",
- component:()=>import('@/views/myChart/List.vue'),
- meta: {
- title: "我的图库",
- keepAlive:true,
- isRoot:true
- }
- },
- {
- path:"search",
- name:"MyChartSearch",
- component:()=>import('@/views/myChart/Search.vue'),
- meta: {
- title: "搜索",
- keepAlive:true,
- isRoot:false,
- hasBack:true
- }
- },
- {
- path:"detail",
- name:"MyChartDetail",
- component:()=>import('@/views/myChart/Detail.vue'),
- meta: {
- title: "图表详情",
- keepAlive:false,
- isRoot:false,
- hasBack:true
- }
- }
- ]
- },
- //持仓分析模块
- {
- path:"/positionanalysis",
- name:"PositionAnalysis",
- component: () => import("@/layout/Index.vue"),
- meta: {
- title:"持仓分析"
- },
- children:[
- {
- path:"index",
- name:"PositionAnalysisIndex",
- component:()=>import('@/views/positionAnalysis/Index.vue'),
- meta: {
- title: "持仓列表",
- keepAlive:true,
- isRoot:true
- }
- },
- {
- path:"detail",
- name:"PositionAnalysisDetail",
- component:()=>import('@/views/positionAnalysis/Detail.vue'),
- meta: {
- title: "持仓详情",
- keepAlive:false,
- isRoot:false,
- hasBack:true
- }
- },
- ]
- },
- //外汇日历表模块
- {
- path:"/forexCalendar",
- name:"ForexCalendar",
- component: () => import("@/layout/Index.vue"),
- meta: {
- title:"外汇日历表"
- },
- children:[
- {
- path:"index",
- name:"ForexCalendarIndex",
- component:()=>import('@/views/forexCalendar/Index.vue'),
- meta: {
- title: "日历表",
- keepAlive:true,
- isRoot:true
- }
- },
- {
- path:"detail",
- name:"ForexCalendarDetail",
- component:()=>import('@/views/forexCalendar/EdbDetail.vue'),
- meta: {
- title: "事项详情",
- keepAlive:false,
- isRoot:false,
- hasBack:true
- }
- },
- ]
- },
- {
- path: '/:pathMatch(.*)',
- name: 'error',
- component: () => import("@/views/404.vue"),
- meta: { title: '404' },
- }
- ]
- const router=createRouter({
- history:createWebHistory(import.meta.env.VITE_APP_BASE_URL),
- routes,
- scrollBehavior(to, from, savedPosition){
- if (savedPosition&&to.meta.keepAlive) {
- return savedPosition
- } else {
- return new Promise((resolve)=>{
- setTimeout(() => {
- resolve({left:0,top:0})
- }, 0);
- })
- }
- }
- })
- router.beforeEach((to, from, next) => {
- if (to.query.token) {
- store.commit('getToken', to.query.token)
- store.dispatch('getUserInfo')
- }
- if (to.query.platform_source) { // 来源是否是小程序
- sessionStorage.setItem('platformSource', to.query.platform_source)
- }
- if(to.meta.isRoot){
- store.commit('setBreadCrumb', to)
- }else{
- if(store.state.breadCrumbList.length==1){
- store.commit('modifyBreadCrumb',to.meta.title)
- }
- }
-
- document.title=to.meta.title
- next();
- })
- export default router
|