Browse Source

Merge branch 'development' into byll

Luolei 6 years ago
parent
commit
7b4d2b7b39

+ 22 - 12
src/common/CheckBox.vue

@@ -1,10 +1,10 @@
 <template>
   <div class="check-wrap" v-if="item">
-    <p class="quest">{{indx + '.' + item.name}}</p>
-    <img :src="item.url.replace('{imageUrlPrefix}',imgUrl)" v-if="item.url">
-    <p v-for="(it,index) in item.questionDetailList" class="list">
-      <img :src="checkId.includes(it.id)?check:defaultPic" @click="handleClick(it,index)">
-      <span :class="{'check':checkId.includes(it.id)}">{{it.name}}</span>
+    <p class="quest">{{indx + '.' + datas.name}}</p>
+    <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>
     </p>
   </div>
 </template>
@@ -19,19 +19,29 @@ import checkIcon from '../images/check.png'
         imgUrl:tools.imageUrlPrefix,
         defaultPic:icon,
         check:checkIcon,
-        checkId:[]
+        datas:{},
+        checkTxt:[]
       }
     },
     props:['item','indx'],
+    created(){
+      this.datas = JSON.parse(JSON.stringify(this.item));
+    },
     methods:{
-      handleClick(it){
-        const id = it.id;
-        let ids = this.checkId;
-        if(ids.includes(id)){
-          this.checkId.splice(ids.indexOf(id),1);
+      handleClick(it,index){
+        const list = this.datas;
+        let data = list.questionDetailList&&list.questionDetailList.slice(0);
+        let value = "";
+        if(data[index].select){
+          data[index].select = 0;
+          this.checkTxt.splice(index,1);
         }else{
-          this.checkId.push(id);
+          data[index].select = 1;
+          this.checkTxt[index] = data[index].name;
         }
+        value = this.checkTxt.filter(item=>item).join(',');
+        const newData = Object.assign({},this.datas,{questionDetailList:data},{value:value})
+        this.$emit("updata",newData);
       }
     }
   }

+ 14 - 16
src/common/Radio.vue

@@ -1,11 +1,10 @@
 <template>
   <div class="radio-wrap" v-if="item">
-    <p class="quest">{{indx + '.' + item.name}}</p>
-    <img :src="item.url.replace('{imageUrlPrefix}',imgUrl)" v-if="item.url">
-    <p v-for="(it,index) in item.questionDetailList" :key="it.id" class="list">
-      <img :src="index==current||it.select==1?check:defaultPic" @click="handleClick(it,index)">
-      <!-- <img :src="it.select?check:defaultPic" @click="handleClick(it,index)"> -->
-      <span :class="{'check':index==current}">{{it.name}}</span>
+    <p class="quest">{{indx + '.' + datas.name}}</p>
+    <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>
     </p>
   </div>
 </template>
@@ -19,17 +18,17 @@ import {deepClone} from '@utils/tools.js'
       return{
         defaultPic:icon,
         check:checkIcon,
-        current:null,
         datas:{}
       }
     },
-    props:['item','indx','pId'],
+    props:['item','indx'],
+    created(){
+      this.datas = JSON.parse(JSON.stringify(this.item));
+    },
     methods:{
-      handleClick(it,index){console.log("单选:",this.item)
-        this.current = index;
-        const list = JSON.parse(JSON.stringify(this.item));
-        let data = list.questionDetailList.slice(0); //数组深拷贝?
-        // let data = deepClone(list);
+      handleClick(it,index){
+        const list = this.datas;
+        let data = list.questionDetailList&&list.questionDetailList.slice(0); //数组深拷贝?
         let value = "";
         for(let i=0;i<data.length; i++){
           data[i].select = 0
@@ -38,9 +37,8 @@ import {deepClone} from '@utils/tools.js'
             value = data[i].name;
           }
         }
-        const newData = Object.assign({},this.item,{questionDetailList:data},{value:value})
-        this.$store.commit('setDatas',{data:newData,pId:this.pId,type:"1"});
-        this.$store.commit('getUpdate'); //更新数据
+        const newData = Object.assign({},this.datas,{questionDetailList:data},{value:value})
+        this.$emit("updata",newData);
       }
     }
   }

+ 42 - 8
src/components/Detail.vue

@@ -1,13 +1,17 @@
 <template>
   <div class="detail-wrap">
