新增试题多选单选回显问题修复
This commit is contained in:
parent
da4016a66e
commit
08c3e42165
@ -41,7 +41,7 @@ if (process.env.NODE_ENV == 'development') {
|
||||
// tag: 本地
|
||||
// axios.defaults.baseURL = 'http://192.168.34.174:6023/' // 老大本地
|
||||
// axios.defaults.baseURL = 'http://192.168.34.125:6023/' //杨意本地 http/1.1
|
||||
// axios.defaults.baseURL = 'http://192.168.34.216:6023/' // 邱平毅本地
|
||||
axios.defaults.baseURL = 'http://192.168.34.216:6023/' // 邱平毅本地
|
||||
// axios.defaults.baseURL ='http://124.71.67.160:8088/' //中建四局线上
|
||||
// axios.defaults.baseURL = 'http://192.168.34.125:6023/' //杨意本地 http/1.1
|
||||
// axios.defaults.baseURL ='http://47.97.202.104:6023/' //金林湾线上
|
||||
@ -50,7 +50,7 @@ if (process.env.NODE_ENV == 'development') {
|
||||
// axios.defaults.baseURL = 'http://47.97.202.104:6023/';
|
||||
// axios.defaults.baseURL = 'http://139.9.66.234:8/';
|
||||
// axios.defaults.baseURL = 'http://120.196.217.6:7000/'; // 鹤洲
|
||||
axios.defaults.baseURL = 'http://182.90.224.237:7000/'; // 广西
|
||||
// axios.defaults.baseURL = 'http://182.90.224.237:7000/'; // 广西
|
||||
// axios.defaults.baseURL = 'http://120.196.217.6:7000/' //鹤洲
|
||||
|
||||
// axios.defaults.baseURL = 'http://117.156.17.59:9090/'; //
|
||||
|
||||
@ -133,9 +133,11 @@
|
||||
<p>{{ $t("message.safetyEducation.noQuestions") }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<!-- $t('message.workType.operate')[type] -->
|
||||
<el-dialog
|
||||
:modal-append-to-body="false"
|
||||
:title="$t('message.workType.operate')[type]"
|
||||
|
||||
:title="qusTitle"
|
||||
:visible.sync="dialogVisible"
|
||||
width="667px"
|
||||
>
|
||||
@ -174,12 +176,12 @@
|
||||
<!-- 试题选项及答案 -->
|
||||
<el-form-item :label="$t('message.safetyEducation.optionsAndAnswers')"> </el-form-item>
|
||||
<!-- 单选 -->
|
||||
<el-radio-group v-model="radio1" @change="checkedVal">
|
||||
<el-radio-group v-model="radio1" v-if="radioShow" @change="checkedVal">
|
||||
<el-form-item
|
||||
prop="lsit"
|
||||
v-for="(item, index) in addEditForm.optionList"
|
||||
:key="index"
|
||||
v-if="addEditForm.questionType != '2'"
|
||||
v-show="addEditForm.questionType != '2'"
|
||||
>
|
||||
<template slot="label">
|
||||
<p>
|
||||
@ -202,7 +204,7 @@
|
||||
prop="lsit"
|
||||
v-for="(item, index) in addEditForm.optionList"
|
||||
:key="index"
|
||||
v-if="addEditForm.questionType == '2'"
|
||||
v-show="addEditForm.questionType == '2'"
|
||||
>
|
||||
<template slot="label">
|
||||
<p>
|
||||
@ -310,7 +312,9 @@ export default {
|
||||
props:['eduId','classifyId'],
|
||||
data() {
|
||||
return {
|
||||
radio1:'',
|
||||
qusTitle:"添加试题",
|
||||
radioShow:true,
|
||||
radio1:-1,
|
||||
styleType: 1,
|
||||
ruleForm: {
|
||||
eduAddr: "",
|
||||
@ -453,6 +457,14 @@ export default {
|
||||
// deep:true,
|
||||
// }
|
||||
// },
|
||||
watch:{
|
||||
'radio1':{
|
||||
handler(newVal,oldVal){
|
||||
console.log(newVal,oldVal)
|
||||
},
|
||||
immediate:true,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//生成二维码
|
||||
createQRcode(index){
|
||||
@ -511,23 +523,36 @@ export default {
|
||||
this.addEditForm.optionList.splice(index, 1);
|
||||
},
|
||||
editBefore(data,index){
|
||||
this.qusTitle = "编辑试题"
|
||||
this.dialogVisible=true
|
||||
console.log(data)
|
||||
|
||||
|
||||
console.log('编辑回显的信息',data)
|
||||
this.$nextTick(()=>{
|
||||
this.addEditForm=JSON.parse(JSON.stringify(data))
|
||||
var optionList=data.optionList
|
||||
this.questionIndex=index
|
||||
optionList.forEach((element,index) => {
|
||||
// 多选
|
||||
if(data.questionType == 2){
|
||||
optionList.forEach((element,index) => {
|
||||
if(element.correctType==1){
|
||||
this.addEditForm.optionList[index].correctType=true
|
||||
}else{
|
||||
this.addEditForm.optionList[index].correctType=false
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
});
|
||||
}else{
|
||||
optionList.forEach((item,index) => {
|
||||
if(item.correctType==1){
|
||||
this.radioShow =false
|
||||
this.$nextTick(()=>{
|
||||
this.radio1 = index
|
||||
this.radioShow = true
|
||||
})
|
||||
}else{
|
||||
this.radio1 = -1
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
deleteBefore(index){
|
||||
this.$confirm(this.$t('message.safetyEducation.determineDelete'), this.$t('message.safetyEducation.tips'), {
|
||||
@ -548,7 +573,7 @@ export default {
|
||||
|
||||
},
|
||||
checkedVal(val){
|
||||
console.log('当前选择的值',val)
|
||||
// console.log('当前选择的值',val)
|
||||
console.log('当前绑定的值',this.radio1)
|
||||
},
|
||||
saveQuesFn() {
|
||||
@ -602,7 +627,7 @@ export default {
|
||||
}else{
|
||||
this.ruleForm.questionList[this.questionIndex]=data
|
||||
}
|
||||
this.radio1=''
|
||||
this.radio1=-1
|
||||
this.dialogVisible=false
|
||||
this.computeTotalScore()
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user