ソースを参照

属于命名bug修改

Luolei 6 年 前
コミット
bc27f8e39e
1 ファイル変更13 行追加6 行削除
  1. 13 6
      src/components/icss/AddMedicalName.vue

+ 13 - 6
src/components/icss/AddMedicalName.vue

@@ -155,7 +155,8 @@ import api from '@api/icss.js';
         colspans:5,
         currentPage:1,
         pageSize:10,
-        show:false
+        show:false,
+        tmpSynonymous:[]
       }
     },
     created(){
@@ -177,7 +178,7 @@ import api from '@api/icss.js';
     },
     methods:{
       changeState(val){
-        let tmpAllwords = this.synonymous.slice(0);
+        let tmpAllwords = JSON.parse(JSON.stringify(this.synonymous));
         for(let i = 0;i < tmpAllwords.length;i++){
           if(i+1 == val){
             tmpAllwords[i].isConcept = 1
@@ -186,6 +187,7 @@ import api from '@api/icss.js';
             tmpAllwords[i].isConcept = 0
           }
         }
+        this.tmpSynonymous = tmpAllwords
       },
       toggleShow(num){
         let tmpShow = this.show
@@ -346,10 +348,11 @@ import api from '@api/icss.js';
           return
         }
         // 过滤同义词空数据
-        let realData = this.synonymous.filter((item)=>{
-          return item.name;
-        })
-        if(this.id){
+        let realData=[];
+        if(this.id){//修改用暂存的列表
+          realData = this.tmpSynonymous.filter((item)=>{
+            return item.name;
+          })
           let tmpArr = []
           for(let k = 0;k < realData.length;k++){
             if(realData[k].isConcept == 1){
@@ -361,6 +364,10 @@ import api from '@api/icss.js';
               this.data = tmpArr[0]
             }
           }
+        }else{
+          realData = this.synonymous.filter((item)=>{
+            return item.name;
+          })
         }
         let detailList = [];
         detailList[0] = this.data;