浏览代码

Merge branch 'dev/new1' into dev/zhangxc1

zhangxc 6 年之前
父节点
当前提交
f6f6e02391

+ 21 - 11
src/common/components/EditableSpan/index.jsx

@@ -3,6 +3,7 @@ import style from './index.less';
 import config from "@config/index";
 import {filterArr,isIE} from '@utils/tools.js';
 import Notify from '../Notify/index.js';
+import classNames from 'classnames';
 
 import $ from 'jquery';
 /*****
@@ -88,7 +89,9 @@ class EditableSpan extends Component{
       isEnd = !(newText.indexOf(searchPre)>0);
       search = temp.replace(/[(^\s*)|(\s*$)|(^\,*)|(\,*$)]/g,'');
       //console.log(labelVal,'旧:',searchPre,'新:',newText,'搜索:',search);
-      handleSearch&&handleSearch({text:search,isEnd,boxMark,mainIds});
+      if(config.punctuationReg.test(search)){     //只有标点符号时不搜索
+        handleSearch&&handleSearch({text:search,isEnd,boxMark,mainIds});
+      }
       //搜索后保持现在的值,继续输入时要用于对比
       that.setState({
         searchPre:newText
@@ -153,9 +156,13 @@ class EditableSpan extends Component{
     let innerVal = target.innerText;
     if(ev.keyCode==8){
       // 主诉现病史去重:删除最后一个字的时候移除该数据(将name、id和value替换成空)并移除id
-      if(preVal.trim().length==1){
+      // 前面是标签,内容为空时再删一次才移除标签;前面是文本,则直接移除;
+      let preObj = $(this.$span.current).prev();
+      if(index!==0&&preVal.trim().length==1){
           removeId && removeId({boxMark,i:index,text:""});
-          // this.moveEnd(obj[0]);
+          if(preObj[0].nodeName !=="DIV"){
+            this.moveEnd(preObj[0]);
+          }
         }
       
       if(innerVal !==preVal){return false}
@@ -163,7 +170,7 @@ class EditableSpan extends Component{
       //判断是否为空、中英文:, 。、;,且不是第一位
       let pattern = new RegExp(/^\,?$|^\,?$|^\.?$|^\。?$|^\、?$|^\;?$|^\;?$|^\:?$|^\:?$\s/);
       if(index!==0 && pattern.test(data)){
-        let preObj = $(this.$span.current).prev();
+        // let preObj = $(this.$span.current).prev();
         let obj = preObj[0].nodeName=="DIV"?preObj.prev():preObj;
         handleKeydown&&handleKeydown({boxMark,i:index,text:data});
         this.moveEnd(obj[0]);  
@@ -173,12 +180,6 @@ class EditableSpan extends Component{
       }
     }
   }
-  /*shouldComponentUpdate(next){
-    if(JSON.stringify(next) == JSON.stringify(this.props)){
-      return false;
-    }
-    return true;
-  }*/
   componentWillReceiveProps(next){
     const isRead = this.props.isRead;
     if(next.isRead != isRead){
@@ -197,8 +198,17 @@ class EditableSpan extends Component{
     }
   }
 
+  getClass(){
+    const {full,value,saveText,i} = this.props;
+    const preSelected = saveText[i-1];
+    const isFull = full?' '+style['full']:'';       //是否宽度设为整行宽度
+    //有标点符号之外的字符或者前一个标签有选中值时,显示为黑色,否则灰显
+    const unselect = value.match(config.punctuationReg)||preSelected?'':style['unselect'];
+    return classNames(style['editable-span'],isFull,unselect);
+  }
+
   render() {
-    return <span className={style['editable-span']+(this.props.full?' '+style['full']:'')}
+    return <span className={this.getClass()}
                       contentEditable='true'
                       ref={this.$span}
                       onInput={this.onChange}

+ 5 - 1
src/common/components/EditableSpan/index.less

@@ -1,14 +1,18 @@
+@import "~@less/variables.less";
 .editable-span{
   display: inline-block;
   outline: none;
   word-break: break-word;
   min-width: 10px;
   // line-height: 2;
-  /*height: 20px;*/
+  height: 16px;
   line-height: 16px;
   /*vertical-align: middle;*/
   text-align: left;
 }
 .full{
   width: 100%;
+}
+.unselect{
+  color: @placeholder-color;
 }

+ 1 - 1
src/common/js/func.js

@@ -66,7 +66,7 @@ export const strTrim = (str) =>{
 };
 
 //获取组合组件已填文字填入saveText
-function getSaveText(data){console.log(data)
+function getSaveText(data){//console.log(data)
   const arr = data.questionMapping.map((it)=>{
     return it.value?(it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||''):'';
   });

+ 1 - 1
src/common/less/variables.less

@@ -164,5 +164,5 @@
 }
 
 .borderd{
-   border:1px #3B9ED0 solid;
+   border:1px #000 solid;
  }

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

@@ -63,7 +63,7 @@ class CheckBody extends Component{
       return ;
     }
     //有主诉时且本身无数据,第一次点击获取数据,(不论获取成功与否)再点击不获取(直到刷新成空白页或清空)
-    if(hasMain&&isEmpty!=false){
+    if(hasMain&&isEmpty!=false&&!hasData){
       this.props.getInit();
     }
   }

+ 3 - 3
src/components/CurrentIll/index.jsx

@@ -34,7 +34,7 @@ class CurrentIll extends Component{
 
   handleFocus(e){
     // 判断主诉是否为空
-    const {mainData,mainText,setData,moduleNum,mainIds,data,changeEditIll,editClear,mainSymptIds} = this.props;
+    const {mainData,mainText,setData,moduleNum,mainIds,data,changeEditIll,editClear} = this.props;
     const that = this;
     let mainFinallyText = filterDataArr(mainText);
     // if(mainData.length == 0 && !mainText[0]){
@@ -46,11 +46,11 @@ class CurrentIll extends Component{
       })
     }else {
       // let useEmpty = mainData.length>0?false:true;
-      let useEmpty = mainSymptIds.length>0?false:true;
       let num = moduleNum.num;//主诉使用了几个模板
       // if(editClear && data.length==0){//第一次聚焦去设置现病史的data
       if(data.length==0){//第一次聚焦去设置现病史的data
-        setData && setData({useEmpty,num,mainData,mainIds});//是否使用空模板 及数据处理
+        // setData && setData({useEmpty,num,mainData,mainIds});//是否使用空模板 及数据处理
+        setData && setData({num,mainData,mainIds});//是否使用空模板 及数据处理
       }
       this.setState({
           showMoudle:true,

+ 0 - 8
src/components/OtherHistory/index.jsx

@@ -57,14 +57,6 @@ class OtherHistory extends Component{
     }
     //智能模式有主诉或者文本模式获取最近历史
     setInitData();
-
-    //回读后容器框要不可编辑,否则自由文本标签onInput,onFocus事件失效(原因未知)
-    /*if(data.length>0){
-       this.setState({
-         editable:false
-       });
-      changeEditClear(false)
-    }*/
   }
   handleClick(e){//让搜索框跟随鼠标点击移动
     //e.stopPropagation();

+ 29 - 28
src/components/PreviewBody/index.jsx

@@ -107,60 +107,61 @@ class PreviewBody extends Component {
     }
     render() {
         const { show, preInfo, dataJson, dataStr,baseObj } = this.props;
-
+        const infoNull = JSON.stringify(preInfo) == '{}';
+        console.log(dataStr,baseObj)
         return <div className={style['content']}>
             <div className={style['contents']} id="content" style={{margin:"0 auto"}}>
-                <div ref={this.$content} style={{ clear: 'both', fontSize: '24px', margin: '0px 0px 30px 0px',textAlign:'center' }}>{preInfo.hospitalName}</div>
-                <table className={style['patInfo']} style={{ margin: '0px 0px 30px 0px', borderCollapse: 'collapse', width: "100%" }}>
+                <div ref={this.$content} className={style['hisName']}>{preInfo.hospitalName}</div>
+                <table className={style['patInfo']}>
                     <tr>
-                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '25%' }}>卡号:{baseObj?baseObj.patientIdNo:JSON.stringify(preInfo) == '{}'?'':preInfo.patientIdNo}</td>
-                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '25%' }}>姓名:{baseObj?baseObj.patientName:JSON.stringify(preInfo) == '{}'?'':preInfo.patientName}</td>
-                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '25%' }}>年龄:{baseObj?baseObj.patientAge:JSON.stringify(preInfo) == '{}'?'':preInfo.patientAge}</td>
-                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '25%' }}>性别:{baseObj?baseObj.patientSex:JSON.stringify(preInfo) == '{}'?'':preInfo.patientSex}</td>
+                        <td>卡号:{baseObj?baseObj.patientIdNo:infoNull?'':preInfo.patientIdNo}</td>
+                        <td >姓名:{baseObj?baseObj.patientName:infoNull?'':preInfo.patientName}</td>
+                        <td >年龄:{baseObj?baseObj.patientAge:infoNull?'':preInfo.patientAge}</td>
+                        <td >性别:{baseObj?baseObj.patientSex:infoNull?'':preInfo.patientSex}</td>
                     </tr>
                     <tr>