-    <div v-for="(item,index) in datas">
+    <!-- <div v-for="(item,index) in datas"> -->
+    <div v-for="(item,index) in checkDatas.questionMapping">
       <Radio v-if="item.controlType==1" 
             :item="item" 
-            :indx="index+1" 
-            :pId="id"
+            :indx="index+1"
+            :key="item.id"
+            @updata="updataData"/>
+      <CheckBox v-if="item.controlType==2" 
+            :item="item" 
+            :indx="index+1"
             :key="item.id"
             @updata="updataData"/>
-      <CheckBox v-if="item.controlType==2" :item="item" :indx="index+1"/>
       <!-- 输入框 -->
       <div class="inp" v-if="item.controlType==6">
         <p class="name">{{index+1+'.'+item.name}}</p>
@@ -19,23 +23,53 @@
 <script type="text/javascript">
 import Radio from '../common/Radio.vue';
 import CheckBox from '../common/CheckBox.vue';
+// 将获取到的数据源转换成私有数据,处理选择事件。点击完成后统一存到store中,便于回读
   export default {
     name:'Detail',
     data(){
       return{
-
+        checkDatas:{}
       }
     },
-    props:['datas','id'],
+    props:['datas'],
+    created(){
+      this.checkDatas = JSON.parse(JSON.stringify(this.datas));
+    },
     components:{
       Radio,
       CheckBox
     },
     methods:{
       updataData(data){
-        // console.log("源数据:",this.datas,'更改后:',data)
+        const origMapping = this.datas.questionMapping;
+        let mapping = this.checkDatas.questionMapping;
+        for(let i in origMapping){
+          if(origMapping[i].id==data.id){
+            mapping.splice(i,1,data)
+          }
+        }
+      },
+      saveData(){//存值
+        const datas = this.checkDatas.questionMapping;
+        let text = "";
+        for(let i in datas){
+          if(datas[i].value){
+            text += datas[i].value+',';
+          }
+        }
+        let msg = this.checkDatas.name+ ',' + text;
+        this.$store.commit('setDatas',{data:this.checkDatas,pId:this.checkDatas.id,type:"1"});
+        this.$store.commit('setText',{text:msg,pId:this.checkDatas.id,type:"1"});
+      }
+    },
+    /*watch:{
+      checkDatas:{
+        handler(newVal,oldVal){
+          console.log("详情数据更新:",newVal,oldVal); 
+        },
+        deep:true
       }
-    }
+    },*/
   }
 </script>
 <style lang="less" scoped>

+ 6 - 22
src/components/DetailBox.vue

@@ -8,7 +8,7 @@
       <span>清空</span>
     </div>
     <div class="main">
-      <Detail :datas="privateData.questionMapping" :id="privateData.id"/>
+      <Detail :datas="privateData" ref="detail"/>
     </div>
     <div class="foot" @click="complete">完成</div>
   </div>
@@ -20,11 +20,11 @@
     data(){
       return{
         msg:"胸痛详情",
-        privateData:{}
+        privateData:{},
+        compFlag:false
       }
     },
     created(){
-      console.log("详情盒子:",this.data);
       this.privateData = this.data;
     },
     mounted(){
@@ -34,23 +34,11 @@
     },
     methods:{
       close(){
-        this.$emit("close","胸痛");
+        this.$emit("close");
       },
       complete(){
-      //拼接value,将选中的数据结构存到store--setDatas
-        const id = this.data.id;
-        // const datas = this.$store.state.datas;
-        const datas = this.$store.state.symptom.datas;
-        const current = datas[id];
-        const detail = current.questionMapping;
-        let text = "";
-        for(let i in detail){
-          if(detail[i].value){
-            text += detail[i].value+',';
-          }
-        }
-        let msg = current.name+ ',' + text;
-        this.$emit("pComplete",msg.substring(0,msg.length-1));
+        this.$refs.detail.saveData();
+        this.$emit("pComplete");
       }
     },
     props:['data'],
