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.
103 lines
3.3 KiB
103 lines
3.3 KiB
<template> |
|
<el-dialog title="提示" :visible.sync="listVisible" width="800px" :close-on-click-modal="false" :show-close="false" |
|
@closed="closeDia"> |
|
<el-alert title="以下试题在试卷中疑似出现重复,是否要继续发布!" type="warning" effect="dark" :closable="false" /> |
|
<el-table class="m-t-10" :data="data" stripe header-align="center" row-key="id"> |
|
<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="240"> |
|
<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> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
<el-button type="primary" @click="check">检查一下</el-button> |
|
<el-button @click="submit">继续发布</el-button> |
|
</span> |
|
</el-dialog> |
|
</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]) |
|
}, |
|
// 移除 |
|
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) |
|
this.data.splice(i, 1) |
|
} 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 { list } = this |
|
this.$parent.form.paperOutline.map(e => { |
|
e.examQuestions.map(n => { |
|
if (list.find(m => m.questionVersionId === n.questionVersionId)) this.$set(n, 'repeat', true) |
|
}) |
|
}) |
|
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></style> |