Просмотр исходного кода

Merge branch 'newVersion' of http://223.93.170.82:10080/zhouna/preliminary into newVersion

luolei 5 лет назад
Родитель
Сommit
5551dbf648

+ 1 - 1
src/common/Dialog.vue

@@ -66,7 +66,7 @@ export default {
     background-color: #colors[bgques];
     border-radius: 0 0.24rem 0.24rem 0.24rem;
     margin-top: 0.3rem;
-    font-size: 0.3rem;
+    font-size: 0.28rem;
     padding: 0.24rem;
     display: inline-block;
   }

+ 21 - 7
src/common/MultSelect.vue

@@ -8,10 +8,10 @@
         :key="item.id"
       >
         <span v-if="((item.description||item.name).indexOf('${'))==-1">{{item.description||item.name}}</span>
-        <OptionInp v-else :item="item" @handleInp="inpVal" :inx="idx" @handleSelec="handleClick(item,idx,false,true)"/>
+        <OptionInp v-else :item="item" @handleInp="inpVal" :inx="idx"/>
       </li>
     </ul>
-    <div class="realSure sure" @click="makeSuer">
+    <div :class="sure?'realSure sure':'sure'" @click="makeSuer">
       确定 <span v-if="numPlus">({{numPlus}})</span>
     </div>
   </div>
@@ -28,7 +28,8 @@ export default {
       connectResult: [], //id
       contentResult: "", //name
       rules: [], //规则所需数据value
-      numPlus:0     //已选答案个数
+      numPlus:0,     //已选答案个数
+      sure:false
     };
   },
   mounted() {
@@ -59,6 +60,16 @@ export default {
       let detailList = this.result;
       let currItem = detailList[index];
       currItem.value = val;
+      if(val){
+        this.sure=true;
+      }else{
+        if(detailList.findIndex((it)=>it.value)!==-1){
+          this.sure=true;
+        }else{
+          this.sure=false;
+        }
+      }
+
     },
     handleClick(it,index,flg,ipt){
       if(flg){
@@ -100,8 +111,10 @@ export default {
         const msg = getExpStr(text);
         const msgp = getExpStr(text);
         if(result[i].name.indexOf("${")!==-1){
-          tmpResult.push(msg.prefix+(result[i].value||"")+msg.suffix);
-          tmpResultp.push(msgp.prefix+(result[i].value||"")+msgp.suffix);
+          if(result[i].value){
+            tmpResult.push(msg.prefix+(result[i].value||"")+msg.suffix);
+            tmpResultp.push(msgp.prefix+(result[i].value||"")+msgp.suffix);
+          }
         }else {
           //tmpIds=tmpIds.concat(result[i].connectId)
           tmpResult.push(text);
@@ -157,17 +170,18 @@ export default {
   @import "../less/base.less";
 .select {
   background-color: #fff;
-  padding: 0.2rem 0 0 0;
+  padding: 0.12rem 0 0 0;
   position: fixed;
   width: 100%;
   bottom: 0;
   box-sizing: border-box;
+  box-shadow: 0 0 30px -10px rgba(104, 124, 189, 0.25);
   li {
     padding: 0.14rem 0.2rem;
     border:1px #DFE0E4 solid;
     border-radius: 0.36rem;
     font-size: 0.26rem;
-    margin: 0.15rem;
+    margin: 0.15rem 0.15rem 0;
     float: left;
     color: #666;
   }

+ 12 - 5
src/common/OptionInp.vue

@@ -6,10 +6,10 @@
             :placeholder="msg.placeholder"
             :style="{'width':!msg.prefix&&!msg.suffix?'90%':'33%'}"
             :class="[{'cancel':item.select==0}]"
-            v-model="txt"
+           v-model="txt"
            @click="handleCli"
            @input="changeVal"
-            @blur="handleBlur">
+    >
     <span class="suffix" v-if="msg.suffix">{{msg.suffix}}</span>
   </div>
 </template>
@@ -22,7 +22,7 @@ import $ from 'jquery';
     data(){
       return{
         msg:{},
-        txt:this.item.value || '',
+        txt:this.item.value||'',
         select:0,
         url:[require('../images/iptselect.png'),require('../images/iptdis.png')]
       }
@@ -34,19 +34,26 @@ import $ from 'jquery';
     },
     methods:{
       changeVal(e){
+        this.txt = e.target.value;
         if(this.msg.type=='number'){//数字键盘
           this.txt = e.target.value=e.target.value.replace(/^\.$/,'')
         }
+        this.$emit('handleInp',this.txt,this.inx);
+        if(this.txt&&!this.item.select||(!this.txt&&this.item.select)){
+          this.$emit("handleSelect")
+        }
       },
       handleBlur(){
-        this.$emit('handleInp',this.txt,this.inx);
+       /* if(this.txt){
+          this.$emit('handleInp',this.txt,this.inx);
+        }*/
         /*setTimeout(()=>{
           $(".foot").css({'display':'block'})
         },150)*/
 
       },
       handleCli(e){
-        if(this.select){//已选中后点击输入框不取消选中
+        if(this.select||!this.txt){//已选中后点击输入框不取消选中
           e.stopPropagation();
         }
       }

+ 13 - 4
src/common/PushSymptom.vue

@@ -93,13 +93,21 @@
             };
             //没有了与其他互斥
             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>11?11:this.symptoms.length;
+            this.symptoms.length=this.symptoms.length>10?10:this.symptoms.length;
             //this.getSymptomLisCom(result)
           }else{
             //this.getSymptomLisCom()
@@ -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);
       }
     }

+ 1 - 1
src/common/Radio.vue

@@ -9,7 +9,7 @@
         @click="selectResult(item,idx)"
       >
         <span v-if="((item.description||item.name).indexOf('${'))==-1">{{item.description||item.name}}</span>
-        <OptionInp v-else :item="item" @handleInp="inpVal" :inx="idx"/>
+        <OptionInp v-else :item="item" @handleInp="inpVal" :inx="idx" @handleSelect="selectResult(item,idx)"/>
       </li>
     </ul>
     <div :class="sure?'realSure sure':'sure'" @click="makeSuer">

+ 1 - 1
src/common/Select.vue

@@ -9,7 +9,7 @@
         @click="selectResult(item,idx)"
       >
         <span v-if="((item.description||item.name).indexOf('${'))==-1">{{item.description||item.name}}</span>
-        <OptionInp v-else :item="item" @handleInp="inpVal" :inx="idx"/>
+        <OptionInp v-else :item="item" @handleInp="inpVal" :inx="idx" @handleSelect="selectResult(item,idx)"/>
       </li>
     </ul>
     <div :class="sure?'realSure sure':'sure'" @click="makeSuer">

+ 1 - 1
src/components/MainPage.vue

@@ -138,7 +138,7 @@ export default {
       defaultIndex: 0, //温度默认值
       order:0,
       userInfo: {}, //用户信息
-      pdbm:'9.93rem',
+      pdbm:'8.5rem',
       waring:'',        //错误提示语
       wrong:false,      //是否显示错误toast
       showConfirm: false,