Explorar o código

推送去重3252

zhouna %!s(int64=5) %!d(string=hai) anos
pai
achega
8e04aa73a3
Modificáronse 1 ficheiros con 12 adicións e 3 borrados
  1. 12 3
      src/common/PushSymptom.vue

+ 12 - 3
src/common/PushSymptom.vue

@@ -93,11 +93,19 @@
             };
             //没有了与其他互斥
             const hasNone = symptoms.indexOf("没有了")!==-1;
-            const newSyms = delResymptoms(this.extSyms,syms);
+            const selecteds = this.selecteds;
+            const exts=JSON.parse(JSON.stringify(this.extSyms));
+            const newSyms = delResymptoms(exts,syms);
+            const newExt =selecteds.length>0?newSyms.reduce((total,it,idx)=>{
+                if(selecteds.findIndex((i)=>i.name===it.name)!==-1){
+                  total.splice(idx,1);
+                }
+              return total;
+            },[...newSyms]):newSyms;
             if(hasNone){
-              this.symptoms = [...newSyms];
+              this.symptoms = [...newExt];
             }else{
-              this.symptoms = [none,...newSyms];
+              this.symptoms = [none,...newExt];
             }
             this.symptoms.length=this.symptoms.length>10?10:this.symptoms.length;
             //this.getSymptomLisCom(result)
@@ -172,6 +180,7 @@
           selecteds.splice(inx,1);
         }
         this.selecteds = selecteds;
+        this.numPlus = this.selectedsName==="没有了"?0:this.selecteds.length;
         this.getPush(this.chooseSymp[0].name+this.selectedsName);
       }
     }