瀏覽代碼

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

zhouna 6 年之前
父節點
當前提交
e6a8e4b31b

+ 2 - 2
src/common/components/DropList/index.jsx

@@ -43,14 +43,14 @@ class DropList extends Component{
     onSelect&&onSelect(undefined);
   }
   render(){
-    const {data} = this.props;
+    const {data,hideTag} = this.props;
     const domNode = document.getElementById('root');
     return ReactDom.createPortal(
       <div className={this.getClass()} style={this.getStyle()} contentEditable='false'>
         <ul>
           {data&&data.map((it)=>{
             /*return <li onClick={(e)=>this.handleSelect(e,it)} className={it.selected||(it.selected!==false&&+it.defaultSelect===1)?style['selected']:''}>{it.labelPrefix}{it.questionDetailList&&it.questionDetailList.length>0?it.questionDetailList[0].name:it.name}{it.labelSuffix}</li>*/
-            return <li onClick={(e)=>this.handleSelect(e,it)} className={it.selected||(it.selected!==false&&+it.defaultSelect===1)?style['selected']:''}>{it.labelPrefix}{it.name}{it.labelSuffix}</li>
+            return <li onClick={(e)=>this.handleSelect(e,it)} className={it.selected||(!hideTag&&it.selected!==false&&+it.defaultSelect===1)?style['selected']:''}>{it.labelPrefix}{it.name}{it.labelSuffix}</li>
           })}
           <li onClick={(e)=>this.handleClear(e)} className='red'>清空选项</li>
         </ul>

+ 2 - 2
src/common/components/NumberUnitPan/index.jsx

@@ -83,7 +83,7 @@ class NumberUnitPan extends Component{
           <td><span onClick={this.handleSelect}>1</span></td>
           <td><span onClick={this.handleSelect}>2</span></td>
           <td><span onClick={this.handleSelect}>3</span></td>
-          <td><span onClick={this.handleSelect}>分</span></td>
+          <td><span onClick={this.handleSelect}>分</span></td>
           <td><span onClick={this.handleSelect}>周</span></td>
           <td><span onClick={this.handleSelect}>余</span></td>
         </tr>
@@ -91,7 +91,7 @@ class NumberUnitPan extends Component{
           <td><span onClick={this.handleSelect}>4</span></td>
           <td><span onClick={this.handleSelect}>5</span></td>
           <td><span onClick={this.handleSelect}>6</span></td>
-          <td><span onClick={this.handleSelect}>时</span></td>
+          <td><span onClick={this.handleSelect}>时</span></td>
           <td><span onClick={this.handleSelect}>月</span></td>
           <td><span onClick={this.handleSelect}>次</span></td> 
         </tr>

+ 7 - 11
src/components/NumberDrop/index.jsx

@@ -52,16 +52,11 @@ class NumberDrop extends Component{
         placeholder:this.props.placeholder
       });
     }else{
-      //console.log(text,isNaN(+text),max<+text)
       if(needCompare){
-        /*if(text!=''&&(isNaN(+text)||max<+text)){    //数值过大
-          this.beyondArea();
-          return;
-        }*/
         const that = this;
         const isFine = this.validSymbols(text,min,max);      //有~或/时是否合理
         const hasSymbol = /[\/|\~]/g.test(text);           //是否有~或/
-        const singleFine = !isNaN(+text)&&max!=undefined&&min<text&&text<max;   //无~或/时是否合理
+        const singleFine = !isNaN(+text)&&min<text&&text<max;   //无~或/时是否合理
         timer = setTimeout(function(){
           clearTimeout(that.state.sltTimer);
           if(text!=''&&(!hasSymbol&&!singleFine)||(hasSymbol&&!isFine)){
@@ -139,11 +134,12 @@ class NumberDrop extends Component{
     //输入只有一个~或/时判断两边是否为合理数字,有多个为不合理
     const index1 = txt.indexOf('~');
     const index2 = txt.indexOf('/');
+    const needCompare = min!=undefined&&max!=undefined;
     let arr1=[],arr2=[];
     if(index1!=-1&&index1==txt.lastIndexOf('~')&&index1!=txt.length-1){   //有且只有一个~,且不在最后
       arr1 = txt.split('~');
       //~的范围在合理范围内为合理值
-      if(!isNaN(+arr1[0])&&!isNaN(+arr1[1])&&+arr1[0]>min&&+arr1[1]<max){
+      if(!isNaN(+arr1[0])&&!isNaN(+arr1[1])&&((!needCompare)||(needCompare&&min<arr1[0]&&arr1[0]<max&&min<arr1[1]&&arr1[1]<max))){
         return true
       }
       return false;
@@ -151,7 +147,7 @@ class NumberDrop extends Component{
     if(index2!=-1&&index2==txt.lastIndexOf('/')&&index2!=txt.length-1){   //有且只有一个~,且不在最后
       arr2 = txt.split('/');
       // /两边的数字分别在合理范围内为合理值
-      if(!isNaN(+arr2[0])&&!isNaN(+arr2[1])&&min<arr2[0]&&arr2[0]<max&&min<arr2[1]&&arr2[1]<max){
+      if(!isNaN(+arr2[0])&&!isNaN(+arr2[1])&&((!needCompare)||(needCompare&&min<arr2[0]&&arr2[0]<max&&min<arr2[1]&&arr2[1]<max))){
         return true
       }
       return false;
@@ -166,16 +162,16 @@ class NumberDrop extends Component{
     }
     //输入超出合理范围或输入不是数字提示且清空
     const needCompare=min!=undefined&&max!=undefined;
-    if(needCompare){
+    //if(needCompare){
       const txt = e.target.innerText.trim();
       const isFine = this.validSymbols(txt,min,max);      //有~或/时是否合理
       const hasSymbol = /[\/|\~]/g.test(txt);           //是否有~或/
-      const singleFine = !isNaN(+txt)&&min<txt&&txt<max;   //无~或/时是否合理
+      const singleFine = (!isNaN(+txt)&&!needCompare)||(!isNaN(+txt)&&needCompare&&min<txt&&txt<max);   //无~或/时是否合理
       if(txt!=''&&(!hasSymbol&&!singleFine)||(hasSymbol&&!isFine)){
         this.beyondArea();
         return;
       }
-    }
+    //}
 
     //输入为空时显示placeholder
     if(!e.target.innerText.trim()){

+ 2 - 2
src/components/PushItems/DetailsModal/index.jsx

@@ -3,6 +3,7 @@ import styles from "./index.less";
 import NewPortal from './NewPortal'
 import close from "./../img/close.png";
 import $ from "jquery";
+import { imageUrlPrefix } from '@utils/config.js';
 class DetailsModal extends Component {
     constructor(props) {
         super(props);
@@ -50,11 +51,10 @@ class DetailsModal extends Component {
     render() {
         const {showTipsDetails, tipsDetails} = this.props;
         const { currentIndex } = this.state
-        const imageUrlPrefix = 'http://192.168.2.241:82'; //图片服务器地址
         return (<NewPortal visible={showTipsDetails}>
         <div className={styles['details-wrapper']}>
            <div className={styles['details-content-wrapper']}>
-                <h1 className={styles['details-content-name']} >{tipsDetails && tipsDetails.name} <img className={styles['details-close']} onClick={this.hideTips} src={close} /></h1>
+                <h1 className={styles['details-content-name']} >{tipsDetails && tipsDetails.tagName} <img className={styles['details-close']} onClick={this.hideTips} src={close} /></h1>
                 <div className={styles['details-content']} id= 'detailsContent' onScroll={this.handleScrollModal.bind(this, tipsDetails)}>
                     {tipsDetails && tipsDetails.introduceDetailList && tipsDetails.introduceDetailList.map((item, index) => {
                         return (<div id={item.title}>

+ 1 - 1
src/components/PushItems/index.jsx

@@ -332,7 +332,7 @@ class PushItems extends Component {
                 <img src={recommendImg} />
                 推荐检验检查
                 <div className={style["billing"]} 
-                     style={assay.length === 0 && check.length === 0 ? {color: 'gray', border: '1px solid gray'} : ''} 
+                     style={assay.length === 0 && check.length === 0 ? {color: 'gray', border: '1px solid gray', cursor:'auto'} : ''} 
                      onClick={assay.length === 0 && check.length === 0 ? '' : billing}>
                     开单
                 </div>

+ 2 - 2
src/components/RadioDrop/index.jsx

@@ -144,7 +144,7 @@ class RadioDrop extends Component{
     handleDbclick&&handleDbclick({id:patId||id});
   }
   render(){
-    const {data,prefix,suffix,placeholder,show,value} = this.props;
+    const {data,prefix,suffix,placeholder,show,value,hideTag} = this.props;
     const {boxLeft,boxTop} = this.state;
     return <div className={style['container']} ref = {this.$cont}>
       {prefix}
@@ -157,7 +157,7 @@ class RadioDrop extends Component{
         {value||placeholder}
       </div>
       {suffix}
-      <DropList onSelect={this.handleSelect} data={data} left={boxLeft} top={boxTop} show={show}/>
+      <DropList onSelect={this.handleSelect} data={data} left={boxLeft} top={boxTop} show={show} hideTag={hideTag}/>
     </div>
   }
 }

+ 2 - 2
src/components/RadioInpDrop/index.jsx

@@ -57,7 +57,7 @@ class RadioInpDrop extends Component{
     return classNames(style['tag'],orgBorder);
   }
   handleSelect(item){
-    const {handleSelect,ikey,value,placeholder} = this.props;
+    const {handleSelect,ikey,value,placeholder,mainSaveText} = this.props;
     let vals = {}, inx = 0;
     if(!item){
       handleSelect&&handleSelect({ikey});  //清空
@@ -77,7 +77,7 @@ class RadioInpDrop extends Component{
     this.setState({
       texts:vals
     });
-    handleSelect&&handleSelect({ikey,id:item.id,values:vals});
+    handleSelect&&handleSelect({ikey,id:item.id,values:vals,mainSaveText,value});
   }
   handleShow(e){
     //e.stopPropagation();

+ 1 - 1
src/components/SpreadDrop/index.jsx

@@ -250,7 +250,7 @@ class SpreadDrop extends Component{
         // withs:withOn?[]:[...withs,id],     //取消“伴”选中,伴随症状全部取消选中    
         // withs:withOn?[]:[...withs,{id:item.id,name:name}],
         withs:withOn?[]:withs,
-        ban:withOn?{}:{id:id,name:name},
+        ban:withOn?{}:{id:id,name:name,value:name},
         //withsName:withOn?"":withsName+name,     //取消“伴”选中,伴随症状全部取消选中
         nowOn:withOn?(noneOn?'none':''):'with'
       });

+ 3 - 3
src/containers/NumberUnitDrop.js

@@ -54,15 +54,15 @@ function handleModuleDiff(dispatch,params){
   switch (+type){
     case 1:
       if(mark){//选中才限制,清空和回退无需验证
-        // let text = filterDataArr(mainSaveText);
-        let text = filterArr(mainSaveText);
+        let text = filterDataArr(mainSaveText);
+        // let text = filterArr(mainSaveText);
         const item = mainData[+ikey];
         const nextItem = mainData[+ikey+1];
         let lengths = text.length;
         if(nextItem&&nextItem.tagType==8 && nextItem.tagName==',' && item.value){
           lengths = text.length + 1;
         }
-        // console.log(999,mainSaveText,lengths);
+        
         if(lengths >= config.limited){
           Notify.info(config.limitText);
           return

+ 20 - 11
src/containers/RadioInpDrop.js

@@ -14,7 +14,7 @@ import config from '@config/index.js';
 
 function mapStateToProps(state){
   return {
-    //mainSaveText:state.mainSuit.saveText,
+    mainSaveText:state.mainSuit.saveText,
   }
 }
 
@@ -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
     }
@@ -75,13 +75,22 @@ function checkSelect(dispatch,params){
 }
 //在不同模块(主诉、现病史等)下拉选中调用不同事件
 function handleModuleDiff(dispatch,store,params){
-  const {mainSaveText,value,text} = params;
+  const {mainSaveText,values,value} = params;
   const type = params.ikey.substr(0,1);    //当前所在的项目
   switch (+type){
     case 1:
-      if(text){//有选值才需要判断,清空不需要处理
+      if(values){//有选值才需要判断,清空不需要处理
+        let str='',temp='';
+        for(let i in values){
+          temp = values[i];
+          if(typeof temp=='object'){
+            str+=temp.value;
+          }else{
+            str+=temp;
+          }
+        }
         let mainText = filterDataArr(mainSaveText);
-        let lengths = value?mainText.length - value.length + text.length:mainText.length + text.length;
+        let lengths = value?mainText.length - value.length + str.length:mainText.length + str.length;
         if(lengths >= config.limited){
           Notify.info(config.limitText);
           return
@@ -147,7 +156,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({

+ 16 - 3
src/containers/SpreadDrop.js

@@ -53,6 +53,19 @@ function mainSuitModule(dispatch,store,params){
     Notify.info(config.limitText);
     return
   }
+  // 给主症状伴随添加exists字段
+  if(exists.length>0){
+    for(let k=0; k<exists.length; k++){
+      exists[k].value=exists[k].name;
+      exists[k].exist=1;
+    }
+  }
+  if(withs.length>0){
+    for(let n=0; n<withs.length; n++){
+      withs[n].value=withs[n].name;
+      withs[n].exist=2;
+    }
+  }
   // let existsName = getNames(exists);
   // let withsName = getNames(withs);
   const copExists = JSON.parse(JSON.stringify(exists));
@@ -78,7 +91,6 @@ function mainSuitModule(dispatch,store,params){
     if(banIndex==-1){
       num = 1;
     }
-    console.log(11,exists,mainSlice);
     // ikey前的data里没有exist=1的数据,则existNum=1
     if(exists.length>0){
       for(let i=0; i<mainSlice.length; i++){
@@ -483,7 +495,7 @@ function mapDispatchToProps(dispatch,store){
           // let pushDataList = result.data.symptom;
           let bigDataList = result.data.symptom;
           let pushDataList = [];
-          if(bigDataList.length>0){//剔除没有id
+          if(bigDataList&&bigDataList.length>0){//剔除没有id
             pushDataList = bigDataList.filter(function(item){
               return item.id
             });
@@ -509,7 +521,7 @@ function mapDispatchToProps(dispatch,store){
             // return
           }*/
           //推送无数据显示空下拉并提示暂无推送--1.9/1.18
-          if(pushDataList.length == 0){Notify.info("暂无推送");}
+          if(!pushDataList || pushDataList.length == 0){Notify.info("暂无推送");}
           if(obj.type == 1){// 主诉--添加症状
               dispatch({
                 type:GET_BIGDATAPUSH,
@@ -525,6 +537,7 @@ function mapDispatchToProps(dispatch,store){
             }
         }else{
           console.log(result.msg);
+          Notify.info("暂无推送");
           // 接口请求失败,不往下执行显示下拉
           return
         }

+ 4 - 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||'');
@@ -440,10 +440,12 @@ 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{
     data.splice(delIndex-1,2);
+    res.selecteds.splice(delIndex-1,2);      //杂音类样式选中状态对应
     res.saveText.splice(delIndex-1,2);
   }
   // res.saveText = fullfillText(data).saveText;

+ 56 - 8
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){
@@ -20,8 +21,29 @@ function insertPro(data,processModule){
 //设置模板
 export const setModule = (state,action)=>{
   const res = Object.assign({},state);
-  res.moduleData = action.data;
-  res.processModule = action.processModule;//病程变化模板
+  // 处理tagType=4的类型
+  const originalData = action.data;
+  const originalSonData = action.processModule;
+  let spreadLabels=[];
+  let sonSpreadLabels=[];//子模板
+  for(let i=0; i<originalData.length;i++){
+    if(originalData[i].tagType==4){
+      spreadLabels.push(...originalData[i].questionMapping);
+    }else{
+      spreadLabels.push(originalData[i]);
+    }
+  }
+  for(let j=0; j<originalSonData.length;j++){
+    if(originalSonData[j].tagType==4){
+      sonSpreadLabels.push(...originalSonData[j].questionMapping);
+    }else{
+      sonSpreadLabels.push(originalSonData[j]);
+    }
+  }
+  // res.moduleData = action.data;
+  // res.processModule = action.processModule;//病程变化模板
+  res.moduleData = spreadLabels;
+  res.processModule = sonSpreadLabels;//病程变化模板
   res.processModuleName = action.processModuleName;//模板名称
   res.emptyData = action.emptyData;//空模板
   let data = action.data;
@@ -83,7 +105,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 +278,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 +510,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 +524,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 +559,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 +887,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;

+ 76 - 18
src/store/actions/mainSuit.js

@@ -22,9 +22,31 @@ export const setMainMoudle = (state,action) => {
   const res = Object.assign({},state);
   // const emptySpan = JSON.parse(config.textLabel);
   // let data = action.data.push(emptySpan);
-  res.moduleData = action.data;
+  // 处理tagType=4的类型
+  // const originalData = JSON.parse(JSON.stringify(action.data));
+  const originalData = action.data;
+  const originalSonData = action.addSymptom;
+  let spreadLabels=[];
+  let sonSpreadLabels=[];//子模板
+  for(let i=0; i<originalData.length;i++){
+    if(originalData[i].tagType==4){
+      spreadLabels.push(...originalData[i].questionMapping);
+    }else{
+      spreadLabels.push(originalData[i]);
+    }
+  }
+  for(let j=0; j<originalSonData.length;j++){
+    if(originalSonData[j].tagType==4){
+      sonSpreadLabels.push(...originalSonData[j].questionMapping);
+    }else{
+      sonSpreadLabels.push(originalSonData[j]);
+    }
+  }
+  // res.moduleData = action.data;
+  // res.addSmoduleData = action.addSymptom;
+  res.moduleData = spreadLabels;
   res.saveText = res.save||[];
-  res.addSmoduleData = action.addSymptom;
+  res.addSmoduleData = sonSpreadLabels;
   res.addModuleName = action.addModuleName;
   res.update=Math.random();
   return res;
@@ -167,16 +189,19 @@ export const confirm = (state,action) =>{
   // 第二病程-伴位置处理
   let forwardId;
   let text;
-  for(let n=labelIndx-1; n>0; n--){
+  for(let n=labelIndx-1; n>=0; n--){
     // if(arr[n].id==8){
     if(arr[n].flag && arr[n].flag==1){//添加症状打标flag=1
       forwardId = n;
-      continue;
+      break;
     }
   }
   if(forwardId){
     text = saveText.slice(forwardId,labelIndx);
     let index = text.indexOf('伴');
+    let sliceArr = arr.slice(forwardId,labelIndx);
+    let newSliceArr = JSON.parse(JSON.stringify(sliceArr));
+
     if(index==-1){//没有伴,直接插入ikey前
       if(exists.length > 0){
         let withsAddP = addPoint(exists,1);
@@ -200,17 +225,27 @@ export const confirm = (state,action) =>{
     }
     }else{//有伴
       if(exists.length > 0){
-        for(let i=0; i<exists.length; i++){
-          let pos = index + i;
-          arr.splice(pos,0,getTextLabel(exists[i].id,'、'+exists[i].name,1));
-          res.saveText[pos] = exists[i].name;
+        // 判断前面是否已有主症状--是否加顿号、
+        let existsAddP,startInd;
+        for(let m=0; m<newSliceArr.length; m++){
+          if(newSliceArr[m].exist && newSliceArr[m].exist==1){
+            startInd = 0; 
+            break;
+          }else{
+            startInd = 1;
+          }
+        }
+        existsAddP = addPoint(exists,startInd);
+        for(let i=0; i<existsAddP.length; i++){
+          let pos = forwardId + index + i;
+          arr.splice(pos,0,getTextLabel(existsAddP[i].id,existsAddP[i].name,1));
+          res.saveText[pos] = existsAddP[i].name;
         }
       }
       
       if(withs.length>0){//有伴插到ikey前既可
         let withsAddP = addPoint(withs,0);     
         for(let j=0; j<withsAddP.length; j++){
-          // let withsPos = labelIndx + j;
           let withsPos = labelIndx +length + j;
           arr.splice(withsPos,0,getTextLabel(withsAddP[j].id,withsAddP[j].name,2));
           res.saveText[withsPos] = withsAddP[j].name;
@@ -229,9 +264,6 @@ export const confirm = (state,action) =>{
         }
       }
       if(withs.length > 0){
-        /*for(let k=1; k<withs.length; k++){
-          withs[k].name = '、'+ withs[k].name;
-        }*/
         let withsAddP = addPoint(withs,1);
         let newWiths = JSON.parse(JSON.stringify(withsAddP));
         if(banText){
@@ -255,7 +287,6 @@ export const confirm = (state,action) =>{
       if(withs.length>0){//有伴插到ikey前既可
         let withsAddP = addPoint(withs,0);     
         for(let j=0; j<withsAddP.length; j++){
-          // let withsPos = labelIndx + j;
           let withsPos = labelIndx +length + j;
           arr.splice(withsPos,0,getTextLabel(withsAddP[j].id,withsAddP[j].name,2));
           res.saveText[withsPos] = withsAddP[j].name;
@@ -384,19 +415,22 @@ export const insertSearch = (state,action)=>{
     if(index < 1){//前
       if(data[focusIndex].value==searchStr){//为空标签则替换
         res.data.splice(focusIndex,1,nText);
+        res.saveText.splice(focusIndex,1,searchData);
       }else{
         res.data.splice(focusIndex,0,nText);
+        res.saveText.splice(focusIndex,0,searchData);
         res.data[focusIndex+1].value = value;
         res.saveText[focusIndex+1] = value;
       }  
     }else{
       res.data.splice(focusIndex+1,0,nText);
+      res.saveText.splice(focusIndex+1,0,searchData);
       res.data[focusIndex].value = value;
     }
     span.current.innerText?(span.current.innerText = value):(span.current.innerHTML=value);
     res.mainIds.push(id);
   }
-  res.saveText = fullfillText(res.data).saveText;
+  // console.log(456,res,action);
   res.update=Math.random();
   return res;
 }
@@ -488,8 +522,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 +536,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 +571,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

@@ -67,12 +67,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());          //获取其他史最近记录

+ 0 - 1
src/store/async-actions/pushMessage.js

@@ -108,7 +108,6 @@ export const getTipsDetails = () => {
 
         //弹窗显示
         const url ='/introduceInfo/getByQuestionId'
-        const imageUrlPrefix = 'http://192.168.2.241:82'
         
         const params = {
             type: 7,

+ 3 - 1
src/utils/config.js

@@ -5,7 +5,9 @@ const host='http://192.168.2.236:5050';//后端接口访问地址
 //const host='http://192.168.2.164:8080';
 // const host='http://192.168.3.117:8080'; //周铁刚
 // const newIcssVisitUrl = '223.93.170.82:13000';    //icss服务访问地址(跳转目的地),不能加http://
+const imageUrlPrefix = 'http://192.168.2.241:82'
 module.exports={
     host,
-    prefix:'/api/icss'            //带权限验证的api
+    prefix:'/api/icss',            //带权限验证的api
+    imageUrlPrefix
 };

+ 2 - 1
static/pages/hisLib/infomation.js

@@ -1,10 +1,11 @@
+import { imageUrlPrefix } from '@utils/config.js';
 (function($){
     getInfomation();
     function getInfomation(){
         // var infoUrl ="http://" + window.location.host+'/icss-web/kl/introduce/get_by_itemidAndType';
         // var infoUrl ="http://" + window.location.host+'/api/icss/introduceInfo/getByQuestionId';
         var infoUrl ='/api/icss/introduceInfo/getByQuestionId'
-        var imageUrlPrefix = 'http://192.168.2.241:82'
+        // var imageUrlPrefix = 'http://192.168.2.241:82'
         var urlParam = parseUrlParams();
         console.log(urlParam)
         var param = {