-                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '25%' }}>就诊时间:{baseObj?baseObj.inquiryDate:(JSON.stringify(preInfo) == '{}'?'':preInfo.systemTime.split(' ')[0])}</td>
-                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '25%' }}>科室:{baseObj?baseObj.hospitalDeptName:(JSON.stringify(preInfo) == '{}'?'':preInfo.hospitalDeptName)}</td>
-                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '25%' }}>医生:{baseObj?baseObj.doctorName:(JSON.stringify(preInfo) == '{}'?'':preInfo.doctorName)}</td>
-                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '25%' }}>门诊号:{baseObj?baseObj.inquiryCode:(JSON.stringify(preInfo) == '{}'?'':preInfo.recordId)}</td>
+                        <td>就诊时间:{baseObj?baseObj.inquiryDate:(infoNull?'':preInfo.systemTime.split(' ')[0])}</td>
+                        <td>科室:{baseObj?baseObj.hospitalDeptName:(infoNull?'':preInfo.hospitalDeptName)}</td>
+                        <td>医生:{baseObj?baseObj.doctorName:(infoNull?'':preInfo.doctorName)}</td>
+                        <td>门诊号:{baseObj?baseObj.inquiryCode:(infoNull?'':preInfo.recordId)}</td>
                     </tr>
                 </table>
