zhuliu vor 2 Jahren
Ursprung
Commit
d7d6a10cdf
1 geänderte Dateien mit 19 neuen und 3 gelöschten Zeilen
  1. 19 3
      RMS-FrontEnd/src/views/report/Invalid/InvalidPage/Claims.vue

+ 19 - 3
RMS-FrontEnd/src/views/report/Invalid/InvalidPage/Claims.vue

@@ -57,7 +57,7 @@
           <template slot-scope="scope" >
             <el-checkbox-group v-model="checkList" >
 
-                <el-checkbox  :label="scope.row.id" @change="getFunInfo(scope.row)" style="display: flex; align-items: center;">
+                <el-checkbox  :label="scope.row.id" @change="getFunInfo(scope.row,scope)" style="display: flex; align-items: center;">
                   <el-input type="textarea" style="width:250px" autosize v-model="scope.row.content"> {{scope.row.content}}</el-input>
                 </el-checkbox>
 
@@ -137,6 +137,7 @@ export default {
         return false
       }
       const offsetBodyHeight = body.offsetHeight
+      console.log( window.innerHeight,body,offsetBodyHeight,offsetTop)
       if (this.tableData.length && offsetBodyHeight < offsetTop) {
         this.tableHeight = offsetBodyHeight + 75
       } else if (!this.tableData.length) {
@@ -146,11 +147,12 @@ export default {
       }
     },
     //选中特征
-    getFunInfo(row) {
-      console.log("row",row)
+    getFunInfo(row,scope) {
+      console.log("row",row,scope)
       // this.$emit('getfeatures', row)
       let Index=this.row.findIndex(item => {return item.id==row.id })
       if (Index<0) {
+        row.$index = scope.$index
         this.row.push(row)
       } else {
         this.row.splice(Index,1)
@@ -186,6 +188,20 @@ export default {
         let row = this.row.sort((aId, bId) => {
             return aId.id-bId.id; 
           })
+          row.sort((aId, bId) => {
+            if(aId.$index - bId.$index!=1){
+              allow = false
+            }
+          })
+          if(!allow){
+            this.$alert('只能合并相邻的特征','提示',{
+              confirmButtonText: '确定',
+              type:'warning',
+              callback: action => {
+              }
+            })
+            return false;
+          }
         for (var i = 0; i < this.row.length; i++) {
           if (i < row.length - 1) {
             str = str + row[i].content + ','