Quellcode durchsuchen

Merge branch 'dev/new1' into dev/zhangxc1

zhangxc vor 6 Jahren
Ursprung
Commit
cd77c307ae
40 geänderte Dateien mit 315 neuen und 208 gelöschten Zeilen
  1. 12 24
      src/common/components/EditableSpan/index.jsx
  2. 1 1
      src/common/components/ItemBox/index.jsx
  3. 1 1
      src/common/components/SearchOption/index.jsx
  4. 4 4
      src/common/less/variables.less
  5. 4 20
      src/components/AddInspect/index.jsx
  6. 1 1
      src/components/CheckBody/index.jsx
  7. 2 1
      src/components/CurrentIll/index.jsx
  8. 3 1
      src/components/DiagResultSearch/index.less
  9. 14 10
      src/components/MainSuit/index.jsx
  10. 37 39
      src/components/Operation/index.jsx
  11. 5 20
      src/components/PreviewBody/index.jsx
  12. 8 7
      src/components/PushContainer/index.jsx
  13. 5 7
      src/components/RadioDrop/index.jsx
  14. 6 3
      src/components/SpreadDrop/index.jsx
  15. 4 7
      src/components/TemplateItems/TemplateItem/index.jsx
  16. 1 1
      src/config/index.js
  17. 1 1
      src/containers/AssistCheck.js
  18. 1 1
      src/containers/CheckBody.js
  19. 3 3
      src/containers/CurrentIll.js
  20. 1 1
      src/containers/DiagnosticList.js
  21. 1 1
      src/containers/EditableSpan.js
  22. 1 1
      src/containers/Inspect.js
  23. 6 6
      src/containers/MainSuit.js
  24. 1 1
      src/containers/NumberDrop.js
  25. 1 1
      src/containers/NumberUnitDrop.js
  26. 5 4
      src/containers/OtherHistory.js
  27. 1 1
      src/containers/PushItemsContainer.js
  28. 2 2
      src/containers/RadioDrop.js
  29. 2 2
      src/containers/SpreadDrop.js
  30. 10 2
      src/containers/TypeConfigContainer.js
  31. 1 1
      src/store/actions/checkBody.js
  32. 25 4
      src/store/actions/currentIll.js
  33. 81 10
      src/store/actions/mainSuit.js
  34. 0 1
      src/store/actions/print.js
  35. 1 1
      src/store/async-actions/homePage.js
  36. 3 3
      src/store/async-actions/patInfo.js
  37. 5 2
      src/store/async-actions/pushMessage.js
  38. 4 4
      src/store/reducers/assistCheck.js
  39. 1 1
      src/store/reducers/homePage.js
  40. 50 7
      src/utils/tools.js

+ 12 - 24
src/common/components/EditableSpan/index.jsx

