考试管理

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, handleClick: this.handleEdit,
type: 'primary', type: 'primary',
showControl: row => { 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' } }) this.$router.push({ path: `/info/examRule/draft/add/0`, query: { source: 'org' } })
}, },
handleLock(index, data) { handleLock(index, data) {
console.log(data) lockPaper(data.id)
debugger
lockPaper(data)
.then(res => { .then(res => {
this.examRefresh() this.examRefresh()
this.$message.success('封存试卷成功!') this.$message.success('封存试卷成功!')
@ -203,7 +201,7 @@ export default {
type: 'warning', type: 'warning',
}) })
.then(() => { .then(() => {
setExamEfficacy(data) unlockPaper(data.id)
.then(res => { .then(res => {
this.examRefresh() this.examRefresh()
this.$message({ this.$message({
@ -223,7 +221,24 @@ export default {
}) })
.catch(() => {}) .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() { examRefresh() {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.examQueryListPage.refresh(true) this.$refs.examQueryListPage.refresh(true)

View File

@ -25,7 +25,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="score" :label="$t('publish.eachScore')" width="100" /> <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"> <template slot-scope="scope">
<span>{{ Number(scope.row.amount) * Number(scope.row.score) }}</span> <span>{{ Number(scope.row.amount) * Number(scope.row.score) }}</span>
</template> </template>
@ -96,7 +96,6 @@ export default {
created() {}, created() {},
methods: { methods: {
handleAdd() { handleAdd() {
this.changeCourseDisable()
this.$refs.addRule.show() this.$refs.addRule.show()
}, },
handleRuleSubmit(formData, isEdit) { handleRuleSubmit(formData, isEdit) {
@ -117,34 +116,11 @@ export default {
const index = data.$index const index = data.$index
this.ruleList.splice(index, 1) 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() { checkTotolScores() {
return this.currentTotalScore === this.examData.fullScore return this.currentTotalScore === this.examData.fullScore
}, },
editRow(data) { editRow(data) {
this.changeCourseDisable()
this.editingIndex = data.$index this.editingIndex = data.$index
const list = JSON.stringify(data.row) const list = JSON.stringify(data.row)
const detail = JSON.parse(list) const detail = JSON.parse(list)