ソースを参照

Merge branch 'dev' into byll

Luolei 5 年 前
コミット
3ef5b31d31

+ 39 - 5
src/common/MultiLineInput.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="multipIpt">
+  <div :class="['multipIpt',{'border':border,'inline':inline,'check':select}]">
     <span class="prefix" v-if="content.prefix">{{content.prefix}}</span>
     <div class="sticP" :style="{paddingRight:content.suffix?'1rem':'0'}">
         <div class="iptWrap">
@@ -22,11 +22,28 @@ export default {
       type:Object,
       require: true
     },
+    border:{//最外层边框
+      default:true,
+      type:Boolean
+    },
+    inline:{ //是否行内元素
+      default:false,
+      type:Boolean
+    },
+    select:{ //是否选中
+      default:false,
+      type:Boolean
+    },
+    value:{ //回读的值
+      default:'',
+      type:String
+    }
   },
   data(){
     return {
       content:{},
-      txt:this.part.value || '' //回读用
+      txt:this.part.value || '', //回读用
+      val:this.value
     }
   },
   mounted(){
@@ -34,11 +51,12 @@ export default {
   },
   methods:{
     changeVal(){
-      this.$emit('changeMultipVal',this.val)
+      this.$emit('changeMultipVal',this.txt)
     },
     blur(){
       const newData = Object.assign({},this.part,{value:this.txt,controlType:3});
       this.$emit("updata",newData);
+      this.$emit('handleInp',this.txt)
     }
   }
 }
@@ -48,8 +66,8 @@ export default {
     width: 100%;
     height: .74rem /* 74/100 */;
     line-height: .74rem /* 74/100 */;
-    border: 1px solid #DFE0E4;
-    border-radius: .08rem /* 8/100 */;
+    // border: 1px solid #DFE0E4;
+    // border-radius: .08rem /* 8/100 */;
     padding: 0 .12rem 0 .26rem;
     box-sizing: border-box;
     position: relative;
@@ -70,6 +88,19 @@ export default {
       box-sizing: border-box;
     }
   }
+  .border{
+    border: 1px solid #DFE0E4;
+    border-radius: .08rem
+  }
+  .inline{
+    display: inline-block;
+    vertical-align: middle;
+    color: #7C828E;
+    padding: 0;
+    margin:0;
+    height: auto /* 74/100 */;
+    line-height: .36rem /* 74/100 */;
+  }
   .prefix {
     float: left;
   }
@@ -92,4 +123,7 @@ export default {
       overflow: hidden;
     }
   }
+  .check{
+    color: #4F50FF;
+  }
 </style>

+ 33 - 2
src/common/Radio.vue

@@ -3,7 +3,18 @@
     <img :src="datas.url.replace('{imageUrlPrefix}',imgUrl)" v-if="datas.url">
     <p v-for="(it,index) in datas.questionDetailList" :key="it.id" class="list" @click="handleClick(it,index)">
       <img :src="it.select==1?check:defaultPic">
-      <span :class="{'check':it.select==1}">{{it.name}}</span>
+      <!-- <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 
+          @changeMultipVal="changeMultipVal($event,index)" 
+          @handleInp="inpVal($event,index)"
+          :msg="it.name" 
+          :part="it"
+          :value="it.value" 
+          :border="false" 
+          :inline="true" 
+          :select="it.select==1" 
+          />
     </p>
   </div>
 </template>
@@ -11,6 +22,7 @@
 import icon from '../images/radio-default.png'
 import checkIcon from '../images/radio-check.png'
 import {deepClone} from '@utils/tools.js'
+import MultiLineInput from '../common/MultiLineInput.vue';
   export default{
     name:'Radio',
     data(){
@@ -39,7 +51,22 @@ import {deepClone} from '@utils/tools.js'
         }
         const newData = Object.assign({},this.datas,{questionDetailList:data},{value:value})
         this.$emit("updata",newData);
-      }
+      },
+      inpVal(val,index){//输入框失焦处理
+        let valueStr = this.datas.value;
+        let patt = /\$\{[^\]]+\}/g;
+        let newVal = '{' + val + '}';//修改时替换值用
+        const str = valueStr.replace(patt,newVal);
+        this.datas.value = str;
+        // 输入框回读
+        let detailList = this.datas.questionDetailList;
+        let currItem = detailList[index];
+        currItem.value = val; //console.log('单选:',val,valueStr,str,this.datas)
+        this.$emit("updata",this.datas);
+      },
+      changeMultipVal(val){
+        // console.log('输入:',this.datas,val)
+      },
     },
     watch:{
       item:{
@@ -48,6 +75,9 @@ import {deepClone} from '@utils/tools.js'
         },
         deep:true
       }
+    },
+    components:{
+      MultiLineInput
     }
   }
 </script>
@@ -61,6 +91,7 @@ import {deepClone} from '@utils/tools.js'
       margin:0 .1rem .1rem 0;
       padding: .12rem .1rem;
       display: inline-block;
