yujialong 4 years ago
parent 554f8bdfa5
commit 0c4594bd3a
  1. 2
      src/pages/account/login/index.vue
  2. 25
      src/pages/achievement/assessment/index.vue
  3. 2
      src/pages/achievement/list/examResults.vue
  4. 8
      src/pages/achievement/list/practiceResults.vue
  5. 25
      src/pages/achievement/practice/index.vue
  6. 25
      src/pages/exam/detail/index.vue
  7. 5
      src/pages/exception/error/403/index.vue
  8. 5
      src/pages/exception/error/404/index.vue
  9. 2
      src/pages/practice/do/index.vue
  10. 18
      src/pages/wrongBook/list/index.vue
  11. 2
      src/plugins/requests/index.js
  12. 4
      src/router/permission.js

@ -98,7 +98,7 @@ export default {
password: this.loginForm.password password: this.loginForm.password
} }
this.login(data).then(() => { this.login(data).then(() => {
let redirect = decodeURIComponent(this.$route.query.redirect || '/') let redirect = this.$route.query.redirect ? decodeURIComponent(this.$route.query.redirect) : '/index'
this.$router.replace(redirect) this.$router.replace(redirect)
}).catch(() => {}) }).catch(() => {})
} }

@ -17,7 +17,9 @@
</div> </div>
<ul class="tab"> <ul class="tab">
<li v-for="(item,index) in tabs" :key="index" :class="{active: active == item.id}" @click="tabChange(item.id)">{{item.name}}</li> <template v-for="(item,index) in tabs">
<li v-if="item.show" :key="index" :class="{active: active == item.id}" @click="tabChange(item.id)">{{item.name}}</li>
</template>
</ul> </ul>
<div class="wrap"> <div class="wrap">
@ -74,19 +76,24 @@ export default {
tabs: [ tabs: [
{ {
id: 1, id: 1,
name: '单选题' name: '单选题',
show: true
},{ },{
id: 2, id: 2,
name: '多选题' name: '多选题',
show: true
},{ },{
id: 3, id: 3,
name: '填空题' name: '判断题',
show: true
},{ },{
id: 4, id: 4,
name: '判断题' name: '简答题',
show: true
},{ },{
id: 5, id: 5,
name: '简答题' name: '填空题',
show: true
} }
], ],
active: 1, active: 1,
@ -112,6 +119,12 @@ export default {
this.time = res.time this.time = res.time
this.ranking = res.ranking this.ranking = res.ranking
this.allData = res.data this.allData = res.data
let tabs = this.tabs
res.data.list1.length || (tabs[0].show = false)
res.data.list2.length || (tabs[1].show = false)
res.data.list3.length || (tabs[2].show = false)
res.data.list4.length || (tabs[3].show = false)
res.data.list5.length || (tabs[4].show = false)
this.curType = this.allData.list1 this.curType = this.allData.list1
this.handleOptions() this.handleOptions()
}) })

