bug
This commit is contained in:
@@ -19,26 +19,17 @@
|
||||
<span class="type-name">{{ dict.getLabel('qjEAType', item.assessmentType) }}</span>
|
||||
<ai-select
|
||||
style="width: 180px;"
|
||||
v-model="item.qjEACondition"
|
||||
v-model="item.upCondition"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
:selectList="dict.getDict('qjEACondition')">
|
||||
</ai-select>
|
||||
<el-input size="small" style="width: 180px;" v-model="item.upScore" placeholder="请输入"></el-input>
|
||||
<span>且</span>
|
||||
<ai-select
|
||||
style="width: 180px;"
|
||||
v-model="item.downCondition"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
:selectList="dict.getDict('qjEACondition')">
|
||||
</ai-select>
|
||||
<el-input size="small" style="width: 180px;" v-model="item.downScore" placeholder="请输入"></el-input>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item prop="chooseType" label="选题方式" :rules="[{required: true, message: '请选择选题方式', trigger: 'change'}]">
|
||||
<el-radio-group v-model="form.chooseType">
|
||||
<el-radio-group v-model="form.chooseType" @change="form.questions = []">
|
||||
<el-radio :label="item.dictValue" :key="item.dictValue" v-for="item in dict.getDict('qjEIChooseType')">{{ item.dictName }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
@@ -53,7 +44,7 @@
|
||||
</div>
|
||||
<div class="form-item">
|
||||
<span>每题分数</span>
|
||||
<el-input-number size="small" v-model="item.eachScore" :min="0"></el-input-number>
|
||||
<el-input-number size="small" v-model="item.eachScore" :min="0"></el-input-number>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -65,6 +56,7 @@
|
||||
</el-form>
|
||||
<ai-dialog
|
||||
:visible.sync="isShow"
|
||||
@onConfirm="onConfirm"
|
||||
width="890px"
|
||||
title="选择试题">
|
||||
<ai-search-bar class="search-bar">
|
||||
@@ -105,7 +97,7 @@
|
||||
:page-size="search.size"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
layout="slot,->, prev, pager, next, sizes, jumper"
|
||||
:pager-count="search.current"
|
||||
:pager-count="7"
|
||||
@size-change="getList"
|
||||
@current-change="getList">
|
||||
<!-- <div class="paginationPre" v-if="isMultiple">
|
||||
@@ -115,6 +107,31 @@
|
||||
</ai-dialog>
|
||||
</template>
|
||||
</ai-card>
|
||||
|
||||
<ai-card title="试题" v-if="form.questions.length">
|
||||
<template #content>
|
||||
<ai-wrapper
|
||||
class="topic-item"
|
||||
v-for="(item, index) in form.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>
|
||||
<template #footer>
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
@@ -136,35 +153,28 @@
|
||||
return {
|
||||
info: {},
|
||||
form: {
|
||||
examinationName: '',
|
||||
title: '',
|
||||
showIndex: '',
|
||||
chooseType: '0',
|
||||
questions: [],
|
||||
assessments: [{
|
||||
assessmentType: '0',
|
||||
downCondition: '',
|
||||
downScore: '',
|
||||
status: '',
|
||||
upCondition: '',
|
||||
upScore: ''
|
||||
}, {
|
||||
assessmentType: '1',
|
||||
downCondition: '',
|
||||
downScore: '',
|
||||
status: '',
|
||||
upCondition: '',
|
||||
upScore: ''
|
||||
}, {
|
||||
assessmentType: '2',
|
||||
downCondition: '',
|
||||
downScore: '',
|
||||
status: '',
|
||||
upCondition: '',
|
||||
upScore: ''
|
||||
}, {
|
||||
assessmentType: '3',
|
||||
downCondition: '',
|
||||
downScore: '',
|
||||
status: '',
|
||||
upCondition: '',
|
||||
upScore: ''
|
||||
@@ -201,6 +211,17 @@
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
answerTotal () {
|
||||
let subjectNumber = 0
|
||||
this.form.subjectConfigs.forEach(v => {
|
||||
subjectNumber = Number(v.subjectNumber) + subjectNumber
|
||||
})
|
||||
|
||||
return subjectNumber
|
||||
}
|
||||
},
|
||||
|
||||
created () {
|
||||
this.getList()
|
||||
this.dict.load(['qjQBType', 'qjEIChooseType', 'qjEACondition', 'qjEAType']).then(() => {
|
||||
@@ -213,30 +234,31 @@
|
||||
|
||||
methods: {
|
||||
getInfo (id) {
|
||||
this.instance.post(`/app/appcontentinfo/queryDetailById?id=${id}`).then(res => {
|
||||
this.instance.post(`/app/appexaminationinfo/queryDetailById?id=${id}`).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.form = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
onChange (e) {
|
||||
onChange () {
|
||||
this.getList()
|
||||
this.initChoose()
|
||||
},
|
||||
|
||||
initChoose () {
|
||||
console.log(1)
|
||||
this.ids.forEach(v => {
|
||||
this.$refs.aitable.toggleRowSelection(v, true)
|
||||
onConfirm () {
|
||||
if (this.ids.length !== this.answerTotal) {
|
||||
return this.$message.error(`请选择${this.answerTotal}道题目`)
|
||||
}
|
||||
|
||||
this.instance.post(`/app/appquestionbank/queryDetailByIds`, this.ids).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.form.questions = res.data
|
||||
|
||||
this.isShow = false
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
handleSelectionChange (e) {
|
||||
this.ids = e
|
||||
console.log(this.ids)
|
||||
},
|
||||
|
||||
getList() {
|
||||
this.instance.post(`/app/appquestionbank/list`, null, {
|
||||
params: {
|
||||
@@ -272,7 +294,12 @@
|
||||
|
||||
this.instance.post(`/app/appquestionbank/randomChoose`, this.form.subjectConfigs).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.form.questions = res.data
|
||||
this.form.questions = res.data.map(v => {
|
||||
return {
|
||||
...v,
|
||||
answer: v.items.filter(v => v.checked === '1').map(v => v.content).join(',')
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -280,6 +307,20 @@
|
||||
confirm () {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
let subjectNumber = 0
|
||||
let eachScore = 0
|
||||
this.form.subjectConfigs.forEach(v => {
|
||||
eachScore = Number(v.eachScore) + eachScore
|
||||
subjectNumber = Number(v.subjectNumber) + subjectNumber
|
||||
})
|
||||
if (subjectNumber === 0 || eachScore === 0) {
|
||||
return this.$message.error('请进行题目设置')
|
||||
}
|
||||
|
||||
if (!this.form.questions.length) {
|
||||
return this.$message.error('请选择试题')
|
||||
}
|
||||
|
||||
this.instance.post(`/app/appexaminationinfo/addOrUpdate`, {
|
||||
...this.form,
|
||||
id: this.params.id || ''
|
||||
@@ -307,6 +348,19 @@
|
||||
|
||||
<style scoped lang="scss">
|
||||
.AppExaminationManage {
|
||||
.topic-item {
|
||||
padding: 40px 0 0;
|
||||
border-bottom: 1px solid #eee;
|
||||
|
||||
&:first-child {
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
|
||||
.el-checkbox-group {
|
||||
width: 100%;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user