Parcourir la source

其他不适多选顿号3218

zhouna il y a 5 ans
Parent
commit
ce5dcd1b0a
1 fichiers modifiés avec 5 ajouts et 3 suppressions
  1. 5 3
      src/common/PushSymptom.vue

+ 5 - 3
src/common/PushSymptom.vue

@@ -127,7 +127,9 @@
       makeSuer() {
         if(!this.selecteds.length>0){return}
         let number = this.num;
-        this.$emit("updataResult", '',{val:this.selectedsName,valp:this.selectedsNamep,idx:2},++number);
+        const sName=this.selectedsName.replace(/、+/g,"、").replace(/^、|、$/g,'');
+        const sNamep=this.selectedsName.replace(/、+/g,"、").replace(/^、|、$/g,'');
+        this.$emit("updataResult", '',{val:sName,valp:sNamep,idx:2},++number);
         this.$store.commit("setChoose",{choose:[...this.chooseSymp,...this.selecteds]});
       },
       selectResult(item) {
@@ -160,8 +162,8 @@
           return it.tagName === item.tagName;
         });
         if(inx!==-1){
-          this.selectedsName = this.selectedsName.replace(item.name,"").replace("、、","、");
-          this.selectedsNamep = this.selectedsNamep.replace(item.description||item.name,"").replace("、、","、");
+          this.selectedsName = this.selectedsName.replace(item.name,"");
+          this.selectedsNamep = this.selectedsNamep.replace(item.description||item.name,"");
           selecteds.splice(inx,1);
         }
         this.selecteds = selecteds;