Files
dvcp_v2_webapp/project/qujing/app/AppExaminationManage/components/Detail.vue
yanran200730 403dfeb725 优化
2023-02-20 10:27:27 +08:00

132 lines
4.2 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<ai-detail class="AppExaminationManage-detail">
<template slot="title">
<ai-title title="考试详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
</ai-title>
</template>
<template slot="content">
<ai-card title="基本信息">
<template #content>
<ai-wrapper
label-width="120px">
<ai-info-item label="考试名称" :value="info.examinationName"></ai-info-item>
<ai-info-item label="排序" :value="info.showIndex"></ai-info-item>
<ai-info-item label="成绩评核" isLine :value="assessmentsName"></ai-info-item>
<ai-info-item label="选题方式" isLine :value="dict.getLabel('qjEIChooseType', info.chooseType)">
</ai-info-item>
<ai-info-item label="试题总数" :value="info.questions && info.questions.length"></ai-info-item>
<ai-info-item label="总分数" :value="info.subjectScore"></ai-info-item>
<ai-info-item label="考试人数" :value="info.examinationNumber"></ai-info-item>
<ai-info-item label="通过人数" :value="info.passNumber"></ai-info-item>
<ai-info-item label="状态" :value="dict.getLabel('qjEIStatus', info.status)"></ai-info-item>
</ai-wrapper>
</template>
</ai-card>
<ai-card title="试题" v-if="info.questions && info.questions.length">
<template #content>
<ai-wrapper
class="topic-item"
v-for="(item, index) in info.questions"
:key="index"
label-width="120px">
<ai-info-item label="题目描述" isLine :value="item.title"></ai-info-item>
<ai-info-item label="题目类型" :value="dict.getLabel('qjQBType', item.type)"></ai-info-item>
<ai-info-item label="正确答案" :value="item.answer"></ai-info-item>
<ai-info-item label="题目选项" isLine>
<div class="">
<div class="options" v-for="(e, index) in item.items" :key="index">
<span>{{ e.sort }}</span>
<span>{{ e.content }}</span>
</div>
</div>
</ai-info-item>
<ai-info-item label="答案解析" isLine>
<AiArticle :value="item.analysis"></AiArticle>
</ai-info-item>
</ai-wrapper>
</template>
</ai-card>
</template>
</ai-detail>
</template>
<script>
export default {
name: 'Detail',
props: {
instance: Function,
dict: Object,
params: Object
},
data () {
return {
info: {},
id: '',
assessmentsName: '',
sort: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I']
}
},
created () {
this.dict.load(['qjQBType', 'qjEIChooseType', 'qjEACondition', 'qjEAType', 'qjEIStatus']).then(() => {
if (this.params && this.params.id) {
this.id = this.params.id
this.getInfo(this.params.id)
}
})
},
methods: {
getInfo (id) {
this.instance.post(`/app/appexaminationinfo/queryDetailById?id=${id}`).then(res => {
if (res.code === 0) {
this.info = {
...res.data,
questions: res.data.questions.map(v => {
let answer = []
v.items.forEach((e, index) => {
if (e.checked === '1') {
answer.push(this.sort[index])
}
})
return {
...v,
answer: answer.join(',')
}
})
}
this.assessmentsName = res.data.assessments.map(v => {
return `${this.dict.getLabel('qjEAType', v.assessmentType)} ${this.dict.getLabel('qjEACondition', v.upCondition)} ${v.upScore} `
}).join('、')
}
})
},
cancel (isRefresh) {
this.$emit('change', {
type: 'List',
isRefresh: !!isRefresh
})
}
}
}
</script>
<style scoped lang="scss">
.AppExaminationManage-detail .topic-item {
padding: 40px 0 0;
border-bottom: 1px solid #eee;
&:first-child {
padding-top: 0;
}
&:last-child {
border: none;
}
}
</style>