@@ -63,18 +51,14 @@
 @import '../less/base.less';
   .detailBox-wrap{
     width: 100%;
-    // height: 100%;
-    // height: calc(~"100%-1.15rem");
     overflow-y: auto;
     position: fixed;
-    // top: 1.15rem;
     bottom: 0;
     left: 0;
     z-index: 666;
     background: #fff;
     border-radius: .08rem .08rem 0 0;
     font-size: .3rem;
-    // padding-bottom: .88rem;
     .head{
       height: .88rem;
       line-height: .88rem;

+ 55 - 19
src/components/DiagTreat.vue

@@ -1,11 +1,14 @@
 <template>
   <div class="treat-wrap">
-    <div v-for="(it,i) in datas.moduleDetailDTOList" 
-        v-if="datas&&datas.moduleDetailDTOList"
+    <div v-for="(it,i) in dtoList" 
+        v-if="dtoList"
         :key="it.id">
       <div class="label" v-if="it.controlType==0">
         <p class="quest">{{it.name}}</p>
-        <span class="symp" v-for="item in it.questionMapping">{{item.name}}</span>
+        <span v-for="(item,indx) in it.questionMapping" class="symp" @click="handleClick(item,indx,i)">
+          {{item.name}}
+          <i v-if="item.select==1" @click="deletSymp(item,indx)"><img src="../images/delete.png" alt=""></i>
+        </span>
       </div>
       <UploadImg v-if="it.controlType==4" 
             :item="it" 
@@ -21,6 +24,16 @@
       <span class="back" @click="beBack">{{'返回'+ preName}}</span>
       <span class="next" @click="toNext">{{'进入'+ nextName}}</span>
     </div>
+    <!-- <div class="detail" v-if="show">
+      <DetailBox @close="closeDetal" 
+              :data="labelDetail" 
+              v-if="labelDetail.questionMapping&&labelDetail.questionMapping.length>0"
+              @pComplete="complete"/>
+    </div>
+    <Toast :message="delText" 
+          :show="showToast"
+          @comfirn="comfirnDel" 
+          @cancel="cancelDel"/> -->
   </div>
 </template>
 <script type="text/javascript">
@@ -31,21 +44,49 @@
       return{
         msg:"诊疗情况",
         chooseSymp:[{name:'未治疗'}],
-        imgs:this.$store.state.diagnose.imgSrc
+        imgs:this.$store.state.diagnose.imgSrc,
+        dtoList:[], //选项
+        details:[], //明细
+        chooseTxt:{} //选中的文字
       }
     },
     props:['datas','preName','nextName'],
+    created(){
+      let dataArr = this.datas&&this.datas.moduleDetailDTOList;
+      if(dataArr){
+        this.dtoList = JSON.parse(JSON.stringify(dataArr));
+      }
+    },
     methods:{
       beBack(){
         this.$emit('back');
       },
       toNext(){
         this.$emit('next');
+      },
+      handleClick(item,index,pIndex){ 
+        // 存值到store并实现及时更新
+        let value = item.name;
+        let currMapping = JSON.parse(JSON.stringify(this.dtoList[pIndex].questionMapping));
+        currMapping[index].select = 1
+        this.dtoList[pIndex] = Object.assign({},this.dtoList[pIndex],{questionMapping:currMapping},{value:value})
+         console.log(222,this.dtoList[pIndex],currMapping)
+      },
+      deletSymp(item,index){
+        console.log(456,item)
       }
     },
     components:{
       UploadImg
-    }
+    },
+    watch:{
+      dtoList:{
+        handler(newVal,oldVal){
+          console.log("诊疗数据更新:",newVal,oldVal); 
+        },
+        deep:true
+      }
+    },
   }
 </script>
 <style lang="less" scoped>
@@ -58,21 +99,11 @@
       font-weight: 700;
     }
     .label{
-      padding-bottom: .2rem;
-      .symp{
-        display: inline-block;
-        width:1.9rem;
+      .label;
+      img{
+        width:.56rem;
         height: .74rem;
-        line-height: .74rem;
-        border: 1px solid #DFE0E4;
-        border-radius: .08rem;
-        text-align: center;
-        color: #7C828E;
-        margin: 0 0 .3rem .3rem;
-        box-sizing: border-box;
-      }
-      .symp:nth-child(3n+2){
-        margin-left: 0;
+        vertical-align: top;
       }
     }
     .result{
@@ -88,6 +119,11 @@
         line-height: .44rem;
       }
     }