-                <table style={{width:"100%"}}>
+                <table>
                     <tr style={{ verticalAlign: 'top' }}>
-                        <td style={{ width: 70, textAlign: 'right', padding: '0px 5px 16px 0px', fontSize: '14px' }}>主诉:</td>
-                        <td style={{ fontSize: '14px', padding: '0px 0px 16px 0px',lineHeight:'18px' }}>
+                        <td className={style['title']}>主诉:</td>
+                        <td className={style['text']}>
                             {
                                 filterDataArr(JSON.parse(dataStr.chief))
                             }
                         </td>
                     </tr>
                     <tr style={{ verticalAlign: 'top' }}>
-                        <td style={{ width: 70, textAlign: 'right', padding: '0px 5px 16px 0px', fontSize: '14px' }}>现病史:</td>
-                        <td style={{ fontSize: '14px', padding: '0px 0px 16px 0px',lineHeight:'18px'  }}>
+                        <td className={style['title']}>现病史:</td>
+                        <td className={style['text']}>
                             {
                                 filterDataArr(JSON.parse(dataStr.present))
                             }
                         </td>
                     </tr>
                     <tr style={{ verticalAlign: 'top' }}>
-                        <td style={{ width: 70, textAlign: 'right', padding: '0px 5px 16px 0px', fontSize: '14px' }}>其他史:</td>
-                        <td style={{ fontSize: '14px', padding: '0px 0px 16px 0px',lineHeight:'18px'  }}>
+                        <td className={style['title']}>其他史:</td>
+                        <td className={style['text']}>
                             {
                                 filterDataArr(JSON.parse(dataStr.other))
                             }
                         </td>
                     </tr>
                     <tr style={{ verticalAlign: 'top' }}>
-                        <td style={{ width: 70, textAlign: 'right', padding: '0px 5px 16px 0px', fontSize: '14px' }}>查体:</td>
-                        <td style={{ fontSize: '14px', padding: '0px 0px 16px 0px',lineHeight:'18px'  }}>
+                        <td className={style['title']}>查体:</td>
+                        <td className={style['text']}>
                             {
                                 filterDataArr(JSON.parse(dataStr.vital))
                             }
                         </td>
                     </tr>
                     <tr style={{ verticalAlign: 'top',width:'100%',overflow:"hidden" }}>
