|
@@ -3,16 +3,16 @@
|
|
|
<el-form>
|
|
|
<div class="operation-row">
|
|
|
<el-checkbox-group size="small" v-for="(it,i) in rows" v-if="focusOn==i||(focusOn==-1&&i==0)" :key="1+i" v-model="rows[i].defaultSelect" @change="emitValues(i,'hasDefault',rows[i].defaultSelect)">
|
|
|
- <el-checkbox-button v-if=" dataPub.region1 != 5 || dataPub.region2 != 1" :label="i" :disabled="hasNone==i||hasBan==i|| hasCorrect==i || (hasDefault!=-1&&hasDefault!=i)">默认选中</el-checkbox-button>
|
|
|
+ <el-checkbox-button v-if=" ascription != 5 || type != 1" :label="i" :disabled="hasNone==i||hasBan==i|| hasCorrect==i || (hasDefault!=-1&&hasDefault!=i)">默认选中</el-checkbox-button>
|
|
|
</el-checkbox-group>
|
|
|
<el-checkbox-group size="small" v-for="(it,i) in rows" v-if="focusOn==i||(focusOn==-1&&i==0)" :key="2+i" v-model="rows[i].isNone" @change="emitValues(i,'hasNone',rows[i].isNone)">
|
|
|
- <el-checkbox-button v-if=" dataPub.region1 != 5 || dataPub.region2 != 1" :label="i" :disabled="hasDefault==i||hasBan==i || hasCorrect==i ||(hasNone!=-1&&hasNone!=i)">同“无”类型</el-checkbox-button>
|
|
|
+ <el-checkbox-button v-if=" ascription != 5 || type != 1" :label="i" :disabled="hasDefault==i||hasBan==i || hasCorrect==i ||(hasNone!=-1&&hasNone!=i)">同“无”类型</el-checkbox-button>
|
|
|
</el-checkbox-group>
|
|
|
<el-checkbox-group size="small" v-for="(it,i) in rows" v-if="focusOn==i||(focusOn==-1&&i==0)" :key="3+i" v-model="rows[i].isBan" @change="emitValues(i,'hasBan',rows[i].isBan)">
|
|
|
- <el-checkbox-button v-if=" dataPub.region1!=5 || dataPub.region2 != 1" :label="i" :disabled="hasDefault==i||hasNone==i || hasCorrect==i||(hasBan!=-1&&hasBan!=i)">同“伴”类型</el-checkbox-button>
|
|
|
+ <el-checkbox-button v-if=" ascription!=5 || type != 1" :label="i" :disabled="hasDefault==i||hasNone==i || hasCorrect==i||(hasBan!=-1&&hasBan!=i)">同“伴”类型</el-checkbox-button>
|
|
|
</el-checkbox-group>
|
|
|
<el-checkbox-group size="small" v-for="(it,i) in rows" v-if="focusOn==i||(focusOn==-1&&i==0)" :key="4+i" v-model="rows[i].isCorrect" @change="emitValues(i,'hasCorrect',rows[i].isCorrect)">
|
|
|
- <el-checkbox-button v-if="dataPub.region1==5 && dataPub.region2 == 1" :label="i" :disabled="hasDefault==i||hasBan==i ||hasNone==i ||(hasCorrect!=-1&&hasCorrect!=i)">标记正确选项</el-checkbox-button>
|
|
|
+ <el-checkbox-button v-if="ascription==5 && type == 1" :label="i" :disabled="hasDefault==i||hasBan==i ||hasNone==i ||(hasCorrect!=-1&&hasCorrect!=i)">标记正确选项</el-checkbox-button>
|
|
|
</el-checkbox-group>
|
|
|
<el-button type="danger" size="small" class="del" @click="delRow">删除</el-button>
|
|
|
</div>
|
|
@@ -82,7 +82,7 @@
|
|
|
<script>
|
|
|
import utils from '@api/utils.js';
|
|
|
export default {
|
|
|
- props:['type','options','dataPub'],
|
|
|
+ props:['type','options','ascription','sexType'],
|
|
|
data(){
|
|
|
return {
|
|
|
maps:{isBan:'同“伴”',isNone:'同“无”',defaultSelect:'默认选中',isCorrect:'正确选项'},
|
|
@@ -133,6 +133,29 @@
|
|
|
return index;
|
|
|
}
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ ascription(newVal, preVal) {
|
|
|
+ if (newVal != preVal) {
|
|
|
+ if (JSON.stringify(newVal) != JSON.stringify(preVal)) {
|
|
|
+ this.rows = [{name:'',defaultSelect:'',isBan:'',isNone:'',isCorrect:''},{name:'',defaultSelect:'',isBan:'',isNone:'',isCorrect:''},{name:'',defaultSelect:'',isBan:'',isNone:'',isCorrect:''},{name:'',defaultSelect:'',isBan:'',isNone:'',isCorrect:''}];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ type(newVal, preVal) {
|
|
|
+ if (newVal != preVal) {
|
|
|
+ if (JSON.stringify(newVal) != JSON.stringify(preVal)) {
|
|
|
+ this.rows = [{name:'',defaultSelect:'',isBan:'',isNone:'',isCorrect:''},{name:'',defaultSelect:'',isBan:'',isNone:'',isCorrect:''},{name:'',defaultSelect:'',isBan:'',isNone:'',isCorrect:''},{name:'',defaultSelect:'',isBan:'',isNone:'',isCorrect:''}];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ sexType(newVal, preVal) {
|
|
|
+ if (newVal != preVal) {
|
|
|
+ if (JSON.stringify(newVal) != JSON.stringify(preVal)) {
|
|
|
+ this.rows = [{name:'',defaultSelect:'',isBan:'',isNone:'',isCorrect:''},{name:'',defaultSelect:'',isBan:'',isNone:'',isCorrect:''},{name:'',defaultSelect:'',isBan:'',isNone:'',isCorrect:''},{name:'',defaultSelect:'',isBan:'',isNone:'',isCorrect:''}];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
methods:{
|
|
|
addRow(){
|
|
|
this.rows.push({name:'',defaultSelect:'',isBan:'',isNone:'',isCorrect:''});
|