yujialong 2 months ago
parent 1b50a851b9
commit 58fc15212f
  1. 55
      src/pages/allocationReview/list/index.vue
  2. 5
      src/pages/allocationReview/list/setup.vue
  3. 22
      src/pages/allocationReview/records/index.vue
  4. 41
      src/pages/myReview/list/index.vue
  5. 26
      src/pages/myReview/records/index.vue
  6. 79
      src/pages/myReview/theoryReview/index.vue

@ -5,13 +5,13 @@
<ul class="filter">
<li>
<label>评阅时间</label>
<el-radio-group v-model="filter.month">
<el-radio-group v-model="month" @change="monthChange">
<el-radio v-for="(item, index) in dateList" :key="index" :label="item.id" border>{{ item.name
}}</el-radio>
</el-radio-group>
<el-date-picker class="m-l-10" v-model="date" align="right" unlink-panels type="daterange"
start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
clearable></el-date-picker>
start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable
@change="dateChange"></el-date-picker>
</li>
<li>
<label>评阅阶段</label>
@ -80,7 +80,6 @@ import Setup from './setup'
import Progress from './progress'
import Util from '@/libs/util'
import Setting from '@/setting'
import Const from '@/const/ques'
import Qs from 'qs'
import dayjs from 'dayjs'
export default {
@ -145,8 +144,8 @@ export default {
},
],
date: [],
filter: {
month: '',
filter: {
startTime: '',
endTime: '',
reviewStage: '',
@ -168,24 +167,6 @@ export default {
};
},
watch: {
'filter.month': function (val) {
if (val) {
let unit = 24 * 60 * 60 * 1000
this.date = [dayjs(new Date(Date.now() - unit * 30 * val)).format('YYYY-MM-DD'), dayjs(new Date(Date.now() + unit)).format('YYYY-MM-DD')]
} else {
this.date = []
}
},
date: function (val) {
if (val) {
this.filter.startTime = val[0]
this.filter.endTime = val[1]
} else {
this.filter.startTime = ''
this.filter.endTime = ''
}
this.initData()
},
'filter.keyWord': function () {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(this.initData, 500)
@ -200,12 +181,12 @@ export default {
if (query.page) {
const { month, startTime, endTime, reviewStage, reviewStatus, taskAllocationStatus, keyWord } = query
this.filter = {
month: !startTime && month ? +month : '',
reviewStage: reviewStage ? +reviewStage : '',
reviewStatus: reviewStatus ? +reviewStatus : '',
taskAllocationStatus: taskAllocationStatus ? +taskAllocationStatus : '',
keyWord: keyWord || '',
}
this.month = !startTime && month !== '' ? +month : ''
if (startTime) this.date = [startTime, endTime]
this.$router.push(`/allocationReview`).catch(() => { })
@ -219,6 +200,7 @@ export default {
this.loading = true
const { pageList } = await this.$post(this.api.reviewSettingsList, {
...this.filter,
isTimed: this.month === 0 ? 1 : 0,
pageNum: this.page,
pageSize: this.pageSize,
platformSource: 0,
@ -280,12 +262,35 @@ export default {
},
//
async getNow () {
if (!this.now) {
this.now = await Util.getNow()
clearInterval(this.timer)
this.timer = setInterval(() => {
this.now = new Date(this.now.setSeconds(this.now.getSeconds() + 1))
this.handleStage()
}, 1000)
}
},
//
monthChange (val) {
if (val) {
const unit = 24 * 60 * 60 * 1000
this.date = [dayjs(new Date(Date.now() - unit * 30 * val)).format('YYYY-MM-DD'), dayjs(new Date(Date.now() + unit)).format('YYYY-MM-DD')]
} else {
this.date = []
}
this.dateChange(this.date)
},
//
dateChange (val) {
if (val && val.length) {
this.filter.startTime = val[0]
this.filter.endTime = val[1]
} else {
this.filter.startTime = ''
this.filter.endTime = ''
}
this.initData()
},
//
@ -301,7 +306,7 @@ export default {
toTask (row) {
this.$store.commit('user/setReferrer', {
i: 1,
url: `${this.$route.path}?${Qs.stringify(this.filter)}&page=${this.page}&pageSize=${this.pageSize}`
url: `${this.$route.path}?${Qs.stringify(this.filter)}&month=${this.month}&page=${this.page}&pageSize=${this.pageSize}`
})
localStorage.setItem('reviewRow', JSON.stringify(row))
this.$router.push(`records?competitionId=${row.id}&stageId=${row.stageId}`)

@ -156,12 +156,13 @@ export default {
async init () {
this.form = _.cloneDeep(this.originForm)
this.timed = []
const { row } = this
//
if (!this.row.resultsDetails && this.row.hasManualScoreType) {
if (!row.resultsDetails && row.hasManualScoreType) {
const now = await Util.getNow()
this.timed = [dayjs(now).format('YYYY-MM-DD HH:mm:ss'), '']
}
this.form.isTimed = this.row.resultsDetails ? 0 : 1 //
this.form.isTimed = row.resultsDetails ? 0 : 1 //
this.getDetail()
},

@ -7,7 +7,7 @@
<li>
<label>省份</label>
<el-select v-model="filter.provinceId" clearable placeholder="请选择省份" @change="provinceChange"
@clear="clearprovince">
@clear="clearProvince">
<el-option v-for="(item, i) in provinces" :key="i" :label="item.provinceName"
:value="item.provinceId"></el-option>
</el-select>
@ -15,7 +15,7 @@
<li>
<label>城市</label>
<el-select v-model="filter.cityId" clearable placeholder="请选择城市" :disabled="!filter.provinceId"
@clear="clearcity" @change="cityChange">
@clear="clearCity" @change="cityChange">
<el-option v-for="(item, i) in cities" :key="i" :label="item.cityName" :value="item.cityId"></el-option>
</el-select>
</li>
@ -237,25 +237,28 @@ export default {
this.provinces = list
},
//
clearprovince () {
clearProvince () {
this.filter.cityId = ''
this.filter.realSchoolId = ''
},
//
provinceChange () {
this.clearprovince()
this.clearProvince()
this.getCity()
this.initData()
},
//
async getCity () {
const id = this.filter.provinceId
if (id) {
const { list } = await this.$get(this.api.queryCity, {
provinceId: this.filter.provinceId
provinceId: id
})
this.cities = list
}
},
//
clearcity () {
clearCity () {
this.filter.realSchoolId = ''
},
//
@ -266,11 +269,14 @@ export default {
},
//
async getSchool () {
const { provinceId, cityId } = this.filter
if (cityId) {
const { list } = await this.$get(this.api.querySchoolByReadAndAppraise, {
provinceId: this.filter.provinceId,
cityId: this.filter.cityId,
provinceId,
cityId,
})
this.schools = list
}
},

@ -10,8 +10,8 @@
}}</el-radio>
</el-radio-group>
<el-date-picker class="m-l-10" v-model="date" align="right" unlink-panels type="daterange"
start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
clearable></el-date-picker>
start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable
@change="dateChange"></el-date-picker>
</li>
<li>
<label>评阅阶段</label>
@ -124,7 +124,7 @@ export default {
endTime: '',
evaluationResult: '',
evaluationStatus: '',
keyWord: '',
keyword: '',
},
now: '',
timer: null,
@ -135,17 +135,7 @@ export default {
};
},
watch: {
date: function (val) {
if (val) {
this.filter.startTime = val[0]
this.filter.endTime = val[1]
} else {
this.filter.startTime = ''
this.filter.endTime = ''
}
this.initData()
},
'filter.keyWord': function () {
'filter.keyword': function () {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(this.initData, 500)
},
@ -157,13 +147,13 @@ export default {
const { query } = this.$route
if (query.page) {
const { month, startTime, endTime, evaluationResult, evaluationStatus, keyWord } = query
const { month, startTime, endTime, evaluationResult, evaluationStatus, keyword } = query
this.filter = {
evaluationResult: evaluationResult ? +evaluationResult : '',
evaluationStatus: evaluationStatus ? +evaluationStatus : '',
keyWord: keyWord || '',
keyword: keyword || '',
}
this.month = !startTime && month ? +month : ''
this.month = !startTime && month !== '' ? +month : ''
if (startTime) this.date = [startTime, endTime]
this.$router.push(`/myReview`).catch(() => { })
@ -235,12 +225,14 @@ export default {
},
//
async getNow () {
if (!this.now) {
this.now = await Util.getNow()
clearInterval(this.timer)
this.timer = setInterval(() => {
this.now = new Date(this.now.setSeconds(this.now.getSeconds() + 1))
this.handleStage()
}, 1000)
}
},
//
monthChange (val) {
@ -249,15 +241,26 @@ export default {
this.date = [dayjs(new Date(Date.now() - unit * 30 * val)).format('YYYY-MM-DD'), dayjs(new Date(Date.now() + unit)).format('YYYY-MM-DD')]
} else {
this.date = []
// this.initData()
}
this.dateChange(this.date)
},
//
dateChange (val) {
if (val && val.length) {
this.filter.startTime = val[0]
this.filter.endTime = val[1]
} else {
this.filter.startTime = ''
this.filter.endTime = ''
}
this.initData()
},
//
toReview (row) {
this.$store.commit('user/setReferrer', {
i: 1,
url: `${this.$route.path}?${Qs.stringify(this.filter)}&page=${this.page}&pageSize=${this.pageSize}`
url: `${this.$route.path}?${Qs.stringify(this.filter)}&month=${this.month}&page=${this.page}&pageSize=${this.pageSize}`
})
this.$router.push(`records?competitionId=${row.competitionId}&stageId=${row.stageId}`)
},

@ -8,7 +8,7 @@
<li>
<label>省份</label>
<el-select v-model="filter.provinceId" clearable placeholder="请选择省份" @change="provinceChange"
@clear="clearprovince">
@clear="clearProvince">
<el-option v-for="(item, i) in provinces" :key="i" :label="item.provinceName"
:value="item.provinceId"></el-option>
</el-select>
@ -16,7 +16,7 @@
<li>
<label>城市</label>
<el-select v-model="filter.cityId" clearable placeholder="请选择城市" :disabled="!filter.provinceId"
@clear="clearcity" @change="cityChange">
@clear="clearCity" @change="cityChange">
<el-option v-for="(item, i) in cities" :key="i" :label="item.cityName" :value="item.cityId"></el-option>
</el-select>
</li>
@ -228,40 +228,46 @@ export default {
this.provinces = list
},
//
clearprovince () {
clearProvince () {
this.filter.cityId = ''
this.filter.realSchoolId = ''
},
//
provinceChange () {
this.clearprovince()
this.clearProvince()
this.getCity()
this.initData()
},
//
async getCity () {
const id = this.filter.provinceId
if (id) {
const { list } = await this.$get(this.api.queryCity, {
provinceId: this.filter.provinceId
provinceId: id
})
this.cities = list
}
},
//
clearcity () {
this.filter.schoolId = ''
clearCity () {
this.filter.realSchoolId = ''
},
//
cityChange () {
this.filter.schoolId = ''
this.filter.realSchoolId = ''
this.getSchool()
this.initData()
},
//
async getSchool () {
const { provinceId, cityId } = this.filter
if (cityId) {
const { list } = await this.$get(this.api.querySchoolByReadAndAppraise, {
provinceId: this.filter.provinceId,
cityId: this.filter.cityId,
provinceId,
cityId,
})
this.schools = list
}
},
//

@ -30,7 +30,8 @@
<template v-for="(ques, j) in item.userAnswerList">
<li v-if="!sheetStatus || sheetStatus === ques.isCorrect" :key="j" :class="'status' + ques.isCorrect"
@click="scrollToQues(ques, item)">
<p :class="['serial', { answered: ques.answered, partAnswer: ques.partAnswer }]">{{ j + 1 }}</p>
<p :class="['serial', { answered: ques.answered, partAnswer: ques.partAnswer }]">{{
ques.serialNumber }}</p>
<p class="score">{{ ques.originUserScore }}</p>
</li>
</template>
@ -56,7 +57,7 @@
<div v-for="(ques, j) in item.userAnswerList" :key="j" class="item" :id="'ques' + ques.id">
<div class="stem-wrap">
<div class="labels">
<span class="label">{{ j + 1 }} / {{ item.questionNum }}</span>
<span class="label">{{ ques.serialNumber }} / {{ item.questionNum }}</span>
<span class="label">{{ item.questionTypeName }}</span>
</div>
<el-tag class="m-r-5" :type="ques.difficultTheme">{{ ques.difficult }}</el-tag>
@ -103,7 +104,7 @@
<div v-else>暂无解析</div>
</div>
<div :class="['ques-info', { essay: item.questionType === 'essay' }]">
<div :class="['ques-info', { essay: item.questionType === 'essay' && ques.reviewScore === '' }]">
<template v-if="item.questionType === 'essay'">
<div class="line">
<span class="line-label">参考答案</span>
@ -273,10 +274,11 @@ export default {
};
},
mounted () {
this.getData()
this.switchRecord(0, 1)
this.getData(1)
},
methods: {
async getData () {
async getData (init) {
this.loading = true
try {
const { userAnswers: outline, report } = await this.$get(`${this.api.reviewTheDetailsReport}?reportId=${this.reportId}&status=${this.curReview}`)
@ -351,8 +353,8 @@ export default {
n.isCorrect = n.userScore && n.questionScore === n.userScore ? 1 : (rightLen ? 3 : 2)
} else if (type === 'essay') { //
if (!n.userScore) n.userScore = ''
if (!n.reviewScore) n.reviewScore = ''
n.isCorrect = 4 //
if (isNaN(n.reviewScore)) n.reviewScore = ''
this.handleEssayScore(n)
}
n.originUserScore = n.reviewScore
n.newComments = n.comments || ''
@ -360,7 +362,12 @@ export default {
paper.push(e)
}
})
//
if (!paper.length && init) {
this.curReview = 1
this.getData()
return false
}
this.paper = paper
this.loading = false
@ -368,13 +375,17 @@ export default {
this.loading = false
}
},
//
handleEssayScore (n) {
n.isCorrect = n.reviewScore === '' ? 4 : (n.reviewScore === n.questionScore ? 1 : n.reviewScore ? 3 : 2) // reviewScore 0
},
scrollToSmooth (position, duration) {
let startTime = Date.now()
function scroll () {
let now = Date.now()
let progress = Math.min(1, (now - startTime) / duration)
document.querySelector('#right').scrollTo(0, position * progress)
document.querySelector('#quesWrap').scrollTo(0, position * progress)
if (progress < 1) {
window.requestAnimationFrame(scroll)
@ -388,7 +399,7 @@ export default {
item.shrink = false
const el = document.querySelector('#ques' + e.id)
this.$nextTick(() => {
el && this.scrollToSmooth(el.offsetTop - document.querySelector('#right').offsetTop, 200)
el && this.scrollToSmooth(el.offsetTop - document.querySelector('#quesWrap').offsetTop, 200)
})
},
//
@ -427,6 +438,7 @@ export default {
reviewScore: ques.reviewScore,
}])
ques.originUserScore = ques.reviewScore
this.handleEssayScore(ques)
Util.successMsg('保存成功')
},
//
@ -466,21 +478,53 @@ export default {
Util.successMsg('删除成功')
},
//
async handleLeave (cb) {
const { paper } = this
let invalid = 0
for (const e of paper) {
if (e.userAnswerList.some(n => n.originUserScore !== n.reviewScore)) {
invalid = 1
break
}
}
if (invalid) {
try {
await this.$confirm('还有未保存的分数,是否保存并继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
closeOnClickModal: false,
})
await this.saveAll()
cb()
} catch (e) { }
} else {
cb()
}
},
//
async switchRecord (isNext) {
async switchRecord (isNext, init) {
this.handleLeave(async () => {
const res = await this.$post(this.api.getTheLabReportIdUpAndDown, {
competitionId: this.competitionId,
stageId: this.stageId,
currentReportId: this.reportId
})
this.showNext = !init && !isNext && res.previousReportId ? true : (init ? !!res.nextReportId : !!res.nextNextReportId)
this.showPrev = !init && isNext && res.nextReportId ? true : (init ? !!res.previousReportId : !!res.previousPreviousReportId)
if (!init) {
const id = res[isNext ? 'nextReportId' : 'previousReportId']
this.showNext = !!res.nextReportId
this.showPrev = !!res.previousReportId
if (id) {
this.reportId = id
this.$router.push(`/theoryReview?id=${id}&u=${this.showUserInfo}&c=${this.competitionId}&s=${this.stageId}`)
this.$router.push(`/theoryReview?id=${id}&u=${this.showUserInfo}&m=${this.hasManualScoreType}&c=${this.competitionId}&s=${this.stageId}`)
this.getData()
}
}
})
},
//
async saveAll () {
@ -495,6 +539,8 @@ export default {
assignmentDetailId: n.assignmentDetailId,
reviewScore: n.reviewScore,
})
n.originUserScore = n.reviewScore
this.handleEssayScore(n)
})
})
if (params.length) await this.$post(this.api.reviewPaper, params)
@ -504,7 +550,7 @@ export default {
}
},
close () {
window.close()
this.handleLeave(window.close)
},
}
};
@ -833,7 +879,7 @@ export default {
}
.stem {
max-width: calc(100% - 207px);
max-width: calc(100% - 216px);
}
.ques-info {
@ -853,6 +899,7 @@ export default {
color: #fff;
background-color: #fe9f0a;
transform: rotate(45deg);
opacity: .7;
}
}
}

Loading…
Cancel
Save