yujialong 4 years ago
parent 0c4594bd3a
commit 22a1da2c6a
  1. 2
      src/pages/account/login/index.vue
  2. 14
      src/pages/achievement/assessment/index.vue
  3. 3
      src/pages/achievement/list/examResults.vue
  4. 18
      src/pages/achievement/list/practiceResults.vue
  5. 16
      src/pages/achievement/practice/index.vue
  6. 14
      src/pages/exam/detail/index.vue
  7. 6
      src/pages/exam/do/index.vue
  8. 12
      src/pages/exam/list/index.vue
  9. 22
      src/pages/index/list/index.vue
  10. 10
      src/pages/practice/do/index.vue
  11. 6
      src/pages/practice/list/index.vue
  12. 12
      src/pages/practice/list/myPractice.vue
  13. 2
      src/pages/practice/list/randomPractice.vue
  14. 6
      src/pages/practice/randomDo/index.vue
  15. 3
      src/pages/setting/person/index.vue
  16. 15
      src/router/permission.js
  17. 2
      src/setting.js
  18. 4
      src/store/modules/achievement.js
  19. 2
      src/store/modules/practice.js
  20. 3
      src/store/modules/user.js

@ -65,7 +65,7 @@ export default {
isReg: false, isReg: false,
loginForm: { loginForm: {
username: '13563422432', username: '13563422432',
password: 'huoran123', password: '111aaa',
}, },
loginRules: { loginRules: {
username: [{ required: true, message: '请输入用户名', trigger: 'blur' }], username: [{ required: true, message: '请输入用户名', trigger: 'blur' }],

@ -6,20 +6,24 @@
<span class="name">总分</span> <span class="name">总分</span>
<span class="val">100</span> <span class="val">100</span>
</div> </div>
<div class="m-r-20" v-if="score != 'null'">
<span class="name">得分</span>
<span class="val">{{score}}</span>
</div>
<div class="m-r-20"> <div class="m-r-20">
<span class="name">考试时长</span> <span class="name">考试时长</span>
<span class="val">{{time}}分钟</span> <span class="val">{{time}}分钟</span>
</div> </div>
<div> <div>
<span class="name">排名</span> <span class="name">排名</span>
<span class="val">{{ranking}}</span> <span class="val">{{ranking === 0 ? 1 : ranking}}</span>
</div> </div>
</div> </div>
<ul class="tab"> <ul class="tab">
<template v-for="(item,index) in tabs"> <!-- <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> <li v-for="(item,index) in tabs" :key="index" :class="{active: active == item.id}" @click="tabChange(item.id)">{{item.name}}</li>
</template> <!-- </template> -->
</ul> </ul>
<div class="wrap"> <div class="wrap">
@ -105,7 +109,7 @@ export default {
'userId' 'userId'
]), ]),
...mapState('achievement', [ ...mapState('achievement', [
'id','assessmentId' 'id','assessmentId','score'
]) ])
}, },
mounted() { mounted() {

@ -84,7 +84,8 @@ export default {
show(row){ show(row){
this.setInfo({ this.setInfo({
id: row.paperId, id: row.paperId,
assessmentId: row.id assessmentId: row.assessmentId,
score: row.thisScore
}) })
this.$router.push('assessment') this.$router.push('assessment')
}, },

@ -22,9 +22,21 @@
</el-table-column> </el-table-column>
<el-table-column prop="practiseName" label="练习名称" align="center"></el-table-column> <el-table-column prop="practiseName" label="练习名称" align="center"></el-table-column>
<el-table-column prop="practiseNum" label="练习次数" align="center"></el-table-column> <el-table-column prop="practiseNum" label="练习次数" align="center"></el-table-column>
<el-table-column prop="timeCost" label="用时(分钟)" align="center"></el-table-column> <el-table-column prop="timeCost" label="用时(分钟)" align="center">
<el-table-column prop="examTime" label="练习时间" align="center"></el-table-column> <template slot-scope="scope">
<el-table-column prop="score" label="最新得分" align="center"></el-table-column> {{scope.row.timeCost !== '' ? scope.row.timeCost : '--'}}
</template>
</el-table-column>
<el-table-column prop="examTime" label="练习时间" align="center">
<template slot-scope="scope">
{{scope.row.examTime !== '' ? scope.row.examTime : '--'}}
</template>
</el-table-column>
<el-table-column prop="score" label="最新得分" align="center">
<template slot-scope="scope">
{{scope.row.score !== '' ? scope.row.score : '--'}}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="180"> <el-table-column label="操作" align="center" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="scope.row.practiseId" type="text" @click="show(scope.row)">查看详情</el-button> <el-button v-if="scope.row.practiseId" type="text" @click="show(scope.row)">查看详情</el-button>

@ -2,20 +2,24 @@
<div class="box"> <div class="box">
<h1 class="title">{{paperName }}</h1> <h1 class="title">{{paperName }}</h1>
<div class="metas"> <div class="metas">
<div style="margin-right: 20px;"> <div class="m-r-20">
<span class="name">总分</span> <span class="name">总分</span>
<span class="val">100</span> <span class="val">100</span>
</div> </div>
<div class="m-r-20" v-if="score != 'null'">
<span class="name">得分</span>
<span class="val">{{score}}</span>
</div>
<div> <div>
<span class="name">考试时长</span> <span class="name">考试时长</span>
<span class="val">{{duration}}</span> <span class="val">{{duration}}分钟</span>
</div> </div>
</div> </div>
<ul class="tab"> <ul class="tab">
<template v-for="(item,index) in tabs"> <!-- <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> <li v-for="(item,index) in tabs" :key="index" :class="{active: active == item.id}" @click="tabChange(item.id)">{{item.name}}</li>
</template> <!-- </template> -->
</ul> </ul>
<div class="wrap"> <div class="wrap">
@ -66,6 +70,7 @@ export default {
data() { data() {
return { return {
paperName: '', paperName: '',
score: 0,
duration: 0, duration: 0,
selectVisible: false, selectVisible: false,
tabs: [ tabs: [
@ -137,6 +142,7 @@ export default {
this.userName = data.stuName this.userName = data.stuName
this.this_score = data.score this.this_score = data.score
this.duration = data.timeCost this.duration = data.timeCost
this.score = data.score
}) })
.catch(err => {}) .catch(err => {})
}, },

@ -6,16 +6,20 @@
<span class="name">总分</span> <span class="name">总分</span>
<span class="val">100</span> <span class="val">100</span>
</div> </div>
<div> <div class="m-r-20">
<span class="name">考试时长</span> <span class="name">考试时长</span>
<span class="val">{{time}}分钟</span> <span class="val">{{time}}分钟</span>
</div> </div>
<div>
<span class="name">排名</span>
<span class="val">{{ranking}}</span>
</div>
</div> </div>
<ul class="tab"> <ul class="tab">
<template v-for="(item,index) in tabs"> <!-- <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> <li v-for="(item,index) in tabs" :key="index" :class="{active: active == item.id}" @click="tabChange(item.id)">{{item.name}}</li>
</template> <!-- </template> -->
</ul> </ul>
<div class="wrap"> <div class="wrap">
@ -67,6 +71,7 @@ export default {
return { return {
paperName: '', paperName: '',
time: 0, time: 0,
ranking: 1,
selectVisible: false, selectVisible: false,
tabs: [ tabs: [
{ {
@ -111,6 +116,7 @@ export default {
this.$post(`${this.api.answerDetail}?userId=${this.userId}&assessmentId=${this.assessmentId}&paperId=${this.testPaperId}`) this.$post(`${this.api.answerDetail}?userId=${this.userId}&assessmentId=${this.assessmentId}&paperId=${this.testPaperId}`)
.then(res => { .then(res => {
this.paperName = res.paperName this.paperName = res.paperName
this.ranking = res.ranking
this.time = res.time this.time = res.time
this.allData = res.data this.allData = res.data
let tabs = this.tabs let tabs = this.tabs

@ -125,7 +125,8 @@ export default {
progress: 0, progress: 0,
isSubmit: false, isSubmit: false,
isDone: false, isDone: false,
totalLen: 0 totalLen: 0,
submiting: false
}; };
}, },
computed: { computed: {
@ -299,6 +300,8 @@ export default {
},1000) },1000)
}, },
save(){ save(){
if(this.submiting) return false
this.submiting = true
let data1 = [] let data1 = []
this.subjects.map((e,i) => { this.subjects.map((e,i) => {
e.map((n,k) => { e.map((n,k) => {
@ -327,6 +330,7 @@ export default {
.then(res => { .then(res => {
this.$post(`${this.api.addGzAnswerDetails}`,data1) this.$post(`${this.api.addGzAnswerDetails}`,data1)
.then(res => { .then(res => {
this.submiting = false
let timeSpent = parseInt((new Date().getTime() - this.startTime) / 1000) let timeSpent = parseInt((new Date().getTime() - this.startTime) / 1000)
let data2 = { let data2 = {
testPaperId: this.testPaperId, testPaperId: this.testPaperId,

@ -42,11 +42,11 @@
{{(scope.row.timeCost / 60).toFixed(2)}} {{(scope.row.timeCost / 60).toFixed(2)}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="score" label="得分" width="100" align="center"> <!-- <el-table-column prop="score" label="得分" width="100" align="center"> -->
<template slot-scope="scope"> <!-- <template slot-scope="scope">
{{scope.row.score | transferScore}} {{scope.row.score | transferScore}}
</template> </template> -->
</el-table-column> <!-- </el-table-column> -->
<el-table-column prop="state" label="考试状态" width="100" align="center"> <el-table-column prop="state" label="考试状态" width="100" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{getAssessmentStateName(scope.row.assessmentState)}} {{getAssessmentStateName(scope.row.assessmentState)}}
@ -57,7 +57,7 @@
<!-- 学生考试状态:考试状态 state: (0未考 1在考 2已考) <!-- 学生考试状态:考试状态 state: (0未考 1在考 2已考)
考核状态: state: 考核状态(1待开始 2进行中 3已结束) --> 考核状态: state: 考核状态(1待开始 2进行中 3已结束) -->
<el-button type="text" @click="toExam(scope.row)" v-if="scope.row.assessmentState == 2" :disabled="scope.row.state == 2">进入考试</el-button> <el-button type="text" @click="toExam(scope.row)" v-if="scope.row.assessmentState == 2" :disabled="scope.row.state == 2">进入考试</el-button>
<el-button type="text" @click="query(scope.row)" v-if="scope.row.state == 2">成绩查询</el-button> <!-- <el-button type="text" @click="query(scope.row)" v-if="scope.row.state == 2">成绩查询</el-button> -->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -98,7 +98,7 @@ export default {
}, },
filters: { filters: {
transferScore(val){ transferScore(val){
return val ? val : '--' return val !== 0 ? val : '--'
} }
}, },
watch: { watch: {

@ -136,7 +136,8 @@ import util from '@/libs/util'
export default { export default {
data() { data() {
return { return {
date: [util.formatDate('yyyy-MM-dd'),util.formatDate('yyyy-MM-dd')], timer: null,
date: [],
startTime: '', startTime: '',
endTime: '', endTime: '',
page: 1, page: 1,
@ -180,6 +181,12 @@ export default {
quill quill
}, },
mounted() { mounted() {
let now = util.formatDate('yyyy-MM-dd')
let second = util.formatDate('yyyy-MM-dd',new Date(new Date().getTime() + 86400000))
this.date = [now,second]
this.startTime = now
this.endTime = second
this.addInterval()
this.getData() this.getData()
this.getPractice() this.getPractice()
this.getAchievement() this.getAchievement()
@ -189,6 +196,12 @@ export default {
...mapActions('exam', [ ...mapActions('exam', [
'setInfo' 'setInfo'
]), ]),
addInterval(){
this.timer = setInterval(this.getData,1000)
this.$once('hook:beforeDestroy',() => {
clearInterval(this.timer)
})
},
getData() { getData() {
this.$post(`${this.api.waitExam}?userId=${this.userId}&pageNum=${this.page}&pageSize=${this.pageSize}&startTime=${this.startTime}&endTime=${this.endTime}`) this.$post(`${this.api.waitExam}?userId=${this.userId}&pageNum=${this.page}&pageSize=${this.pageSize}&startTime=${this.startTime}&endTime=${this.endTime}`)
.then(res => { .then(res => {
@ -218,7 +231,7 @@ export default {
let avgScore = 0 let avgScore = 0
list.map(n => avgScore += n.lastScore) list.map(n => avgScore += n.lastScore)
this.avgScore = (avgScore / list.length).toFixed(2) this.avgScore = list.length ? (avgScore / list.length).toFixed(2) : 0
let totalDuration = 0 let totalDuration = 0
list.map(n => totalDuration += n.duration) list.map(n => totalDuration += n.duration)
@ -236,17 +249,18 @@ export default {
this.getPractice() this.getPractice()
}, },
getPracticeDuration(){ getPracticeDuration(){
console.log(11,this.practiceDateList,this.practiceDurationList)
let myChart = echarts.init(document.getElementById('practiceDuration')) let myChart = echarts.init(document.getElementById('practiceDuration'))
myChart.setOption({ myChart.setOption({
title: { text: '总练习时长' }, title: { text: '总练习时长' },
tooltip: {}, tooltip: {},
xAxis: { xAxis: {
name: '日期',
type: 'category', type: 'category',
boundaryGap: false, boundaryGap: false,
data: this.practiceDateList data: this.practiceDateList
}, },
yAxis: { yAxis: {
name: '时长(分钟)',
type: 'value' type: 'value'
}, },
series: [{ series: [{
@ -268,10 +282,12 @@ export default {
let myChart = echarts.init(document.getElementById('achievement')) let myChart = echarts.init(document.getElementById('achievement'))
myChart.setOption({ myChart.setOption({
xAxis: { xAxis: {
name: '考试名称',
type: 'category', type: 'category',
data: this.assesmentNameList data: this.assesmentNameList
}, },
yAxis: { yAxis: {
name: '得分',
type: 'value' type: 'value'
}, },
series: [{ series: [{

@ -123,7 +123,8 @@ export default {
progress: 0, progress: 0,
isSubmit: false, isSubmit: false,
isDone: false, isDone: false,
totalLen: 0 totalLen: 0,
submiting: false
}; };
}, },
computed: { computed: {
@ -206,7 +207,7 @@ export default {
this.subjects.map(n => len += n.length) this.subjects.map(n => len += n.length)
this.totalLen = len this.totalLen = len
if(this.isContinue){ if(this.isContinue){
this.identification = res.data.Identification this.identification = res.data.Identification ? res.data.Identification : this.identification
this.subjects.forEach((e,i) => { this.subjects.forEach((e,i) => {
e.forEach((n,k) => { e.forEach((n,k) => {
this.initMedia(n) this.initMedia(n)
@ -257,6 +258,8 @@ export default {
} }
}, },
save(){ save(){
if(this.submiting) return false
this.submiting = true
let data1 = [] let data1 = []
this.subjects.map((e,i) => { this.subjects.map((e,i) => {
e.map((n,k) => { e.map((n,k) => {
@ -286,9 +289,10 @@ export default {
.then(res => { .then(res => {
this.$post(`${this.api.calculationScorePractice}`,data1) this.$post(`${this.api.calculationScorePractice}`,data1)
.then(res => { .then(res => {
this.submiting = false
this.isSubmit = true this.isSubmit = true
this.$message.success(this.isDone ? '练习已结束,已经自动为您提交练习!' : '提交成功') this.$message.success(this.isDone ? '练习已结束,已经自动为您提交练习!' : '提交成功')
this.$router.back() this.$router.push('list')
}).catch(err => {}) }).catch(err => {})
}).catch(err => {}) }).catch(err => {})
}).catch(err => {}) }).catch(err => {})

@ -10,12 +10,14 @@
</template> </template>
<script> <script>
import { mapState,mapGetters,mapActions } from 'vuex'
import myPractice from './myPractice.vue'; import myPractice from './myPractice.vue';
import randomPractice from './randomPractice.vue'; import randomPractice from './randomPractice.vue';
export default { export default {
name: 'index', name: 'index',
data() { data() {
return { return {
isRandom: this.$route.query.isRandom,
activeName: 'first', activeName: 'first',
tabs: { tabs: {
first: '我的练习', first: '我的练习',
@ -25,12 +27,12 @@ export default {
}, },
components: {myPractice,randomPractice}, components: {myPractice,randomPractice},
mounted() { mounted() {
if(this.isRandom) this.activeName = 'second'
}, },
methods: { methods: {
tabChange(index){ tabChange(index){
this.activeName = index this.activeName = index
} },
} }
}; };
</script> </script>

@ -27,9 +27,17 @@
{{getDegreeName(scope.row.degree)}} {{getDegreeName(scope.row.degree)}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="duration" label="时长(分钟)" align="center"></el-table-column> <el-table-column prop="duration" label="时长(分钟)" align="center">
<template slot-scope="scope">
{{scope.row.duration !== '' ? scope.row.duration : '--'}}
</template>
</el-table-column>
<el-table-column prop="practiceNum" label="练习次数" align="center"></el-table-column> <el-table-column prop="practiceNum" label="练习次数" align="center"></el-table-column>
<el-table-column prop="lastScore" label="最后一次得分" align="center"></el-table-column> <el-table-column prop="lastScore" label="最后一次得分" align="center">
<template slot-scope="scope">
{{scope.row.lastScore !== '' ? scope.row.lastScore : '--'}}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="180"> <el-table-column label="操作" align="center" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="practice(scope.row)">进入练习</el-button> <el-button type="text" @click="practice(scope.row)">进入练习</el-button>

@ -84,7 +84,7 @@ export default {
}, },
practice(){ practice(){
this.$router.push('randomDo') this.$router.push('randomDo')
} },
} }
}; };
</script> </script>

@ -111,6 +111,7 @@ export default {
briefAnswerScore: 0, briefAnswerScore: 0,
scoreList: [], scoreList: [],
questionType: ['单选题','多选题','判断题','填空题','简答题'], questionType: ['单选题','多选题','判断题','填空题','简答题'],
submiting: false
}; };
}, },
computed: { computed: {
@ -183,6 +184,8 @@ export default {
}).catch(err => {}) }).catch(err => {})
}, },
save(){ save(){
if(this.submiting) return false
this.submiting = true
let data1 = [] let data1 = []
this.subjects.map((e,i) => { this.subjects.map((e,i) => {
e.map((n,k) => { e.map((n,k) => {
@ -208,8 +211,9 @@ export default {
.then(res => { .then(res => {
this.$post(`${this.api.addPractiseRecordRandom}?userId=${this.userId}&randomId=${this.randomId}`) this.$post(`${this.api.addPractiseRecordRandom}?userId=${this.userId}&randomId=${this.randomId}`)
.then(res => { .then(res => {
this.submiting = false
this.$message.success('提交成功') this.$message.success('提交成功')
this.$router.back() this.$router.push('list?isRandom=true')
}) })
.catch(err => {}) .catch(err => {})
}) })

@ -345,7 +345,7 @@ export default {
}, },
methods: { methods: {
...mapActions('user', [ ...mapActions('user', [
'setAvatar' 'setAvatar','setUserName'
]), ]),
getProvince(){ getProvince(){
this.$get(this.api.queryProvince).then(res => { this.$get(this.api.queryProvince).then(res => {
@ -468,6 +468,7 @@ export default {
let data = userInfoEntity let data = userInfoEntity
this.$post(this.api.userinfoUpdate,data).then(res => { this.$post(this.api.userinfoUpdate,data).then(res => {
if(res.success){ if(res.success){
this.setUserName(personalInformation.userName)
this.$message.success('提交成功') this.$message.success('提交成功')
this.$router.back() this.$router.back()
}else{ }else{

@ -6,14 +6,15 @@ 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') next('/login')
}else{ // if(to.fullPath == '/'){
next({ // next('/login')
path: '/login', // }else{
query: {redirect: to.fullPath} // 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 {

@ -16,7 +16,7 @@ const Setting = {
showProgressBar: true, showProgressBar: true,
// 接口请求地址 // 接口请求地址
// apiBaseURL: env === 'development' ? 'http://192.168.31.152:8001' : 'http://39.108.250.202:8000', // apiBaseURL: env === 'development' ? 'http://192.168.31.152:8001' : 'http://39.108.250.202:8000',
apiBaseURL: env === 'development' ? 'http://192.168.31.152:8001' : 'http://39.108.250.202:9000', apiBaseURL: env === 'development' ? 'http://39.108.250.202:9000' : 'http://39.108.250.202:9000',
// oss文件管理接口地址 // oss文件管理接口地址
apiUploadURL: 'http://8.134.8.197:8001', apiUploadURL: 'http://8.134.8.197:8001',
// 接口请求返回错误时,弹窗的持续时间,单位:秒 // 接口请求返回错误时,弹窗的持续时间,单位:秒

@ -7,7 +7,8 @@ export default {
id: '', id: '',
assessmentId: '', assessmentId: '',
assessmentName: '', assessmentName: '',
classId: '' classId: '',
score: 0
}, },
getters: { getters: {
@ -18,6 +19,7 @@ export default {
state.assessmentId = info.assessmentId state.assessmentId = info.assessmentId
state.assessmentName = info.assessmentName state.assessmentName = info.assessmentName
state.classId = info.classId state.classId = info.classId
state.score = info.score
}, },
}, },
actions: { actions: {

@ -22,7 +22,7 @@ export default {
practiseId: '', practiseId: '',
paperId: '', paperId: '',
isContinue: '', isContinue: '',
identification: '' identification: '',
}, },
getters: { getters: {
getDegreeName: state => id => { getDegreeName: state => id => {

@ -102,5 +102,8 @@ export default {
} }
post(api.userinfoUpdate,data).then(res => {}).catch(res => {}) post(api.userinfoUpdate,data).then(res => {}).catch(res => {})
}, },
setUserName({ state,commit },userName) {
commit('SET_USERNAME',userName)
},
} }
} }
Loading…
Cancel
Save