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. 17
      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,
loginForm: {
username: '13563422432',
password: 'huoran123',
password: '111aaa',
},
loginRules: {
username: [{ required: true, message: '请输入用户名', trigger: 'blur' }],

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

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

@ -22,9 +22,21 @@
</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="timeCost" label="用时(分钟)" align="center"></el-table-column>
<el-table-column prop="examTime" label="练习时间" align="center"></el-table-column>
<el-table-column prop="score" label="最新得分" align="center"></el-table-column>
<el-table-column prop="timeCost" label="用时(分钟)" align="center">
<template slot-scope="scope">
{{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">
<template slot-scope="scope">
<el-button v-if="scope.row.practiseId" type="text" @click="show(scope.row)">查看详情</el-button>

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

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

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

@ -42,11 +42,11 @@
{{(scope.row.timeCost / 60).toFixed(2)}}
</template>
</el-table-column>
<el-table-column prop="score" label="得分" width="100" align="center">
<template slot-scope="scope">
<!-- <el-table-column prop="score" label="得分" width="100" align="center"> -->
<!-- <template slot-scope="scope">
{{scope.row.score | transferScore}}
</template>
</el-table-column>
</template> -->
<!-- </el-table-column> -->
<el-table-column prop="state" label="考试状态" width="100" align="center">
<template slot-scope="scope">
{{getAssessmentStateName(scope.row.assessmentState)}}
@ -57,7 +57,7 @@
<!-- 学生考试状态:考试状态 state: (0未考 1在考 2已考)
考核状态: 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="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>
</el-table-column>
</el-table>
@ -98,7 +98,7 @@ export default {
},
filters: {
transferScore(val){
return val ? val : '--'
return val !== 0 ? val : '--'
}
},
watch: {

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

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

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

@ -27,9 +27,17 @@
{{getDegreeName(scope.row.degree)}}
</template>
</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="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">
<template slot-scope="scope">
<el-button type="text" @click="practice(scope.row)">进入练习</el-button>

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

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

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

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

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

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

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

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