考试管理

This commit is contained in:
Yuan 2022-10-17 16:18:25 +08:00
parent aa3bd6770f
commit 574dc69a3c
2 changed files with 23 additions and 32 deletions

View File

@ -123,7 +123,7 @@ export default {
handleClick: this.handleEdit,
type: 'primary',
showControl: row => {
return row.creatorId == this.userId
return row.creatorId == this.userId && row.state === 1
},
},
{
@ -185,9 +185,7 @@ export default {
this.$router.push({ path: `/info/examRule/draft/add/0`, query: { source: 'org' } })
},
handleLock(index, data) {
console.log(data)
debugger
lockPaper(data)
lockPaper(data.id)
.then(res => {
this.examRefresh()
this.$message.success('封存试卷成功!')
@ -203,7 +201,7 @@ export default {
type: 'warning',
})
.then(() => {
setExamEfficacy(data)
unlockPaper(data.id)
.then(res => {
this.examRefresh()
this.$message({
@ -223,7 +221,24 @@ export default {
})
.catch(() => {})
},
handleDelete(index, data) {},
handleDelete(index, data) {
this.$confirm('确定删除该试卷吗?', this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning',
})
.then(() => deletePaper(data.id))
.then(resp => {
this.examRefresh()
this.$message({
type: 'success',
message: '删除成功!',
})
})
.catch(res => {
this.$message({ type: 'error', message: '删除试卷失败!' })
})
},
examRefresh() {
this.$nextTick(() => {
this.$refs.examQueryListPage.refresh(true)

View File

@ -25,7 +25,7 @@
</template>
</el-table-column>
<el-table-column prop="score" :label="$t('publish.eachScore')" width="100" />
<el-table-column :label="$t('publish.totalScore')" width="100">
<el-table-column :label="$t('publish.totalScore')" width="90">
<template slot-scope="scope">
<span>{{ Number(scope.row.amount) * Number(scope.row.score) }}</span>
</template>
@ -96,7 +96,6 @@ export default {
created() {},
methods: {
handleAdd() {
this.changeCourseDisable()
this.$refs.addRule.show()
},
handleRuleSubmit(formData, isEdit) {
@ -117,34 +116,11 @@ export default {
const index = data.$index
this.ruleList.splice(index, 1)
},
//
changeCourseDisable() {
this.trainingTypeList.forEach(item => {
item.disabled = false
})
for (const val in this.operationTypeMap) {
this.operationTypeMap[val].forEach(item => {
item.disabled = false
})
}
this.ruleList.forEach(ele => {
this.trainingTypeList.forEach(item => {
if (ele.trainingType == item.value && !ele.operateType) {
item.disabled = true
}
})
;(this.operationTypeMap[ele.trainingType] || []).forEach(item => {
if (ele.operateType && ele.operateType == item.value) {
item.disabled = true
}
})
})
},
checkTotolScores() {
return this.currentTotalScore === this.examData.fullScore
},
editRow(data) {
this.changeCourseDisable()
this.editingIndex = data.$index
const list = JSON.stringify(data.row)
const detail = JSON.parse(list)