Kaynağa Gözat

Squashed commit of the following:

commit 4a52e161620cb9827b0b30431cd752bc2b6dbf44
Author: Luolei <16657115156@163.com>
Date:   Tue Jul 23 17:08:16 2019 +0800

    数据处理

commit 0f282a4005150b8b4234df99de1521fba5ec55e8
Merge: 6fc7207 a1ac90c
Author: Luolei <16657115156@163.com>
Date:   Tue Jul 23 15:47:37 2019 +0800

    Merge branch 'dev' into byll

    # Conflicts:
    #	config/index.js
    #	src/common/MultiLineInput.vue
    #	src/components/Symptom.vue
    #	src/components/TabPage.vue
    #	src/store.js
    #	src/utils/tools.js

commit 6fc720795865ba16ff3c9cd9cd8a2d1b0dbda978
Author: Luolei <16657115156@163.com>
Date:   Tue Jul 23 15:24:38 2019 +0800

    数字键盘弹起输入问题解决

commit 89f2791e4b36c0ee671c8dc87285b7c82cf35cfd
Author: Luolei <16657115156@163.com>
Date:   Tue Jul 23 10:27:55 2019 +0800

    类型修改

commit 55594b6e10078c5aff8ed95cd938c0fa07fb0125
Author: Luolei <16657115156@163.com>
Date:   Tue Jul 23 10:20:19 2019 +0800

    type类型改变

commit e9eeb458968371f579c6b61c7693438b99d18443
Merge: ada4e4e 1248f0c
Author: Luolei <16657115156@163.com>
Date:   Mon Jul 22 15:49:52 2019 +0800

    Merge branch 'dev' into byll

commit ada4e4e7216614e111914fc4a787609722b665cf
Author: Luolei <16657115156@163.com>
Date:   Mon Jul 22 15:39:22 2019 +0800

    模块配置

commit 1fe1910a2a54e5ece7a2b3ea8162cd9c7827059b
Merge: 7ef08db 3a8f52d
Author: Luolei <16657115156@163.com>
Date:   Thu Jul 18 16:39:19 2019 +0800

    Merge branch 'dev' into byll

commit 7ef08db55a456528a93b2ca8bb204b67a83daa80
Author: Luolei <16657115156@163.com>
Date:   Thu Jul 18 16:38:09 2019 +0800

    图片上传数据结构修改

# Conflicts:
#	src/common/MultiLineInput.vue
#	src/components/AddContent.vue
#	src/utils/tools.js
liucf 5 yıl önce
ebeveyn
işleme
6ad0e3b018

+ 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

+ 2 - 2
config/index.js

@@ -4,8 +4,8 @@
 
 const path = require('path')
 // const proxy_path = 'http://192.168.2.236:80';
