Преглед изворни кода

Merge branch 'dev' of http://47.106.221.167:8088/zhuliu/RMS-FrontEnd into dev

zhuliu пре 2 година
родитељ
комит
8ec1e41b96
1 измењених фајлова са 180 додато и 8 уклоњено
  1. 180 8
      RMS-FrontEnd/src/views/report/avoid/avoidPage/avoidDirection.vue

+ 180 - 8
RMS-FrontEnd/src/views/report/avoid/avoidPage/avoidDirection.vue

@@ -39,7 +39,7 @@
             width="180"
             align="center">
             <template slot-scope="scope">
-              <el-tooltip class="item" effect="dark" :content="scope.row.pRightName" placement="top">
+              <el-tooltip class="item" effect="dark" :content="scope.row.pContent" placement="top">
                 <span>{{ scope.row.pRightName }}</span>
               </el-tooltip>
             </template>
@@ -102,7 +102,10 @@ export default {
       mergeArr: ['id', 'pRightName'],
       mergeObj: {},
       typeArr:[1],//显示权要还是全部显示
-      loading:false,
+      loading: false,
+      row: [],
+      Index_row: [],
+      arrIndex: 0,
     };
   },
   mounted() {
@@ -227,23 +230,192 @@ export default {
         // }
     },
       //保存
-    keep() { },
+    keep() { 
+      console.log(this.tableData);
+      let keepArr = [
+        {
+          RightName: this.tableData1[0].pRightName,
+          signPatentNo: this.tableData1[0].pSignPatentNo,
+          patentId: this.tableData1[0].pPatentId,
+          content: this.tableData1[0].pContent,
+          type: this.tableData1[0].pType,
+          sort: this.tableData1[0].pSort,
+          reportId: this.tableData1[0].pReportId,
+          contentOut: this.tableData1[0].pContentOut,
+          features:[],
+        }
+      ]
+      var j=0
+      for (let i = 0; i < this.tableData1.length; i++) {
+        // console.log(this.tableData1);
+        if (keepArr.findIndex(item => { return item.contentOut == this.tableData1[i].pContentOut }) < 0) {
+          j += 1
+          keepArr.push(
+            {
+              RightName: this.tableData1[i].pRightName,
+              signPatentNo: this.tableData1[i].pSignPatentNo,
+              patentId: this.tableData1[i].pPatentId,
+              content: this.tableData1[i].pContent,
+              type: this.tableData1[i].pType,
+              sort: this.tableData1[i].pSort,
+              reportId: this.tableData1[i].pReportId,
+              contentOut: this.tableData1[i].pContentOut,
+              features: [],
+            }
+          )
+        }
+        let featuresArr = ["signPatentNo", "patentId", "content","type","direction","explainText","contentOut","splitBy","splitType","featuresOrder","id","rightName","isFinal"]
+        featuresArr.forEach(item1 => {
+          var keepArrIndex = keepArr[j].features.findIndex(item2 => {
+          // console.log(item2,item1);
+            return item2==item1
+          })
+          if (keepArrIndex < 0) {
+            // console.log(keepArr[j].features);
+            keepArr[j].features.push()
+           
+          }
+        })
+        // keepArr[j].features.push({
+        //       signPatentNo: this.tableData1[i].signPatentNo,
+        //       patentId: this.tableData1[i].patentId,
+        //       content: this.tableData1[i].content,
+        //       type: this.tableData1[i].type,
+        //       direction: this.tableData1[i].direction?this.tableData1[i].direction:'',
+        //       explainText: this.tableData1[i].explainText?this.tableData1[i].explainText:'',
+        //       contentOut: this.tableData1[i].contentOut,
+        //       splitBy: this.tableData1[i].splitBy,
+        //       splitType: this.tableData1[i].splitType,
+        //       featuresOrder: this.tableData1[i].featuresOrder,
+        //       id: this.tableData1[i].id,
+        //       rightName: this.tableData1[i].rightName,
+        //       isFinal: this.tableData1[i].isFinal,
+        // })
+      }
+      console.log(this.tableData,keepArr);
+      // this.$api.KeepPatentRight(keepArr).then(res => {
+      //   console.log(res);
+      //   if (res.code == 200) {
+      //     this.keepSure = true;
+      //     this.$message.success("保存成功")
+      //   }
+      // })
+    },
     // 获取选中特征信息
     getRow(scope) {
       console.log(scope);
       
+      let Index=this.row.findIndex(item=>{ return item.id==scope.row.id })
+      if (Index < 0) {
+        this.Index_row.push(scope.$index)
+        this.row.push(scope.row)
+      } else {
+        this.row.splice(Index, 1)
+        this.Index_row.splice(Index, 1)
+      }
     },
     // 特征等合并
     merge() { 
-      console.log(this.checkList);
-      if (this.checkList.length>1) {
-        // this.checkListL=true
-        this.checkList.forEach(item => {
+      console.log(this.checkList,this.row);
+      if (this.row.length > 1) {
+        var str=''
+        var str1=''
+        var str2=''
+        var str3 = ''
+        for (let i = 0; i < this.row.length - 1; i++){
+          if (this.row[i].pSort!=this.row[i+1].pSort) {
+              this.$alert("不能跨权要合并特征","提示", {
+                confirmButtonText: '确定',
+              })
+              return false
+          } else {
+            let Index_rowArr=this.Index_row.sort((a, b) => {
+              return a-b
+            })
+            if (Index_rowArr[i+1]-Index_rowArr[i]!=1) {
+              this.$alert("非相邻不能合并特征","提示", {
+                confirmButtonText: '确定',
+              })
+              return false
+            }
+          }
+        }
+        this.row.forEach((rowItem, rowIndex) => {
+          // console.log(rowItem,rowIndex);
+          if (rowIndex<this.row.length-1) {
+            str = str + rowItem.content + ","
+            str1 = str1 + rowItem.contentOut + ","
+            str2 = str2 + rowItem.direction + ","
+            str3 = str3 + rowItem.explainText + ","
+            let Index1 = this.tableData1.findIndex(item => { return rowItem.id==item.id  })
+            if (Index1!=-1) {
+              this.tableData1.splice(Index1,1)
+            }
+            // console.log(Index1, this.tableData1);
+          }else if(rowIndex==this.row.length-1){
+            str=str+rowItem.content
+            str1=str1+rowItem.contentOut
+            str2=str2+rowItem.direction
+            str3=str3+rowItem.explainText
+          }
+          let Index2 = this.tableData1.findIndex(item => { return item.id == rowItem.id })
+          if (Index2!=-1) {
+            this.tableData1[Index2].content=str
+            this.tableData1[Index2].contentOut=str1
+            this.tableData1[Index2].direction=str2
+            this.tableData1[Index2].explainText = str3
+            console.log(this.tableData1);
+          }
+          // console.log(this.tableData1[Index2]);
           
         })
+        this.TypeSelect(this.Type)
+        this.row=[]
+        this.checkList=[]
+      }
+    },
+    // 拆分
+    split() {
+      //不能同时拆分
+      if (this.row.length>0) {
+        if (this.row.length>1) {
+          this.$alert("不能同时拆分多个特征","提示", {
+            confirmButtonText: '确定',
+          })
+          return false
+        }
+        this.row.forEach((rowItem, rowIndex) => {
+          var splitAdd = {
+              id: rowItem.id+'a',
+              content: '',
+              contentOut:'',
+              direction:'',
+              explainText: '',
+              rightName:rowItem.rightName,
+              featuresOrder:rowItem.featuresOrder,
+              splitBy:rowItem.splitBy,
+              splitType:rowItem.splitType,
+              signPatentNo:rowItem.signPatentNo,
+            reportId: rowItem.reportId,
+
+            pRightName:rowItem.pRightName,
+                  pSignPatentNo:rowItem.pSignPatentNo,
+                  pContentOut:rowItem.pContentOut,
+                  pContent:rowItem.pContent,
+                  pReportId:rowItem.pReportId,
+                  pPatentId:rowItem.pPatentId,
+                  pType:rowItem.pType,
+                  pSort:rowItem.pSort,
+            
+          }
+          let Index2 = this.tableData1.findIndex(item => { return rowItem.id == item.id })
+           this.tableData1.splice(Index2+1,0,splitAdd)
+        })
+        this.TypeSelect(this.Type)
+        this.row=[]
+        this.checkList=[]
       }
     },
-    split(){},
   }
 }
 </script>