Forráskód Böngészése

Merge remote-tracking branch 'origin/dev/otherHis' into dev/new1

zhouna 6 éve
szülő
commit
6d7f4ed388

+ 7 - 7
src/containers/RadioInpDrop.js

@@ -22,11 +22,11 @@ function mapStateToProps(state){
 // 主诉选中事件
 function mainSelect(dispatch,params){
   const {ikey,id,values} = params;
-  let index = getLabelIndex(ikey);
+  //let index = getLabelIndex(ikey);
   dispatch({
     type:SET_MS_RADIO_INPUT_VAL,
     data:{
-      ikey:index,
+      ikey,
       id,
       values
     }
@@ -36,11 +36,11 @@ function mainSelect(dispatch,params){
 // 现病史选中事件
 function currentSelect(dispatch,params){
   const {ikey,id,values} = params;
-  let index = getLabelIndex(ikey);
+  //let index = getLabelIndex(ikey);
   dispatch({
     type:SET_RADIO_INPUT_VALUE,
     data:{
-      ikey:index,
+      ikey,
       id,
       values
     }
@@ -51,11 +51,11 @@ function currentSelect(dispatch,params){
 //其他史选中事件
 function otherSelect(dispatch,params){
   const {ikey,id,values} = params;
-  let index = getLabelIndex(ikey);
+  //let index = getLabelIndex(ikey);
   dispatch({
     type:SET_OT_RADIO_INPUT_VAL,
     data:{
-      ikey:index,
+      ikey,
       id,
       values
     }
@@ -147,7 +147,7 @@ function mapDispatchToProps(dispatch,store){
       let ikey = getLabelIndex(index);
       dispatch({
         type:InputActions[+boxMark],
-        data:{values:params.values,ikey:boxMark==4?params.ikey:ikey}
+        data:{values:params.values,ikey:params.ikey}
       });
       dispatch(billing());
       dispatch({

+ 2 - 2
src/store/actions/checkBody.js

@@ -149,7 +149,7 @@ export const setRadioInputValue = (state,action)=>{
   let index = getLabelIndex(ikey);
   let innerInx = ikey.substr(ikey.length-1);
   let item = res.data[index];
-  if(item.tagType==3){      //在组合项中
+  if(item.tagType!=1){      //在组合项中
     item = res.data[index].questionMapping[innerInx];
   }
   let str='',temp='',obj=item.questionDetailList;
@@ -195,7 +195,7 @@ export const setRadioInputValue = (state,action)=>{
   }
   item.vals = values;
   item.value = str;
-  if(res.data[index].tagType==3){
+  if(res.data[index].tagType!=1){
     let hasValue = false;
     const sub = res.data[index].questionMapping.map((it)=>{
       return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');

+ 33 - 6
src/store/actions/currentIll.js

@@ -1,6 +1,7 @@
 import {getLabelIndex,fullfillText,getIds} from '@common/js/func.js';
 import config from '@config/index.js';
 import {getInitModules} from '@store/async-actions/homePage.js';
+import {formatContinueDots} from '@utils/tools';
 
 //插入病程变化模板
 function insertPro(data,processModule){
@@ -83,7 +84,7 @@ export const setData = (state,action) =>{
   let newMain = [];
   let mainLabelModule = res.mainLabelModule;//主诉选中的症状id获取到的模板
   let objToArr = [];
-  let keyArr = Object.keys(mainLabelModule); 
+  let keyArr = Object.keys(mainLabelModule);
   for(let i=0; i<keyArr.length; i++){
     objToArr.push(mainLabelModule[JSON.parse(keyArr[i])]);
   }
@@ -256,7 +257,7 @@ export const setData = (state,action) =>{
       }
       
       let symptomArr = newMainCopy.concat(manInput,newWiths,manWithInput);
-      let newSymptomArr = JSON.parse(JSON.stringify(symptomArr));  
+      let newSymptomArr = formatContinueDots(JSON.parse(JSON.stringify(symptomArr)));   //过来连续标点
       //组装好的主症状和伴随症状插入现病史模板(flag=4前)
       let insertIdx = null;
       for(let j=0; j<current.length; j++){
@@ -488,8 +489,13 @@ export function setRadioValue(state,action){
 export const setRadioInputValue = (state,action)=>{
   const res = Object.assign({},state);
   const {ikey,values,id} = action.data;
-  const item = res.data[ikey];
-  let str='',temp='',obj=res.data[ikey].questionDetailList;
+  let index = getLabelIndex(ikey);
+  let innerInx = ikey.substr(ikey.length-1);
+  let item = res.data[index];
+  if(item.tagType!=1){      //在组合项中
+    item = res.data[index].questionMapping[innerInx];
+  }
+  let str='',temp='',obj=item.questionDetailList;
   if(!values){    //清空
     let sld=obj.find((item)=>{
       return item.selected==true;
@@ -497,7 +503,18 @@ export const setRadioInputValue = (state,action)=>{
     sld?sld.selected=false:'';
     item.vals = null;
     item.value = '';
-    res.saveText[ikey] = '';
+    if(res.data[index].tagType!=1){
+      let hasValue = false;
+      const sub = res.data[index].questionMapping.map((it)=>{
+        if(it.value){     //至少有一个子值才黑显
+          hasValue = true;
+        }
+        return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
+      });
+      res.saveText[index] = hasValue?sub.join(''):'';
+    }else{
+      res.saveText[index] = '';
+    }
     res.update = Math.random();
     return res;
   }
@@ -521,7 +538,15 @@ export const setRadioInputValue = (state,action)=>{
   }
   item.vals = values;
   item.value = str;
-  res.saveText[ikey] = str;
+  if(res.data[index].tagType!=1){
+    let hasValue = false;
+    const sub = res.data[index].questionMapping.map((it)=>{
+      return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
+    });
+    res.saveText[index] = sub.join('');
+  }else {
+    res.saveText[ikey] = str;
+  }
   res.update = Math.random();
   return res;
 }
@@ -841,10 +866,12 @@ export function backspaceText(state,action){
     // data[delIndex].value = text;
   }else if(data[delIndex-1].tagType==8){
     data.splice(delIndex,1);
+    res.selecteds.splice(delIndex,1);      //杂音类样式选中状态对应
     res.saveText.splice(delIndex,1);
   }
   else{
     data.splice(delIndex-1,2);
+    res.selecteds.splice(delIndex-1,2);      //杂音类样式选中状态对应
     res.saveText.splice(delIndex-1,2);
   }
   // res.saveText = fullfillText(data).saveText;

+ 28 - 4
src/store/actions/mainSuit.js

@@ -500,8 +500,13 @@ export function setRadioValue(state,action){
 export const setRadioInputValue = (state,action)=>{
   const res = Object.assign({},state);
   const {ikey,values,id} = action.data;
-  const item = res.data[ikey];
-  let str='',temp='',obj=res.data[ikey].questionDetailList;
+  let index = getLabelIndex(ikey);
+  let innerInx = ikey.substr(ikey.length-1);
+  let item = res.data[index];
+  if(item.tagType!=1){      //在组合项中
+    item = res.data[index].questionMapping[innerInx];
+  }
+  let str='',temp='',obj=item.questionDetailList;
   if(!values){    //清空
     let sld=obj.find((item)=>{
       return item.selected==true;
@@ -509,7 +514,18 @@ export const setRadioInputValue = (state,action)=>{
     sld?sld.selected=false:'';
     item.vals = null;
     item.value = '';
-    res.saveText[ikey] = '';
+    if(res.data[index].tagType!=1){
+      let hasValue = false;
+      const sub = res.data[index].questionMapping.map((it)=>{
+        if(it.value){     //至少有一个子值才黑显
+          hasValue = true;
+        }
+        return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
+      });
+      res.saveText[index] = hasValue?sub.join(''):'';
+    }else{
+      res.saveText[index] = '';
+    }
     res.update = Math.random();
     return res;
   }
@@ -533,7 +549,15 @@ export const setRadioInputValue = (state,action)=>{
   }
   item.vals = values;
   item.value = str;
-  res.saveText[ikey] = str;
+  if(res.data[index].tagType!=1){
+    let hasValue = false;
+    const sub = res.data[index].questionMapping.map((it)=>{
+      return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
+    });
+    res.saveText[index] = sub.join('');
+  }else {
+    res.saveText[ikey] = str;
+  }
   res.update = Math.random();
   return res;
 }

+ 30 - 4
src/store/actions/otherHistory.js

@@ -107,8 +107,13 @@ export function setRadioValue(state,action){
 export const setRadioInputValue = (state,action)=>{
   const res = Object.assign({},state);
   const {ikey,values,id} = action.data;
-  const item = res.data[ikey];
-  let str='',temp='',obj=res.data[ikey].questionDetailList;
+  let index = getLabelIndex(ikey);
+  let innerInx = ikey.substr(ikey.length-1);
+  let item = res.data[index];
+  if(item.tagType!=1){      //在组合项中
+    item = res.data[index].questionMapping[innerInx];
+  }
+  let str='',temp='',obj=item.questionDetailList;
   if(!values){    //清空
     let sld=obj.find((item)=>{
       return item.selected==true;
@@ -116,7 +121,18 @@ export const setRadioInputValue = (state,action)=>{
     sld?sld.selected=false:'';
     item.vals = null;
     item.value = '';
-    res.saveText[ikey] = '';
+    if(res.data[index].tagType!=1){
+      let hasValue = false;
+      const sub = res.data[index].questionMapping.map((it)=>{
+        if(it.value){     //至少有一个子值才黑显
+          hasValue = true;
+        }
+        return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
+      });
+      res.saveText[index] = hasValue?sub.join(''):'';
+    }else{
+      res.saveText[index] = '';
+    }
     res.update = Math.random();
     return res;
   }
@@ -140,7 +156,15 @@ export const setRadioInputValue = (state,action)=>{
   }
   item.vals = values;
   item.value = str;
-  res.saveText[ikey] = str;
+  if(res.data[index].tagType!=1){
+    let hasValue = false;
+    const sub = res.data[index].questionMapping.map((it)=>{
+      return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
+    });
+    res.saveText[index] = sub.join('');
+  }else {
+    res.saveText[ikey] = str;
+  }
   res.update = Math.random();
   return res;
 }
@@ -408,6 +432,7 @@ export function backspaceText(state,action){
     // 前一个是文本标签或者子模板 不做处理
   }else if(data[delIndex-1].tagType==8){
     data.splice(delIndex,1);
+    res.selecteds.splice(delIndex,1);      //杂音类样式选中状态对应
     res.saveText.splice(delIndex,1);
   }
   else{
@@ -416,6 +441,7 @@ export function backspaceText(state,action){
       res[data[delIndex-1].formulaCode]=undefined;
     }
     data.splice(delIndex-1,2);
+    res.selecteds.splice(delIndex-1,2);      //杂音类样式选中状态对应
     res.saveText.splice(delIndex-1,2);
   }
   // res.saveText = fullfillText(data).saveText;

+ 3 - 3
src/store/async-actions/homePage.js

@@ -63,12 +63,12 @@ export const getInitModules= (dispatch,getStore)=>{
         });
         dispatch({
           type:SET_CURRENT,
-          data:initData.current,
+          data:formatContinueDots(initData.current),
           save:initSaveText.current,
-          processModule:initData.process,//病程变化
+          processModule:formatContinueDots(initData.process),//病程变化
           processModuleName:initModuleName.process,//病程变化模板名称
           saveProcess:initSaveText.process,
-          emptyData:initData.currentEmpty,//现病史空模板
+          emptyData:formatContinueDots(initData.currentEmpty),//现病史空模板
           saveEmpty:initSaveText.currentEmpty,
         });
         dispatch(getOtherHisRecord());          //获取其他史最近记录