-                        <td style={{ width: 70, textAlign: 'right', padding: '0px 5px 16px 0px', fontSize: '14px' }}>化验:</td>
-                        <td style={{ fontSize: '14px', padding: '0px 0px 16px 0px',maxWidth:'650px'}}>
+                        <td className={style['title']}>化验:</td>
+                        <td className={style['text']}>
                             {/* <table style={{ width: '100%' }}> */}
                                 {
                                     dataJson.lis.getExcelDataList && dataJson.lis.getExcelDataList.map((items)=>{
@@ -211,8 +212,8 @@ class PreviewBody extends Component {
                         </td>
                     </tr>
                     <tr style={{ verticalAlign: 'top' }}>
-                        <td style={{ width: 70, textAlign: 'right', padding: '0px 5px 16px 0px', fontSize: '14px' }}>辅检:</td>
-                        <td style={{ fontSize: '14px', padding: '0px 0px 16px 0px',lineHeight:'18px' }}>
+                        <td className={style['title']}>辅检:</td>
+                        <td className={style['text']}>
                             {
                                 dataStr.pacs && dataStr.pacs != '' && dataStr.pacs.split(';').map((item)=>{
                                     return <div style={{ fontSize: '14px' }}>{item}</div>
@@ -221,8 +222,8 @@ class PreviewBody extends Component {
                         </td>
                     </tr>
                     <tr style={{ verticalAlign: 'top' }}>
-                        <td style={{ width: 70, textAlign: 'right', padding: '0px 5px 16px 0px', fontSize: '14px' }}>诊断:</td>
-                        <td style={{ fontSize: '14px', padding: '0px 0px 16px 0px',lineHeight:'18px' }}>
+                        <td className={style['title']}>诊断:</td>
+                        <td className={style['text']}>
                             {
                                 dataStr.diag && dataStr.diag != '' && dataStr.diag.split(';').map((item)=>{
                                     return <div style={{ fontSize: '14px'}}>{item}</div>
@@ -231,8 +232,8 @@ class PreviewBody extends Component {
                         </td>
                     </tr>
                     <tr style={{ verticalAlign: 'top' }}>
-                        <td style={{ width: 70, textAlign: 'right', padding: '0px 5px 16px 0px', fontSize: '14px' }}>医嘱:</td>
-                        <td style={{ fontSize: '14px', padding: '0px 0px 16px 0px' }}>
+                        <td className={style['title']}>医嘱:</td>
+                        <td className={style['text']}>
                             {
                                 dataJson.advice.assay && dataJson.advice.assay.length > 0 || dataJson.advice.check && dataJson.advice.check.length > 0 ? <p style={{fontSize:'14px',marginBottom:"8px"}}>开单项目</p> : ''
                             }

+ 25 - 0
src/components/PreviewBody/index.less

@@ -6,14 +6,39 @@
       top:120px;
       width: 820px;
       padding: 0 40px 60px 40px;
+      .hisName{
+        clear: both;
+        font-size: 24px;
+        margin: 0px 0px 30px 0px;
+        text-align:center;
+      }
       .contents {
         position: relative;
         padding-bottom: 26px;
+        table{
+          width: 100%;
+          .title{
+            width: 70px;
+            text-align: right;
+            padding: 0px 5px 16px 0px;
+            font-size: 14px;
+          }
+          .text{
+            font-size: 14px;
+            padding: 0px 0px 16px 0px;
+            line-height:18px;
+            max-width: 650px;
+          }
+        }
       }
     }
     .patInfo {
+      margin: 0px 0px 30px 0px;
+      border-collapse: collapse;
       td {
         border: 1px solid #aaa;
+        padding: 8px 10px;
+        width: 25%;
       }
     }
   

+ 1 - 0
src/components/RadioDrop/index.jsx

@@ -104,6 +104,7 @@ class RadioDrop extends Component{
    // 更改标签的value值
     const ev = e || window.event;
     let changeVal = ev.target.innerText;
+    ev.target.innerText = '';
     handleLabelEdit && handleLabelEdit({ikey,changeVal,type:boxMark});
   }
   handledbClick(e){

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

@@ -175,8 +175,8 @@ class SpreadDrop extends Component{
   }
   handleConfirm(e){
     e.stopPropagation();
-    const {handleConfirm,ikey,type,tagType,order,mainSaveText,copyType} = this.props;
-    const params = Object.assign({},this.state,{ikey,type,tagType,order,mainSaveText,copyType});
+    const {handleConfirm,ikey,type,tagType,order,mainSaveText,copyType,value} = this.props;
+    const params = Object.assign({},this.state,{ikey,type,tagType,order,mainSaveText,copyType,value});
     handleConfirm&&handleConfirm(params);
 	this.btnClickFlag = true;
     //点确定后隐藏弹窗

+ 1 - 0
src/config/index.js

@@ -30,6 +30,7 @@ export default {
     delayTime:500,      //延迟搜索的时间
     delayPushTime:1000,    //延迟推送时间
     pushDelay:1000,
+    punctuationReg:/[^,,.。;;、]/g,       //正则表达式,全局查找不是括号内标点的字符
     currentText:"患者XX因XX诊断为(**),经XX治疗后,目前XX症状已缓解,仍有XX,各项指标情况:XX,辅助检查:XX。今来复诊,进一步治疗",
     timeUnit:{
       minute:"分",

+ 1 - 2
src/containers/CurrentIll.js

@@ -12,7 +12,7 @@ import {getModule} from '@store/async-actions/fetchModules.js';
 import {didPushParamChange} from '@utils/tools.js';
 
 
-function mapStateToProps(state) {
+function mapStateToProps(state) { 
   const {homePage} = state;
     return {
         data:state.currentIll.data,//主诉模板
@@ -29,7 +29,6 @@ function mapStateToProps(state) {
         moduleNum:state.mainSuit.moduleNum,//主诉使用的模板
         type: state.typeConfig.typeConfig,
         mainIds:state.mainSuit.mainIds,//主诉症状选中的id(去重用)
-        mainSymptIds:state.mainSuit.mainSymptIds,//主诉症状选中的id(移植用)
         fillInfo: state.fillInfo,
         showArr:homePage.showDrop,
         totalHide: homePage.totalHide,

+ 15 - 6
src/containers/SpreadDrop.js

@@ -45,6 +45,10 @@ function mainSuitModule(dispatch,store,params){
   let withsName = getNames(withs);
   let banName = ban.name;
   let text = filterArr(mainSaveText);
+  if(text.length >= config.limited){
+    Notify.info(config.limitText);
+    return
+  }
   let names;
   if(banName){
     names = existsName + banName + withsName;
@@ -169,11 +173,11 @@ function handleModuleDiff(dispatch,store,params){
   const {type,mainSaveText} = params;
   switch (+type){
     case 1:
-      let text = filterArr(mainSaveText);
+      /*let text = filterArr(mainSaveText);
       if(text.length >= config.limited){
         Notify.info(config.limitText);
         return
-      }
+      }*/
       mainSuitModule(dispatch,store,params);
       break;
     case 2:
@@ -194,10 +198,15 @@ function handleModuleDiff(dispatch,store,params){
 
 //主诉普通多选确定
 function mainSuitCheck(dispatch,store,params){
-  const {nones,exists,withs,order,mainSaveText} = params;
+  const {nones,exists,withs,order,mainSaveText,value} = params;
   let existsName = getNames(exists,order);
   let text = filterArr(mainSaveText);
-  let lengths = text.length + existsName.length;
+  if(text.length >= config.limited){
+    Notify.info(config.limitText);
+    return
+  }
+  // let lengths = text.length + existsName.length;
+  let lengths = value?(text.length - value.length + existsName.length):(text.length + existsName.length);
   if(lengths > config.limited){
     Notify.info(config.limitText);
     return
@@ -253,11 +262,11 @@ function handleCheckBox(dispatch,store,params){
   const {type,mainSaveText} = params;
   switch (+type){
     case 1:
-      let text = filterArr(mainSaveText);
+      /*let text = filterArr(mainSaveText);
       if(text.length >= config.limited){
         Notify.info(config.limitText);
         return
-      }
+      }*/
       mainSuitCheck(dispatch,store,params);
       break;
     case 2:

+ 1 - 1
src/containers/eleType.js

@@ -124,7 +124,7 @@ export default function(params){
     case 8:
       // return <EditableSpan {...params} value={data.value||data.name} update={Math.random()}/>;
       // 删除后value为空,应展示空而不是name
-      return <EditableSpan {...params} value={data.value||data.value==''?data.value:data.name} full={data.full} update={Math.random()}/>;
+      return <EditableSpan {...params} value={data.value||data.value==''?data.value:data.name} full={data.full}/>;
     case 11://推送类型
       return multCheckLabels(params,data.tagType);
     default:

+ 8 - 3
src/store/actions/currentIll.js

@@ -616,9 +616,14 @@ export function removeId(state,action){
   if(ids.includes(id)){
     ids.splice(ids.indexOf(id),1);
   }
-  data[index].id = "";
-  data[index].name = text;
-  data[index].value = text;
+  if(!data[index].value && data[index-1].tagType==8){
+    data.splice(index,1);
+  }else{
+    data[index].id = "";
+    data[index].name = text;
+    data[index].value = text;
+  }
+  
   res.update = Math.random();
   return res;
 }

+ 1 - 1
src/store/actions/homePage.js

@@ -32,7 +32,7 @@ export const confirmHide=(state,action)=>{
   let res = Object.assign({},state);
   let obj = res.showDrop||{};
   let temp = Object.assign({},obj);
-  let keyArr = Object.keys(obj); 
+  let keyArr = Object.keys(obj);
   for(let i=0; i<keyArr.length; i++){
     temp[JSON.parse(keyArr[i])] = false;
   }

+ 6 - 10
src/store/actions/mainSuit.js

@@ -110,7 +110,6 @@ export const insertMain = (state,action) => {
   // res.saveText[inserIndx] = text.name;
   res.saveText = fullfillText(res.data).saveText;
   res.mainIds.push(id);
-  res.mainSymptIds.push(id);
   res.editClear = false;//主诉框编辑状态
   res.update=Math.random();
   return res;
@@ -136,7 +135,6 @@ export const confirm = (state,action) =>{
     let existsId = getIds(exists);
     let withsId = getIds(withs);
     res.mainIds = res.mainIds?res.mainIds.concat(existsId,withsId):[];
-    res.mainSymptIds = res.mainSymptIds.concat(existsId,withsId);
   }
 
   // 第二病程-伴位置处理
@@ -298,7 +296,6 @@ export const insertSearch = (state,action)=>{
     // res.saveText[inserIndx] = searchData;
     res.saveText = fullfillText(res.data).saveText;
     res.mainIds.push(id);
-    res.mainSymptIds.push(id);
     res.editClear = false;//主诉框编辑状态
   }else{
     // 替换
@@ -518,7 +515,6 @@ export const clearMainSuit = (state,action)=>{//回读和清除
   // res.saveText = fullfillText(action.data).saveText;//解决删除data里的值保存,回读后页面上有内容saveText里没有的情况
   res.selecteds = action.selecteds?action.selecteds:[];
   res.mainIds = action.mainIds;
-  res.mainSymptIds = action.mainSymptIds;
   if(action.editClear){
     res.editClear = action.editClear;
   }
@@ -611,16 +607,16 @@ export function removeId(state,action){
   const data = res.data;
   const id = data[index].id;
   let ids = res.mainIds;
-  let mainIds = res.mainSymptIds;
   if(ids.includes(id)){
     ids.splice(ids.indexOf(id),1);
   }
-  if(mainIds.includes(id)){
-    mainIds.splice(mainIds.indexOf(id),1);
+  if(!data[index].value && data[index-1].tagType==8){
+    data.splice(index,1);
+  }else{
+    data[index].id = "";
+    data[index].name = text;
+    data[index].value = text;
   }
-  data[index].id = "";
-  data[index].name = text;
-  data[index].value = text;
   res.update = Math.random();
   return res;
 }

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

@@ -71,6 +71,7 @@ export const getOtherHisRecord = ()=>{
         const objStr = JSON.parse(data.otherStr||'[]');
         let arr = [];
         if((!obj||!obj.other||obj.other.length==0)&&!objStr[0]){        //无其他史历史记录用默认模板
+          //console.log('其他史最近数据无')
           //arr = state.homePage.initData.otherHis;
         }else{
           arr = obj.other;

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

@@ -56,7 +56,7 @@ export const getInitModules= (dispatch,getStore)=>{
           emptyData:initData.currentEmpty,//现病史空模板
           saveEmpty:initSaveText.currentEmpty,
         });
-        dispatch(getOtherHisRecord());  console.log(111)        //获取其他史最近记录
+        dispatch(getOtherHisRecord());          //获取其他史最近记录
         initHis(dispatch)
       }else{
         initHis(dispatch)

+ 0 - 1
src/store/reducers/mainSuit.js

@@ -20,7 +20,6 @@ const initState = {
   focusIndex:'',
   mainIds:[], //选中的主症状和伴随的id(搜索去重)
   editClear:true,
-  mainSymptIds:[]//选中的主症状和伴随的id(移植到现病史)
 }
 
 export default function(state=initState,action){

+ 4 - 4
src/utils/tools.js

@@ -177,7 +177,6 @@ const getAllDataList =(baseList) =>{           //获取所有模块结构化的
     jsonData.checkBodySelecteds = baseList.checkBody.selecteds;      //主诉选中状态保存
     jsonData.addItems = baseList.homePage.addItems||{};
     jsonData.mainsuitIds = baseList.mainSuit.mainIds;      //主诉去重
-    jsonData.mainSymptIds = baseList.mainSuit.mainSymptIds;      //主诉去重
     jsonData.currentIds = baseList.currentIll.symptomIds;      //现病史去重
     // console.log(jsonData,'结构化数据获取')
     return jsonData;
@@ -230,7 +229,7 @@ const getAllDataStringList =(baseList) =>{           //获取所有模块文本
  */
 const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清空所有的数据
     if(action == 'clear'){     //清空
-        store.dispatch({type: CLEAR_MAIN_SUIT,data:[],saveText:[],selecteds:[],editClear:true,mainIds:[],mainSymptIds:[]});
+        store.dispatch({type: CLEAR_MAIN_SUIT,data:[],saveText:[],selecteds:[],editClear:true,mainIds:[]});
         store.dispatch({type: CLEAR_CURRENT_ILL,data:[],saveText:[],selecteds:[],editClear:true,symptomIds:[]});
         store.dispatch({type: CLEAROTHERHISTORY,data:[],saveText:[],selecteds:[],editClear:true});
         store.dispatch({type: CLEARCHECKBODY,data:[],isEmpty:true,saveText:[],selecteds:[]});
@@ -264,7 +263,6 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                     selecteds:dataJson.mainSuitSelecteds?dataJson.mainSuitSelecteds:[],
                     saveText:JSON.parse(dataJsonStr.chief),
                     mainIds:dataJson.mainsuitIds?dataJson.mainsuitIds:[],
-                    mainSymptIds:dataJson.mainSymptIds?dataJson.mainSymptIds:[],
                 });
                 store.dispatch({
                     type: CLEAR_CURRENT_ILL,
@@ -318,7 +316,6 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                     selecteds:dataJson.mainSuitSelecteds?dataJson.mainSuitSelecteds:[],
                     saveText:dataJsonStr[0].content ? JSON.parse(dataJsonStr[0].content) :[],
                     mainIds:dataJson.mainsuitIds?dataJson.mainsuitIds:[],
-                    mainSymptIds:dataJson.mainSymptIds?dataJson.mainSymptIds:[],
                 });
                 store.dispatch({
                     type: CLEAR_CURRENT_ILL,
@@ -483,6 +480,9 @@ function filterDataArr(arrTmp){   //数据处理
     let tmpArr = [];
     let arr = arrTmp.join('').split('');
     for(let i = 0;i < arr.length;i++){
+        if(!(arr[i].match(config.punctuationReg)||arr[i-1])){        //只有标点符号或者前一个标签无值是(说明本标点灰显,不显示在预览中)
+            arr.splice(i,1,'');
+        }
         if(arr[i] && arr[i].indexOf('undefined') == -1){
             if(tmpArr[tmpArr.length-1] != ',' && tmpArr[tmpArr.length-1] != ',' ){
                 tmpArr.push(arr[i])