Parcourir la source

Merge branch 'dev' into byll

Luolei il y a 5 ans
Parent
commit
d0a606ea47

+ 2 - 2
build/webpack.dev.conf.js

@@ -33,8 +33,8 @@ const devWebpackConfig = merge(baseWebpackConfig, {
     contentBase: false, // since we use CopyWebpackPlugin.
     compress: true,
     // host: HOST || config.dev.host,
-    // host: '192.168.3.6',
-    host: '192.168.3.126',
+    host: '192.168.3.6',
+    // host: '192.168.3.126',
     port: PORT || config.dev.port,
     open: config.dev.autoOpenBrowser,
     overlay: config.dev.errorOverlay

+ 6 - 3
src/common/CheckBox.vue

@@ -5,14 +5,15 @@
       <img :src="it.select==1?check:defaultPic">
       <!-- <span :class="{'check':it.select==1}">{{it.name}}</span> -->
       <span v-if="(it.name.indexOf('${'))==-1" :class="[{'check':it.select==1},{'exclu':exclusion !==999 && it.exclusion !== exclusion}]">{{it.name}}</span>
-      <MultiLineInput v-else 
+      <!-- <MultiLineInput v-else 
           @handleInp="inpVal($event,index)"
           :msg="it.name" 
           :part="it"
           :border="false" 
           :inline="true" 
           :select="it.select==1" 
-          />
+          /> -->
+      <OptionInp v-else :item="it" @handleInp="inpVal($event,index)" />
     </p>
   </div>
 </template>
@@ -21,6 +22,7 @@ import {imageUrlPrefix,patt} from '@utils/tools.js';
 import icon from '../images/check-default.png';
 import checkIcon from '../images/check.png';
 import MultiLineInput from '../common/MultiLineInput.vue';
+import OptionInp from '../common/OptionInp.vue';
   export default{
     name:'CheckBox',
     data(){
@@ -114,7 +116,8 @@ import MultiLineInput from '../common/MultiLineInput.vue';
       }
     },
     components:{
-      MultiLineInput
+      MultiLineInput,
+      OptionInp
     }
   }
 </script>

+ 5 - 2
src/common/Input.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="inp-wrap">
-    <input :type="item.controlType==6?'text':'number'" 
+    <input :type="item.controlType==6?'text':'tel'" 
           :class="{'change':borColor}" 
           v-model="val" 
           @input="changeVal" 
@@ -19,8 +19,11 @@
     },
     props:['item'],
     methods:{
-      changeVal(){
+      changeVal(e){
         this.borColor = true;
+        if(this.item.controlType==7){//数字键盘
+          this.val = e.target.value=e.target.value.replace(/[^\d]/g,'')
+        }
       },
       blur(){
         this.borColor = false;

+ 76 - 0
src/common/OptionInp.vue

@@ -0,0 +1,76 @@
+<!-- 带输入框选项 -->
+<template>
+  <div :class="['inpbox',{'check':item.select}]">
+    <span class="prefix" v-if="msg.prefix">{{msg.prefix}}</span>
+    <div class="inp" @click="preClick">
+      <input :type="msg.type=='number'?'tel':'text'" 
+              :placeholder="msg.placeholder"
+              v-model="txt"
+              @blur="handleBlur"
+              @input="changeVal">
+    </div>
+    <span class="suffix" v-if="msg.suffix">{{msg.suffix}}</span>
+  </div>
+</template>
+<script type="text/javascript">
+import { getExpStr } from '@utils/tools';
+  export default {
+    name:'OptionInp',
+    data(){
+      return{
+        msg:{},
+        txt:this.item.value || ''
+      }
+    },
+    props:['item'],
+    mounted(){
+      this.msg = getExpStr(this.item.name);
+    },
+    methods:{
+      changeVal(e){
+        if(this.msg.type=='number'){//数字键盘
+          this.txt = e.target.value=e.target.value.replace(/[^\d]/g,'')
+        }
+      },
+      handleBlur(){
+        // 如果该项未选中,则不存值
+      const select = this.item.select;
+      if(!select){return}
+      const newData = Object.assign({},this.part,{value:this.txt});
+      this.$emit("updata",newData);
+      this.$emit('handleInp',this.txt);
+      },
+      preClick(e){
+        e.stopPropagation();
+      }
+    },
+    watch:{
+      item:{//清空时更新
+        handler(newVal,oldVal){
+          this.txt = newVal.value;
+        },
+        deep:true
+      }
+    },
+  }
+</script>
+<style lang="less" scoped>
+  .inpbox{
+    color:#7C828E;
+    display: inline-block;
+    .inp{
+      display: inline-block;
+      vertical-align: top;
+      input{
+        color: #4F50FF;
+        font-size: .3rem;
+        border-bottom: 1px solid #DFE0E4 !important;
+        border-radius: 0;
+        padding-left: .05rem;
+      }
+    }
+    .check{
+      color: #4F50FF;
+    }
+  }
+</style>

+ 6 - 3
src/common/Radio.vue

@@ -5,14 +5,15 @@
       <img :src="it.select==1?check:defaultPic">
       <!-- <span :class="{'check':it.select==1}">{{it.name}}</span> -->
       <span v-if="(it.name.indexOf('${'))==-1" :class="{'check':it.select==1}">{{it.name}}</span>
-      <MultiLineInput v-else 
+      <!-- <MultiLineInput v-else 
           @handleInp="inpVal($event,index)"
           :msg="it.name" 
           :part="it" 
           :border="false" 
           :inline="true" 
           :select="it.select==1" 
-          />
+          /> -->
+      <OptionInp v-else :item="it" @handleInp="inpVal($event,index)" />
     </p>
   </div>
 </template>
@@ -21,6 +22,7 @@ import icon from '../images/radio-default.png'
 import checkIcon from '../images/radio-check.png'
 import {patt,imageUrlPrefix} from '@utils/tools.js'
 import MultiLineInput from '../common/MultiLineInput.vue';
+import OptionInp from '../common/OptionInp.vue';
   export default{
     name:'Radio',
     data(){
@@ -77,7 +79,8 @@ import MultiLineInput from '../common/MultiLineInput.vue';
       }
     },
     components:{
-      MultiLineInput
+      MultiLineInput,
+      OptionInp
     }
   }
 </script>

+ 14 - 2
src/components/DetailBox.vue

@@ -6,6 +6,7 @@
       </span>
       <span class="name">{{privateData.name+'详情'}}</span>
       <span @click="handleClear">清空</span>
+      <i>{{tips}}</i>
     </div>
     <div class="main">
       <Detail :datas="privateData" 
@@ -31,7 +32,8 @@
         privateData:{},
         compFlag:false,
         clearTxt:"是否清空当前已选内容?",
-        showToast:false
+        showToast:false,
+        tips:"(请完成病情预问诊可让医生提前了解病情)"
       }
     },
     created(){
@@ -86,7 +88,8 @@
     // animation: wave .4s ease-in;
     animation: wave .4s linear;
     .head{
-      height: .88rem;
+      // height: .88rem;
+      height: 1rem; //增加了提示
       line-height: .88rem;
       display: flex;
       justify-content: space-between;
@@ -94,6 +97,15 @@
       padding: 0 .4rem 0 .32rem;
       font-size: .28rem;
       color: #7C828E;
+      i{
+        position: absolute;
+        top:0.35rem;
+        left:0;
+        font-size: .22rem;
+        width:100%;
+        display: inline-block;
+        text-align: center;
+      }
       .icon{
         display: inline-block;
         height: 100%;

+ 3 - 3
src/components/Symptom.vue

@@ -97,7 +97,7 @@ export default {
       labelDetail: {}, //明细
       checkText: text, //症状情况文字
       questId: null, //id
-      delText: "是否删除该信息?<br/> (已填内容将清除)",
+      delText: "是否删除该信息?<br/>(已填内容将清除)",
       delIndex: null,
       showToast: false,
       searchShow: false,//显示搜索界面
@@ -218,7 +218,7 @@ export default {
       this.delIndex = index;
       this.questId = item.questionId || item.conceptId;
       if (this.chooseSymp.length == 1) {
-        this.delText = "是否删除该信息?删除后将重新填写预问诊流程 (已填内容将清除)"
+        this.delText = "是否删除该信息?<br/>删除后将重新填写预问诊流程 <br/>(已填内容将清除)"
       }
       this.showToast = true;
     },
@@ -240,7 +240,7 @@ export default {
       this.showToast = false;
       this.delIndex = null;
       this.questId = null;
-      this.delText = "是否删除该信息?<br/> (已填内容将清除)";
+      this.delText = "是否删除该信息?<br/>(已填内容将清除)";
     },
     complete() {//明细填写完成
       if(this.isSearch){

+ 26 - 2
src/utils/tools.js

@@ -1,6 +1,7 @@
 
 const qs = require('qs');
 const imageUrlPrefix = 'http://192.168.2.241:82' //后台图片地址
+// const imageUrlPrefix = 'http://192.168.2.236:82' //后台图片地址
 
 const getUrlArgObject = (parm) => {
     let query = window.location.search;
@@ -16,9 +17,31 @@ const deepClone = (arr) =>{
   return newArr;
 }
 
+const getExpStr = (str) =>{
+  let result = {}
+  if(str.match(/\${number_(.*})/)){//数字输入框
+    let matchStr = str.match(/\${number_(.*})/)[0]
+    result = {
+      type:'number',
+      placeholder:matchStr.split('${number_')[1].split('}')[0],
+      prefix:str.split(matchStr)[0]||'',
+      suffix:str.split(matchStr)[1]||''
+    }
+  }else if(str.match(/\${input_(.*})/)){
+    let matchStr = str.match(/\${input_(.*})/)[0]
+    result = {
+      type:'text',
+      placeholder:matchStr.split('${input_')[1].split('}')[0],
+      prefix:str.split(matchStr)[0]||'',
+      suffix:str.split(matchStr)[1]||''
+    }
+  }
+  return result
+}
+// 多行输入 多个输入框
 const getModelExpStr = (str,txt) =>{
   let result = {}
-  console.log(str,txt,44444)
+  // console.log(str,txt,44444)
   if(str.match(/\${number_(.*})/)){//数字输入框
     let matchStr = str.match(/\${number_(.*})/)[0]
     let tmpHolder = matchStr.split('${number_')[1].split('}')[0]
@@ -142,7 +165,8 @@ module.exports =  {
   getAllStr,
   moduleConfig,
   patt,
-  moduleCP
+  moduleCP,
+  getExpStr
 }