diff --git a/src/utils/routerList.js b/src/utils/routerList.js index df29e39..a3e0442 100644 --- a/src/utils/routerList.js +++ b/src/utils/routerList.js @@ -1,521 +1,501 @@ import Layout from '@/layout' -import {getInfo} from '../store/modules/user.js' +import { getInfo } from '../store/modules/user.js' export function getRoutes() { - let userInfo ={} - if (localStorage.userinfo) { - userInfo = JSON.parse(localStorage.userinfo) - } - console.log(userInfo) - let constantRoutes1 = [] - if(userInfo.UserId==1){ - constantRoutes1 = [{ - path: '/login', - component: () => import('@/views/login/index'), - hidden: true - }, - - { - path: '/404', - component: () => import('@/views/404'), - hidden: true - }, - - { - path: '/', - component: Layout, - redirect: '/dashboard', - children: [{ - path: 'dashboard', - name: '首页', - component: () => import('@/views/dashboard/index'), - meta: { - title: '首页', - icon: 'dashboard' - } - }] - }, + let userInfo = {} + if (localStorage.userinfo) { + userInfo = JSON.parse(localStorage.userinfo) + } + console.log(userInfo) + let constantRoutes1 = [] + if (userInfo.UserId == 1) { + constantRoutes1 = [{ + path: '/login', + component: () => + import ('@/views/login/index'), + hidden: true + }, - // { - // path: '/example', - // component: Layout, - // redirect: '/example/table', - // name: 'Example', - // meta: { - // title: '题库管理', - // icon: 'el-icon-s-help' - // }, - // children: [{ - // path: 'QuestionBank', - // name: 'Table', - // component: () => import('@/views/QuestionBank/index'), - // meta: { - // title: '题库', - // icon: 'table' - // } - // }] - // }, - { - path: '/moduleIndex', - component: Layout, - redirect: '/module/index', - name: 'module', - meta: { - title: '练习', - icon: 'el-icon-s-help' - }, - children: [{ - path: 'recharge', - name: 'recharge', - component: () => import('@/views/module/index'), - meta: { - title: '章节练习', - icon: 'el-icon-s-operation' - } + { + path: '/404', + component: () => + import ('@/views/404'), + hidden: true }, + { - path: 'index', - name: 'index', - component: () => import('@/views/TestPaper/index'), - hidden: true, - meta: { - title: '试卷维护', - icon: 'table' - } + path: '/', + component: Layout, + redirect: '/dashboard', + children: [{ + path: 'dashboard', + name: '首页', + component: () => + import ('@/views/dashboard/index'), + meta: { + title: '首页', + icon: 'dashboard' + } + }] }, - ] - }, - { - path: '/realQuestion', - component: Layout, - redirect: '/module/realQuestion', - name: 'realQuestion', - meta: { - title: '历年真题', - icon: 'el-icon-s-help' - }, - children: [{ - path: 'recharge', - name: 'recharge', - component: () => import('@/views/module/realQuestion'), - meta: { - title: '历年真题', - icon: 'el-icon-s-management' - } - }] - }, - { - path: '/simulation', - component: Layout, - redirect: '/module/simulation', - name: 'module', - meta: { - title: '模拟试卷', - icon: 'el-icon-s-help' - }, - children: [{ - path: 'recharge', - name: 'recharge', - component: () => import('@/views/module/simulation'), - meta: { - title: '模拟试卷', - icon: 'el-icon-s-promotion' - } - }] - }, - { - path: '/views', - component: Layout, - redirect: '/views/TestPaper', - name: 'TestPaper', - meta: { - title: '试卷管理', - icon: 'el-icon-s-help' - }, - children: [ + // { + // path: '/example', + // component: Layout, + // redirect: '/example/table', + // name: 'Example', + // meta: { + // title: '题库管理', + // icon: 'el-icon-s-help' + // }, + // children: [{ + // path: 'QuestionBank', + // name: 'Table', + // component: () => import('@/views/QuestionBank/index'), + // meta: { + // title: '题库', + // icon: 'table' + // } + // }] + // }, + // { + // path: '/moduleIndex', + // component: Layout, + // redirect: '/module/index', + // name: 'module', + // meta: { + // title: '面试题', + // icon: 'el-icon-s-help' + // }, + // children: [{ + // path: 'index', + // name: 'index', + // component: () => + // import ('@/views/TestPaper/index'), + // hidden: true, + // meta: { + // title: '试卷维护', + // icon: 'table' + // } + // }, ] + // }, + // { + // path: '/realQuestion', + // component: Layout, + // redirect: '/module/realQuestion', + // name: 'realQuestion', + // meta: { + // title: '历年真题', + // icon: 'el-icon-s-help' + // }, + // children: [{ + // path: 'recharge', + // name: 'recharge', + // component: () => + // import ('@/views/module/realQuestion'), + // meta: { + // title: '历年真题', + // icon: 'el-icon-s-management' + // } + // }] + // }, + { - path: 'TestPaperList', - name: 'Table', - component: () => import('@/views/TestPaper/TestPaperList'), - meta: { - title: '试卷列表', - icon: 'table' - } - }, - { - path: 'index', - name: 'index', - component: () => import('@/views/TestPaper/index'), - hidden: true, - meta: { - title: '试卷维护', - icon: 'table' - } - }, - { - path: 'ManualTestPaper', - name: 'Table', - component: () => import('@/views/TestPaper/ManualTestPaper'), - meta: { - title: '组卷', - icon: 'table' - } - }, + path: '/views', + component: Layout, + redirect: '/views/TestPaper', + name: 'TestPaper', + meta: { + title: '试卷管理', + icon: 'el-icon-s-help' + }, + children: [{ + path: 'TestPaperList', + name: 'Table', + component: () => + import ('@/views/TestPaper/TestPaperList'), + meta: { + title: '试卷列表', + icon: 'table' + } + }, + { + path: 'index', + name: 'index', + component: () => + import ('@/views/TestPaper/index'), + hidden: true, + meta: { + title: '试卷维护', + icon: 'table' + } + }, + { + path: 'ManualTestPaper', + name: 'Table', + component: () => + import ('@/views/TestPaper/ManualTestPaper'), + meta: { + title: '组卷', + icon: 'table' + } + }, - ] - }, - { - path: '/order', - component: Layout, - redirect: '/', - name: 'order', - meta: { - title: '订单管理', - icon: 'el-icon-s-marketing' - }, - children: [{ - path: 'recharge', - name: 'recharge', - component: () => import('@/views/order/rechargeList'), - meta: { - title: '充值记录', - } - }, { - path: 'shop', - name: 'shop', - component: () => import('@/views/order/shopList'), - meta: { - title: '购买记录', - } - }] - }, - { - path: '/user', - component: Layout, - redirect: '/', - name: 'user', - meta: { - title: '用户管理', - icon: 'el-icon-s-help' - }, - children: [{ - path: 'user', - name: 'User', - component: () => import('@/views/user/userlist'), - meta: { - title: '普通用户列表', - } + ] }, { - path: 'admin', - name: 'admin', - - component: () => import('@/views/user/adminList'), - meta: { - title: '管理员列表', - } + path: '/order', + component: Layout, + redirect: '/', + name: 'order', + meta: { + title: '订单管理', + icon: 'el-icon-s-marketing' + }, + children: [{ + path: 'recharge', + name: 'recharge', + component: () => + import ('@/views/order/rechargeList'), + meta: { + title: '充值记录', + } + }, { + path: 'shop', + name: 'shop', + component: () => + import ('@/views/order/shopList'), + meta: { + title: '购买记录', + } + }] }, + { + path: '/user', + component: Layout, + redirect: '/', + name: 'user', + meta: { + title: '用户管理', + icon: 'el-icon-s-help' + }, + children: [{ + path: 'user', + name: 'User', + component: () => + import ('@/views/user/userlist'), + meta: { + title: '普通用户列表', + } + }, + { + path: 'admin', + name: 'admin', - ] - }, { - path: '/password', - component: Layout, - redirect: '/', - name: 'password', - meta: { - title: '系统管理', - icon: 'el-icon-s-platform' - }, - children: [{ - path: 'index', - name: 'index', - component: () => import('@/views/password/index'), - meta: { - title: '忘记密码', - } - }, { - path: 'TestPaperClass', - name: 'Table', - component: () => import('@/views/TestPaper/TestPaperClass'), - meta: { - title: '分类管理', - } - }, { - path: 'carousel', - name: 'carousel', - component: () => import('@/views/carousel/index'), - meta: { - title: '轮播图', - } - }, { - path: 'new', - name: 'new', - component: () => import('@/views/carousel/new'), - meta: { - title: '最新资讯', - } - }] - }, - // 404 page must be placed at the end !!! - { - path: '*', - redirect: '/404', - hidden: true - } - ] - }else { - constantRoutes1 = [{ - path: '/login', - component: () => import('@/views/login/index'), - hidden: true - }, - - { - path: '/404', - component: () => import('@/views/404'), - hidden: true - }, + component: () => + import ('@/views/user/adminList'), + meta: { + title: '管理员列表', + } + }, - { - path: '/', - component: Layout, - redirect: '/dashboard', - children: [{ - path: 'dashboard', - name: '首页', - component: () => import('@/views/dashboard/index'), - meta: { - title: '首页', - icon: 'dashboard' + ] + }, { + path: '/password', + component: Layout, + redirect: '/', + name: 'password', + meta: { + title: '系统管理', + icon: 'el-icon-s-platform' + }, + children: [{ + path: 'index', + name: 'index', + component: () => + import ('@/views/password/index'), + meta: { + title: '忘记密码', + } + }, { + path: 'TestPaperClass', + name: 'Table', + component: () => + import ('@/views/TestPaper/TestPaperClass'), + meta: { + title: '分类管理', + } + }, { + path: 'carousel', + name: 'carousel', + component: () => + import ('@/views/carousel/index'), + meta: { + title: '轮播图', + } + }, { + path: 'new', + name: 'new', + component: () => + import ('@/views/carousel/new'), + meta: { + title: '最新资讯', + } + }] + }, + // 404 page must be placed at the end !!! + { + path: '*', + redirect: '/404', + hidden: true } - }] - }, + ] + } else { + constantRoutes1 = [{ + path: '/login', + component: () => + import ('@/views/login/index'), + hidden: true + }, - // { - // path: '/example', - // component: Layout, - // redirect: '/example/table', - // name: 'Example', - // meta: { - // title: '题库管理', - // icon: 'el-icon-s-help' - // }, - // children: [{ - // path: 'QuestionBank', - // name: 'Table', - // component: () => import('@/views/QuestionBank/index'), - // meta: { - // title: '题库', - // icon: 'table' - // } - // }] - // }, - { - path: '/moduleIndex', - component: Layout, - redirect: '/module/index', - name: 'module', - meta: { - title: '练习', - icon: 'el-icon-s-help' - }, - children: [{ - path: 'recharge', - name: 'recharge', - component: () => import('@/views/module/index'), - meta: { - title: '练习', - icon: 'el-icon-s-operation' - } + { + path: '/404', + component: () => + import ('@/views/404'), + hidden: true }, + { - path: 'index', - name: 'index', - component: () => import('@/views/TestPaper/index'), - hidden: true, - meta: { - title: '试卷维护', - icon: 'table' - } + path: '/', + component: Layout, + redirect: '/dashboard', + children: [{ + path: 'dashboard', + name: '首页', + component: () => + import ('@/views/dashboard/index'), + meta: { + title: '首页', + icon: 'dashboard' + } + }] }, - ] - }, - { - path: '/realQuestion', - component: Layout, - redirect: '/module/realQuestion', - name: 'realQuestion', - meta: { - title: '历年真题', - icon: 'el-icon-s-help' - }, - children: [{ - path: 'recharge', - name: 'recharge', - component: () => import('@/views/module/realQuestion'), - meta: { - title: '历年真题', - icon: 'el-icon-s-management' - } - }] - }, - { - path: '/simulation', - component: Layout, - redirect: '/module/simulation', - name: 'module', - meta: { - title: '模拟试卷', - icon: 'el-icon-s-help' - }, - children: [{ - path: 'recharge', - name: 'recharge', - component: () => import('@/views/module/simulation'), - meta: { - title: '模拟试卷', - icon: 'el-icon-s-promotion' - } - }] - }, - // { - // path: '/views', - // component: Layout, - // redirect: '/views/TestPaper', - // name: 'TestPaper', - // meta: { - // title: '试卷管理', - // icon: 'el-icon-s-help' - // }, - // children: [ - // { - // path: 'TestPaperList', - // name: 'Table', - // component: () => import('@/views/TestPaper/TestPaperList'), - // meta: { - // title: '试卷列表', - // icon: 'table' - // } - // }, - // { - // path: 'index', - // name: 'index', - // component: () => import('@/views/TestPaper/index'), - // hidden: true, - // meta: { - // title: '试卷维护', - // icon: 'table' - // } - // }, - // // { - // // path: 'ManualTestPaper', - // // name: 'Table', - // // component: () => import('@/views/TestPaper/ManualTestPaper'), - // // meta: { - // // title: '组卷', - // // icon: 'table' - // // } - // // }, + // { + // path: '/example', + // component: Layout, + // redirect: '/example/table', + // name: 'Example', + // meta: { + // title: '题库管理', + // icon: 'el-icon-s-help' + // }, + // children: [{ + // path: 'QuestionBank', + // name: 'Table', + // component: () => import('@/views/QuestionBank/index'), + // meta: { + // title: '题库', + // icon: 'table' + // } + // }] + // }, + { + path: '/moduleIndex', + component: Layout, + redirect: '/module/index', + name: 'module', + meta: { + title: '面试题', + icon: 'el-icon-s-help' + }, + children: [{ + path: 'recharge', + name: 'recharge', + component: () => + import ('@/views/module/index'), + meta: { + title: '面试题', + icon: 'el-icon-s-operation' + } + }, + { + path: 'index', + name: 'index', + component: () => + import ('@/views/TestPaper/index'), + hidden: true, + meta: { + title: '试卷维护', + icon: 'table' + } + }, + ] + }, + // { + // path: '/realQuestion', + // component: Layout, + // redirect: '/module/realQuestion', + // name: 'realQuestion', + // meta: { + // title: '历年真题', + // icon: 'el-icon-s-help' + // }, + // children: [{ + // path: 'recharge', + // name: 'recharge', + // component: () => + // import ('@/views/module/realQuestion'), + // meta: { + // title: '历年真题', + // icon: 'el-icon-s-management' + // } + // }] + // }, + + // { + // path: '/views', + // component: Layout, + // redirect: '/views/TestPaper', + // name: 'TestPaper', + // meta: { + // title: '试卷管理', + // icon: 'el-icon-s-help' + // }, + // children: [ + // { + // path: 'TestPaperList', + // name: 'Table', + // component: () => import('@/views/TestPaper/TestPaperList'), + // meta: { + // title: '试卷列表', + // icon: 'table' + // } + // }, + // { + // path: 'index', + // name: 'index', + // component: () => import('@/views/TestPaper/index'), + // hidden: true, + // meta: { + // title: '试卷维护', + // icon: 'table' + // } + // }, + // // { + // // path: 'ManualTestPaper', + // // name: 'Table', + // // component: () => import('@/views/TestPaper/ManualTestPaper'), + // // meta: { + // // title: '组卷', + // // icon: 'table' + // // } + // // }, - // ] - // }, - { - path: '/order', - component: Layout, - redirect: '/', - name: 'order', - meta: { - title: '订单管理', - icon: 'el-icon-s-marketing' - }, - children: [{ - path: 'recharge', - name: 'recharge', - component: () => import('@/views/order/rechargeList'), - meta: { - title: '充值记录', - } - }, { - path: 'shop', - name: 'shop', - component: () => import('@/views/order/shopList'), - meta: { - title: '购买记录', - } - }] - }, - { - path: '/user', - component: Layout, - redirect: '/', - name: 'user', - meta: { - title: '用户管理', - icon: 'el-icon-s-help' - }, - children: [{ - path: 'user', - name: 'User', - component: () => import('@/views/user/userlist'), - meta: { - title: '普通用户列表', - } + // ] + // }, + { + path: '/order', + component: Layout, + redirect: '/', + name: 'order', + meta: { + title: '订单管理', + icon: 'el-icon-s-marketing' + }, + children: [{ + path: 'recharge', + name: 'recharge', + component: () => + import ('@/views/order/rechargeList'), + meta: { + title: '充值记录', + } + }, { + path: 'shop', + name: 'shop', + component: () => + import ('@/views/order/shopList'), + meta: { + title: '购买记录', + } + }] }, + { + path: '/user', + component: Layout, + redirect: '/', + name: 'user', + meta: { + title: '用户管理', + icon: 'el-icon-s-help' + }, + children: [{ + path: 'user', + name: 'User', + component: () => + import ('@/views/user/userlist'), + meta: { + title: '普通用户列表', + } + }, - ] - }, { - path: '/password', - component: Layout, - redirect: '/', - name: 'password', - meta: { - title: '系统管理', - icon: 'el-icon-s-platform' - }, - children: [{ - path: 'index', - name: 'index', - component: () => import('@/views/password/index'), - meta: { - title: '忘记密码', - } - }, { - path: 'TestPaperClass', - name: 'Table', - component: () => import('@/views/TestPaper/TestPaperClass'), - meta: { - title: '分类管理', - } - }, { - path: 'carousel', - name: 'carousel', - component: () => import('@/views/carousel/index'), - meta: { - title: '轮播图', - } - }, { - path: 'new', - name: 'new', - component: () => import('@/views/carousel/new'), - meta: { - title: '最新资讯', + ] + }, { + path: '/password', + component: Layout, + redirect: '/', + name: 'password', + meta: { + title: '系统管理', + icon: 'el-icon-s-platform' + }, + children: [{ + path: 'index', + name: 'index', + component: () => + import ('@/views/password/index'), + meta: { + title: '忘记密码', + } + }, { + path: 'TestPaperClass', + name: 'Table', + component: () => + import ('@/views/TestPaper/TestPaperClass'), + meta: { + title: '分类管理', + } + }, { + path: 'carousel', + name: 'carousel', + component: () => + import ('@/views/carousel/index'), + meta: { + title: '轮播图', + } + }, { + path: 'new', + name: 'new', + component: () => + import ('@/views/carousel/new'), + meta: { + title: '最新资讯', + } + }] + }, + // 404 page must be placed at the end !!! + { + path: '*', + redirect: '/404', + hidden: true } - }] - }, - // 404 page must be placed at the end !!! - { - path: '*', - redirect: '/404', - hidden: true - } - ] - } + ] + } - return constantRoutes1; -} + return constantRoutes1; +} \ No newline at end of file diff --git a/src/views/TestPaper/TestPaperList.vue b/src/views/TestPaper/TestPaperList.vue index bb1cc78..d1e56f6 100644 --- a/src/views/TestPaper/TestPaperList.vue +++ b/src/views/TestPaper/TestPaperList.vue @@ -97,9 +97,7 @@ - - - + @@ -165,7 +163,7 @@ QuestionClass: [], TestPaper: { TestPaperTitle: "", - PlateClass: "", + PlateClass: 4, TestPaperClassId: 0, TotalScore: 0, Describe: "", @@ -224,7 +222,7 @@ this.dialogAddTestPaperVIsible = false this.TestPaper= { TestPaperTitle: "", - PlateClass: "", + PlateClass: "4", TestPaperClassId: 0, TotalScore: 0, Describe: "", diff --git a/src/views/module/index.vue b/src/views/module/index.vue index 8de8cfd..2526548 100644 --- a/src/views/module/index.vue +++ b/src/views/module/index.vue @@ -99,9 +99,7 @@ - - - + @@ -159,7 +157,7 @@ parameter: { pageIndex: 1, pageSize: 12, - PlateClass: 1, + PlateClass: 4, QuestionClassId: 0, }, Count: 0, @@ -169,7 +167,7 @@ QuestionClass: [], TestPaper: { TestPaperTitle: "", - PlateClass: "1", + PlateClass: "4", TestPaperClassId: 0, TotalScore: 0, Describe: "", @@ -233,7 +231,7 @@ this.getTestPaperListHeadler(); this.TestPaper = { TestPaperTitle: "", - PlateClass: "1", + PlateClass: "4", TestPaperClassId: 0, TotalScore: 0, Describe: "", @@ -334,7 +332,7 @@ this.dialogAddTestPaperVIsible = true this.TestPaper = val // this.TestPaper.PresentPrice = this.TestPaper.PresentPrice * 0.01 - this.TestPaper.PlateClass = '1' + this.TestPaper.PlateClass = '4' } else if (value == 'del') { this.$confirm('确定删除该卷子?', '消息', { confirmButtonText: '确认', diff --git a/src/views/module/realQuestion.vue b/src/views/module/realQuestion.vue index 5638aa1..0d430b1 100644 --- a/src/views/module/realQuestion.vue +++ b/src/views/module/realQuestion.vue @@ -103,9 +103,7 @@ - - - + @@ -163,7 +161,7 @@ parameter: { pageIndex: 1, pageSize: 12, - PlateClass: 2, + PlateClass: 4, QuestionClassId: 0, }, Count: 0, @@ -173,7 +171,7 @@ QuestionClass: [], TestPaper: { TestPaperTitle: "", - PlateClass: "2", + PlateClass: "4", TestPaperClassId: 0, TotalScore: 0, Describe: "", @@ -237,7 +235,7 @@ this.getTestPaperListHeadler(); this.TestPaper = { TestPaperTitle: "", - PlateClass: "2", + PlateClass: "4", TestPaperClassId: 0, TotalScore: 0, Describe: "", @@ -333,7 +331,7 @@ this.dialogAddTestPaperVIsible = true this.TestPaper = val // this.TestPaper.PresentPrice=this.TestPaper.PresentPrice*0.01 - this.TestPaper.PlateClass='2' + this.TestPaper.PlateClass='4' } else if (value == 'del') { this.$confirm('确定删除该卷子?', '消息', { confirmButtonText: '确认', diff --git a/src/views/module/simulation.vue b/src/views/module/simulation.vue index 8dd0aaf..b6e391e 100644 --- a/src/views/module/simulation.vue +++ b/src/views/module/simulation.vue @@ -103,9 +103,7 @@ - - - + @@ -163,7 +161,7 @@ parameter: { pageIndex: 1, pageSize: 12, - PlateClass: 3, + PlateClass: 4, QuestionClassId: 0, }, Count: 0, @@ -173,7 +171,7 @@ QuestionClass: [], TestPaper: { TestPaperTitle: "", - PlateClass: "3", + PlateClass: "4", TestPaperClassId: 0, TotalScore: 0, Describe: "", @@ -237,7 +235,7 @@ this.getTestPaperListHeadler(); this.TestPaper= { TestPaperTitle: "", - PlateClass: "3", + PlateClass: "4", TestPaperClassId: 0, TotalScore: 0, Describe: "", @@ -334,7 +332,7 @@ this.dialogAddTestPaperVIsible = true this.TestPaper = val // this.TestPaper.PresentPrice=this.TestPaper.PresentPrice*0.01 - this.TestPaper.PlateClass='3' + this.TestPaper.PlateClass='4' }else if (value == 'del') { this.$confirm('确定删除该卷子?', '消息', { confirmButtonText: '确认',