浏览代码

其他不适多选顿号3218

zhouna 5 年之前
父节点
当前提交
ce5dcd1b0a
共有 1 个文件被更改,包括 5 次插入3 次删除
  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;