@ -72,7 +72,7 @@ export default {
'setInfo' 'setInfo'
]), ]),
getData() { getData() {
this.$post(`${this.api.getMyAchievement}?userId=${this.userId}&pageSize=${this.pageSize}&pageNum=${this.page}`).then(res => { this.$post(`${this.api.getMyAchievement}?userId=${this.userId}&pageSize=${this.pageSize}&pageNum=${this.page}&keyword=${this.keyword}`).then(res => {
this.listData = res.data.list.list this.listData = res.data.list.list
this.total = res.data.list.totalCount this.total = res.data.list.totalCount
}).catch(res => {}) }).catch(res => {})

@ -6,7 +6,7 @@
<div class="flex"> <div class="flex">
<div> <div>
<el-input placeholder="请输入练习/试卷名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input> <el-input placeholder="请输入练习名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</div> </div>
</div> </div>
</div> </div>
@ -75,7 +75,9 @@ export default {
'setInfo' 'setInfo'
]), ]),
getData() { getData() {
this.$post(`${this.api.practiseAchievement}?userId=${this.userId}&pageNum=${this.page}&pageSize=${this.pageSize}`).then(res => { let url = `${this.api.practiseAchievement}?userId=${this.userId}&pageNum=${this.page}&pageSize=${this.pageSize}`
if(this.keyword) url = url + `&keyword=${this.keyword}`
this.$post(url).then(res => {
this.listData = res.data.list.list this.listData = res.data.list.list
this.total = res.data.list.totalCount this.total = res.data.list.totalCount
}).catch(res => {}) }).catch(res => {})
@ -100,7 +102,7 @@ export default {
}, },
show(row){ show(row){
this.setInfo({ this.setInfo({
id: row.practiseId, id: row.id,
}) })
this.$router.push('practice') this.$router.push('practice')
} }

@ -13,7 +13,9 @@
</div> </div>
<ul class="tab"> <ul class="tab">
<li v-for="(item,index) in tabs" :key="index" :class="{active: active == item.id}" @click="tabChange(item.id)">{{item.name}}</li> <template v-for="(item,index) in tabs">
<li v-if="item.show" :key="index" :class="{active: active == item.id}" @click="tabChange(item.id)">{{item.name}}</li>
</template>
</ul> </ul>
<div class="wrap"> <div class="wrap">
@ -69,19 +71,24 @@ export default {
tabs: [ tabs: [
{ {
id: 1, id: 1,
name: '单选题' name: '单选题',
show: true
},{ },{
id: 2, id: 2,
name: '多选题' name: '多选题',
show: true
},{ },{
id: 3, id: 3,
name: '判断题' name: '判断题',
show: true
},{ },{
id: 4, id: 4,
name: '简答题' name: '简答题',
show: true
},{ },{
id: 5, id: 5,
name: '填空题' name: '填空题',
show: true
} }
], ],
typeNameList: ['单项选择','多项选择','判断题','简答题','填空题'], typeNameList: ['单项选择','多项选择','判断题','简答题','填空题'],
@ -119,6 +126,12 @@ export default {
} }
}) })
this.list = data.list this.list = data.list
let tabs = this.tabs
data.list.find(n => n.typeName == '单项选择') || (tabs[0].show = false)
data.list.find(n => n.typeName == '多项选择') || (tabs[1].show = false)
data.list.find(n => n.typeName == '判断题') || (tabs[2].show = false)
data.list.find(n => n.typeName == '简答题') || (tabs[3].show = false)
data.list.find(n => n.typeName == '填空题') || (tabs[4].show = false)
this.handleOptions() this.handleOptions()
this.paperName = data.paperName this.paperName = data.paperName
this.userName = data.stuName this.userName = data.stuName

@ -13,7 +13,9 @@
</div> </div>
<ul class="tab"> <ul class="tab">
<li v-for="(item,index) in tabs" :key="index" :class="{active: active == item.id}" @click="tabChange(item.id)">{{item.name}}</li> <template v-for="(item,index) in tabs">
<li v-if="item.show" :key="index" :class="{active: active == item.id}" @click="tabChange(item.id)">{{item.name}}</li>
</template>
</ul> </ul>
<div class="wrap"> <div class="wrap">
@ -69,19 +71,24 @@ export default {
tabs: [ tabs: [
{ {
id: 1, id: 1,
name: '单选题' name: '单选题',
show: true
},{ },{
id: 2, id: 2,
name: '多选题' name: '多选题',
show: true
},{ },{
id: 3, id: 3,
name: '填空题' name: '判断题',
show: true
},{ },{
id: 4, id: 4,
name: '判断题' name: '简答题',
show: true
},{ },{
id: 5, id: 5,
name: '简答题' name: '填空题',
show: true
} }
], ],
active: 1, active: 1,
@ -106,6 +113,12 @@ export default {
this.paperName = res.paperName this.paperName = res.paperName
this.time = res.time this.time = res.time
this.allData = res.data this.allData = res.data
let tabs = this.tabs
res.data.list1.length || (tabs[0].show = false)
res.data.list2.length || (tabs[1].show = false)
res.data.list3.length || (tabs[2].show = false)
res.data.list4.length || (tabs[3].show = false)
res.data.list5.length || (tabs[4].show = false)
this.curType = this.allData.list1 this.curType = this.allData.list1
this.handleOptions() this.handleOptions()
}).catch(err => {}) }).catch(err => {})

