You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
119 lines
3.7 KiB
119 lines
3.7 KiB
7 months ago
|
<template>
|
||
|
<el-drawer title="提示" :visible.sync="listVisible" size="800px" :close-on-press-escape="false" :wrapperClosable="false"
|
||
|
:show-close="false" custom-class="ques-dia" @closed="closeDia">
|
||
|
<div class="wrap p-20">
|
||
|
<el-alert title="以下试题在试卷中疑似出现重复,是否要继续发布!" type="warning" effect="dark" :closable="false" />
|
||
|
<el-table class="m-t-10" :data="data" stripe header-align="center" row-key="uuid">
|
||
|
<el-table-column prop="outlineName" label="大题名称" align="center" width="90"></el-table-column>
|
||
|
<el-table-column prop="serialNumber" label="题号" align="center" width="60"></el-table-column>
|
||
|
<el-table-column prop="stem" label="题干" align="center" min-width="120">
|
||
|
<template slot-scope="scope">
|
||
|
<div v-html="scope.row.stem"></div>
|
||
|
</template>
|
||
|
</el-table-column>
|
||
|
<el-table-column label="操作" align="center" width="140">
|
||
|
<template slot-scope="scope">
|
||
|
<el-button type="text" @click="toQues(scope.row)">详情</el-button>
|
||
|
<el-button type="text" @click="delQues(scope.row, scope.$index)">移除</el-button>
|
||
|
<!-- <el-button type="text" @click="switchQues(scope.row, scope.$index)">替换</el-button> -->
|
||
|
</template>
|
||
|
</el-table-column>
|
||
|
</el-table>
|
||
|
</div>
|
||
|
<div class="btns">
|
||
|
<el-button type="primary" @click="check">检查一下</el-button>
|
||
|
<el-button :loading="submiting" @click="submit">继续发布</el-button>
|
||
|
</div>
|
||
|
</el-drawer>
|
||
|
</template>
|
||
|
<script>
|
||
|
import _ from 'lodash'
|
||
|
export default {
|
||
|
props: ['visible', 'list'],
|
||
|
data () {
|
||
|
return {
|
||
|
listVisible: false,
|
||
|
data: [],
|
||
|
submiting: false,
|
||
|
};
|
||
|
},
|
||
|
watch: {
|
||
|
visible () {
|
||
|
this.listVisible = this.visible
|
||
|
this.visible && this.init()
|
||
|
}
|
||
|
},
|
||
|
mounted () {
|
||
|
|
||
|
},
|
||
|
methods: {
|
||
|
init () {
|
||
|
this.data = this.list
|
||
|
},
|
||
|
// 详情
|
||
|
toQues (row) {
|
||
|
const paper = this.$parent.form.paperOutline
|
||
|
this.$parent.toQues(paper[row.paperIndex], row.quesIndex, paper[row.paperIndex].examQuestions[row.quesIndex], 3)
|
||
|
},
|
||
|
// 移除
|
||
|
async delQues (row, i) {
|
||
|
try {
|
||
|
await this.$confirm(`确认要移除吗?`, '提示', {
|
||
|
confirmButtonText: '确定',
|
||
|
cancelButtonText: '取消',
|
||
|
type: 'warning',
|
||
|
closeOnClickModal: false,
|
||
|
})
|
||
|
this.$parent.delQues(this.$parent.form.paperOutline[row.paperIndex], row.quesIndex, 1)
|
||
|
|
||
|
const { data } = this
|
||
|
data.splice(i, 1)
|
||
|
data.map(e => e.repeat = false)
|
||
|
this.data = this.$parent.hasRepeatQues(data)
|
||
|
} catch (e) { }
|
||
|
},
|
||
|
// 替换
|
||
|
switchQues (row) {
|
||
|
const paper = this.$parent.form.paperOutline
|
||
|
this.$parent.showManualDia(paper[row.paperIndex], row.quesIndex, paper[row.paperIndex].examQuestions[row.quesIndex])
|
||
|
this.listVisible = false
|
||
|
},
|
||
|
// 检查一下
|
||
|
async check () {
|
||
|
const { data } = this
|
||
|
this.$parent.form.paperOutline.map(e => {
|
||
|
e.examQuestions.map(n => {
|
||
|
this.$set(n, 'repeat', !!data.find(m => m.questionVersionId === n.questionVersionId))
|
||
|
})
|
||
|
})
|
||
|
this.$parent.submiting = false
|
||
|
this.listVisible = false
|
||
|
},
|
||
|
// 提交
|
||
|
async submit () {
|
||
|
if (this.submiting) return false
|
||
|
this.submiting = true
|
||
|
await this.$parent.saveTestPaper()
|
||
|
this.submiting = false
|
||
|
},
|
||
|
// 弹框关闭回调
|
||
|
closeDia () {
|
||
|
this.$parent.submiting = false
|
||
|
this.$emit('update:visible', false)
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
</script>
|
||
|
|
||
|
<style lang="scss" scoped>
|
||
|
/deep/.ques-dia {
|
||
|
.el-drawer__header {
|
||
|
margin-bottom: 0;
|
||
|
}
|
||
|
|
||
|
.wrap {
|
||
|
max-height: calc(100vh - 110px);
|
||
|
overflow: auto;
|
||
|
}
|
||
|
}
|
||
|
</style>
|