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. 33
      src/pages/exception/error/403/index.vue
  8. 33
      src/pages/exception/error/404/index.vue
  9. 2
      src/pages/practice/do/index.vue
  10. 186
      src/pages/wrongBook/list/index.vue
  11. 2
      src/plugins/requests/index.js
  12. 12
      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 => {})

@ -1,23 +1,26 @@
<template> <template>
<div class="error-page"> <div class="error-page">
<div class="error-code">4<span>0</span>3</div> <div class="error-code">4<span>0</span>3</div>
<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>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
methods: { methods: {
goBack(){ toIndex(){
this.$router.go(-1); this.$router.push('/')
} },
} goBack(){
this.$router.go(-1);
}
}
} }
</script> </script>

@ -1,23 +1,26 @@
<template> <template>
<div class="error-page"> <div class="error-page">
<div class="error-code">4<span>0</span>4</div> <div class="error-code">4<span>0</span>4</div>
<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>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
methods: { methods: {
goBack(){ toIndex(){
this.$router.go(-1); this.$router.push('/')
} },
} goBack(){
this.$router.go(-1);
}
}
} }
</script> </script>

@ -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,99 +1,93 @@
<template> <template>
<div> <div>
<el-row :gutter="20"> <el-card shadow="hover" class="m-b-20">
<el-col :span="24"> <div class="p-title m-b-20">筛选</div>
<el-card shadow="hover" class="m-b-20"> <div class="flex j-between">
<div class="p-title m-b-20">筛选</div> <el-form label-width="80px" inline>
<div class="flex j-between"> <el-form-item class="no-mb" label="题库来源">
<el-form label-width="80px" inline> <el-select v-model="type" placeholder="请选择题库来源" @change="getName">
<el-form-item class="no-mb" label="题库来源"> <el-option v-for="(item,index) in sourceList" :key="index" :label="item.name" :value="item.id"></el-option>
<el-select v-model="type" clearable placeholder="请选择题库来源" @change="getName"> </el-select>
<el-option v-for="(item,index) in sourceList" :key="index" :label="item.name" :value="item.id"></el-option> </el-form-item>
</el-select> <el-form-item class="no-mb" label="试卷名称">
</el-form-item> <el-select v-model="paperId" placeholder="请选择试卷名称" @change="getData">
<el-form-item class="no-mb" label="试卷名称"> <el-option v-for="(item,index) in nameList" :key="index" :label="item.paperName" :value="item.paperId"></el-option>
<el-select v-model="paperId" clearable placeholder="请选择试卷名称" @change="getData"> </el-select>
<el-option v-for="(item,index) in nameList" :key="index" :label="item.paperName" :value="item.paperId"></el-option> </el-form-item>
</el-select> <el-form-item class="no-mb" label="试题类型">
</el-form-item> <el-select v-model="typeId" clearable placeholder="请选择试题类型" @change="getData">
<el-form-item class="no-mb" label="试题类型"> <el-option label="不限" value=""></el-option>
<el-select v-model="typeId" clearable placeholder="请选择试题类型" @change="getData"> <el-option v-for="(item,index) in typeList" :key="index" :label="item.name" :value="item.id"></el-option>
<el-option label="不限" value=""></el-option> </el-select>
<el-option v-for="(item,index) in typeList" :key="index" :label="item.name" :value="item.id"></el-option> </el-form-item>
</el-select> </el-form>
</el-form-item> <div>
</el-form> <el-input
<div> placeholder="请输入知识点"
<el-input prefix-icon="el-icon-search"
placeholder="请输入知识点" v-model="keyword"
prefix-icon="el-icon-search" clearable
v-model="keyword" ></el-input>
clearable </div>
></el-input> </div>
</div> </el-card>
</div>
</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 type="primary"
type="primary" size="small"
size="small" round
round @click="practice"
@click="practice" >错题练习</el-button>
>错题练习</el-button> </div>
</div>
<el-table <el-table
:data="listData" :data="listData"
ref="table" ref="table"
row-key="id" row-key="id"
class="table" class="table"
stripe stripe
header-align="center" header-align="center"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<el-table-column <el-table-column
type="selection" type="selection"
width="55" width="55"
align="center" align="center"
:reserve-selection="true" :reserve-selection="true"
></el-table-column> ></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"> <el-table-column type="index" width="100" label="序号" align="center">
<template <template
slot-scope="scope" slot-scope="scope"
>{{scope.$index + (page - 1) * pageSize + 1}}</template> >{{scope.$index + (page - 1) * pageSize + 1}}</template>
</el-table-column> </el-table-column>
<el-table-column prop="questionStem" label="错题题干名称" align="center" :show-overflow-tooltip="true"></el-table-column> <el-table-column prop="questionStem" label="错题题干名称" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="题目来源" width="120" align="center"> <el-table-column label="题目来源" width="120" align="center">
<template> <template>
{{type == 1 ? '考试' : '练习'}} {{type == 1 ? '考试' : '练习'}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="courses" label="对应课程" width="140" align="center"></el-table-column> <el-table-column prop="courses" label="对应课程" width="140" align="center"></el-table-column>
<el-table-column prop="knowledgePoints" label="对应知识点" width="140" align="center"></el-table-column> <el-table-column prop="knowledgePoints" label="对应知识点" width="140" align="center"></el-table-column>
<el-table-column prop="wrongNum" label="错题次数" width="100" align="center"></el-table-column> <el-table-column prop="wrongNum" label="错题次数" width="100" align="center"></el-table-column>
<el-table-column label="操作" width="100" align="center"> <el-table-column label="操作" width="100" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="show(scope.row)">查看</el-button> <el-button type="text" @click="show(scope.row)">查看</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination <el-pagination
background background
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page="page" :current-page="page"
:page-size="pageSize" :page-size="pageSize"
layout="total,prev, pager, next" layout="total,prev, pager, next"
:total="total" :total="total"
></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') {
next({ if(to.fullPath == '/'){
path: '/login', next('/login')
query: {redirect: to.fullPath} }else{
}) next({
path: '/login',
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