@ -4,7 +4,7 @@
<div class="error-desc">啊哦~ 你没有权限访问该页面哦</div> <div class="error-desc">啊哦~ 你没有权限访问该页面哦</div>
<div class="error-handle"> <div class="error-handle">
<router-link to="/"> <router-link to="/">
<el-button type="primary" size="large">返回首页</el-button> <el-button type="primary" size="large" @click="toIndex">返回首页</el-button>
</router-link> </router-link>
<el-button class="error-btn" type="primary" size="large" @click="goBack">返回上一页</el-button> <el-button class="error-btn" type="primary" size="large" @click="goBack">返回上一页</el-button>
</div> </div>
@ -14,6 +14,9 @@
<script> <script>
export default { export default {
methods: { methods: {
toIndex(){
this.$router.push('/')
},
goBack(){ goBack(){
this.$router.go(-1); this.$router.go(-1);
} }

@ -4,7 +4,7 @@
<div class="error-desc">啊哦~ 你所访问的页面不存在</div> <div class="error-desc">啊哦~ 你所访问的页面不存在</div>
<div class="error-handle"> <div class="error-handle">
<router-link to="/"> <router-link to="/">
<el-button type="primary" size="large">返回首页</el-button> <el-button type="primary" size="large" @click="toIndex">返回首页</el-button>
</router-link> </router-link>
<el-button class="error-btn" type="primary" size="large" @click="goBack">返回上一页</el-button> <el-button class="error-btn" type="primary" size="large" @click="goBack">返回上一页</el-button>
</div> </div>
@ -14,6 +14,9 @@
<script> <script>
export default { export default {
methods: { methods: {
toIndex(){
this.$router.push('/')
},
goBack(){ goBack(){
this.$router.go(-1); this.$router.go(-1);
} }

@ -97,7 +97,7 @@ export default {
mixins: [ setBackground,examDo ], mixins: [ setBackground,examDo ],
data() { data() {
return { return {
identification: this.$store.state.identification, identification: this.$store.state.practice.identification,
subjects: [], subjects: [],
singleCount: 0, singleCount: 0,
multipleCount: 0, multipleCount: 0,

@ -1,18 +1,16 @@
<template> <template>
<div> <div>
<el-row :gutter="20">
<el-col :span="24">
<el-card shadow="hover" class="m-b-20"> <el-card shadow="hover" class="m-b-20">
<div class="p-title m-b-20">筛选</div> <div class="p-title m-b-20">筛选</div>
<div class="flex j-between"> <div class="flex j-between">
<el-form label-width="80px" inline> <el-form label-width="80px" inline>
<el-form-item class="no-mb" label="题库来源"> <el-form-item class="no-mb" label="题库来源">
<el-select v-model="type" clearable placeholder="请选择题库来源" @change="getName"> <el-select v-model="type" placeholder="请选择题库来源" @change="getName">
<el-option v-for="(item,index) in sourceList" :key="index" :label="item.name" :value="item.id"></el-option> <el-option v-for="(item,index) in sourceList" :key="index" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item class="no-mb" label="试卷名称"> <el-form-item class="no-mb" label="试卷名称">
<el-select v-model="paperId" clearable placeholder="请选择试卷名称" @change="getData"> <el-select v-model="paperId" placeholder="请选择试卷名称" @change="getData">
<el-option v-for="(item,index) in nameList" :key="index" :label="item.paperName" :value="item.paperId"></el-option> <el-option v-for="(item,index) in nameList" :key="index" :label="item.paperName" :value="item.paperId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -33,9 +31,7 @@
</div> </div>
</div> </div>
</el-card> </el-card>
</el-col>
<el-col :span="24">
<el-card shadow="hover" class="m-b-20"> <el-card shadow="hover" class="m-b-20">
<div class="m-b-20"> <div class="m-b-20">
<el-button <el-button
@ -92,8 +88,6 @@
></el-pagination> ></el-pagination>
</div> </div>
</el-card> </el-card>
</el-col>
</el-row>
<el-dialog title="错题详情" :visible.sync="detailVisible" width="40%"> <el-dialog title="错题详情" :visible.sync="detailVisible" width="40%">
<div class="ques"> <div class="ques">
@ -129,14 +123,14 @@ export default {
data() { data() {
return { return {
keyword: '', keyword: '',
type: 1, type: 2,
sourceList: [ sourceList: [
{ {
id: 1,
name: '用于考试'
},{
id: 2, id: 2,
name: '用于练习' name: '用于练习'
},{
id: 1,
name: '用于考试'
} }
], ],
paperId: '', paperId: '',

@ -5,7 +5,7 @@ import Setting from '@/setting'
const service = axios.create({ const service = axios.create({
baseURL: Setting.apiBaseURL, baseURL: Setting.apiBaseURL,
timeout: 5000 timeout: 50000
}) })
// post请求头 // post请求头

@ -6,10 +6,14 @@ router.beforeEach((to, from, next) => {
document.title = Setting.titleSuffix; document.title = Setting.titleSuffix;
const role = util.session.get(Setting.usernameKey); const role = util.session.get(Setting.usernameKey);
if (!role && to.path !== '/login') { if (!role && to.path !== '/login') {
if(to.fullPath == '/'){
next('/login')
}else{
next({ next({
path: '/login', path: '/login',
query: {redirect: to.fullPath} query: {redirect: to.fullPath}
}) })
}
} else if(role && to.path == '/login') { } else if(role && to.path == '/login') {
next('/index') next('/index')
} else { } else {

Loading…
Cancel
Save