-// const proxy_path = 'http://192.168.2.236:5050';
-const proxy_path = 'http://192.168.2.241:5050';
+const proxy_path = 'http://192.168.2.236:5050';
+// const proxy_path = 'http://192.168.2.241:5050';
 
 module.exports = {
   dev: {

+ 8 - 13
src/common/MultiLineInput.vue

@@ -11,14 +11,14 @@
               :key="item.placeholder+idx" 
               v-model="item.value"
               :placeholder="item.placeholder"
-              @input="changeVal($event,idx)" 
+              @input="changeVal($event,idx,content.type)" 
               @blur="blur" 
               @click="handleClick">
             <input v-show="content.iptLis.length==1" class="contentVal" 
               :type="content.type=='number'?'tel':'text'" 
               :placeholder="content.placeholder" 
               v-model="item.value" 
-              @input="changeVal($event,idx)" 
+              @input="changeVal($event,idx,content.type)" 
               @blur="blur" 
               @click="handleClick">
             <span v-if="idx == 0&&content.iptLis.length>1">/</span>
@@ -62,25 +62,20 @@ export default {
     }
   },
   mounted(){
-    this.setValue()
+    this.content = getModelExpStr(this.msg,this.txt)
   },
   methods:{
-    changeVal(e,num){
+    changeVal(e,num,type){
       let tmpTxt = '',arr=this.tmpArr
-      e.currentTarget.value=e.currentTarget.value.replace(/[^\d]/g,'')
+      if(type == 'number'){
+        e.currentTarget.value=e.currentTarget.value.replace(/[^\d]/g,'')
+      }
       arr[num]=e.currentTarget.value
       tmpTxt=arr.join('/')
       this.txt = tmpTxt
-      this.setValue()
+      this.content = getModelExpStr(this.msg,this.txt)
       // this.$emit('changeMultipVal',e.currentTarget.value,num)
     },
-    setValue(){
-      if(this.txt){
-        this.content = getModelExpStr(this.msg,this.txt)
-      }else{
-        this.content = getModelExpStr(this.msg)
-      }
-    },
     blur(){
       // 如果该项未选中,则不存值
       const select = this.part.select;

+ 29 - 17
src/components/AddContent.vue

@@ -7,21 +7,21 @@
           <Radio v-if="item.controlType==1" 
             :item="item"
             :key="item.id"
-            @updata="updataData"/>
+            @updata="updataData($event,idx,item)"/>
           <CheckBox v-if="item.controlType==2" 
             :item="item"
             :key="item.id"
-            @updata="updataData"/>
+            @updata="updataData($event,idx,item)"/>
           <ComTextArea
             v-if="item.controlType == 5"
             :item="item"
-            @updata="updataData"
+            @updata="updataData($event,idx,item)"
             @changeAreaVal="changeAreaVal($event,idx)"
           ></ComTextArea>
           <Input v-if="item.controlType==6 || item.controlType==7"
             :item="item"
             :key="item.id"
-            @updata="updataData"/>
+            @updata="updataData($event,idx,item)"/>
           <template
             v-if="item.controlType == 3"
             v-for="(part,index) in item.questionDetailList"
@@ -31,17 +31,19 @@
               :msg="part.name"
               :part="part"
               @updata="updataData($event,index,item)"
-              @changeMultipVal="changeMultipVal($event,val,idx)"
             ></MultiLineInput>
           </template>
         </li>
       </ul>
+      <div class="result" v-if="allStr">
+        <p class="title">{{allMoudles.name}}</p>
+        <p>{{allStr}}</p>
+      </div>
       <div class="thanks">
         <p>感谢您的回答,您的病历已经自动生成。</p>
         <p>您可以点击预览病历回顾病情;或者点击顶部修改病历采集信息。</p>
         <p>如果没有需要修改的内容,请点击提交,医生便能看到您的病历。</p>
       </div>
-      <p>{{vals}}</p>
     </div>
     <div class="foot">
       <span class="back" @click="back">{{'返回'+ preName}}</span>
@@ -55,6 +57,7 @@ import MultiLineInput from '../common/MultiLineInput.vue';
 import Input from '../common/Input.vue';
 import Radio from '../common/Radio.vue';
 import CheckBox from '../common/CheckBox.vue';
+import {getAllStr} from '@utils/tools.js'
 
 export default {
   name: 'AddContent',
@@ -63,7 +66,7 @@ export default {
     return {
       dataTrd: [],
       val: '',
-      vals:''
+      allStr:''
     }
   },
   mounted() {
@@ -74,13 +77,8 @@ export default {
       this.$emit("back");
     },
     changeAreaVal(value, idx) {
-      // console.log(value,idx)
       this.val = value
     },
-    changeMultipVal(value, idx) {
-      console.log(value,idx)
-      this.vals = value
-    },
     next(){
       this.$store.commit('setText',{data:this.dataTrd,type:this.allMoudles&&this.allMoudles.type});
       this.$emit('next','preview')
@@ -95,14 +93,11 @@ export default {
       // this.dtoList = origin;console.log("更新:",origin)
     },
     updataData(data,idx,item){
-      console.log(data)
       let mapping = this.dataTrd;
       if(data.controlType == 3){//多行输入,多了一层需单独处理
         let tmpLis = item.questionDetailList
         tmpLis.splice(idx,1,data)
-        // console.log(this.dataTrd,7878)
-        // this.$store.commit('setDatas',{data:this.checkDatas,pId:this.checkDatas.id,type:this.type,ppId:this.ppId});
-        // this.$store.commit('setText',{text:msg,pId:this.checkDatas.id,type:this.type,flag:true});
+        this.allStr=getAllStr({data:this.dataTrd,type:this.allMoudles&&this.allMoudles.type})
         return;
       }
       for(let i in mapping){
@@ -110,7 +105,8 @@ export default {
           mapping.splice(i,1,data)
         }
       }
-      this.$store.commit('setDataAll',data);
+      this.allStr=getAllStr({data:this.dataTrd,type:this.allMoudles&&this.allMoudles.type})
+      this.$store.commit('setDataAll',{data:data,idx:idx});
     },
   },
   components: {
@@ -137,6 +133,7 @@ export default {
   .addPart {
     li {
       margin-bottom: 0.1rem;
+      clear: both;
     }
     .question {
       margin-bottom: 0.2rem;
@@ -147,6 +144,21 @@ export default {
   .foot{
     .dbfooter;
   }
+  
+.result{
+  margin-bottom: .3rem;
+  .title{
+    color: #4F50FF;
+    padding-left: .1rem;
+    border-left: .08rem solid #4F50FF;
+    margin-bottom: .19rem;
+    font-weight: 700;
+  }
+  p{
+    color: #666;
+    line-height: .44rem;
+  }
+}
 .thanks {
   font-size: .28rem /* 28/100 */;
   color: #666666;

+ 7 - 2
src/store.js

@@ -60,9 +60,14 @@ const store = new Vuex.Store({
         txt:'',
       }
     },
-    setDataAll(state,data){
+    setDataAll(state,param){
+      console.log(state,moduleCP['suplement'],param,1111)
       let res = state.allMoudles
-      res[1].moduleDetailDTOList[0].questionMapping[1].questionMapping = data
+      for(let i = 0;i<res.length;i++){
+        if(res[i].type == moduleCP['suplement']){
+          res[i].moduleDetailDTOList[param.idx] = param.data
+        }
+      }
       state.allMoudles = res
     },
     savePathInfo(state,param){

+ 25 - 5
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.241:82' //后台图片地址
+const imageUrlPrefix = 'http://192.168.2.236:82' //后台图片地址
 
 const getUrlArgObject = (parm) => {
     let query = window.location.search;
@@ -15,8 +16,7 @@ const deepClone = (arr) =>{
   }
   return newArr;
 }
-
-// 选项带输入
+// 带输入框选项
 const getExpStr = (str) =>{
   let result = {}
   if(str.match(/\${number_(.*})/)){//数字输入框
@@ -72,11 +72,31 @@ const getModelExpStr = (str,txt) =>{
     }
   }else if(str.match(/\${input_(.*})/)){
     let matchStr = str.match(/\${input_(.*})/)[0]
+    let tmpHolder = matchStr.split('${input_')[1].split('}')[0]
+    let iptLis = [],join='';
+    if(tmpHolder.indexOf('/') != -1){
+      let tmpHolderArr = tmpHolder.split('/')
+      for(let i = 0;i < tmpHolderArr.length;i++){
+        let obj={placeholder:'',value:''}
+        let tmpData = tmpHolderArr[i];
+        obj.placeholder=tmpData
+        if(txt){
+          obj.value=txt.split('/')[i]
+        }
+        iptLis.push(obj)
+      }
+      join = '/'
+    }else{
+      let obj={placeholder:'tmpHolder',value:txt}
+      iptLis.push(obj)
+    }
     result = {
       type:'text',
-      placeholder:matchStr.split('${input_')[1].split('}')[0],
+      placeholder:tmpHolder,
+      iptLis:iptLis,
+      join:join,
       prefix:str.split(matchStr)[0]||'',
-      suffix:str.split(matchStr)[1]||''
+      suffix:str.split(matchStr)[1]||'',
     }
   }
   return result