+      white-space: nowrap;
       img{
         width: .38rem;
         vertical-align: middle;

+ 2 - 2
src/components/AddContent.vue

@@ -62,8 +62,8 @@ export default {
     }
   },
   mounted() {
-    // this.dataTrd = this.allMoudles && this.allMoudles.moduleDetailDTOList
-    this.dataTrd = this.allMoudles && this.allMoudles.moduleDetailDTOList[0].questionMapping[1].questionMapping
+    this.dataTrd = this.allMoudles && this.allMoudles.moduleDetailDTOList
+    // this.dataTrd = this.allMoudles && this.allMoudles.moduleDetailDTOList[0].questionMapping[1].questionMapping
   },
   methods: {
     back() {

+ 3 - 7
src/components/Detail.vue

@@ -75,16 +75,12 @@ import ComTextArea from '../common/ComTextArea.vue';
             text += datas[i].value+',';
           }
         }
-        let msg = this.checkDatas.name+ ',' + text.substring(0,text.length-1);//console.log("完成:",this.checkDatas)
+        // 替换占位符 {}
+        let msg = this.checkDatas.name+ ',' + text.substring(0,text.length-1);
         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.$store.commit('setText',{text:msg.replace('{','').replace('}',''),pId:this.checkDatas.id,type:this.type,flag:true});
       },
       clearData(){//清空
-        /*if(!this.finished){//没有点完成
-          this.checkDatas = JSON.parse(JSON.stringify(this.datas));console.log("未完成清空:",this.checkDatas,this.datas)
-          this.$store.commit('setDatas',{data:this.checkDatas,pId:this.checkDatas.id,type:this.type,ppId:this.ppId});
-          return
-        }*/
         const datas = this.checkDatas.questionMapping;
         for(let i in datas){
           datas[i].value = "";

+ 1 - 1
src/components/Others.vue

@@ -10,7 +10,7 @@
               :ppId="it.id" 
               :moduleType="datas.type" 
               @setDetail="setDetail"
-              @updateOrig=""/>
+              @updateOrig="updateOrig"/>
         <!-- 输入框 -->
         <Input v-if="it.controlType==6 || it.controlType==7"
             :item="it"

+ 28 - 9
src/components/Symptom.vue

@@ -133,7 +133,7 @@ export default {
     },
     toNext() {
       // 把1切换成完成图标,且2高亮--判断有几个模块显示,1个--提交预览;1个以上--下一步
-      // if (this.chooseSymp.length == 0) { return }
+      if (this.chooseSymp.length == 0) { return }
       this.$emit('next');
       // 把症状情况的数据存起-已选
       this.$store.commit('setChoose', { choose: this.chooseSymp, type: "1" });
@@ -164,10 +164,13 @@ export default {
             this.$store.commit('setOrigin', { type: "1", data: result.data });
             if (mapping && mapping.length > 0) {
               this.show = true;
+            } else { //没有详情,推送
+              const sympText = this.getSympText();
+              this.getPush(sympText);
             }
           }
         })
-      } else {//没有questionId或id 就没有详情,则直接调推送
+      } else {//没有questionId或id 则直接调推送
         const sympText = this.getSympText();
         this.getPush(sympText);
         this.checkText = this.$store.state.symptom.text;
@@ -283,9 +286,9 @@ export default {
 .choose{
   padding-bottom: .2rem;
   .choo-symp{
-    display: inline-block;
-    width:1.9rem;
-    height: .74rem;
+      display: inline-block;
+      width:1.9rem;
+      height: .74rem;
       // background: linear-gradient(-270deg, #4F4FFF, #4F8BFF);
       background: linear-gradient(-270deg, #3638EE, #4E72FF);
       box-shadow: 0 .08rem .16rem 0 rgba(79,129,255,0.40);
@@ -297,7 +300,7 @@ export default {
         vertical-align: top;
       }
       span:first-child{
-        width:1.34rem;
+        min-width:1.34rem;
         height: .74rem;
         line-height: .74rem;
         text-align: center;
@@ -307,9 +310,25 @@ export default {
         width:.56rem;
         height: .74rem;
       }
-      .over{
-        .over;
-      }
+    }
+  .label{
+    .label;
+  }
+  .result{
+    .title{
+      color: #4F50FF;
+      padding-left: .1rem;
+      border-left: .08rem solid #4F50FF;
+      margin-bottom: .19rem;
+      font-weight: 700;
+    }
+    p{
+      color: #666;
+      line-height: .44rem;
+    }
+  }
+  .footer{
+    .footer;
   }
 }
 .label{

+ 3 - 3
src/components/TabPage.vue

@@ -35,7 +35,7 @@
       />
       <AddContent
         v-show="flag == 4&&moduleShow"
-        :allMoudles="modlues[1]"
+        :allMoudles="modlues[3]"
         :preName="modlues[2]&&modlues[2].name"
         @toggleModule="toggleModule"
         @next="toNext"
@@ -92,8 +92,8 @@ export default {
       let flag = parseInt(this.flag);
       if (this.modlues[flag]) {
         const type = this.modlues[flag].type;
-        // this.flag = type;
-        this.flag = 4;
+        this.flag = type;
+        // this.flag = 4;
         this.finish[type] = true;
       }
     },