@@ -113,23 +113,17 @@ class EditableSpan extends Component{
   }
 
   moveEnd(obj) {
-    obj.focus();
-    if($.support.msie)
-    {
-        var range = document.selection.createRange();
-        this.last = range;
-        range.moveToElementText(obj);
-        range.select();
-        document.selection.empty(); //取消选中
+    if(window.getSelection){//ie11 10 9 ff safari
+      obj.focus(); //解决ff不获取焦点无法定位问题
+      var range = window.getSelection();//创建range
+      range.selectAllChildren(obj);//range 选择obj下所有子内容
+      range.collapseToEnd();//光标移至最后
     }
-    else
-    {
-        var range = document.createRange();
-        range.selectNodeContents(obj);
-        range.collapse(false);
-        var sel = window.getSelection();
-        sel.removeAllRanges();
-        sel.addRange(range);
+    else if (document.selection) {//ie10 9 8 7 6 5
+      var range = document.selection.createRange();//创建选择对象
+      range.moveToElementText(obj);//range定位到obj
+      range.collapse(false);//光标移至最后
+      range.select();
     }
   }
 
@@ -159,16 +153,10 @@ class EditableSpan extends Component{
     let innerVal = target.innerText;
     if(ev.keyCode==8){
       // 主诉现病史去重:删除最后一个字的时候移除该数据(将name、id和value替换成空)并移除id
-      let pattern1 = new RegExp(/^\,|^\,|^\.|^\。|^\、|^\;|^\;|^\:|^\:/);
-      if(pattern1.test(preVal)){//以标点开头的情况-现病史
-        if(preVal.trim().length==2){
+      if(preVal.trim().length==1){
           removeId && removeId({boxMark,i:index,text:""});
+          // this.moveEnd(obj[0]);
         }
-      }else{
-        if(preVal.trim().length==1){
-          removeId && removeId({boxMark,i:index,text:""});
-        }
-      }
       
       if(innerVal !==preVal){return false}
       let data = innerVal.trim();

+ 1 - 1
src/common/components/ItemBox/index.jsx

@@ -33,7 +33,7 @@ class ItemBox extends Component {
   }
   handleInput(e){
     const {onchange,data} = this.props;
-    if((data&&data.length==0)||!data){//避免结构化下触发onchange,导致下拉要点两下
+    if(!data || (data.length==0)){//避免结构化下触发onchange,导致下拉要点两下
       onchange&&onchange(e)
     }
   }

+ 1 - 1
src/common/components/SearchOption/index.jsx

@@ -57,7 +57,7 @@ class SearchOption extends React.Component {
               show:true
           })
       }else{
-          // this.handleClearVal()
+          this.handleClearVal('')            //这个要放开,输入为空清除列表
           this.setState({
               show:false
           })

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

@@ -57,8 +57,8 @@
   top:30px;
   background: #fff;
   box-shadow: 0 10px 20px 0 #989DA3;
-  filter:progid:DXImageTransform.Microsoft.Shadow(color='#989DA3',Direction=125,Strength=6);
-  border: 1px solid #f3f0f0;
+  // filter:progid:DXImageTransform.Microsoft.Shadow(color='#989DA3',Direction=125,Strength=6);
+  border: 1px solid #dedede;
   z-index: 203;
   padding: 20px;
   white-space: nowrap;
@@ -159,8 +159,8 @@
 
 .llStyle{
   box-shadow: 0 10px 20px 0 #989DA3;
-  filter:progid:DXImageTransform.Microsoft.Shadow(color='#989DA3',Direction=125,Strength=6);
-  border: 1px solid #f3f0f0;
+  // filter:progid:DXImageTransform.Microsoft.Shadow(color='#989DA3',Direction=125,Strength=6);
+  border: 1px solid #dedede;
 }
 
 .borderd{

+ 4 - 20
src/components/AddInspect/index.jsx

@@ -1,6 +1,6 @@
 import React from 'react';
 import { SearchOption, InspectCommon, Calendar ,Notify,ConfirmModal,Add} from '@commonComp';
-import { deepClone } from '@utils/tools';
+import { deepClone,normalVal } from '@utils/tools';
 import styles from './index.less';
 import date1 from './img/date1.png';
 import date2 from './img/date2.png';
@@ -30,7 +30,6 @@ class Inspect extends React.Component {
         this.getItemList = this.getItemList.bind(this)
         this.getSearchList = this.getSearchList.bind(this)
         this.changeActivePart = this.changeActivePart.bind(this)
-        this.normalVal = this.normalVal.bind(this)
         this.showDetails = this.showDetails.bind(this)
         this.delConfirm = this.delConfirm.bind(this)
         this.handleCancel = this.handleCancel.bind(this)
@@ -232,21 +231,6 @@ class Inspect extends React.Component {
         }
     </ul>
     }
-    normalVal(min,max){
-        if((min-0) && (max-0)){
-            return `正常值: (${min}~${max})`
-        }else if((min-0) && !(max-0)){
-            return `正常值: (>=${min})`
-        }else if(!(min-0) && (max-0)){
-            if(min == '' || min == null){
-                return `正常值: (<=${max})`
-            }else{
-                return `正常值: (${min}~${max})`
-            }
-        }else{
-            return null;
-        }
-    }
     showDetails(val){
         if(val.questionDetailList.length > 0){
             return val.questionDetailList.map((item)=>{
@@ -255,7 +239,7 @@ class Inspect extends React.Component {
                 }
             })
         }else{
-            return <td><span className={val.value > val.maxValue || val.value < val.minValue?"red":''}>{val.value}</span> { val.labelSuffix}</td>
+            return <td><span className={(val.maxValue || val.minValue) ? (val.value > val.maxValue || val.value < val.minValue?"red":''):''}>{val.value}</span> { val.labelSuffix}</td>
         }
     }
     render() {
@@ -283,7 +267,7 @@ class Inspect extends React.Component {
                                                                 <td>{value.itemName}</td>
                                                                 <td><span className={value.type == 1?'red':null}>{value.value}</span> {value.unit}</td>
                                                                 <td>
-                                                                    {this.normalVal(value.min,value.max)}
+                                                                    {normalVal(value.min,value.max)}
                                                                 </td>
                                                                 <td>{value.time == ''?('导入时间: '+this.state.dateTime):'化验时间: '+value.time}</td>
                                                             </tr>
@@ -322,7 +306,7 @@ class Inspect extends React.Component {
                                                                 <td>{val.name}</td>
                                                                 {this.showDetails(val)}
                                                                 <td>
-                                                                    {this.normalVal(val.minValue,val.maxValue)}
+                                                                    {normalVal(val.minValue,val.maxValue)}
                                                                 </td>
                                                                 <td>{'化验时间:'+item.time}</td>
                                                             </tr>

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

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

+ 2 - 1
src/components/CurrentIll/index.jsx

@@ -72,7 +72,8 @@ class CurrentIll extends Component{
   }
 
   onchange(e){//监听输入事件,主诉无数据不能输入
-    e.target.innerText = "";
+    const ev = e || window.event;
+    ev.target.innerText = "";
   }
 
   handleClick(e){//让搜索框跟随鼠标点击移动

+ 3 - 1
src/components/DiagResultSearch/index.less

@@ -4,10 +4,12 @@
     width: 316px;
     margin: 0 10px 10px;
     padding: 0 8px;
-    box-shadow: 0 6px 20px 0 #989DA3;
+    // box-shadow: 0 6px 20px 0 #989DA3;
     background: #fff;
     z-index: 99;
     margin-bottom: 80px;
+    .llStyle;
+    
 }
 .search {
     width: 100%;

+ 14 - 10
src/components/MainSuit/index.jsx

@@ -143,20 +143,21 @@ class MainSuit extends Component{
   }
 
   handleChange(e){
-    const data = e.target.innerText;
+    const ev = e || window.event;
+    const data = ev.target.innerText;
     const {getSearchData,searchData,datas,pushMessage,reTotalHide} = this.props;
     const {overFlag,inpText} = this.state;
     reTotalHide && reTotalHide();//重置homePage中的控制项
     const that = this;
-    if(data.length > config.limited){
+    if(data&&data.length > config.limited){
       Notify.info(config.limitText);
       if(overFlag){
-        e.target.innerText = inpText;
-        e.target.blur();
+        ev.target.innerText = inpText;
+        ev.target.blur();
         return
       }
-      e.target.innerText = data.substr(0,config.limited);  //输入法内输入多个字再按enter的情况
-      e.target.blur();
+      ev.target.innerText = data.substr(0,config.limited);  //输入法内输入多个字再按enter的情况
+      ev.target.blur();
       this.setState({
         inpText:data.substr(0,config.limited),
         overFlag:true
@@ -167,11 +168,11 @@ class MainSuit extends Component{
       inpText:data,
       overFlag:false
     })
-    if(datas.length > 0){//使用模板
+    if(datas && datas.length > 0){//使用模板
       return false;
     }
     // 有输入内容或搜索结果时关闭,否则显示
-    if(data.trim()||searchData.length>0){
+    if(data && data.trim()||searchData.length>0){
       this.setState({
         symptom:false
       })
@@ -180,9 +181,9 @@ class MainSuit extends Component{
         symptom:true
       })
     }
-
     clearTimeout(this.state.timer);
     const timer = setTimeout(function(){
+      pushMessage && pushMessage(data);
       //调搜索接口 使用模板走EditableSpan里的搜索方法
       getSearchData && getSearchData({inpStr:data,boxMark:1});
     },config.delayTime);
@@ -211,7 +212,10 @@ class MainSuit extends Component{
       });
     }else{
       if(datas.length==0){
-        freeText && freeText(data.trim());
+        const ev = e || window.event;
+        const data = ev.target.innerText;
+        // freeText && freeText(data.trim());
+        freeText && freeText(data);
       }
     }
     

+ 37 - 39
src/components/Operation/index.jsx

@@ -6,7 +6,7 @@ import saveHistory from '@common/images/saveHistory.png';
 import PrintPreviewContainer from '@containers/PrintPreviewContainer';
 import PreviewContainer from '@containers/PreviewContainer';
 import { ConfirmModal, Notify } from '@commonComp';
-import {getAllDataList,getAllDataStringList} from '@utils/tools';
+import {getAllDataList,getAllDataStringList,isAllClear} from '@utils/tools';
 import store from '@store';
 
 
@@ -94,7 +94,10 @@ class Operation extends Component {
     }
   }
   clearAll(type) {
-    let flg = this.isClear();
+    let baseList = store.getState();
+    let jsonData = getAllDataList(baseList);
+    let jsonStr = getAllDataStringList(baseList);
+    let flg = isAllClear(jsonData,jsonStr);
     if(flg){
       this.setState({
         type: type,
@@ -106,6 +109,8 @@ class Operation extends Component {
       })
       
       this.props.diagShowTmp(true)
+    }else{
+      Notify.info('当前页面数据已清空');
     }
   }
   isClear(){
@@ -180,51 +185,44 @@ class Operation extends Component {
     let jsonStr = getAllDataStringList(baseList);
     let whichSign = baseList.typeConfig.typeConfig;
     let tmpLis = baseList.tabTemplate.items;
+    // console.log(jsonStr.present,'2222')
     for(let i = 0;i <tmpLis.length;i++){
       let dataStr = tmpLis[i].preview;
       let jsStr = tmpLis[i].dataJson;
-      // console.log(JSON.stringify(JSON.parse(dataStr)))
-      // console.log(JSON.stringify(jsonStr))
-      if(JSON.stringify(JSON.parse(dataStr)) == JSON.stringify(jsonStr) && jsStr == JSON.stringify(jsonData)){
+      // console.log(JSON.stringify(eval('('+JSON.parse(dataStr).chief+')')),111)
+      // if(JSON.stringify(eval('('+JSON.stringify(JSON.parse(dataStr))+')')) == JSON.stringify(jsonStr) && jsStr == JSON.stringify(jsonData)){
+      //   Notify.info('该模板已保存');
+      //   return false;
+      // }
+      if(
+        jsonStr.chief == JSON.stringify(eval('('+JSON.parse(dataStr).chief+')')) && 
+        jsonStr.present == JSON.stringify(eval('('+JSON.parse(dataStr).present+')')) && 
+        jsonStr.other == JSON.stringify(eval('('+JSON.parse(dataStr).other+')')) && 
+        jsonStr.vital == JSON.stringify(eval('('+JSON.parse(dataStr).vital+')'))  &&
+        JSON.stringify(jsonData.chief) == JSON.stringify(JSON.parse(jsStr).chief) &&    
+        JSON.stringify(jsonData.present) == JSON.stringify(JSON.parse(jsStr).present) &&    
+        JSON.stringify(jsonData.other) == JSON.stringify(JSON.parse(jsStr).other) &&      
+        JSON.stringify(jsonData.vital) == JSON.stringify(JSON.parse(jsStr).vital) &&   
+        JSON.stringify(jsonData.lis) == JSON.stringify(JSON.parse(jsStr).lis) &&  
+        JSON.stringify(jsonData.pacs) == JSON.stringify(JSON.parse(jsStr).pacs) &&     
+        JSON.stringify(jsonData.diag) == JSON.stringify(JSON.parse(jsStr).diag) &&    
+        JSON.stringify(jsonData.advice) == JSON.stringify(JSON.parse(jsStr).advice) &&      
+        JSON.stringify(jsonData.mainSuitSelecteds) == JSON.stringify(JSON.parse(jsStr).mainSuitSelecteds) &&      
+        JSON.stringify(jsonData.currentIllSelecteds) == JSON.stringify(JSON.parse(jsStr).currentIllSelecteds) &&     
+        JSON.stringify(jsonData.otherHistorySelecteds) == JSON.stringify(JSON.parse(jsStr).otherHistorySelecteds) && 
+        JSON.stringify(jsonData.checkBodySelecteds) == JSON.stringify(JSON.parse(jsStr).checkBodySelecteds) &&     
+        JSON.stringify(jsonData.addItems) == JSON.stringify(JSON.parse(jsStr).addItems)    
+      ){
         Notify.info('该模板已保存');
         return false;
       }
     }
-    if (whichSign == 0) {
-      if (
-        JSON.stringify(jsonData.advice) == '{}' &&
-        (jsonData.chief.length < 1 && jsonStr.chief == '[]') &&
-        jsonData.diag.length < 1 &&
-        jsonData.vital.length < 1 &&
-        jsonData.other.length < 1 &&
-        jsonData.pacs.length < 1 &&
-        jsonData.present.length < 1 &&
-        jsonData.lis.labelList.length < 1 &&
-        jsonData.lis.getExcelDataList.length < 1
-      ) {
-        Notify.info('模板数据不能为空');
-        return false;
-      }else{
-        return true;
-      }
-    } else if(whichSign == 1) {
-      if (JSON.stringify(jsonData.advice) == '{}' && 
-          jsonStr.chief == '[]' && 
-          jsonStr.present == '[]' && 
-          jsonStr.other == '[]' && 
-          jsonData.vital.length < 1 && 
-          jsonData.diag.length < 1 && 
-          jsonData.pacs.length < 1 && 
-          jsonData.lis.labelList.length < 1 && 
-          jsonData.lis.getExcelDataList.length < 1
-        ) {
-        Notify.info('模板数据不能为空');
-        return false;
-      }else{
-        return true;
-      }
+    let flg = isAllClear(jsonData,jsonStr)
+    if(!flg){
+      Notify.info('模板数据不能为空')
+      return false
     }else{
-      return true;
+      return true
     }
   }
   changeTitle() {

+ 5 - 20
src/components/PreviewBody/index.jsx

@@ -1,5 +1,6 @@
 import React, { Component } from "react";
 import style from "./index.less";
+import { normalVal } from '@utils/tools';
 import $ from "jquery";
 
 (function ($) {
@@ -67,7 +68,6 @@ class PreviewBody extends Component {
             dateTime:"",
         }
         this.$content = React.createRef();
-        this.normalVal = this.normalVal.bind(this);
         this.getCurrentDate = this.getCurrentDate.bind(this);
         this.onPrint = this.onPrint.bind(this);
     }
@@ -94,21 +94,6 @@ class PreviewBody extends Component {
         let date = year+'-'+(mon<10?'0'+mon:mon)+'-'+(day<10?'0'+day:day);
         this.setState({dateTime:date})
     }
-    normalVal(min,max){
-        if((min-0) && (max-0)){
-            return `正常值: (${min}~${max})`
-        }else if((min-0) && !(max-0)){
-            return `正常值: (>=${min})`
-        }else if(!(min-0) && (max-0)){
-            if(min == '' || min == null){
-                return `正常值: (<=${max})`
-            }else{
-                return `正常值: (${min}~${max})`
-            }
-        }else{
-            return null;
-        }
-    }
     showDetails(val){
         if(val.questionDetailList.length > 0){
             return val.questionDetailList.map((item)=>{
@@ -116,8 +101,8 @@ class PreviewBody extends Component {
                     return <td style={{width:'23%'}}><span style={{color:item.abnormal != '0' ?"red":null}}>{val.value}</span> { val.labelSuffix}</td>
                 }
             })
-        }else{
-            return <td style={{width:'23%'}}><span style={{color:val.value > val.maxValue || val.value < val.minValue?"red":null}}>{val.value}</span> { val.labelSuffix}</td>
+        }else{ 
+            return <td style={{width:'23%'}}><span style={{color:(val.maxValue || val.minValue)?(val.value > val.maxValue || val.value < val.minValue?"red":null):null}}>{val.value}</span> { val.labelSuffix}</td>
         }
     }
     render() {
@@ -188,7 +173,7 @@ class PreviewBody extends Component {
                                                             <td style={{width:'25%',fontSize:'12px'}}>{value.itemName}</td>
                                                             <td style={{width:'23%',fontSize:'12px'}}><span style={{fontSize:'12px',color:value.type == 1?"red":null}}>{value.value}</span> {value.unit}</td>
                                                             <td style={{width:'24%',fontSize:'12px'}}>
-                                                                {this.normalVal(value.min,value.max)}
+                                                                {normalVal(value.min,value.max)}
                                                             </td>
                                                             <td style={{width:'28%',fontSize:'12px'}}>{value.time == ''?('导入时间: '+this.state.dateTime):'化验时间: '+value.time}</td>
                                                         </tr>
@@ -211,7 +196,7 @@ class PreviewBody extends Component {
                                                                 {this.showDetails(val)}
                                                                 
                                                                 <td style={{width:'24%'}}>
-                                                                    {this.normalVal(val.minValue,val.maxValue)}
+                                                                    {normalVal(val.minValue,val.maxValue)}
                                                                 </td>
                                                                 <td style={{width:'28%'}}>{'化验时间:'+item.time}</td>
                                                             </tr>

+ 8 - 7
src/components/PushContainer/index.jsx

@@ -46,6 +46,7 @@ class PushContainer extends Component {
         this.handleAllCheckbox=this.handleAllCheckbox.bind(this)
         this.handleMangerTemplate=this.handleMangerTemplate.bind(this)
         this.handleDelList=this.handleDelList.bind(this)
+        this.makeSure=this.makeSure.bind(this)
         this.handleClose = this.handleClose.bind(this);
     }
     componentDidMount(){
@@ -115,7 +116,6 @@ class PushContainer extends Component {
         let e = event?event:window.event;
         if(e.keyCode == 13) {
             this.makeSure()
-            // store.dispatch(changeVisible(false))
         }
     }
     handleInput(e){
@@ -147,14 +147,15 @@ class PushContainer extends Component {
     }
     /**
      * 改变模板标题
-     * @param {模板id和模板title} obj 
+     * @param {模板id和模板title} obj
      */
-    handleTitleChange(obj) {
+    handleTitleChange(id,text) {
         store.dispatch(changeVisible(true))
         this.setState({
             type:3,
-            obj:obj,
-            title:obj.text,
+            currId:id,
+            title:text,
+            text:text,
             okText:'保存',
             okBorderColor:'#3B9ED0',
             okColor:'#fff',
@@ -200,13 +201,13 @@ class PushContainer extends Component {
             store.dispatch(delBatchItem(this.props.checkItems))
             store.dispatch(changeVisible(false))
         }else if(this.state.type == 3){
-            if(this.state.title == this.state.obj.text){
+            if(this.state.title == this.state.text){
                 store.dispatch(changeVisible(false))
                 Notify.success('标题修改成功');
                 return;
             }
             let tempObj = {
-                id:this.state.obj.id,
+                id:this.state.currId,
                 title:this.state.title
             }
             store.dispatch(changeTitleAsync(tempObj))

+ 5 - 7
src/components/RadioDrop/index.jsx

@@ -94,18 +94,16 @@ class RadioDrop extends Component{
   }
   handleEditLabel(e){
     e.stopPropagation();
+    if(!this.state.editable){     //ie8点开下拉未选值存值bug修改
+      return;
+    }
     const {ikey,boxMark,handleLabelEdit} = this.props;
-    /*const {editable} = this.state;
-    if(editable){
-      // 更改标签的value值
-      let changeVal = e.target.innerText;
-      handleLabelEdit && handleLabelEdit({ikey,changeVal,type:boxMark});
-    }*/
     this.setState({
       editable:false
     });  
    // 更改标签的value值
-    let changeVal = e.target.innerText;
+    const ev = e || window.event;
+    let changeVal = ev.target.innerText;
     handleLabelEdit && handleLabelEdit({ikey,changeVal,type:boxMark});
   }
   handledbClick(e){

+ 6 - 3
src/components/SpreadDrop/index.jsx

@@ -122,10 +122,13 @@ class SpreadDrop extends Component{
     e.stopPropagation();
     const {ikey,type,handleLabelChange} = this.props;
     const {editable} = this.state;
+    const ev = e || window.event;
     if(editable){
       // 更改标签的value值
-      let changeVal = e.target.innerText;
-      e.target.innerText = '';      //避免出现重复输入值
+      let changeVal = ev.target.innerText;
+      if(!isIE()){
+        e.target.innerText = '';      //避免出现重复输入值
+      }
       handleLabelChange && handleLabelChange({ikey,changeVal,type});
     }
     this.setState({
@@ -175,7 +178,7 @@ class SpreadDrop extends Component{
     const {handleConfirm,ikey,type,tagType,order,mainSaveText,copyType} = this.props;
     const params = Object.assign({},this.state,{ikey,type,tagType,order,mainSaveText,copyType});
     handleConfirm&&handleConfirm(params);
-	  this.btnClickFlag = true;
+	this.btnClickFlag = true;
     //点确定后隐藏弹窗
     this.props.handleHide();
   }

+ 4 - 7
src/components/TemplateItems/TemplateItem/index.jsx

@@ -74,7 +74,7 @@ class TemplateItem extends React.Component {
                     isOpen: false
                 });
             });
-            console.log($(this.content).parent().siblings().find('.content'))
+            // console.log($(this.content).parent().siblings().find('.content'))
             return;
         }
         $(this.content).slideDown(() => {
@@ -148,12 +148,9 @@ class TemplateItem extends React.Component {
 
     handleEditIconClick(e) {
         e.stopPropagation();
-        const text = $.trim($(`<div>${this.titleDOM.innerHTML}</div>`).text());
-        this.props.handleTitleChange({
-            id: this.props.id,
-            text: text
-        });
-        return true;
+        const text = this.titleDOM.innerHTML;
+        let currId = this.props.id
+        this.props.handleTitleChange(currId,text);
     }
 
     recoverTitle() {

+ 1 - 1
src/config/index.js

@@ -12,7 +12,7 @@ export default {
       '1':'mainSuit',         //主诉
       '2':'current',          //现病史
       '3':'process',          //病程变化
-      '4':'otherHis',         //其他史
+      '4':'otherHisModel',         //其他史
       // '5':'checkbody'        //查体
       '5':'currentEmpty',        //现病史空模板
       '6':'addSymptom'        //添加病情变化--主诉

+ 1 - 1
src/containers/AssistCheck.js

@@ -36,7 +36,7 @@ function mapDispatchToProps(dispatch, store) {
         //右侧推送
         fetchPushInfos(){
           //调右侧推送
-          dispatch(billing);
+          dispatch(billing());
         }
     }
 }

+ 1 - 1
src/containers/CheckBody.js

@@ -51,7 +51,7 @@ function mapDispatchToProps(dispatch,state){
     //右侧推送
     fetchPushInfos(){
       //调右侧推送
-      dispatch(billing);
+      dispatch(billing());
     },
   }
 }

+ 3 - 3
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,//主诉模板
@@ -78,7 +78,7 @@ function mapDispatchToProps(dispatch) {
          //右侧推送
          setTimeout(function(){      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
            if(didPushParamChange()){     //操作后内容有变化才推送
-             dispatch(billing);
+             dispatch(billing());
            }
          },500);
        },
@@ -91,7 +91,7 @@ function mapDispatchToProps(dispatch) {
         //文本模式下推送
         fetchPushInfos(){
           //调右侧推送
-          dispatch(billing);
+          dispatch(billing());
         },
       handleInput(obj){    //文本模式值保存
         dispatch({

+ 1 - 1
src/containers/DiagnosticList.js

@@ -64,7 +64,7 @@ function mapDispatchToProps(dispatch) {
             dispatch(getTips(diagItem))
         },
         getBilling: () => {
-            dispatch(billing)
+            dispatch(billing())
         }
     }
 }

+ 1 - 1
src/containers/EditableSpan.js

@@ -172,7 +172,7 @@ function mapDispatchToProps(dispatch,state) {
       clearTimeout(timer);
       let timer = setTimeout(function(){      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
         if(didPushParamChange()){     //操作后内容有变化才推送
-          dispatch(billing);
+          dispatch(billing());
           clearTimeout(timer);
         }
       },config.delayPushTime);

+ 1 - 1
src/containers/Inspect.js

@@ -48,7 +48,7 @@ function mapDispatchToProps(dispatch, store) {
         //右侧推送
         fetchPushInfos(){
           //调右侧推送
-          dispatch(billing);
+          dispatch(billing());
         }
     }
 }

+ 6 - 6
src/containers/MainSuit.js

@@ -79,7 +79,7 @@ function mapDispatchToProps(dispatch) {
           //右侧推送
           setTimeout(function(){      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
             if(didPushParamChange()){     //操作后内容有变化才推送
-              dispatch(billing);
+              dispatch(billing());
             }
           },500);
         },
@@ -91,9 +91,9 @@ function mapDispatchToProps(dispatch) {
       setMainSuit: (value) => {
         dispatch({type: SET_MAIN_SUIT, value})
       },
-      pushMessage() {//结构模式右侧推送
-        console.log("右侧推送接口");
-        dispatch(billing);
+      pushMessage(data) {//结构模式右侧推送
+        // console.log("右侧推送接口");
+        dispatch(billing(data));
       },
       getSearchData:(item)=>{
         getSearch(item).then((res)=>{
@@ -132,14 +132,14 @@ function mapDispatchToProps(dispatch) {
         //右侧推送
           setTimeout(function(){ 
             if(didPushParamChange()){
-              dispatch(billing);
+              dispatch(billing());
             }
           },500);
       },
       fetchPushInfos(){//文本模式下推送
         //调右侧推送
         console.log('右侧推送内容');
-        dispatch(billing);
+        dispatch(billing());
       },
       handleInput(obj){   //文本模式值保存
           dispatch({

+ 1 - 1
src/containers/NumberDrop.js

@@ -125,7 +125,7 @@ function mapDispatchToProps(dispatch,store){
       clearTimeout(timer);
       let timer = setTimeout(function(){      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
         if(didPushParamChange()){     //操作后内容有变化才推送
-          dispatch(billing);
+          dispatch(billing());
           clearTimeout(timer);
         }
       },config.delayPushTime);

+ 1 - 1
src/containers/NumberUnitDrop.js

@@ -120,7 +120,7 @@ function mapDispatchToProps(dispatch,store){
       clearTimeout(timer);
       let timer = setTimeout(function(){      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
         if(didPushParamChange()){     //操作后内容有变化才推送
-          dispatch(billing);
+          dispatch(billing());
           clearTimeout(timer);
         }
       },config.delayPushTime);

+ 5 - 4
src/containers/OtherHistory.js

@@ -36,10 +36,11 @@ function mapDispatchToProps(dispatch,store){
       //先获取最近记录,没有的话显示模板
       dispatch((dispatch,getStore)=>{
         const initData = getStore().homePage.initData;
-        const arr = JSON.parse(JSON.stringify(initData.otherHis));
+        const model = JSON.parse(JSON.stringify(initData.otherHisModel));
+        const arr = JSON.parse(JSON.stringify(initData.otherHis||null));
         const arrSave = JSON.parse(JSON.stringify(initData.otherHisSave||null));
         const isHis = initData.otherIsHis;
-        const listObj = isHis?{newArr:arr,saveText:arrSave||[]}:fullfillText(arr);
+        const listObj = isHis?{newArr:arr,saveText:arrSave||[]}:fullfillText(model);
         dispatch({
           type:SETDATA,
           data:listObj.newArr,
@@ -52,7 +53,7 @@ function mapDispatchToProps(dispatch,store){
       //右侧推送
       setTimeout(function(){      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
         if(didPushParamChange()){     //操作后内容有变化才推送
-          dispatch(billing);
+          dispatch(billing());
         }
       },500);
     },
@@ -78,7 +79,7 @@ function mapDispatchToProps(dispatch,store){
     //右侧推送
     fetchPushInfos(){
       //调右侧推送
-      dispatch(billing);
+      dispatch(billing());
     },
     handleInput(obj){    //文本模式值保存
       dispatch({

+ 1 - 1
src/containers/PushItemsContainer.js

@@ -30,7 +30,7 @@ function mapDispatchToProps(dispatch) {
                 type: GET_DIAGNOSTIC_STR
             });
             dispatch(isAddMainSuit())
-            dispatch(billing);
+            dispatch(billing());
         },
         billing: (checkedAssay, checkedCheck) => {
             // dispatch(billing)

+ 2 - 2
src/containers/RadioDrop.js

@@ -107,7 +107,7 @@ function mapDispatchToProps(dispatch,store){
       //右侧推送
       setTimeout(function(){      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
         if(didPushParamChange()){     //操作后内容有变化才推送
-          dispatch(billing);
+          dispatch(billing());
         }
       },500);
     },
@@ -127,7 +127,7 @@ function mapDispatchToProps(dispatch,store){
         type:dbEditActions[+type],
         data:{changeVal:params.changeVal,ikey:ikey}
       });
-      dispatch(billing);
+      dispatch(billing());
       dispatch({
         type:ISREAD
       })

+ 2 - 2
src/containers/SpreadDrop.js

@@ -332,7 +332,7 @@ function handleLabel(dispatch,params){
       break;
     default:
   }
-  dispatch(billing);
+  dispatch(billing());
   dispatch({
     type:ISREAD
   })
@@ -349,7 +349,7 @@ function mapDispatchToProps(dispatch,store){
       //右侧推送
       setTimeout(function(){      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
         if(didPushParamChange()){     //操作后内容有变化才推送
-          dispatch(billing);
+          dispatch(billing());
         }
       },500);
     },

+ 10 - 2
src/containers/TypeConfigContainer.js

@@ -8,6 +8,7 @@ import config from "@config/index";
 import { initItemList } from '@store/async-actions/tabTemplate';
 import { allCheckedShow } from '@store/actions/tabTemplate';
 import {Notify} from '@commonComp';
+import {SETOTHERHISTORY} from "../store/types/homePage";
 
 function mapStateToProps(state) {
   return {
@@ -34,10 +35,17 @@ function mapDispatchToProps(dispatch) {
       //保存模式切换结果
       dispatch(saveMode(confirmType)).then((res)=>{
         if(res.data.code=='0'&&res.data.data){
+          //清空所有数据
           pushAllDataList('','clear');
           dispatch({type: CONFIRM_TYPE, confirmType});
-          //清空所有数据
-          dispatch(getOtherHisRecord());          //获取其他史最近记录
+          //切换模式是要重新获取其他史数据
+          dispatch({
+            type:SETOTHERHISTORY,
+            data:[],
+            save:[],
+            otherIsHis:false
+          });
+          dispatch(getOtherHisRecord());        //获取其他史最近记录
           Notify.success("模式切换成功");
           dispatch(initItemList(confirmType));
           dispatch(allCheckedShow(false))    //全选反选显示重置

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

@@ -240,7 +240,7 @@ export function setInputLabel(state,action){
   if(+item.tagType===3){      //multSpred标签
     item.questionMapping[subIndex].value = text;
     let texts = item.questionMapping.map((it)=>{
-      return it.value?(it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||''):'';
+      return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
     });
     res.saveText[i] = texts.join('');
     res.update = Math.random();

+ 25 - 4
src/store/actions/currentIll.js

@@ -59,10 +59,13 @@ function addPos(data,num){
 export const setData = (state,action) =>{
   let res = Object.assign({},state);
   res.editClear = false;
-  res.symptomIds = JSON.parse(JSON.stringify(action.info.mainIds));
-  const useEmpty = action.info.useEmpty;
+  const mainIds = action.info.mainIds;
+  res.symptomIds = JSON.parse(JSON.stringify(mainIds));
   const num = action.info.num;//点击了几次添加病情变化
-  let mainData = JSON.parse(JSON.stringify(action.info.mainData));//主诉模板数据
+  // const useEmpty = action.info.useEmpty;
+  let useEmpty,mainData;
+  // let mainData = JSON.parse(JSON.stringify(action.info.mainData));//主诉模板数据
+  let mainModleData = JSON.parse(JSON.stringify(action.info.mainData));//主诉模板数据
   let moduleData = JSON.parse(JSON.stringify(res.moduleData));//现病史模板
   let addModule = JSON.parse(JSON.stringify(res.addModule));//拷贝的模板
   let current = JSON.parse(JSON.stringify(moduleData));
@@ -81,6 +84,24 @@ export const setData = (state,action) =>{
   /*let mainLabelModuleArr = objToArr.filter((item)=>{
     return item.questionMapping.length>0;
   })*/
+
+  // 是否使用空模板:num=0时判断mainIds,num>=1,截取第一病程遍历是否有症状exist
+  if(num==0){
+    useEmpty = mainIds.length>0?false:true;
+    mainData = mainModleData;
+  }else{
+    let sliceIdx;
+    for(let j=0; j<mainModleData.length; j++){
+      if(mainModleData[j].id==config.tongYId && mainModleData[j].pos==1){
+        sliceIdx = j;
+      }
+    }
+    mainData = mainModleData.slice(0,sliceIdx);
+    let existData = mainData.filter((item)=>{
+      return item.exist;
+    })
+    useEmpty = existData&&existData.length>0?false:true;
+  }
   
   if (useEmpty) {
     res.data = res.emptyData;
@@ -211,7 +232,7 @@ function getLabel(lid,lname){
 // 多选展开确定事件--主、伴、无
 export const confirm = (state,action) =>{
   let res = Object.assign({},state);
-  let length1 = res.data.length;console.log(123,action);
+  let length1 = res.data.length;
   let arr = JSON.parse(JSON.stringify(res.data));
   const {nones,exists,withs,ikey,exclusion,excluName,ban,noneIds} = action.data;
   let existsId = exists && exists.length>0?getIds(exists):[];

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

@@ -128,10 +128,7 @@ export const confirm = (state,action) =>{
   let arr = res.data;
   let saveText = JSON.parse(JSON.stringify(res.saveText));
   const {exists,withs,ikey,withsName,existsName,ban} = action.data;
-  // let existsId = getIds(exists);
-  // let withsId = getIds(withs);
   let banText = JSON.stringify(ban) == "{}" ? '':{id:ban.id,name:ban.name,value:ban.name,tagType:config.tagType};
-  // res.mainIds = res.mainIds?res.mainIds.concat(existsId,withsId):[];
   let length = exists.length;
   let labelIndx = parseInt(ikey);//当前点击标签的index
   // 取第一个添加症状的主症状和伴随
@@ -142,8 +139,18 @@ export const confirm = (state,action) =>{
     res.mainSymptIds = res.mainSymptIds.concat(existsId,withsId);
   }
 
-  let text = saveText.slice(0,labelIndx);
-  let index = text.indexOf('伴');
+  // 第二病程-伴位置处理
+  let forwardId;
+  let text;
+  for(let n=labelIndx-1; n>0; n--){
+    if(arr[n].id==8){
+      forwardId = n;
+      continue;
+    }
+  }
+  if(forwardId){
+    text = saveText.slice(forwardId,labelIndx);
+    let index = text.indexOf('伴');
     if(index==-1){//没有伴,直接插入ikey前
       if(exists.length > 0){
         for(let i=0; i<exists.length; i++){
@@ -181,6 +188,48 @@ export const confirm = (state,action) =>{
         }
       }
     }
+  }else{
+    let text = saveText.slice(0,labelIndx);
+    let index = text.indexOf('伴');
+    if(index==-1){//没有伴,直接插入ikey前
+      if(exists.length > 0){
+        for(let i=0; i<exists.length; i++){
+          let pos = labelIndx + i;
+          arr.splice(pos,0,getTextLabel(exists[i].id,exists[i].name,1));
+          res.saveText[pos] = exists[i].name;
+        }
+      }
+      if(withs.length > 0){
+        let newWiths = JSON.parse(JSON.stringify(withs));
+        if(banText){
+         newWiths.unshift(banText);
+       }
+       for(let j=0; j<newWiths.length; j++){
+        let withsPos = labelIndx +length + j;
+        arr.splice(withsPos,0,getTextLabel(newWiths[j].id,newWiths[j].name,2));
+        res.saveText[withsPos] = newWiths[j].name;
+      }
+    }
+    }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;
+        }
+      }
+      
+      if(withs.length>0){//有伴插到ikey前既可     
+        for(let j=0; j<withs.length; j++){
+          // let withsPos = labelIndx + j;
+          let withsPos = labelIndx +length + j;
+          arr.splice(withsPos,0,getTextLabel(withs[j].id,withs[j].name,2));
+          res.saveText[withsPos] = withs[j].name;
+        }
+      }
+    }
+  }
+
     
     res.data = arr;
     res.saveText = fullfillText(arr).saveText;
@@ -273,18 +322,39 @@ export const insertSearch = (state,action)=>{
     res.data[focusIndex].value = value;
     res.saveText[focusIndex] = value;*/
 
+    /*******************第一病程搜索结果也移植到现病史修改(2-18)********************/
+    // 位置判断-第一病程-主症状还是伴随 前一个标签存在 并且没有pos;
+    // 判断在伴的前面还是后面:前exist=1(主),后exist=2(伴)
+    let nText = {};
+    if(focusIndex==0){
+      nText = Object.assign({},text,{exist:1});
+    }else{
+      if(!data[focusIndex-1].pos){//第一病程
+        const preText = res.saveText.slice(0,focusIndex);
+        const ind = preText.indexOf("伴");
+        if(ind != -1){
+          nText = Object.assign({},text,{exist:2});
+        }else{
+          nText = Object.assign({},text,{exist:1});
+        }
+      }else{//第二及以上病程
+        nText = Object.assign({},text);
+      }
+    }
+    
+
     // 从新插入一个span标签
     const searchStr = res.searchStr;
     let innerText = span.current.innerText;
     const value = innerText.replace(searchStr,"");
     let index = innerText.indexOf(searchStr);
     if(index < 1){//前
-      res.data.splice(focusIndex,0,text);
+      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,text);
+      res.data.splice(focusIndex+1,0,nText);
       res.saveText.splice(focusIndex+1,0,searchData);
       res.data[focusIndex].value = value;
     }
@@ -382,11 +452,11 @@ export function setRadioValue(state,action){
 //双击标签输入改变值
 export const changeLabelVal = (state,action)=>{
   const res = Object.assign({},state);
-  const index = action.data.ikey;
+  const index = parseInt(action.data.ikey);
   const newVal = action.data.changeVal;
   let data = res.data;
   let item = data[index];
-  if(newVal.trim()){
+  if(newVal&&newVal.trim()){
     if(item){
       item.value = newVal;
       res.saveText[index] = newVal;
@@ -394,9 +464,10 @@ export const changeLabelVal = (state,action)=>{
   }else{//删除完标签内容则删除该标签
     
     data.splice(index,1);
+    // data[index].value = "";
     // res.data.splice(index,1);
-    // res.saveText = fullfillText(res.data).saveText;
     res.saveText.splice(index,1);
+    // res.saveText[index] = "";
   } 
   res.update = Math.random();
   return res;

+ 0 - 1
src/store/actions/print.js

@@ -30,7 +30,6 @@ export const saveMessage=(state,action)=>{
 
 export const diagShow=(state,action)=>{
   const res=Object.assign({},state);
-  console.log(action)
   res.diagShow = action.data
   return res;
 };

+ 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());          //获取其他史最近记录
+        dispatch(getOtherHisRecord());  console.log(111)        //获取其他史最近记录
         initHis(dispatch)
       }else{
         initHis(dispatch)

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

@@ -95,8 +95,8 @@ export const getPatientMessage = (dispatch, getState) => {
         confirmType:data1.modeValue
       });
       dispatch(getInitModules);     //确保病人信息获取以后再获取模板等数据,否则参数为空
-      if(state.tabTemplate.items.length == 0){
-        dispatch(initItemList(data1.modeValue));        //模板列表没有就获取模板列表用于保存时做数据对比是否保存过
-      }
+      // if(state.tabTemplate.items.length == 0){
+      //   dispatch(initItemList(data1.modeValue));        //模板列表没有就获取模板列表用于保存时做数据对比是否保存过
+      // }
     })
 };

+ 5 - 2
src/store/async-actions/pushMessage.js

@@ -9,7 +9,8 @@ const api={
 }
 
 //获取右侧推送信息
-export const billing = (dispatch, getState) => {
+export const billing = (mdata) => {
+ return (dispatch, getState) =>{
   const state = getState();
   let url = api.push;
   if(+state.typeConfig.typeConfig===1){
@@ -25,7 +26,7 @@ export const billing = (dispatch, getState) => {
     pacs: emrData.pacs,
     sex: emrData.sex,
     vital:emrData.vital,
-    symptom: emrData.current + emrData.main
+    symptom: mdata?(emrData.current + mdata):(emrData.current + emrData.main)
   };
   storageLocal.set('emrParam',params);      //推送数据存储,用作推送前对比是否有变,有变才推送
     json(url, params).then((data) => {
@@ -63,8 +64,10 @@ export const billing = (dispatch, getState) => {
   }).catch((e) =>{
       console.log(e)
   }) 
+ }
 };
 
+
 export const getTips = (diagItem) =>{
     return (dispatch, getState) =>{
         dispatch({

+ 4 - 4
src/store/reducers/assistCheck.js

@@ -39,7 +39,7 @@ export default (state = initSearchList, action) => {
             }
         }
         for (let j = 0; j < tempArrs.length; j++) {
-            tmpString += (tempArrs[j].name+(tempArrs[j].value?(':'+tempArrs[j].value):'')+(tempArrs[j].time?'报告日期:'+tempArrs[j].time:'')+';')
+            tmpString += (tempArrs[j].name+(tempArrs[j].value?(':'+tempArrs[j].value):'')+(tempArrs[j].time?', 报告日期:'+tempArrs[j].time:'')+';')
         }
         newState.dataString = tmpString
         return newState;
@@ -54,7 +54,7 @@ export default (state = initSearchList, action) => {
             return
         }
         for (let i = 0; i < tempArr.length; i++) {
-            tmpString += (tempArr[i].name+(tempArr[i].value?(':'+tempArr[i].value):'')+(tempArr[i].time?'报告日期:'+tempArr[i].time:'')+';')
+            tmpString += (tempArr[i].name+(tempArr[i].value?(':'+tempArr[i].value):'')+(tempArr[i].time?', 报告日期:'+tempArr[i].time:'')+';')
         }
         newState.assistLabel = [...tempArr]
         newState.dataString = tmpString
@@ -69,7 +69,7 @@ export default (state = initSearchList, action) => {
                 tempArr[i].value = action.val
                 newState.assistLabel = [...tempArr]
             }
-            tmpString += (tempArr[i].name+(tempArr[i].value?(':'+tempArr[i].value):'')+(tempArr[i].time?'报告日期:'+tempArr[i].time:'')+';')
+            tmpString += (tempArr[i].name+(tempArr[i].value?(':'+tempArr[i].value):'')+(tempArr[i].time?', 报告日期:'+tempArr[i].time:'')+';')
         }
         newState.dataString = tmpString
         return newState;
@@ -83,7 +83,7 @@ export default (state = initSearchList, action) => {
                 tempArr[i].time = action.date
                 newState.assistLabel = [...tempArr]
             }
-            tmpString += (tempArr[i].name+(tempArr[i].value?(':'+tempArr[i].value):'')+(tempArr[i].time?'报告日期:'+tempArr[i].time:'')+';')
+            tmpString += (tempArr[i].name+(tempArr[i].value?(':'+tempArr[i].value):'')+(tempArr[i].time?', 报告日期:'+tempArr[i].time:'')+';')
         }
         newState.dataString = tmpString
         return newState;

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

@@ -44,7 +44,7 @@ export default function (state=initState,action) {
     case SETOTHERHISTORY:
       res.initData.otherHis = action.data;
       res.initData.otherHisSave = action.save;
-      res.initData.otherIsHis = true;
+      res.initData.otherIsHis = action.otherIsHis!=undefined?action.otherIsHis:true;
       return res;
     /*case SETTEXTFOCUS:
       res.focusTextIndex = action.index;

+ 50 - 7
src/utils/tools.js

@@ -218,7 +218,7 @@ const getAllDataStringList =(baseList) =>{           //获取所有模块文本
       'diag' : baseList.diagnosticList.diagnosticStr,
       'advice' : baseList.pushMessage.AdviceStr
     }
-    console.log(jsonDataString,'文本模式数据获取')
+    //console.log(jsonDataString,'文本模式数据获取')
     return jsonDataString;
 }
 /**
@@ -229,9 +229,6 @@ const getAllDataStringList =(baseList) =>{           //获取所有模块文本
  * @param {引用的话是保存时候的文本类型,编辑的时候是当前页面设置的文本类型} whichSign 
  */
 const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清空所有的数据
-      store.dispatch({
-        type:ISREAD
-      });
     if(action == 'clear'){     //清空
         store.dispatch({type: CLEAR_MAIN_SUIT,data:[],saveText:[],selecteds:[],editClear:true,mainIds:[],mainSymptIds:[]});
         store.dispatch({type: CLEAR_CURRENT_ILL,data:[],saveText:[],selecteds:[],editClear:true,symptomIds:[]});
@@ -467,7 +464,10 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
               });
             }
         }
-    }  
+    }
+  store.dispatch({
+    type:ISREAD
+  });
 }
 
 function filterArr(arr){
@@ -573,7 +573,48 @@ function didPushParamChange(){
   }
   return true;
 }
-
+//判断页面所有数据是否为空
+function isAllClear(jsonData,jsonStr){
+  if (      //结构化和文本数据都为空
+    JSON.stringify(jsonData.advice) == '{}' &&
+    jsonData.chief.length < 1 &&
+    jsonData.present.length < 1 &&
+    jsonData.other.length < 1 &&
+    jsonData.vital.length < 1 &&
+    jsonData.diag.length < 1 &&
+    jsonData.pacs.length < 1 &&
+    jsonData.lis.labelList.length < 1 &&
+    jsonData.lis.getExcelDataList.length < 1 &&
+    JSON.stringify(jsonData.advice) == '{}' &&
+    filterArr(JSON.parse(jsonStr.chief)) == '' &&
+    filterArr(JSON.parse(jsonStr.present)) == '' &&
+    filterArr(JSON.parse(jsonStr.other)) == '' &&
+    filterArr(JSON.parse(jsonStr.vital)) == '' &&
+    jsonData.diag.length < 1 &&
+    jsonData.pacs.length < 1 &&
+    jsonData.lis.labelList.length < 1 &&
+    jsonData.lis.getExcelDataList.length < 1
+  ) {
+    return false;
+  }else{
+    return true;
+  }
+}
+function normalVal(min,max){
+  if((min-0) && (max-0)){
+      return `正常值: (${min}~${max})`
+  }else if((min-0) && !(max-0)){
+      return `正常值: (>=${min})`
+  }else if(!(min-0) && (max-0)){
+      if(min == '' || min == null){
+          return `正常值: (<=${max})`
+      }else{
+          return `正常值: (${min}~${max})`
+      }
+  }else{
+      return null;
+  }
+}
 module.exports = {
     checkType: Type.checkType,
     regexp,
@@ -595,5 +636,7 @@ module.exports = {
     handleEnter,
     didPushParamChange,
     getEMRParams,
-    windowEventHandler
+    windowEventHandler,
+    isAllClear,
+    normalVal
 };