+    .choose{
+      color:#fff;
+      background: linear-gradient(-270deg, #4F4FFF, #4F8BFF);
+      box-shadow: 0 .08rem .16rem 0 rgba(79,129,255,0.40);
+    }
   }
   .foot{
     .dbfooter;

+ 3 - 17
src/components/Others.vue

@@ -5,7 +5,8 @@
         :key="it.id">
       <div class="label" v-if="it.controlType==0">
         <p class="quest">{{it.name}}</p>
-        <span class="symp" v-for="item in it.questionMapping">{{item.name}}</span>
+        <!-- <span v-for="item in it.questionMapping" :class="['symp',{'over':item.name&&item.name.length>5}]">{{item.name}}</span> -->
+        <span v-for="item in it.questionMapping" class="symp">{{item.name}}</span>
       </div>
     </div>
     <div class="result">
@@ -48,22 +49,7 @@
       font-weight: 700;
     }
     .label{
-      padding-bottom: .2rem;
-      .symp{
-        display: inline-block;
-        width:1.9rem;
-        height: .74rem;
-        line-height: .74rem;
-        border: 1px solid #DFE0E4;
-        border-radius: .08rem;
-        text-align: center;
-        color: #7C828E;
-        margin: 0 0 .3rem .3rem;
-        box-sizing: border-box;
-      }
-      .symp:nth-child(3n+2){
-        margin-left: 0;
-      }
+      .label;
     }
     .result{
       .title{

+ 59 - 80
src/components/Symptom.vue

@@ -38,8 +38,8 @@ import Toast from '../common/Toast.vue';
   export default {
     name:'Symptom',
     data(){
-      let {datas,update} = this.$store.state;
-      const {pathInfo,originDatas} = this.$store.state;
+      let {datas,pathInfo} = this.$store.state;
+      const {choose,text} = this.$store.state.symptom;
       return {
         age:pathInfo.patientAge,
         sexType:pathInfo.patientSex=='男'?1:(pathInfo.patientSex=='女'?2:3),
@@ -48,25 +48,25 @@ import Toast from '../common/Toast.vue';
         choose:false,
         check:false,
         show:false, //显示明细
-        chooseSymp:[], //已选症状
+        chooseSymp:choose, //已选症状
         symp:[], //症状
         labelDetail:{}, //明细
-        checkText:{}, //选中拼好的明细
+        checkText:text, //症状情况文字
         questId:null, //id
-        // symptomName:'', //点击的症状名称
         delText:"是否删除该信息? (已填内容将清除)",
         delIndex:null,
         showToast:false,
         finished:false,   //是否填写了明细
-        upData:update
       }
     },
     created(){
-      this.getSympList();
-    },
-    mounted(){
-      // 从store中取数据
-
+      if(this.chooseSymp.length>0){
+        // 推送
+        const sympText = this.getSympText();
+        this.getPush(sympText);
+      }else{
+        this.getSympList(); //常见
+      } 
     },
     methods:{
       getSympList(){ 
@@ -87,40 +87,46 @@ import Toast from '../common/Toast.vue';
         // if(this.chooseSymp.length==0){return}
         this.$emit('next');
         // 把症状情况的数据存起-已选、详情、拼好的文字
-        
+        this.$store.commit('setChoose',{choose:this.chooseSymp,type:"1"});
 
       },
-      showDetil(item){
+      showDetil(item){console.log("getById:",item)
         this.chooseSymp.push(item);
-        // this.questId = item.conceptId;
-        this.questId = item.questionId;
-        const param = {
-          "age":this.age,
-          "id":item.questionId,
-          "sexType":this.sexType
-        }
-        api.getById(param).then((res)=>{
-          const result = res.data;
-          if(result.code==0){
-            const mapping = result.data.questionMapping;
-            this.labelDetail = result.data;
-            this.$store.commit('setOrigin',{type:"1",data:result.data});
-            // this.$store.commit('getUpdate');
-            if(mapping&&mapping.length>0){
-              this.show = true;
-            } 
+        this.questId = item.questionId || item.id || item.conceptId;
+        const id = item.questionId || item.id; //常见症状questionId,推送id,两者均有可能没有
+        //将选中的name存到store中的text
+        this.$store.commit('setText',{type:"1",text:item.name,pId:this.questId});
+        if(id){
+          const param = {
+            "age":this.age,
+            "id":id,
+            "sexType":this.sexType
           }
-        })
-        // 推理 
-        const sympText = this.getSympText();
-        this.getPush(sympText);
+          api.getById(param).then((res)=>{
+            const result = res.data;
+            if(result.code==0){
+              const mapping = result.data.questionMapping;
+              this.labelDetail = result.data;
+              this.$store.commit('setOrigin',{type:"1",data:result.data});
+              if(mapping&&mapping.length>0){
+                this.show = true;
+              }
+            }
+          })
+        }else{//没有questionId或id 就没有详情,则直接调推送
+          const sympText = this.getSympText();
+          this.getPush(sympText);
+          this.checkText = this.$store.state.symptom.text;console.log(1111,this.checkText)
+        }
+        
       },
       getSympText(){
-        let sympText = "";
-        for(let k in this.chooseSymp){
-          sympText += this.chooseSymp[k].name;
+        const text = this.$store.state.symptom.text;
+        let msg = "";
+        for(let i in text){
+          msg += text[i];
         }
-        return sympText;
+        return msg;
       },
       getPush(symptoms){//推理
         const param = {
@@ -136,16 +142,17 @@ import Toast from '../common/Toast.vue';
           }
         })
       },
-      closeDetal(msg){
-        const questId = this.questId;
-        this.getPush(msg);
-        // this.checkText = Object.assign({},this.checkText,{[questId]:msg});
+      closeDetal(){
+        // 推理 
+        const sympText = this.getSympText();
+        this.getPush(sympText);
+        // this.getPush("胸痛");
         this.show = false;
         this.questId = null;
       },
       deletSymp(item,index){
         this.delIndex = index;
-        this.questId = item.questionId;
+        this.questId = item.questionId || item.conceptId;
         if(this.chooseSymp.length==1){
           this.delText = "是否删除该信息?删除后将重新填写预问诊流程 (已填内容将清除)"
         }
@@ -169,17 +176,17 @@ import Toast from '../common/Toast.vue';
         this.questId = null;
         this.delText = "是否删除该信息? (已填内容将清除)";
       },
-      complete(msg){//明细填写完成
-        // 获取选择后的明细数据-拼接症状情况-关闭明细弹窗
-        // let text = this.symptomName + text;
-        this.checkText = Object.assign({},this.checkText,{[this.questId]:msg});
+      complete(){//明细填写完成
+        this.checkText = this.$store.state.symptom.text;
         this.show = false;
         this.questId = null;
+        // 推理 
+        const sympText = this.getSympText();
+        this.getPush(sympText);
       },
       showChecked(item){  
         const origin = this.$store.state.symptom.origin;
         const read = this.$store.state.symptom.datas;
-        console.log(1111,item,origin,read,)
         const data = read[item.questionId] || origin[item.questionId];
         if(data.questionMapping&&data.questionMapping.length>0){
           this.labelDetail = data;
@@ -191,22 +198,6 @@ import Toast from '../common/Toast.vue';
       DetailBox,
       Toast
     },
-    computed:{
-      getQuestId(){
-        return this.upData;
-      }
-    },
-    watch:{
-      getQuestId:{
-        handler(newVal,oldVal){
-          console.log("数据更新了",newVal,oldVal);
-          let datas = this.$store.state.datas;
-          let originDatas = this.$store.state.originDatas;
-          this.labelDetail = datas[this.questId] || originDatas[this.questId];
-        },
-        deep:true
-      }
-    }
   }
 </script>
 <style lang="less" scoped>
@@ -245,25 +236,13 @@ import Toast from '../common/Toast.vue';
         width:.56rem;
         height: .74rem;
       }
+      .over{
+        .over;
+      }
     }
   }
   .label{
-    padding-bottom: .2rem;
-    .symp{
-      display: inline-block;
-      width:1.9rem;
-      height: .74rem;
-      line-height: .74rem;
-      border: 1px solid #DFE0E4;
-      border-radius: .08rem;
-      text-align: center;
-      color: #7C828E;
-      margin: 0 0 .3rem .3rem;
-      box-sizing: border-box;
-    }
-    .symp:nth-child(3n+2){
-      margin-left: 0;
-    }
+    .label;
   }
   .result{
     .title{

+ 27 - 0
src/less/base.less

@@ -46,4 +46,31 @@
     color: #fff;
     background: linear-gradient(-270deg, #4F4FFF,#4F8BFF);
   }
+}
+.over{
+  font-size: .24rem !important;
+}
+.label{
+  padding-bottom: .2rem;
+  .symp{
+    display: inline-block;
+    // width:1.9rem;
+    min-width:1.9rem;
+    height: .74rem;
+    line-height: .74rem;
+    border: 1px solid #DFE0E4;
+    border-radius: .08rem;
+    text-align: center;
+    color: #7C828E;
+    // margin: 0 0 .3rem .3rem;
+    margin: 0 .3rem .3rem 0;
+    padding: 0 .05rem;
+    box-sizing: border-box;
+  }
+  /* .symp:nth-child(3n+2){
+    margin-left: 0;
+  } */
+  .over{
+    font-size: .24rem !important;
+  }
 }

+ 3 - 17
src/less/index.less

@@ -15,10 +15,6 @@ input, textarea{
 button {
     border: 0 none;
 }
-h1, h2, h3, h4, h5, h6 {
-  // font-size: 100%;
-  // font-weight: 500;
-}
 i {
   font-style: normal;
 }
@@ -57,7 +53,7 @@ a {
     white-space: nowrap;    
     text-overflow: ellipsis;
 }
-// #app ,body,html{
+
 html,body{
   width: 100%;
   height: auto !important;
@@ -66,20 +62,10 @@ html,body{
 html{
   margin: 0;
   padding: 0;
-  font-size: @font-size;  //750px,1vw = 750*1%=7.5px
-  // font-size: 13.33333333vw !important;  //750px,1vw = 750*1%=7.5px
+  // font-size: @font-size;  //750px,1vw = 750*1%=7.5px
+  font-size: 13.33333333vw !important;
 }
 
-/* @media screen and (-webkit-device-pixel-ratio:2){
-  html{
-    font-size: @font-size * 2;
-  }
-}
-@media screen and (-webkit-device-pixel-ratio:3){
-  html{
-    font-size: @font-size * 2;
-  }
-} */
 // 兼容ipad和pc端大屏幕
 @media screen and (min-width: 560px){
   html{

+ 29 - 16
src/store.js

@@ -8,16 +8,16 @@ const store = new Vuex.Store({
     pathInfo:{}, //患者信息-后续提交要用
     sysConfig:[], //系统配置项
     allMoudles:[], //模板
-    originDatas:{},  //getById获取到的源数据
-    datas:{},  //处理过的数据
+    // originDatas:{},  //getById获取到的源数据
+    // datas:{},  //处理过的数据
     updata:false,  //更新数据
-    imgFile:[],   //上传图片信息file
-    imgSrc:{},   //上传的图片信息src
+    // imgFile:[],   //上传图片信息file
+    // imgSrc:{},   //上传的图片信息src
     symptom:{ //症状情况
       choose:[],
       origin:{},
       datas:{},
-      text:""
+      text:{}
     },
     diagnose:{ //诊疗
       origin:{},
@@ -37,7 +37,7 @@ const store = new Vuex.Store({
     saveAll(state,param){
       state.allMoudles = param;
     },
-    setOrigin(state,param){console.log("存值:",param)
+    setOrigin(state,param){
       const type = parseInt(param.type);
       const data = param.data;
       switch(type){
@@ -56,21 +56,12 @@ const store = new Vuex.Store({
         default:
           break;
       }
-      // state.originDatas = Object.assign({},state.originDatas,{[param.id]:param});
     },
     setDatas(state,param){
-      // let originData = state.datas[param.pId]?state.datas[param.pId]:JSON.parse(JSON.stringify(state.originDatas[param.pId]));
       const type = parseInt(param.type);
       switch(type){
         case 1:
-          let originData = state.symptom.datas[param.pId]?state.symptom.datas[param.pId]:JSON.parse(JSON.stringify(state.symptom.origin[param.pId]));
-          let list = originData.questionMapping.slice(0);
-          for(let i=0; i<originData.questionMapping.length; i++){
-            if(originData.questionMapping[i].id==param.data.id){
-              list.splice(i,1,param.data);
-            }
-          }
-          state.symptom.datas[param.pId] = Object.assign({},state.symptom.origin[param.pId],{questionMapping:list});
+          state.symptom.datas = Object.assign({},state.symptom.datas,{[param.pId]:param.data});
           break;
         case 2: //诊疗情况
           break;
@@ -85,6 +76,28 @@ const store = new Vuex.Store({
       }
       
     },
+    setText(state,param){
+      const type = parseInt(param.type);
+      switch(type){
+        case 1:
+          state.symptom.text = Object.assign({},state.symptom.text,{[param.pId]:param.text});
+          break;
+        case 2: //诊疗情况
+          
+          break;
+        case 3:
+
+          break;
+        case 4:
+
+          break;
+        default:
+          break;
+      }
+    },
+    setChoose(state,param){ //症状情况-已选症状
+      state.symptom.choose = param.choose;
+    },
     getUpdate(state){//更新数据
       state.updata = !state.updata;
     },