Kaynağa Gözat

同无同伴可有多个选项,未选中行禁用按钮

zhouna 6 yıl önce
ebeveyn
işleme
cbdb0771d3
1 değiştirilmiş dosya ile 5 ekleme ve 5 silme
  1. 5 5
      src/components/icss/SingleSelect.vue

+ 5 - 5
src/components/icss/SingleSelect.vue

@@ -3,16 +3,16 @@
         <el-form>
             <div class="operation-row">
                 <el-checkbox-group size="small" v-for="(it,i) in rows" v-if="type!=2&&(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=" !(ascription == 5 && type == 1 || type == 2)" :label="i" :disabled="hasNone==i||hasBan==i|| hasError==i || (hasDefault!=-1&&hasDefault!=i)">默认选中</el-checkbox-button>
+                    <el-checkbox-button  v-if=" !(ascription == 5 && type == 1 || type == 2)" :label="i" :disabled="hasNone==i||hasBan==i|| hasError==i || (hasDefault!=-1&&hasDefault!=i)||focusOn==-1">默认选中</el-checkbox-button>
                 </el-checkbox-group>
                 <el-checkbox-group size="small" v-for="(it,i) in rows" v-if="type!=1&&(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=" !(ascription == 5 && type == 1)" :label="i" :disabled="hasDefault==i||hasBan==i || hasError==i ||(hasNone!=-1&&hasNone!=i)">同“无”类型</el-checkbox-button>
+                    <el-checkbox-button  v-if=" !(ascription == 5 && type == 1)" :label="i" :disabled="hasBan==i || hasError==i ||focusOn==-1">同“无”类型</el-checkbox-button>
                 </el-checkbox-group>
                 <el-checkbox-group size="small" v-for="(it,i) in rows" v-if="type!=1&&(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=" !(ascription == 5 && type == 1)" :label="i" :disabled="hasDefault==i||hasNone==i || hasError==i||(hasBan!=-1&&hasBan!=i)">同“伴”类型</el-checkbox-button>
+                    <el-checkbox-button v-if=" !(ascription == 5 && type == 1)" :label="i" :disabled="hasNone==i || hasError==i||focusOn==-1">同“伴”类型</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].isError" @change="emitValues(i,'hasError',rows[i].isError)">
-                    <el-checkbox-button v-if="ascription==5  && type == 1" :label="i" :disabled="hasDefault==i||hasBan==i ||hasNone==i ||(hasError!=-1&&hasError==i)">标记异常选项</el-checkbox-button>
+                    <el-checkbox-button v-if="ascription==5  && type == 1" :label="i" :disabled="hasDefault==i||hasBan==i ||hasNone==i ||(hasError!=-1&&hasError==i)||focusOn==-1">标记异常选项</el-checkbox-button>
                 </el-checkbox-group>
                 <el-button type="danger" size="small" class="del" @click="delRow">删除</el-button>
             </div>
@@ -166,7 +166,7 @@
           this.focusOn = index;
 
         },
-        emitValues(i,type,flag){
+        emitValues(i,type,flag){console.log(this.rows,this.focusOn)
           if(typeof i =='number'&&this.focusOn == -1){
             this.$message({
               message: '请先选择要操作的行',