安全教育(wifi安全教育):回显问题
This commit is contained in:
parent
1a20c2e9aa
commit
7d21a6787f
@ -132,9 +132,9 @@
|
||||
<el-form-item :label="$t('message.safetyEducation.testQuestionType')" prop="questionType">
|
||||
<el-select v-model="addFormData.questionType" placeholder="试题类型">
|
||||
<!-- 单选题 -->
|
||||
<el-option :label="$t('message.safetyEducation.singleChoice')" :value="'1'"></el-option>
|
||||
<el-option :label="$t('message.safetyEducation.singleChoice')" :value="1"></el-option>
|
||||
<!-- 多选题 -->
|
||||
<el-option :label="$t('message.safetyEducation.multipleChoice')" :value="'2'"> </el-option>
|
||||
<el-option :label="$t('message.safetyEducation.multipleChoice')" :value="2"> </el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="试题名称" prop="questionName">
|
||||
@ -430,16 +430,17 @@ export default {
|
||||
this.isAdd=false
|
||||
this.$nextTick(()=>{
|
||||
this.addFormData=JSON.parse(JSON.stringify(row))
|
||||
var optionList=this.addFormData.optionlist
|
||||
console.log('=======回显的数据',this.addFormData)
|
||||
var optionList=row.optionlist
|
||||
this.addFormData.optionList=optionList
|
||||
// this.questionIndex=index
|
||||
// 多选的回显
|
||||
if(row.questionType == 2){
|
||||
optionList.forEach((element,index) => {
|
||||
if(element.correctType==1){
|
||||
this.addEditForm.optionList[index].correctType=true
|
||||
this.addFormData.optionList[index].correctType=true
|
||||
}else{
|
||||
this.addEditForm.optionList[index].correctType=false
|
||||
this.addFormData.optionList[index].correctType=false
|
||||
}
|
||||
});
|
||||
}else{
|
||||
@ -506,8 +507,9 @@ export default {
|
||||
}
|
||||
},
|
||||
resetForm(){
|
||||
this.radio1 = -1,
|
||||
this.addFormData = {
|
||||
questionType: 1,
|
||||
questionType: "",
|
||||
questionName: "",
|
||||
questionAnalysis: "",
|
||||
questionScore:"",
|
||||
@ -539,6 +541,10 @@ export default {
|
||||
this.showDialog = true
|
||||
this.isAdd=true
|
||||
this.dialogTitle = "新增试题"
|
||||
this.$nextTick(()=>{
|
||||
this.$refs['add_form'].resetFields();
|
||||
this.resetForm()
|
||||
})
|
||||
},
|
||||
removeOptions(index){
|
||||
if(this.addFormData.optionList.length < 3){
|
||||
@ -583,7 +589,8 @@ export default {
|
||||
justify-content: flex-start;
|
||||
margin: 10px 15px 0;
|
||||
.answers_item{
|
||||
width: 25%;
|
||||
flex:1;
|
||||
// width: 25%;
|
||||
margin: 0;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user