Quellcode durchsuchen

Merge branch 'dev/new1' into dev/zhangxc1

zhangxc vor 6 Jahren
Ursprung
Commit
feceb083da
49 geänderte Dateien mit 587 neuen und 320 gelöschten Zeilen
  1. 1 1
      index.html
  2. 7 1
      src/common/less/variables.less
  3. 33 9
      src/components/AddAssistCheck/Textarea/index.jsx
  4. 20 7
      src/components/AddAssistCheck/Textarea/index.less
  5. 9 9
      src/components/AddInspect/index.jsx
  6. 12 11
      src/components/AddInspect/index.less
  7. 1 1
      src/components/CheckBody/index.jsx
  8. 11 6
      src/components/CurrentIll/index.jsx
  9. 2 1
      src/components/EMRContainer/index.less
  10. 1 0
      src/components/HistoryCaseContainer/HistoryList/index.jsx
  11. 1 1
      src/components/HistoryCaseContainer/HistoryList/index.less
  12. 22 4
      src/components/InfoTitle/index.jsx
  13. 4 0
      src/components/InfoTitle/index.less
  14. 7 5
      src/components/MainSuit/index.jsx
  15. 7 1
      src/components/MultSpread/index.jsx
  16. 44 52
      src/components/NumberDrop/index.jsx
  17. 2 1
      src/components/NumberUnitDrop/index.jsx
  18. BIN
      src/components/Operation/img/check-circle.png
  19. BIN
      src/components/Operation/img/check-right.png
  20. 73 13
      src/components/Operation/index.jsx
  21. 36 4
      src/components/Operation/index.less
  22. 13 8
      src/components/OtherHistory/index.jsx
  23. 2 1
      src/components/PatInfo/index.jsx
  24. 5 0
      src/components/PatInfo/index.less
  25. 55 59
      src/components/PreviewBody/index.jsx
  26. 2 28
      src/components/PreviewBody/index.less
  27. 2 2
      src/components/PrintPreview/index.jsx
  28. 9 4
      src/components/PushContainer/index.jsx
  29. 0 1
      src/components/PushContainer/index.less
  30. 2 1
      src/components/RadioDrop/index.jsx
  31. 1 0
      src/components/SearchDrop/index.less
  32. 2 1
      src/components/SpreadDrop/index.jsx
  33. 11 15
      src/components/TemplateItems/TemplateItem/index.jsx
  34. 7 9
      src/components/TemplateItems/index.jsx
  35. 1 5
      src/components/TemplateItems/index.less
  36. 1 1
      src/containers/CurrentIll.js
  37. 7 4
      src/containers/OperationContainer.js
  38. 1 1
      src/containers/SpreadDrop.js
  39. 1 1
      src/containers/eleType.js
  40. 24 6
      src/modules/HomePage/index.jsx
  41. 12 2
      src/store/actions/checkBody.js
  42. 79 23
      src/store/actions/currentIll.js
  43. 12 3
      src/store/actions/mainSuit.js
  44. 12 2
      src/store/actions/otherHistory.js
  45. 1 1
      src/store/actions/pushMessage.js
  46. 2 3
      src/store/async-actions/tabTemplate.js
  47. 5 1
      src/store/reducers/homePage.js
  48. 2 1
      src/store/types/homePage.js
  49. 23 10
      src/utils/tools.js

+ 1 - 1
index.html

@@ -8,6 +8,6 @@
     <title>ICSS</title>
 </head>
 <body>
-<div id="root"></div>
+<div id="root" style="min-width: 1024px;"></div>
 </body>
 </html>

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

@@ -165,4 +165,10 @@
 
 .borderd{
    border:1px #000 solid;
- }
+ }
+
+.blue-border{
+  border:2px @blue solid;
+  border-radius: 2px;
+  /*box-shadow: 0px 0px 2px @blue;*/
+}

+ 33 - 9
src/components/AddAssistCheck/Textarea/index.jsx

@@ -1,21 +1,25 @@
 import React, { Component } from "react";
 import style from "./index.less";
 import config from '@config/index';
+import $ from 'jquery';
 
 class Textarea extends Component {
   constructor(props) {
     super(props);
     this.state = {
-      timer:null
+      timer:null,
+      val:'报告描述或意见'
     };
     this.$dom = React.createRef();
+    this.$domW = React.createRef();
     this.handleInput = this.handleInput.bind(this);
+    this.handleFocus = this.handleFocus.bind(this);
+    this.handleBlur = this.handleBlur.bind(this);
   }
   handleInput(e){
     const {handleChangeAssistValue,idx,handlePush} = this.props;
     const text = e.target.innerText;
     const stimer = this.state.timer;
-    console.log(text)
     handleChangeAssistValue&&handleChangeAssistValue(text,idx);
     //右侧推送--延时推送
     clearTimeout(stimer);
@@ -23,6 +27,11 @@ class Textarea extends Component {
       handlePush&&handlePush();
       clearTimeout(stimer);
     },config.delayPushTime);
+    if(text.trim() != ''){
+      this.setState({val:''})
+    }else{
+      this.setState({val:'报告描述或意见'})
+    }
     this.setState({
       timer
     });
@@ -43,17 +52,32 @@ class Textarea extends Component {
     const {value} = this.props;
     if(value){
       this.$dom.current.innerText = value||'';
+      this.setState({val:''})
+    }
+  }
+  handleFocus(e){
+    this.setState({val:''})
+  }
+  handleBlur(e){
+    let str = this.$dom.current.innerText
+    if(str.trim() == ''){
+      this.setState({val:'报告描述或意见'})
     }
   }
   render() {
-    const {value} = this.props;
+    const {val} = this.state;
     return (
-      <div className={style.divTextarea}
-          contenteditable={true}
-          ref={this.$dom}
-          onInput={this.handleInput}
-          onPropertyChange={this.handleInput}
-      ></div>
+      <div className={style.textWap}>
+        <div className={style.divTextarea}
+            contenteditable={true}
+            ref={this.$dom}
+            onInput={this.handleInput}
+            onFocus={this.handleFocus}
+            onBlur={this.handleBlur}
+            onPropertyChange={this.handleInput}
+        ></div>
+        <p className={style.textareaWarring} id="textareaWarring">{val}</p>
+      </div>
     );
   }
 }

+ 20 - 7
src/components/AddAssistCheck/Textarea/index.less

@@ -10,11 +10,24 @@
   line-height: 20px;
   resize: none;
   font-family: inherit;
+  position: relative;
+  z-index: 10;
 }
-.divTextarea:empty:before{ 
-  content: '报告描述或意见'; 
-  color: gray; 
-} 
-.divTextarea:focus:before{
-  content:none;
-}
+.textWap {
+  overflow: hidden;
+  position: relative;
+  .textareaWarring {
+    position: absolute;
+    left: 0;
+    top: 0;
+    color: #a5a3a3;
+    z-index: 5;
+  }
+}
+// .divTextarea:empty:before{ 
+//   content: '报告描述或意见'; 
+//   color: #a5a3a3; 
+// } 
+// .divTextarea:focus:before{
+//   content:none;
+// }

+ 9 - 9
src/components/AddInspect/index.jsx

@@ -235,11 +235,11 @@ class Inspect extends React.Component {
         if(val.questionDetailList.length > 0){
             return val.questionDetailList.map((item)=>{
                 if(val.value == item.name){
-                    return <td className={item.abnormal != '0' ?"red":'' }>{val.value}</td>
+                    return <td style={{width:'20%'}} className={item.abnormal != '0' ?"red":'' }>{val.value}</td>
                 }
             })
         }else{
-            return <td><span className={(val.maxValue || val.minValue) ? (val.value > val.maxValue || val.value < val.minValue?"red":''):''}>{val.value}</span> { val.labelSuffix}</td>
+            return <td style={{width:'20%'}}><span className={(val.value - 0).toString() == 'NaN'?"red":(val.maxValue || val.minValue) ? (val.value > val.maxValue || val.value < val.minValue?"red":''):''}>{val.value}</span> { val.labelSuffix}</td>
         }
     }
     render() {
@@ -264,12 +264,12 @@ class Inspect extends React.Component {
                                                     {
                                                         item.lisExcelItem && item.lisExcelItem.map((value)=>{
                                                             return <tr>
-                                                                <td>{value.itemName}</td>
-                                                                <td><span className={value.type == 1?'red':null}>{value.value}</span> {value.unit}</td>
-                                                                <td>
+                                                                <td style={{width:'30%'}}>{value.itemName}</td>
+                                                                <td style={{width:'20%'}}><span className={value.type == 1?'red':null}>{value.value}</span> {value.unit}</td>
+                                                                <td style={{width:'25%'}}>
                                                                     {normalVal(value.min,value.max)}
                                                                 </td>
-                                                                <td>{value.time == ''?('导入时间: '+this.state.dateTime):'化验时间: '+value.time}</td>
+                                                                <td style={{width:'25%'}}>{value.time == ''?('导入时间: '+this.state.dateTime):'化验时间: '+value.time}</td>
                                                             </tr>
                                                         })
                                                     }
@@ -303,12 +303,12 @@ class Inspect extends React.Component {
                                                     item.details.map((val)=>{
                                                         if(val.value && val.value != ''){
                                                             return <tr>
-                                                                <td>{val.name}</td>
+                                                                <td style={{width:'30%'}}>{val.name}</td>
                                                                 {this.showDetails(val)}
-                                                                <td>
+                                                                <td style={{width:'25%'}}>
                                                                     {normalVal(val.minValue,val.maxValue)}
                                                                 </td>
-                                                                <td>{'化验时间:'+item.time}</td>
+                                                                <td style={{width:'25%'}}>{'化验时间:'+item.time}</td>
                                                             </tr>
                                                         }
                                                     })

+ 12 - 11
src/components/AddInspect/index.less

@@ -34,6 +34,7 @@
         position: absolute;
         right: 0;
         top: 12px;
+        background-color: #fff;
     }
 }
 .staticTagActive {
@@ -43,8 +44,9 @@
     position: relative;
     vertical-align: top;
     padding: 2px 10px;
-    margin-right: 10px;
-    width: 180px;
+    box-sizing: border-box;
+    width: 20%;
+    float: left;
     span {
         border-bottom: 1px solid #666666 ;
     }
@@ -66,13 +68,13 @@
 }
 .labelWrap {
     .table {
-        display: inline-block;
         color: #000;
+        width: 80%;
         tr {
             line-height: 18px;
             height: 18px;
+            width: 100%;
             td {
-                width: 180px;
                 padding-top: 3px;
             }
         }
@@ -122,17 +124,14 @@
     // line-height: 28px;
     overflow: hidden;
     padding-top: 0 !important;
-    // width: 292px;
     width: 290px;
     float: left;
     padding: 0 15px;
     box-sizing: border-box;
-    // border-bottom: 1px solid #000;
     span {
         display: inline-block;
     }
     .itemPartL {
-        // width: 100px;
         max-width: 180px;
         overflow: hidden;
         text-overflow: ellipsis;
@@ -173,21 +172,23 @@
         border-radius: 50%;
     }
     .excelDataLis {
-        padding: 2px 10px;
+        padding: 2px 0px;
         border-bottom: 1px dashed #989DA3;
         .excelDataTitle {
             display: inline-block;
-            width: 180px;
+            width: 20%;
             vertical-align: top;
+            padding-left: 10px;
+            float: left;
         }
         table {
-            display: inline-block;
+            width: 80%;
             tr {
                 height: 16px;
                 line-height: 16px;
+                width: 100%;
             }
             td {
-                width: 180px;
                 text-align: left;
                 padding-top: 3px;
             }

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

@@ -34,7 +34,7 @@ class CheckBody extends Component{
     return arr;
   }
   handleClick(e){//让搜索框跟随鼠标点击移动
-    e.stopPropagation();
+    // e.stopPropagation();
     const {fetchPushInfos,totalHide} = this.props;
     //fetchPushInfos&&fetchPushInfos();
     this.getData();

+ 11 - 6
src/components/CurrentIll/index.jsx

@@ -4,7 +4,7 @@ import {Button,InlineTag,ItemBox,Notify,Textarea} from '@commonComp';
 import TailInlineTag from '@commonComp/TailInlineTag';
 import chooseType from '@containers/eleType.js';
 import SearchDrop from '@components/SearchDrop';
-import {filterDataArr,getPageCoordinate,windowEventHandler} from '@utils/tools'
+import {filterDataArr,getPageCoordinate,windowEventHandler,isIE} from '@utils/tools'
 import $ from 'jquery';
 
 class CurrentIll extends Component{
@@ -82,14 +82,19 @@ class CurrentIll extends Component{
   handleClick(e){//让搜索框跟随鼠标点击移动
     // e.stopPropagation(); //冒泡到最顶层关闭其他下拉
     //若使用e.target,因为是onClick事件中,值可能是itembox的而不是span因此会有bug
-    const ele = document.activeElement;
-    if(ele.toString().indexOf('HTMLSpanElement') == -1){     //点击的不是span无法聚焦就不再设置位置
-      return;
+    let leftL=0;      //用焦点元素的左边距替换鼠标点击的左边距,高度还是鼠标点击的位置
+    if(isIE()){
+      leftL = getPageCoordinate(e).boxLeft
+    }else{
+      const ele = document.activeElement;
+      if(ele.toString().indexOf('HTMLSpanElement') == -1){     //点击的不是span无法聚焦就不再设置位置
+        return;
+      }
+      leftL = ele.offsetLeft+90
     }
-    const leftL = ele.offsetLeft;      //用焦点元素的左边距替换鼠标点击的左边距,高度还是鼠标点击的位置
     this.setState({
       // boxLeft:getPageCoordinate(e).boxLeft,
-      boxLeft:leftL+90,
+      boxLeft:leftL,
       boxTop:getPageCoordinate(e).boxTop,
       tmpScroll: $("#addScrollEvent")[0].scrollTop,
       tmpTop:getPageCoordinate(e).boxTop

+ 2 - 1
src/components/EMRContainer/index.less

@@ -6,7 +6,8 @@
   padding: 0px 0 10px 0 ;
   box-sizing: border-box;
   position: absolute;
-  min-width: 700px;
+  // min-width: 700px;
+  min-width: 548px;
   float: left;
   overflow-y:auto;
   overflow-x: hidden;

+ 1 - 0
src/components/HistoryCaseContainer/HistoryList/index.jsx

@@ -74,6 +74,7 @@ class HistoryCaseContainer extends React.Component {
                             baseObj={baseObj}
                             dataStr={dataStr.length > 0?getAllDataStringList(dataStr):[]}
                             show={false}
+                            flg={true}
                         ></PreviewBody>
                     }
                 </div>

+ 1 - 1
src/components/HistoryCaseContainer/HistoryList/index.less

@@ -6,7 +6,7 @@
     right: 0;
     bottom:0;
     margin: auto;
-    width: 1120px;
+    width: 1000px;
     top: 70px;
     bottom: 70px;
     background-color: #fff;

+ 22 - 4
src/components/InfoTitle/index.jsx

@@ -8,20 +8,37 @@ import store from '@store';
 import { showHistory } from '@store/actions/historyTemplates';
 import { initItemList } from '@store/async-actions/historyTemplates';
 import HistoryCases from '@containers/HistoryCases';
+import $ from 'jquery';
 
 class InfoTitle extends Component {
     constructor(props){
         super(props);
+        this.state={
+            le:''
+        }
         this.showHistoryBox = this.showHistoryBox.bind(this)
     }
     showHistoryBox(){
         store.dispatch(initItemList());
         store.dispatch(showHistory(true))
     }
+    componentWillReceiveProps(next){
+        const that = this;
+        if(next.winWidth <= 1024){
+          $(window).scroll(function(){
+            let scrollLeft = document.body.scrollLeft || document.documentElement.scrollLeft;
+            let left = -(scrollLeft - 10) +'px';
+            that.setState({
+              le:left
+            })
+          })
+        }
+    }
     render() {
-        const {disVisible,copyVisible} = this.props;
-        return <div className={style['title-wrapper']} style={{zIndex:disVisible||copyVisible?40:204}}>
-            <PatInfoContainer />
+        const {disVisible,copyVisible,winWidth} = this.props;
+        const {le} = this.state;
+        return <div className={style['title-wrapper']} style={{zIndex:disVisible||copyVisible?40:204,left:le}}>
+            <PatInfoContainer sizeFlag={winWidth <= 1035?true:false}/>
             <div className={style["operations"]} onClick={this.showHistoryBox}>
                 <span><img src={historyCase} />&nbsp;历史病历</span>
             </div>
@@ -35,7 +52,8 @@ class InfoTitle extends Component {
 function mapStateToProps(state) {
   return {
     disVisible: state.copyRight.disVisible,
-    copyVisible:state.copyRight.copyVisible
+    copyVisible:state.copyRight.copyVisible,
+    winWidth:state.homePage.windowWidth
   }
 }
 

+ 4 - 0
src/components/InfoTitle/index.less

@@ -10,6 +10,7 @@
   top: 50px;
   right: 470px;
   z-index: 204;
+  min-width: 548px;
 }
 .operations, .health{
   float: left;
@@ -39,5 +40,8 @@
     filter:alpha(opacity=30);
     -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=30);";
 }
+.font{
+  font-size: 13px;
+}
 
 

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

@@ -136,14 +136,16 @@ class MainSuit extends Component{
   handleClick(e){//让搜索框跟随鼠标点击移动
     // e.stopPropagation(); //冒泡到最顶层关闭其他下拉
     //若使用e.target,因为是onClick事件中,值可能是itembox的而不是span因此会有bug
-    const ele = document.activeElement;
-    if(ele.toString().indexOf('HTMLSpanElement') == -1){     //点击的不是span无法聚焦就不再设置位置
-      // return;    //主诉清空焦点在div内
+    let leftL=0;      //用焦点元素的左边距替换鼠标点击的左边距,高度还是鼠标点击的位置
+    if(isIE()){
+      leftL = getPageCoordinate(e).boxLeft
+    }else{
+      const ele = document.activeElement;
+      leftL = ele.offsetLeft+60
     }
-    const leftL = ele.offsetLeft;      //用焦点元素的左边距替换鼠标点击的左边距,高度还是鼠标点击的位置
     this.setState({
       // boxLeft:getPageCoordinate(e).boxLeft,
-      boxLeft:leftL+60,
+      boxLeft:leftL,
       boxTop:getPageCoordinate(e).boxTop,
       tmpScroll: $("#addScrollEvent")[0].scrollTop,
       tmpTop:getPageCoordinate(e).boxTop

+ 7 - 1
src/components/MultSpread/index.jsx

@@ -125,9 +125,15 @@ class MultSpread extends Component{
       saveAddItem&&saveAddItem(copyId,data);
     }
   }
+  getContClass(){
+    const {editable} = this.state;
+    const edit = editable?style['blue-border']:'';
+    return classNames(edit);
+  }
   render(){
     const {showAdd,addLabelItem,ikey,copyId,textPrefix,textSuffix} = this.props;
-    return (<div style={{display:'inline-block'}}
+    return (<div className={this.getContClass()}
+                 style={{display:'inline-block'}}
                  onDoubleClick={this.changeToEdit}
                  contentEditable={this.state.editable}
                  onBlur={this.handleEdit}

+ 44 - 52
src/components/NumberDrop/index.jsx

@@ -18,10 +18,8 @@ class NumberDrop extends Component{
     super(props);
     this.state={
       editable:false,      //标签是否可输入
-      numEditable:true,      //数字框是否可输入
       timer:null,
       hasSelect:false,       //是否点过下拉键盘
-      isClosed:false,
       boxLeft:0,
       boxTop:0,
       tmpTop:0,
@@ -30,6 +28,7 @@ class NumberDrop extends Component{
     this.$span = React.createRef();
     this.$pre = React.createRef();
     this.$suf = React.createRef();
+    this.$cont = React.createRef();
     this.select = this.select.bind(this);
     this.numInpBlur = this.numInpBlur.bind(this);
     this.handleSpanInp = this.handleSpanInp.bind(this);
@@ -38,7 +37,7 @@ class NumberDrop extends Component{
     this.handleBlur = this.handleBlur.bind(this);
     this.changeToEdit = this.changeToEdit.bind(this);
   }
-  select(text){         //选中键盘上数字事件
+  select(text){        //选中键盘上数字事件
     const {handleSelect,ikey,suffix,prefix,mainSaveText} = this.props;
     this.setState({
       hasSelect:true
@@ -47,57 +46,42 @@ class NumberDrop extends Component{
   }
   handleNumFocus(e){       //数字框可编辑状态下聚集事件,处理是否显示下拉等
     e.stopPropagation();
-    const {show,handleShow,ikey,id,patId,handleHide,value} = this.props;
-    const that = this;
-
-    //双击时不显示下拉
-    const timer = setTimeout(function(){
-      const {hasSelect,editable,isClosed} = that.state;
-      if(editable||isClosed){
-        return;
-      }
-      handleShow&&handleShow({ikey,id:patId||id});
-      that.setState({
-        numEditable:false
-      });
-    },300);
-    this.setState({
-      timer
-    });
   }
   handleNumClick(e){      //数字框不可编辑的状态时点击事件,点击将数字框变为可输入且下拉不再显示直到失焦后再次聚集
-    this.setState({
-      boxLeft:getPageCoordinate(e).boxLeft,
-      boxTop:getPageCoordinate(e).boxTop,
-      tmpScroll: $("#addScrollEvent")[0].scrollTop,
-      tmpTop:getPageCoordinate(e).boxTop
-    });
-    $("#addScrollEvent").scroll(()=>{
-      let scrollYs = $("#addScrollEvent")[0].scrollTop;
-      this.setState({
-        boxTop:this.state.tmpTop - scrollYs + this.state.tmpScroll
-      })
-    })
-    e.stopPropagation();
     const {show,handleShow,ikey,id,patId,handleHide,value} = this.props;
-    const {hasSelect} = this.state;
-
-    if(show&&!hasSelect){
+    if(show) {
+      handleHide && handleHide();
+      return;
+    }else{
+      const {editable} = this.state;
+      if(editable){
+        return;
+      }
+      const that = this;
+      //双击时不显示下拉
+      clearTimeout(that.state.timer);
+      const timer = setTimeout(function(){
+        handleShow&&handleShow({ikey,id:patId||id});
+      },300);
       this.setState({
-        numEditable:true,
-        isClosed:true
-      });
-      handleHide&&handleHide();
-      setTimeout(function(){
-        e.target.focus();
+        timer,
+        boxLeft:getPageCoordinate(e).boxLeft,
+        boxTop:getPageCoordinate(e).boxTop,
+        tmpScroll: $("#addScrollEvent")[0].scrollTop,
+        tmpTop:getPageCoordinate(e).boxTop
       });
+      $("#addScrollEvent").scroll(()=>{
+        let scrollYs = $("#addScrollEvent")[0].scrollTop;
+        this.setState({
+          boxTop:this.state.tmpTop - scrollYs + this.state.tmpScroll
+        })
+      })
     }
+    e.stopPropagation();
   }
   numInpBlur(e){        //数字框失焦,保存值到store中
     e.stopPropagation();
     this.setState({
-      isClosed:false,
-      numEditable:true,
       hasSelect:false
     });
     const val = e.target.innerText.replace(/^\s*/,'');
@@ -106,25 +90,32 @@ class NumberDrop extends Component{
     e.target.innerText = '';      //避免出现重复输入值
     handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
   }
-  handleSpanInp(e){    //数字框输入事件
+  handleSpanInp(e){   //数字框输入事件
     e.stopPropagation();
-    //const {value} = this.props;
+    const {handleHide} = this.props;
+    handleHide&&handleHide();
   }
   getClasses(){         //整个标签是否有值的状态
     const {value,hideTag,placeholder} = this.props;
+    const blueBorder = this.state.editable?style['blue-border']:'';
     const isSelected = value&&value!=placeholder?style['selected']:style['container'];
     const noTag = hideTag?style['no-tag']:'';
-    return className(isSelected,noTag);
+    return className(isSelected,noTag,blueBorder);
   }
   changeToEdit(e){        //整个标签双击编辑状态
-    const {value,id,handleDbclick,patId} = this.props;
+    const {value,id,handleDbclick,patId,handleHide,show} = this.props;
     clearTimeout(this.state.timer);//取消延时的单击事件
     e.preventDefault();
+    if(show){
+      handleHide&&handleHide();
+    }
     if(value&&value.trim()) {//有选中值的标签才能双击编辑
       this.setState({
         editable: true
       });
-      //e.target.focus();
+      setTimeout(()=>{
+        this.$cont.current.focus();
+      })
       //双击埋点记录
       handleDbclick && handleDbclick({id:patId||id});
     }
@@ -143,14 +134,15 @@ class NumberDrop extends Component{
     handleLabelChange && handleLabelChange({ikey,changeVal,type:boxMark,totalVal,prefix,suffix});
   }
   getSpanClass(){       //将被替换的文字选中状态显示
-    const {hasSelect} = this.state;
-    const cls = !hasSelect&&this.props.show?style['blued']:'';
+    //const {hasSelect} = this.state;
+    const cls = this.props.show?style['blued']:'';
     return cls;
   }
   render(){
     const {placeholder,prefix,suffix,show,value,handleHide} = this.props;
     const {numEditable,editable,hasSelect,boxTop,boxLeft} = this.state;
     return <div className={this.getClasses()}
+                ref={this.$cont}
                 onDoubleClick={this.changeToEdit}
                 contentEditable={editable}
                 onBlur={this.handleBlur}
@@ -158,7 +150,7 @@ class NumberDrop extends Component{
       <span ref = {this.$pre}>&nbsp;{prefix}</span>
       <span onFocus={this.handleNumFocus}
             onClick={this.handleNumClick}
-            contentEditable={numEditable}
+            contentEditable={true}
             style={{minWidth:'10px',display:'inline-block'}}
             ref = {this.$span}
             onBlur={this.numInpBlur}

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

@@ -131,6 +131,7 @@ class NumberUnitDrop extends Component{
   getClasses(){         //整个标签是否有值的状态
     const {value,hideTag,show} = this.props;
     const inpValue = this.state.value;
+    const blueBorder = this.state.editable?style['blue-border']:'';
     const isSelected = value||inpValue?style['selected']:style['container'];
     const noTag = hideTag?style['no-tag']:'';
     if(show){
@@ -138,7 +139,7 @@ class NumberUnitDrop extends Component{
     }else{
       $(this.$cont.current).removeClass(style['borderd']);
     }
-    return className(isSelected,noTag);
+    return className(isSelected,noTag,blueBorder);
   }
   changeToEdit(e){        //整个标签双击编辑状态
     e.stopPropagation();

BIN
src/components/Operation/img/check-circle.png


BIN
src/components/Operation/img/check-right.png


+ 73 - 13
src/components/Operation/index.jsx

@@ -6,9 +6,11 @@ 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,isAllClear,filterArr} from '@utils/tools';
+import check_circle from './img/check-circle.png';
+import check_right from './img/check-right.png';
+import {getAllDataList,getAllDataStringList,isAllClear,filterDataArr} from '@utils/tools';
 import store from '@store';
-
+import $ from 'jquery';
 
 class Operation extends Component {
   constructor(props) {
@@ -21,7 +23,9 @@ class Operation extends Component {
       oKBg: '',
       msg: '',
       type: '',
-      zIndex:40
+      zIndex:40,
+      sex:'3',
+      le:'',
     }
     this.showPrint = this.showPrint.bind(this);
     this.closePrint = this.closePrint.bind(this);
@@ -80,7 +84,7 @@ class Operation extends Component {
   keepHistory(){
     let baseList = store.getState();
     let jsonStr = getAllDataStringList(baseList);
-    if(filterArr(JSON.parse(jsonStr.chief)) == ''){
+    if(filterDataArr(JSON.parse(jsonStr.chief)) == ''){
         Notify.info('主诉不能为空');
         return false;
     }else if(!jsonStr.diag || jsonStr.diag.trim().length < 1){
@@ -94,7 +98,7 @@ class Operation extends Component {
     let baseList = store.getState();
     let jsonData = getAllDataList(baseList);
     let jsonStr = getAllDataStringList(baseList);
-    let flg = isAllClear(jsonData,jsonStr);
+    let flg = isAllClear(jsonData,jsonStr,baseList);
     if(flg){
       this.setState({
         type: type,
@@ -166,6 +170,7 @@ class Operation extends Component {
     if(flg){
       this.setState({
         title: '',
+        sex:'3',
         type: type,
         okText: '保存',
         borderColor: '#3B9ED0',
@@ -182,7 +187,8 @@ class Operation extends Component {
     let jsonStr = getAllDataStringList(baseList);
     let whichSign = baseList.typeConfig.typeConfig;
     let tmpLis = baseList.tabTemplate.items;
-    // console.log(jsonStr.present,'2222')
+    console.log(jsonStr,'文本')
+    console.log(jsonData,'结构')       //测试需要用到,不要删了
     for(let i = 0;i <tmpLis.length;i++){
       let dataStr = tmpLis[i].preview;
       let jsStr = tmpLis[i].dataJson;
@@ -208,13 +214,13 @@ class Operation extends Component {
         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)    
+        JSON.stringify(jsonData.addItems) == JSON.stringify(JSON.parse(jsStr).addItems)
       ){
         Notify.info('该模板已保存');
         return false;
       }
     }
-    let flg = isAllClear(jsonData,jsonStr)
+    let flg = isAllClear(jsonData,jsonStr,baseList)
     if(!flg){
       Notify.info('模板数据不能为空')
       return false
@@ -237,8 +243,41 @@ class Operation extends Component {
         onKeyPress={e => this.keypress(e)}
       />
       <div className={style['line']}></div>
+      <div className={style['iptWrap']}>
+        <p>请选择模板性别归属(错误引用,显示可能有误)</p>
+        <span className={style['commonSex']} id="commonSex" onClick={this.changeRadio.bind(this,1)}><img src={check_right} alt=""/><i style={{color:'#000'}}>通用</i></span>
+        <span id="maleSex" onClick={this.changeRadio.bind(this,2)}><img src={check_circle} alt=""/><i>男</i></span>
+        <span id="femaleSex" onClick={this.changeRadio.bind(this,3)}><img src={check_circle} alt=""/><i>女</i></span>
+      </div>
     </div>
   }
+  changeRadio(sex){
+    if(sex == 1){
+      $('#commonSex img').attr('src',check_right)
+      $('#maleSex img').attr('src',check_circle)
+      $('#femaleSex img').attr('src',check_circle)
+      $('#commonSex i').css('color','#000')
+      $('#maleSex i').css('color','#6b6969')
+      $('#femaleSex i').css('color','#6b6969')
+      this.setState({sex:'3'})
+    }else if(sex == 2){
+      $('#commonSex img').attr('src',check_circle)
+      $('#maleSex img').attr('src',check_right)
+      $('#femaleSex img').attr('src',check_circle)
+      $('#commonSex i').css('color','#6b6969')
+      $('#maleSex i').css('color','#000')
+      $('#femaleSex i').css('color','#6b6969')
+      this.setState({sex:'1'})
+    }else if(sex == 3){
+      $('#commonSex img').attr('src',check_circle)
+      $('#maleSex img').attr('src',check_circle)
+      $('#femaleSex img').attr('src',check_right)
+      $('#commonSex i').css('color','#6b6969')
+      $('#maleSex i').css('color','#6b6969')
+      $('#femaleSex i').css('color','#000')
+      this.setState({sex:'2'})
+    }
+  }
   makeSure() {
     const { save, clear, saveDataAll,diagShowTmp } = this.props;
     const { type } = this.state;
@@ -255,8 +294,7 @@ class Operation extends Component {
         Notify.error('请输入模板名称')
         return;
       }
-      // diagShowTmp(false)
-      saveDataAll(this.state.title);
+      saveDataAll(this.state.title,this.state.sex);
     }
   }
   closeDiagBox(){
@@ -270,16 +308,36 @@ class Operation extends Component {
       this.setState({ title: '' }) 
     }
   }
+  componentWillReceiveProps(next){//监听滚动事件
+    const that = this;
+    if(next.winWidth <= 1024){
+      /*$(document).on('scroll',function(){
+        let left = -($(document).scrollLeft() - 10) + 'px';
+        that.setState({
+          le:left
+        })
+      })*/
+      $(window).scroll(function(){
+        let scrollLeft = document.body.scrollLeft || document.documentElement.scrollLeft;
+        let left = -(scrollLeft - 10) +'px';
+        that.setState({
+          le:left
+        })
+      })
+    }
+  }
+
   render() {
     const { showPrint, closePrint, showPreview, closePreview } = this;
     const { visible, preVisible,diagShow } = this.props.print;
-    const {zIndex} = this.state;
+    const {winWidth} = this.props;
+    const {zIndex,type,le} = this.state;
     return <div className={style['container']} style={{zIndex:zIndex}}>
       <span className={style['button']} onClick={showPrint}><img src={printImg} /> 打印病历</span>
       <span className={style['preButton']} onClick={showPreview}><img src={preview} /> 预览</span>
       <span className={style['preButton']} onClick={() => { this.saveHis(3) }}><img src={saveHistory} /> 保存病历模板</span>
-      <span className={style['saveButton']} onClick={() => { this.saveAll(1) }}>保存</span>
-      <span className={`${style['clearButton']} ${style['saveButton']}`} onClick={() => { this.clearAll(2) }}>清除</span>
+      <span className={winWidth<=1082?`${style['saveButton']} ${style['b1024']}`: style['saveButton']} onClick={() => { this.saveAll(1) }}>保存</span>
+      <span className={winWidth<=1082?`${style['clearButton']} ${style['saveButton']} ${style['b1024']}`:`${style['clearButton']} ${style['saveButton']}`} onClick={() => { this.clearAll(2) }}>清除</span>
       <PrintPreviewContainer visible={visible} onClose={closePrint} />
       <PreviewContainer visible={preVisible} onClose={closePreview} />
       <ConfirmModal
@@ -288,6 +346,8 @@ class Operation extends Component {
         close={() => { this.closeDiagBox()}}
         cancel={() => {this.closeDiagBox()}}
         okText={this.state.okText}
+        height={type==3?228:200}
+        width={type==3?400:300}
         okBorderColor={this.state.borderColor}
         okColor={this.state.okColor}
         oKBg={this.state.oKBg}

+ 36 - 4
src/components/Operation/index.less

@@ -6,7 +6,7 @@
     bottom: 0;
     left: 10px;
     right: 470px;
-    min-width: 720px;
+    // min-width: 720px;
     background-color: #fff;
     // z-index: 240;
     padding-bottom: 10px;
@@ -66,6 +66,12 @@
         background-color: #fff;
         color: #000;
     }
+    .b1024{
+        width: 60px;
+        margin-left: 15px;
+        margin-right: 10px;
+        font-size: 13px;
+    }
     .modal{
         position: fixed;
         left: 50%;
@@ -108,6 +114,32 @@
         margin-bottom: 20px;
     }
 }
+.iptWrap {
+  width: 320px;
+  line-height: 18px;
+  margin: 10px auto;
+  text-align: center;
+  p {
+    text-align: left;
+    font-size: 12px;
+    color: #6b6969;
+    margin-bottom: 5px;
+  }
+  span {
+    display: inline-block;
+    cursor: pointer;
+    padding-right: 24px;
+    font-size: 14px;
+    i {
+      color: #6b6969;
+    }
+    img {
+      vertical-align: middle;
+      position: relative;
+      top: -1px;
+    }
+  }
+}
 .msg {
     text-align: center;
     font-size: 16px;
@@ -117,11 +149,11 @@
 .box {
     padding-top: 10px;
     box-sizing: border-box;
-    height: 80px;
+    height: 110px;
 }
 .ipt {
     font-size: 16px;
-    width: 170px;
+    width: 320px;
     height: 20px;
     line-height: 18px;
     display: block;
@@ -129,7 +161,7 @@
     text-align: left;
 }
 .line {
-    width: 182px;
+    width: 332px;
     height: 1px;
     margin: 8px auto 0 auto;
     background: #D8D8D8;

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

@@ -2,7 +2,7 @@ import React,{Component} from 'react';
 import {Button,InlineTag,ItemBox,Textarea,Notify} from '@commonComp';
 import chooseType from '@containers/eleType.js';
 import SearchDrop from '@components/SearchDrop';
-import {filterDataArr,getPageCoordinate,windowEventHandler} from '@utils/tools'
+import {filterDataArr,getPageCoordinate,windowEventHandler,isIE} from '@utils/tools'
 import $ from 'jquery';
 
 class OtherHistory extends Component{
@@ -36,10 +36,10 @@ class OtherHistory extends Component{
   getData(){
     //第一次聚焦其他史时,主诉有数据则获取最近一次其他史记录(没有的话显示初始模板),主诉无数据则显示提示;其他时间其他史模板数据不调接口
     const {hasMain,type,setInitData,isEmpty} = this.props;
-
+    console.log(isEmpty)
     //无主诉提示在EditableSpan里
     //智能模式有主诉或者文本模式获取最近历史
-    if((+type===0&&hasMain&&isEmpty!=false)||+type===1){
+    if((+type===0&&hasMain&&isEmpty!=false)||(+type===1&&isEmpty!=false)){
       setInitData();
     }
 
@@ -49,15 +49,20 @@ class OtherHistory extends Component{
     const {fetchPushInfos} = this.props;
     //fetchPushInfos&&fetchPushInfos();
     //若使用e.target,因为是onClick事件中,值可能是itembox的而不是span因此会有bug
-    const ele = document.activeElement;
     this.getData();
-    if(ele.toString().indexOf('HTMLSpanElement') == -1){     //点击的不是span无法聚焦就不再设置位置
-      return;
+    let leftL=0;      //用焦点元素的左边距替换鼠标点击的左边距,高度还是鼠标点击的位置
+    if(isIE()){
+      leftL = getPageCoordinate(e).boxLeft
+    }else{
+      const ele = document.activeElement;
+      if(ele.toString().indexOf('HTMLSpanElement') == -1){     //点击的不是span无法聚焦就不再设置位置
+        return;
+      }
+      leftL = ele.offsetLeft+90
     }
-    const leftL = ele.offsetLeft;      //用焦点元素的左边距替换鼠标点击的左边距,高度还是鼠标点击的位置
     this.setState({
       // boxLeft:getPageCoordinate(e).boxLeft,
-      boxLeft:leftL+90,
+      boxLeft:leftL,
       boxTop:getPageCoordinate(e).boxTop,
       tmpScroll: $("#addScrollEvent")[0].scrollTop,
       tmpTop:getPageCoordinate(e).boxTop

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

@@ -12,7 +12,8 @@ class PatInfo extends Component {
 
   render(){
     const {message} = this.props.patInfo;
-     return <table className={style["table"]}>
+    const {sizeFlag} = this.props;
+     return <table className={sizeFlag?`${style["table"]} ${style["newSize"]}`:style["table"]}>
       <tr>
         <td key='1' className={`${style.tdBorderB} ${style.tdBorderR}`}>卡号:{message.patientIdNo && message.patientIdNo}</td>
         <td key='2' className={`${style.tdBorderB} ${style.tdBorderR}`}>姓名:{message.patientName && message.patientName}</td>

+ 5 - 0
src/components/PatInfo/index.less

@@ -17,3 +17,8 @@
     border-right: 1px solid @person-table-color;
   }
 }
+.newSize{
+  td{
+  font-size: 13px;
+  }
+}

+ 55 - 59
src/components/PreviewBody/index.jsx

@@ -98,81 +98,79 @@ class PreviewBody extends Component {
         if(val.questionDetailList.length > 0){
             return val.questionDetailList.map((item)=>{
                 if(val.value == item.name){
-                    return <td style={{width:'23%'}}><span style={{color:item.abnormal != '0' ?"red":null}}>{val.value}</span> { val.labelSuffix}</td>
+                    return <td style={{width:'16%',fontSize:'12px'}}><span style={{color:item.abnormal != '0' ?"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>
+            return <td style={{width:'16%',fontSize:'12px'}}><span style={{color:(val.value - 0).toString() == 'NaN'?"red":(val.maxValue || val.minValue)?(val.value > val.maxValue || val.value < val.minValue?"red":null):null}}>{val.value}</span> { val.labelSuffix}</td>
         }
     }
     render() {
-        const { show, preInfo, dataJson, dataStr,baseObj } = this.props;
-        const infoNull = JSON.stringify(preInfo) == '{}';
+        const { show, preInfo, dataJson, dataStr,baseObj,flg } = this.props;
 
-        return <div className={style['content']}>
-            <div className={style['contents']} id="content" style={{margin:"0 auto"}}>
-                <div ref={this.$content} className={style['hisName']}>{preInfo.hospitalName}</div>
-                <table className={style['patInfo']}>
+        return <div className={style['content']} style={{width:flg?'700':'820'}}>
+            <div className={style['contents']} id="content" style={{margin:"0 auto",maxWidth:"600px"}}>
+                <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%" }}>
                     <tr>
-                        <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>
+                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '31%',fontSize:"14px" }}>卡号:{baseObj?baseObj.patientIdNo:JSON.stringify(preInfo) == '{}'?'':preInfo.patientIdNo}</td>
+                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '23%',fontSize:"14px" }}>姓名:{baseObj?baseObj.patientName:JSON.stringify(preInfo) == '{}'?'':preInfo.patientName}</td>
+                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '23%',fontSize:"14px" }}>年龄:{baseObj?baseObj.patientAge:JSON.stringify(preInfo) == '{}'?'':preInfo.patientAge}</td>
+                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '23%',fontSize:"14px" }}>性别:{baseObj?baseObj.patientSex:JSON.stringify(preInfo) == '{}'?'':preInfo.patientSex}</td>
                     </tr>
                     <tr>
-                        <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>
+                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '31%',fontSize:"14px" }}>就诊时间:{baseObj?baseObj.inquiryDate:(JSON.stringify(preInfo) == '{}'?'':preInfo.systemTime.split(' ')[0])}</td>
+                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '23%',fontSize:"14px" }}>科室:{baseObj?baseObj.hospitalDeptName:(JSON.stringify(preInfo) == '{}'?'':preInfo.hospitalDeptName)}</td>
+                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '23%',fontSize:"14px" }}>医生:{baseObj?baseObj.doctorName:(JSON.stringify(preInfo) == '{}'?'':preInfo.doctorName)}</td>
+                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '23%',fontSize:"14px" }}>门诊号:{baseObj?baseObj.inquiryCode:(JSON.stringify(preInfo) == '{}'?'':preInfo.recordId)}</td>
                     </tr>
                 </table>
-                <table>
-                    <tr style={{ verticalAlign: 'top' }}>
-                        <td className={style['title']}>主诉:</td>
-                        <td className={style['text']}>
+                <table style={{width:"100%", borderCollapse: 'collapse'}}>
+                    <tr style={{ verticalAlign:'top',borderBottom:"1px solid #e2e4e6" }}>
+                        <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>主诉:</td>
+                        <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px',lineHeight:'20px' }}>
                             {
                                 filterDataArr(JSON.parse(dataStr.chief))
                             }
                         </td>
                     </tr>
-                    <tr style={{ verticalAlign: 'top' }}>
-                        <td className={style['title']}>现病史:</td>
-                        <td className={style['text']}>
+                    <tr style={{ verticalAlign:'top',borderBottom:"1px solid #e2e4e6" }}>
+                        <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>现病史:</td>
+                        <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px',lineHeight:'20px' }}>
                             {
                                 filterDataArr(JSON.parse(dataStr.present))
                             }
                         </td>
                     </tr>
-                    <tr style={{ verticalAlign: 'top' }}>
-                        <td className={style['title']}>其他史:</td>
-                        <td className={style['text']}>
+                    <tr style={{ verticalAlign:'top',borderBottom:"1px solid #e2e4e6" }}>
+                        <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>其他史:</td>
+                        <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px',lineHeight:'20px'  }}>
                             {
                                 filterDataArr(JSON.parse(dataStr.other))
                             }
                         </td>
                     </tr>
-                    <tr style={{ verticalAlign: 'top' }}>
-                        <td className={style['title']}>查体:</td>
-                        <td className={style['text']}>
+                    <tr style={{ verticalAlign:'top',borderBottom:"1px solid #e2e4e6" }}>
+                        <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>查体:</td>
+                        <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px',lineHeight:'20px'  }}>
                             {
                                 filterDataArr(JSON.parse(dataStr.vital))
                             }
                         </td>
                     </tr>
-                    <tr style={{ verticalAlign: 'top',width:'100%',overflow:"hidden" }}>
-                        <td className={style['title']}>化验:</td>
-                        <td className={style['text']}>
-                            {/* <table style={{ width: '100%' }}> */}
+                    <tr style={{ verticalAlign:'top',borderBottom:"1px solid #e2e4e6" }}>
+                        <td style={{ width: 70, textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>化验:</td>
+                        <td style={{ fontSize: '14px', padding: '4px 0px 8px 0px',lineHeight:'20px',maxWidth:'650px'}}>
                                 {
                                     dataJson.lis.getExcelDataList && dataJson.lis.getExcelDataList.map((items)=>{
                                         return items.lisExcelRes && items.lisExcelRes.map((item)=>{
-                                            return <table style={{margin:'8px 0',width:'100%',fontSize:'12px'}}>
-                                                <tr style={{fontSize:'14px',lineHeight:'1.5'}}>{item.menus}</tr>
+                                            return <table style={{marginBottom:'10px',width:'100%',fontSize:'12px'}}>
+                                                <tr style={{fontSize:'14px',lineHeight:'1.5'}}><td><span style={{borderBottom:'1px solid #666666'}}>{item.menus}</span></td></tr>
                                                 {
                                                     item.lisExcelItem && item.lisExcelItem.map((value)=>{
                                                         return <tr style={{lineHeight:'1.5',maxWidth:'650px'}}>
-                                                            <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:'32%',fontSize:'12px'}}>{value.itemName}</td>
+                                                            <td style={{width:'16%',fontSize:'12px'}}><span style={{fontSize:'12px',color:value.type == 1?"red":null}}>{value.value}</span> {value.unit}</td>
                                                             <td style={{width:'24%',fontSize:'12px'}}>
                                                                 {normalVal(value.min,value.max)}
                                                             </td>
@@ -188,18 +186,17 @@ class PreviewBody extends Component {
                                     dataJson.lis.labelList && dataJson.lis.labelList.map((item,idx) => {
                                         if(item.show){
                                             return <table style={{margin:'8px 0',width:'100%'}}>
-                                                <tr style={{fontSize:'14px',lineHeight:'1.5'}}>{item.name}</tr>
+                                                <tr style={{fontSize:'14px',lineHeight:'1.5'}}><td><span style={{borderBottom:'1px solid #666666'}}>{item.name}</span></td></tr>
                                                 {
                                                     item.details.map((val)=>{
                                                         if(val.value && val.value != ''){
                                                             return <tr style={{lineHeight:'1.5',width:'100%',fontSize:'12px'}}>
-                                                                <td style={{width:'25%'}}>{val.name}</td>
+                                                                <td style={{width:'32%',fontSize:'12px'}}>{val.name}</td>
                                                                 {this.showDetails(val)}
-                                                                
-                                                                <td style={{width:'24%'}}>
+                                                                <td style={{width:'24%',fontSize:'12px'}}>
                                                                     {normalVal(val.minValue,val.maxValue)}
                                                                 </td>
-                                                                <td style={{width:'28%'}}>{'化验时间:'+item.time}</td>
+                                                                <td style={{width:'28%',fontSize:'12px'}}>{'化验时间:'+item.time}</td>
                                                             </tr>
                                                         }
                                                     })
@@ -208,12 +205,11 @@ class PreviewBody extends Component {
                                         }
                                     })
                                 }
-                            {/* </table> */}
                         </td>
                     </tr>
-                    <tr style={{ verticalAlign: 'top' }}>
-                        <td className={style['title']}>辅检:</td>
-                        <td className={style['text']}>
+                    <tr style={{ verticalAlign:'top',borderBottom:"1px solid #e2e4e6" }}>
+                        <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>辅检:</td>
+                        <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px',lineHeight:'20px' }}>
                             {
                                 dataStr.pacs && dataStr.pacs != '' && dataStr.pacs.split(';').map((item)=>{
                                     return <div style={{ fontSize: '14px' }}>{item}</div>
@@ -221,9 +217,9 @@ class PreviewBody extends Component {
                             }
                         </td>
                     </tr>
-                    <tr style={{ verticalAlign: 'top' }}>
-                        <td className={style['title']}>诊断:</td>
-                        <td className={style['text']}>
+                    <tr style={{ verticalAlign:'top',borderBottom:"1px solid #e2e4e6" }}>
+                        <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>诊断:</td>
+                        <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px',lineHeight:'20px' }}>
                             {
                                 dataStr.diag && dataStr.diag != '' && dataStr.diag.split(';').map((item)=>{
                                     return <div style={{ fontSize: '14px'}}>{item}</div>
@@ -231,32 +227,32 @@ class PreviewBody extends Component {
                             }
                         </td>
                     </tr>
-                    <tr style={{ verticalAlign: 'top' }}>
-                        <td className={style['title']}>医嘱:</td>
-                        <td className={style['text']}>
+                    <tr style={{ verticalAlign:'top',borderBottom:"1px solid #e2e4e6" }}>
+                        <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>医嘱:</td>
+                        <td style={{ fontSize: '14px', padding: '1px 0px 8px 0px',lineHeight:'20px' }}>
                             {
-                                dataJson.advice.assay && dataJson.advice.assay.length > 0 || dataJson.advice.check && dataJson.advice.check.length > 0 ? <p style={{fontSize:'14px',marginBottom:"8px"}}>开单项目</p> : ''
+                                dataJson.advice.assay && dataJson.advice.assay.length > 0 || dataJson.advice.check && dataJson.advice.check.length > 0 ? <p style={{fontSize:'14px',marginBottom:"8px"}}><span>开单项目</span></p> : ''
                             }
                             {
-                                dataJson.advice.assay && <div style={{ fontSize: '12px', padding: '0px 0px 5px 0px' }}>{dataJson.advice.assay}</div>
+                                dataJson.advice.assay && <div style={{ padding: '0px 0px 5px 0px' }}>{dataJson.advice.assay}</div>
                             }
                             {
-                                dataJson.advice.check && <div style={{ fontSize: '12px', padding: '0px 0px 5px 0px' }}>{dataJson.advice.check}</div>
+                                dataJson.advice.check && <div style={{ padding: '0px 0px 5px 0px' }}>{dataJson.advice.check}</div>
                             }
-                            {dataJson.advice.scheme && dataJson.advice.scheme.length > 0  && <p style={{fontSize:'14px', marginBottom: '8px',marginTop:'8px'}}>治疗方案</p>}
+                            {dataJson.advice.scheme && dataJson.advice.scheme.length > 0  && <p style={{fontSize:'14px', marginBottom: '8px',marginTop:'8px'}}><span>治疗方案</span></p>}
                             {
                                 dataJson.advice.scheme && dataJson.advice.scheme.map((item, index) => {
                                     return <p>{item.treatment.map((it,ii) =>{
                                       return(it.treatmentStr && it.treatmentStr.length > 0 ? 
-                                        <div style={{ fontSize: '12px', padding: '0px 0px 5px 0px' }}>{ it.treatmentStr }</div>: '')
+                                        <div style={{ padding: '0px 0px 5px 0px' }}>{ it.treatmentStr }</div>: '')
                                     })}</p>
                                   })
                             }
                         </td>
                     </tr>
                 </table>
-                <table style={{ marginTop: '10px',marginBottom:'30px',display: show ? 'block' : 'none' }}>
-                    <tr style={{position:'absolute',right:'0px',verticalAlign: 'top'}}>
+                <table style={{ marginTop: '10px',marginBottom:'30px',position:'absolute',minWidth:'200px',right:'0',display: show ? 'block' : 'none' }}>
+                    <tr style={{textAlign:'right',verticalAlign: 'top',position:'absolute',right:'0'}}>
                         <td>医生签名:</td>
                         <td style={{
                           minWidth:'50px',

+ 2 - 28
src/components/PreviewBody/index.less

@@ -5,40 +5,14 @@
       overflow: auto;
       top:120px;
       width: 820px;
-      padding: 0 40px 60px 40px;
-      .hisName{
-        clear: both;
-        font-size: 24px;
-        margin: 0px 0px 30px 0px;
-        text-align:center;
-      }
+      padding: 0 0px 60px 0px;
       .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%;
       }
-    }
-  
+    }

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

@@ -1,5 +1,5 @@
 import React, { Component } from "react";
-import { getAllDataList, getAllDataStringList,filterArr } from '@utils/tools';
+import { getAllDataList, getAllDataStringList,filterDataArr } from '@utils/tools';
 import style from "./index.less";
 import PreviewBody from "../PreviewBody";
 import store from '@store';
@@ -12,7 +12,7 @@ class PrintPreview extends Component {
         super(props)
     }
     surePrint(jsonStr){
-        if(filterArr(JSON.parse(jsonStr.chief)) == ''){
+        if(filterDataArr(JSON.parse(jsonStr.chief)) == ''){
           Notify.info('主诉不能为空');
             return false;
         }else if(!jsonStr.diag || jsonStr.diag.trim().length < 1){

+ 9 - 4
src/components/PushContainer/index.jsx

@@ -67,9 +67,10 @@ class PushContainer extends Component {
      * 引用模板id
      * @param {模板id} id 
      */
-    handleContentClick(id) {
+    handleContentClick(id,sex) {
+        let baseSex = store.getState().patInfo.message.sex
         this.setState({
-            message:this.content(),
+            message:this.content(sex,baseSex),
             type:4,
             id:id,
             okText:'引用',
@@ -80,8 +81,12 @@ class PushContainer extends Component {
             store.dispatch(changeVisible(true))
         })
     }
-    content(){
-        return <p className={style['center']}>确认引用该模板?</p>
+    content(sex,baseSex){
+        if(sex != 3 && sex != baseSex){
+          return <p className={style['center']}>确认引用该模板?<p style={{fontSize:'12px',color:'#6b6969',marginTop:'10px'}}>引用该模版可能显示有误</p></p>
+        }else{
+          return <p className={style['center']}>确认引用该模板?</p>
+        }
     }
     /**
      * 删除模板

+ 0 - 1
src/components/PushContainer/index.less

@@ -7,7 +7,6 @@
   padding-top: 20px;
   z-index: 200;
   position: relative;
-
   // position: fixed;     
   // top: 50px;
   // bottom: 10px;

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

@@ -37,6 +37,7 @@ class RadioDrop extends Component{
   }
   getClass(){
     const {value,hideTag,placeholder,show} = this.props;
+    const blueBorder = this.state.editable?style['blue-border']:'';
     if(show){
       $(this.$cont.current).addClass(style['borderd']);
     }else{
@@ -46,7 +47,7 @@ class RadioDrop extends Component{
       return style['no-tag'];
     }
     if(value){
-      return style['selected-tag'];
+      return blueBorder?style['selected-tag']+' '+blueBorder:style['selected-tag'];
     }
     return style['tag'];
   }

+ 1 - 0
src/components/SearchDrop/index.less

@@ -2,6 +2,7 @@
 .list{
   max-height:300px;
   overflow-y: auto;
+  overflow-x: hidden;
   .pop;
   left: 85px;
   padding: 0 0 10px;

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

@@ -300,13 +300,14 @@ class SpreadDrop extends Component{
     });
   }
   getClass(){
+    const blueBorder = this.state.editable?style['blue-border']:'';
     if(this.props.show){
       $(this.$div.current).addClass(style['borderd']);
     }else{
       $(this.$div.current).removeClass(style['borderd']);
     }
     if(this.props.value){
-      return style['selected-tag'];
+      return classNames(style['selected-tag'],blueBorder);
     }
     return style['tag'];
   }

+ 11 - 15
src/components/TemplateItems/TemplateItem/index.jsx

@@ -10,6 +10,7 @@ import edit_icon from './img/edit_grey.png';
 import editing_icon from './img/edit_blue.png';
 import check_circle from './img/check-circle.png';
 import check_right from './img/check-right.png';
+import Notify from '@commonComp/Notify';
 import store from '@store'
 import {checkItems} from '@store/actions/tabTemplate';
 import $ from 'jquery';
@@ -57,9 +58,9 @@ class TemplateItem extends React.Component {
         }
     }
 
-    handleContentClick(e) {
+    handleContentClick(e,sex) {
         e.stopPropagation();
-        this.props.handleContentClick(this.props.id);
+        this.props.handleContentClick(this.props.id,sex);
     }
 
     handleTitleClick() {
@@ -146,25 +147,20 @@ class TemplateItem extends React.Component {
         });
     }
 
-    handleEditIconClick(e) {
+    handleEditIconClick(e,name) {
         e.stopPropagation();
-        const text = this.titleDOM.innerHTML;
         let currId = this.props.id
-        this.props.handleTitleChange(currId,text);
+        this.props.handleTitleChange(currId,name);
     }
 
     recoverTitle() {
         this.titleDOM.innerHTML = this.props.title;
     }
 
-    confirmChangeTitle() {
-        
-    }
-
     render() {
-        // const DesItems = this.genContent();
-        const { allCheckShow,id,name,preview } = this.props;
+        const { allCheckShow,id,name,preview,sex } = this.props;
         let previewJson = JSON.parse(preview);
+        let sexStr = sex==2?' (女)':sex==1?' (男)':' (通用)';
         return (
             <div className={style.wrapper}>
                 <div className={ 
@@ -182,9 +178,9 @@ class TemplateItem extends React.Component {
                     <span
                         ref={(title) => this.titleDOM = title}
                         className={style['title']}
-                        title={name}
+                        title={name+sexStr}
                     >
-                        {name}
+                        {name+sexStr}
                     </span>
                     <img className={style.arrow} src={this.getArrow()} />
                     <img title={'删除模板'} 
@@ -195,13 +191,13 @@ class TemplateItem extends React.Component {
                         onMouseLeave={() => this.handleDelIconMouseLeave()}
                         onClick={(e) => this.handleTemplateDel(e)} 
                     />
-                    <span className={style.quote} onClick={(e) => this.handleContentClick(e)}>引用</span>
+                    <span className={style.quote} onClick={(e) => this.handleContentClick(e,sex)}>引用</span>
                     <img title={'修改模板标题'}
                         className={style.edit}
                         src={this.getEditIcon()}
                         onMouseEnter={() => this.handleEditIconMouseEnter()}
                         onMouseLeave={() => this.handleEditIconMouseLeave()}
-                        onClick={(e) => this.handleEditIconClick(e)}
+                        onClick={(e) => this.handleEditIconClick(e,name)}
                     />
                 </div>
                 <div

+ 7 - 9
src/components/TemplateItems/index.jsx

@@ -16,10 +16,10 @@ class TemplateItems extends React.Component {
         this.genItems = this.genItems.bind(this);
     }  
     componentDidMount(){
-        const height = getWindowInnerHeight()-216;
+        const height = getWindowInnerHeight()-206;
         this.$cont.current.style.height = height+"px";
         windowEventHandler('resize', ()=>{
-            const height = getWindowInnerHeight()-216;
+            const height = getWindowInnerHeight()-206;
             this.$cont.current.style.height = height+"px";
         });
     }
@@ -68,13 +68,11 @@ class TemplateItems extends React.Component {
                             <span className={`${style['fr-element']} ${style['manger']}`} onClick={handleMangerTemplate}>管理</span>
                     </div>) : null
                 }
-                <div style={{width:'450px',overflow:'hidden'}}>
-                    <div className={style.tempLists} ref={this.$cont}>
-                        {
-                            this.genItems().length > 0?this.genItems():
-                            <Empty message={'还没有保存模板'}></Empty>
-                        }
-                    </div>
+                <div className={style.tempLists} ref={this.$cont}>
+                    {
+                        this.genItems().length > 0?this.genItems():
+                        <Empty message={'还没有保存模板'}></Empty>
+                    }
                 </div>
             </div>
         )

+ 1 - 5
src/components/TemplateItems/index.less

@@ -5,12 +5,8 @@
     user-select: none;
     position: relative;
     .tempLists {
-        overflow-y: scroll;
+        overflow-y: auto;
         background-color: #fff;
-        width: 466px;
-        // &::-webkit-scrollbar {
-        //     display: none;
-        // }
     }
     .wrapperTop {
         height: 36px;

+ 1 - 1
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) { //console.log(111,state);
   const {homePage} = state;
     return {
         data:state.currentIll.data,//主诉模板

+ 7 - 4
src/containers/OperationContainer.js

@@ -12,9 +12,12 @@ import {saveMessage,clearMessages} from "../store/async-actions/print";
 import {saveTemplateDetail} from '@store/async-actions/tabTemplate';
 import {saveClickNum} from '@store/async-actions/homePage';
 
-function mapStateToProps({print}) {
+// function mapStateToProps({print}) {
+function mapStateToProps(state) {
+    const {print,homePage} = state;
     return ({
-        print
+        print,
+        winWidth:homePage.windowWidth
     });
 }
 
@@ -47,8 +50,8 @@ function mapDispatchToProps(dispatch) {
         clear: () => {
             clearMessages()
         },
-        saveDataAll(val){
-          dispatch(saveTemplateDetail(val))
+        saveDataAll(val,sex){
+          dispatch(saveTemplateDetail(val,sex))
         },
         diagShowTmp(bool){
           dispatch({

+ 1 - 1
src/containers/SpreadDrop.js

@@ -130,7 +130,7 @@ function otherHisConfirm(dispatch,store,params){
   }
   let existsId = getIds(exists);
   let withsId = getIds(withs);
-  const ids = existsId.join(",")+','+withsId.join(",");
+  const ids = existsId.length>0?existsId.join(",")+','+withsId.join(","):withsId.join(",");
   if(!ids&&nones){      //只有无的项目
     dispatch({
       type: CONFIRMSELECTED,

+ 1 - 1
src/containers/eleType.js

@@ -124,7 +124,7 @@ function multCheckLabels(params,tagType){
 }
 
 export default function(params){
-  const data = params.item;console.log(params)
+  const data = params.item;
   switch (+data.tagType) {
     case 1:
     case 5:

+ 24 - 6
src/modules/HomePage/index.jsx

@@ -4,11 +4,11 @@ import BannerContainer from '@containers/TypeConfigContainer';
 //  引入组件
 import BodyContainer from "@components/BodyContainer";
 
-import {HIDEDROP} from '@store/types/homePage.js';
+import {HIDEDROP,SETMINSCREEN} from '@store/types/homePage.js';
 import style from './index.less';
 /*import {getInitModules} from '@store/async-actions/homePage.js';*/
 import { getUrlArgObject } from "@utils/tools";
-
+import $ from 'jquery';
 class HomePage extends Component {
     constructor() {
         super();
@@ -17,16 +17,28 @@ class HomePage extends Component {
         }
     }
     
-    /*componentDidMount(){
-        clearTimeout(this.state.timer);
+    componentDidMount(){
+        const {setWindow} = this.props;
+       /* clearTimeout(this.state.timer);
         const that = this;
         const timer = setTimeout(function(){//解决患者信息在获取模板之后的问题
             that.props.getInit();
         },200)
         this.setState({
             timer
-        })      
-    }*/
+        }) */ 
+        // 获取并监听窗口宽度,用于有横向滚动条时患者信息和打印预览跟随滚动
+        let width = $(window).width();
+        let height = $(window).height();
+        setWindow && setWindow({width,height});
+        
+        $(window).resize(function(){
+            let reWidth = $(window).width(); 
+            let reHeight = $(window).height();  
+            setWindow && setWindow({width:reWidth,height:reHeight});
+        })    
+
+    }
     render() {
         return <div className={style['home-page']} onClick={this.props.hideAllDrop}>
             <BannerContainer />
@@ -51,6 +63,12 @@ const mapDispatchToProps = function (dispatch) {
         /*getInit(){
             dispatch(getInitModules);
         }*/
+        setWindow(obj){
+            dispatch({
+                type:SETMINSCREEN,
+                obj:obj
+            })
+        }
     }
 };
 

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

@@ -235,6 +235,10 @@ export const changeLabelVal = (state,action)=>{//双击标签输入改变值
   const newVal = changeVal;     //下拉修改的内容
   let labText = totalVal?totalVal:newVal;   //如单选没有前后缀
   let item = res.data[index];
+  const next = res.data[+index+1];
+  const nextVal = next.value||next.name;
+  //标签后是不是标点符号标签,是的话删除本标签时一起删除
+  let nextIsDot = +next.tagType===8&&!nextVal.match(config.punctuationReg);
   // if(newVal && newVal.trim()){
   if(labText && labText.trim()){
     if(item){
@@ -245,7 +249,8 @@ export const changeLabelVal = (state,action)=>{//双击标签输入改变值
       res.saveText[index] = labText;
     }
   }else{//删除完标签内容则删除该标签
-    res.data.splice(index,1);
+    const num = nextIsDot?2:1;
+    res.data.splice(index,num);
     res.saveText = fullfillText(res.data).saveText;
   }
   res.update = Math.random();
@@ -259,6 +264,10 @@ export const changeNumLabelVal = (state,action)=>{
   const index = ikey;
   const newVal = changeVal;
   let item = res.data[index];
+  const next = res.data[+index+1];
+  const nextVal = next.value||next.name;
+  //标签后是不是标点符号标签,是的话删除本标签时一起删除
+  let nextIsDot = +next.tagType===8&&!nextVal.match(config.punctuationReg);
   if(totalVal.trim()){
     if(item){
       item.value = newVal;
@@ -267,7 +276,8 @@ export const changeNumLabelVal = (state,action)=>{
     }
     res.saveText[index] = totalVal;
   }else{//删除完标签内容则删除该标签
-    res.data.splice(index,1);
+    const num = nextIsDot?2:1;
+    res.data.splice(index,num);
     res.saveText = fullfillText(res.data).saveText;
   } 
   

+ 79 - 23
src/store/actions/currentIll.js

@@ -255,8 +255,8 @@ export const confirm = (state,action) =>{
   if(withs && withs.length>0){
     // for(let i in withs){
     for(let i=0;i<withs.length; i++){
-      // withsArr.splice(parseInt(ikey)+length,0,banText,getLabel(withs[i].id,withs[i].name),...(withs[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==2;})));
-      withsArr.splice(parseInt(ikey)+length,0,getLabel(withs[i].id,withs[i].questionMapping && withs[i].questionMapping.length==0?(ban.name+withs[i].name+','):(ban.name+withs[i].name)),...(withs[i].questionMapping && withs[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==2;})));
+      withsArr.splice(parseInt(ikey)+length,0,banText,getLabel(withs[i].id,withs[i].questionMapping && withs[i].questionMapping.length==0?(withs[i].name+','):(withs[i].name)),...(withs[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==2;})));
+      /*withsArr.splice(parseInt(ikey)+length,0,getLabel(withs[i].id,withs[i].questionMapping && withs[i].questionMapping.length==0?(ban.name+withs[i].name+','):(ban.name+withs[i].name)),...(withs[i].questionMapping && withs[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==2;})));*/
     }
   }
 
@@ -390,6 +390,10 @@ export const changeLabelVal = (state,action)=>{
   const newVal = changeVal;
   let labText = totalVal?totalVal:newVal;
   let item = res.data[index];
+  const next = res.data[+index+1];
+  const nextVal = next.value||next.name;
+  //标签后是不是标点符号标签,是的话删除本标签时一起删除
+  let nextIsDot = +next.tagType===8&&!nextVal.match(config.punctuationReg);
   if(labText.trim()){
     if(item){
       item.value = newVal;
@@ -398,7 +402,8 @@ export const changeLabelVal = (state,action)=>{
       res.saveText[index] = labText;
     }
   }else{//删除完标签内容则删除该标签
-    res.data.splice(index,1);
+    const num = nextIsDot?2:1;
+    res.data.splice(index,num);
     res.saveText = fullfillText(res.data).saveText;
   } 
   res.update = Math.random();
@@ -412,6 +417,10 @@ export const changeNumLabelVal = (state,action)=>{
   const index = ikey;
   const newVal = changeVal;
   let item = res.data[index];
+  const next = res.data[+index+1];
+  const nextVal = next.value||next.name;
+  //标签后是不是标点符号标签,是的话删除本标签时一起删除
+  let nextIsDot = +next.tagType===8&&!nextVal.match(config.punctuationReg);
   let labText = totalVal?totalVal:newVal;   //如单选没有前后缀
   if(labText.trim()){
     if(item){
@@ -421,7 +430,8 @@ export const changeNumLabelVal = (state,action)=>{
     }
     res.saveText[index] = labText;
   }else{//删除完标签内容则删除该标签
-    res.data.splice(index,1);
+    const num = nextIsDot?2:1;
+    res.data.splice(index,num);
     res.saveText = fullfillText(res.data).saveText;
   }
   res.update = Math.random();
@@ -498,6 +508,8 @@ export function insertLabelData(state,action){
   res.symptomIds.push(id);
   const text = Object.assign(JSON.parse(config.textLabel),{name:searchData},{id:id});
   let focusIndex = res.focusIndex;
+  let saveText = res.saveText;
+  let banIdx = saveText.indexOf("伴");
   
   if(isReplace){
     span.current.innerText = '';
@@ -516,26 +528,70 @@ export function insertLabelData(state,action){
     let innerText = span.current.innerText;
     let strIndex = innerText.indexOf(searchStr);
     const value = innerText.replace(searchStr,"");
-    // let value;
-    // if(strIndex <= 1){//前
-    if(strIndex < 1){//前
-      res.data.splice(focusIndex,0,text);
-      res.saveText.splice(focusIndex,0,searchData);
-      res.data[focusIndex+1].value = value;
-      res.saveText[focusIndex+1] = value;
-      resData = JSON.parse(JSON.stringify(res.data));
-      resData.splice(focusIndex+1,0,...(data.questionMapping.filter((item)=>{
-                              return item.symptomType==0||item.symptomType==2;
-                            })));
+    // 没有伴展开主诉symptomType=0/1的尾巴,有伴一>第一个点选上去的伴为依据,伴前展开主诉,伴后展开伴随;多余的伴以及手动输入的伴不做处理(2-25)
+    if(banIdx==-1){
+      // if(strIndex <= 1){//前
+      if(strIndex < 1){//前
+        res.data.splice(focusIndex,0,text);
+        res.saveText.splice(focusIndex,0,searchData);
+        res.data[focusIndex+1].value = value;
+        res.saveText[focusIndex+1] = value;
+        resData = JSON.parse(JSON.stringify(res.data));
+        resData.splice(focusIndex+1,0,...(data.questionMapping.filter((item)=>{
+                                return item.symptomType==0||item.symptomType==1;
+                              })));
+      }else{
+        res.data.splice(focusIndex+1,0,text);
+        res.saveText.splice(focusIndex+1,0,searchData);
+        res.data[focusIndex].value = value;
+        resData = JSON.parse(JSON.stringify(res.data));
+        // +2是因为插入一个文本标签  
+        resData.splice(focusIndex+2,0,...(data.questionMapping.filter((item)=>{
+                                return item.symptomType==0||item.symptomType==1;
+                              })));
+      }
     }else{
-      res.data.splice(focusIndex+1,0,text);
-      res.saveText.splice(focusIndex+1,0,searchData);
-      res.data[focusIndex].value = value;
-      resData = JSON.parse(JSON.stringify(res.data));
-      // +2是因为插入一个文本标签  
-      resData.splice(focusIndex+2,0,...(data.questionMapping.filter((item)=>{
-                              return item.symptomType==0||item.symptomType==2;
-                            })));
+      if(focusIndex > banIdx){//伴后
+        if(strIndex < 1){//前
+          res.data.splice(focusIndex,0,text);
+          res.saveText.splice(focusIndex,0,searchData);
+          res.data[focusIndex+1].value = value;
+          res.saveText[focusIndex+1] = value;
+          resData = JSON.parse(JSON.stringify(res.data));
+          resData.splice(focusIndex+1,0,...(data.questionMapping.filter((item)=>{
+                                  return item.symptomType==0||item.symptomType==2;
+                                })));
+        }else{
+          res.data.splice(focusIndex+1,0,text);
+          res.saveText.splice(focusIndex+1,0,searchData);
+          res.data[focusIndex].value = value;
+          resData = JSON.parse(JSON.stringify(res.data));
+          // +2是因为插入一个文本标签  
+          resData.splice(focusIndex+2,0,...(data.questionMapping.filter((item)=>{
+                                  return item.symptomType==0||item.symptomType==2;
+                                })));
+        }
+      }else{//伴前
+        if(strIndex < 1){//前
+          res.data.splice(focusIndex,0,text);
+          res.saveText.splice(focusIndex,0,searchData);
+          res.data[focusIndex+1].value = value;
+          res.saveText[focusIndex+1] = value;
+          resData = JSON.parse(JSON.stringify(res.data));
+          resData.splice(focusIndex+1,0,...(data.questionMapping.filter((item)=>{
+                                  return item.symptomType==0||item.symptomType==1;
+                                })));
+        }else{
+          res.data.splice(focusIndex+1,0,text);
+          res.saveText.splice(focusIndex+1,0,searchData);
+          res.data[focusIndex].value = value;
+          resData = JSON.parse(JSON.stringify(res.data));
+          // +2是因为插入一个文本标签  
+          resData.splice(focusIndex+2,0,...(data.questionMapping.filter((item)=>{
+                                  return item.symptomType==0||item.symptomType==1;
+                                })));
+        }
+      }
     }
     span.current.innerText = value;
     res.data = fullfillText(resData).newArr;

+ 12 - 3
src/store/actions/mainSuit.js

@@ -453,14 +453,18 @@ export const changeLabelVal = (state,action)=>{
   const newVal = action.data.changeVal;
   let data = res.data;
   let item = data[index];
+  const next = res.data[+index+1];
+  const nextVal = next.value||next.name;
+  //标签后是不是标点符号标签,是的话删除本标签时一起删除
+  let nextIsDot = +next.tagType===8&&!nextVal.match(config.punctuationReg);
   if(newVal&&newVal.trim()){
     if(item){
       item.value = newVal;
       res.saveText[index] = newVal;
     }
   }else{//删除完标签内容则删除该标签
-    
-    data.splice(index,1);
+    const num = nextIsDot?2:1;
+    data.splice(index,num);
     // data[index].value = "";
     // res.data.splice(index,1);
     res.saveText.splice(index,1);
@@ -478,6 +482,10 @@ export const changeNumLabelVal = (state,action)=>{
   const newVal = changeVal;
   let labText = totalVal?totalVal:newVal;   //如单选没有前后缀
   let item = res.data[index];
+  const next = res.data[+index+1];
+  const nextVal = next.value||next.name;
+  //标签后是不是标点符号标签,是的话删除本标签时一起删除
+  let nextIsDot = +next.tagType===8&&!nextVal.match(config.punctuationReg);
   if(labText.trim()){
     if(item){
       item.value = newVal;
@@ -486,7 +494,8 @@ export const changeNumLabelVal = (state,action)=>{
       res.saveText[index] = labText;
     }
   }else{//删除完标签内容则删除该标签
-    res.data.splice(index,1);
+    const num = nextIsDot?2:1;
+    res.data.splice(index,num);
     res.saveText = fullfillText(res.data).saveText;
   }
   res.update = Math.random();//console.log(44,action,res);

+ 12 - 2
src/store/actions/otherHistory.js

@@ -219,6 +219,10 @@ export function changeTextLabel(state,action) {
   const index = ikey;
   const newVal = changeVal;
   let item = res.data[index];
+  const next = res.data[+index+1];
+  const nextVal = next.value||next.name;
+  //标签后是不是标点符号标签,是的话删除本标签时一起删除
+  let nextIsDot = +next.tagType===8&&!nextVal.match(config.punctuationReg);
   let labText = totalVal?totalVal:newVal;
   if(labText.trim()){
     if(item){
@@ -228,7 +232,8 @@ export function changeTextLabel(state,action) {
       res.saveText[index] = labText;
     }
   }else{//删除完标签内容则删除该标签
-    res.data.splice(index,1);
+    const num = nextIsDot?2:1;
+    res.data.splice(index,num);
     res.saveText = fullfillText(res.data).saveText;
   }
   res.update = Math.random();
@@ -242,6 +247,10 @@ export const changeNumLabelVal = (state,action)=>{
   const index = ikey;
   const newVal = changeVal;
   let item = res.data[index];
+  const next = res.data[+index+1];
+  const nextVal = next.value||next.name;
+  //标签后是不是标点符号标签,是的话删除本标签时一起删除
+  let nextIsDot = +next.tagType===8&&!nextVal.match(config.punctuationReg);
   let labText = totalVal?totalVal:newVal;   //如单选没有前后缀
   if(labText.trim()){
     if(item){
@@ -251,7 +260,8 @@ export const changeNumLabelVal = (state,action)=>{
     }
     res.saveText[index] = labText;
   }else{//删除完标签内容则删除该标签
-    res.data.splice(index,1);
+    const num = nextIsDot?2:1;
+    res.data.splice(index,num);
     res.saveText = fullfillText(res.data).saveText;
   };
   res.update = Math.random();

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

@@ -206,7 +206,7 @@ export const addBilling = (state, action) => {
 	return res;
 }
 export const clearAllPushMessage = (state, action) => {
-	const res = JSON.parse(JSON.stringify(state));
+  const res = JSON.parse(JSON.stringify(state));
 	res.advice = action.data;
 	res.AdviceStr = action.saveText;
 	res.tips = {};

+ 2 - 3
src/store/async-actions/tabTemplate.js

@@ -37,13 +37,12 @@ export const initItemList = (type) => { //初始化数据
   }
 };
 
-export const saveTemplateDetail = (val) => { //保存为模板
+export const saveTemplateDetail = (val,sex) => { //保存为模板
   let baseList = store.getState();
   let jsonData = getAllDataList(baseList);
   let jsonStr = getAllDataStringList(baseList);
   let whichSign = baseList.typeConfig.typeConfig;
   let state = baseList.patInfo.message;
-  console.log(state)
   let preview = {
     "chief": jsonStr.chief,
     "present": jsonStr.present,
@@ -63,7 +62,7 @@ export const saveTemplateDetail = (val) => { //保存为模板
       "modeName": val,
       "modeType": whichSign,
       "preview": idx ? JSON.stringify(preview):preview,
-      "sex":state.sex
+      "sex":sex
     }
     return tmpObj;
   }

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

@@ -1,5 +1,5 @@
 import {HIDE,RESET,SETINITDATA,SETDROPSHOW,SETADDITEMINIT,SETT0EDIT,SETREADDITEMS,
-  HIDEDROP,CLICKCOUNT,ISREAD,SETOTHERHISTORY} from '../types/homePage.js';
+  HIDEDROP,CLICKCOUNT,ISREAD,SETOTHERHISTORY,SETMINSCREEN} from '../types/homePage.js';
 import {showDrop,setAddItemInit,setLabelToEdit,confirmHide,clickNum} from '../actions/homePage.js';
 
 const initState = {
@@ -50,6 +50,10 @@ export default function (state=initState,action) {
       res.focusTextIndex = action.index;
       res.span=action.$span;
       return res;*/
+    case SETMINSCREEN:
+      res.windowWidth = action.obj.width;
+      res.windowHeight = action.obj.height;
+      return res;
     default:
       return res;
   }

+ 2 - 1
src/store/types/homePage.js

@@ -9,4 +9,5 @@ export const SETTEXTFOCUS = 'set_focus_text_index';
 export const HIDEDROP = 'set_box_drop_hide';//点击确定隐藏
 export const CLICKCOUNT = 'click_count';//埋点
 export const ISREAD = 'is_history_or_template';     //是否回读或模板数据
-export const SETOTHERHISTORY = 'set_otherHis_history';    //其他史历史数据暂存
+export const SETOTHERHISTORY = 'set_otherHis_history';    //其他史历史数据暂存
+export const SETMINSCREEN = 'SETMINSCREEN';    //1024标识

+ 23 - 10
src/utils/tools.js

@@ -165,7 +165,9 @@ const getAllDataList =(baseList) =>{           //获取所有模块结构化的
     jsonData.chief = baseList.mainSuit.data;      //主诉
     jsonData.present = baseList.currentIll.data;    //现病史
     jsonData.other = baseList.otherHistory.data;      //其他史
+    jsonData.otherHistoryIsEmpty = baseList.otherHistory.isEmpty;
     jsonData.vital = baseList.checkBody.data;    //查体
+    jsonData.checkBodyIsEmpty = baseList.checkBody.isEmpty;
     jsonData.lis.labelList = baseList.inspect.labelList;      //化验
     jsonData.lis.getExcelDataList =  baseList.inspect.getExcelDataList;      //化验导入
     jsonData.pacs = baseList.assistCheck.assistLabel;     //辅检
@@ -178,7 +180,7 @@ const getAllDataList =(baseList) =>{           //获取所有模块结构化的
     jsonData.addItems = baseList.homePage.addItems||{};
     jsonData.mainsuitIds = baseList.mainSuit.mainIds;      //主诉去重
     jsonData.currentIds = baseList.currentIll.symptomIds;      //现病史去重
-    // console.log(jsonData,'结构化数据获取')
+    //console.log(jsonData,'结构化数据获取')
     return jsonData;
 }
 const getAllDataStringList =(baseList) =>{           //获取所有模块文本的数据
@@ -248,7 +250,8 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
         });
         store.dispatch({
             type: CLEAR_ALL_PUSH_MESSAGE,
-            data:{}
+            data:{},
+            saveText:'',
         });
         storageLocal.remove('emrParam');
        // Notify.success('页面已清空')
@@ -276,6 +279,7 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                     type: CLEAROTHERHISTORY,
                     data:dataJson.other,
                     selecteds:dataJson.otherHistorySelecteds?dataJson.otherHistorySelecteds:[],
+                    isEmpty:dataJson.otherHistoryIsEmpty,
                     saveText:JSON.parse(dataJsonStr.other),
                     editClear:dataJson.other.length>0?false:true
                 });
@@ -283,6 +287,7 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                     type: CLEARCHECKBODY,
                     data:dataJson.vital,
                     selecteds:dataJson.checkBodySelecteds?dataJson.checkBodySelecteds:[],
+                    isEmpty:dataJson.checkBodyIsEmpty,
                     saveText:JSON.parse(dataJsonStr.vital)
                 });
                 store.dispatch(clearAllLabel(
@@ -330,12 +335,14 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                     data:dataJson.other,
                     selecteds:dataJson.otherHistorySelecteds?dataJson.otherHistorySelecteds:[],
                     saveText:dataJsonStr[2].content ? JSON.parse(dataJsonStr[2].content):[],
+                    isEmpty:dataJson.otherHistoryIsEmpty,
                     editClear:dataJson.other.length>0?false:true
                 });
                 store.dispatch({
                     type: CLEARCHECKBODY,
                     data:dataJson.vital,
                     selecteds:dataJson.checkBodySelecteds?dataJson.checkBodySelecteds:[],
+                    isEmpty:dataJson.checkBodyIsEmpty,
                     saveText:dataJsonStr[3].content ? JSON.parse(dataJsonStr[3].content):[]
                 });
                 store.dispatch(clearAllLabel(
@@ -381,11 +388,13 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                 store.dispatch({
                     type: CLEAROTHERHISTORY,
                     data:[],
+                    isEmpty:dataJson.otherHistoryIsEmpty,
                     saveText:JSON.parse(dataJsonStr.other)
                 });
                 store.dispatch({
                     type: CLEARCHECKBODY,
                     data:dataJson.vital,
+                    isEmpty:dataJson.checkBodyIsEmpty,
                     saveText:JSON.parse(dataJsonStr.vital)
                 });
                 store.dispatch(clearAllLabel(
@@ -429,11 +438,13 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                 store.dispatch({
                     type: CLEAROTHERHISTORY,
                     data:[],
+                    isEmpty:dataJson.otherHistoryIsEmpty,
                     saveText:dataJsonStr[2].content ? JSON.parse(dataJsonStr[2].content) :[]
                 });
                 store.dispatch({
                     type: CLEARCHECKBODY,
                     data:dataJson.vital,
+                    isEmpty:dataJson.checkBodyIsEmpty,
                     saveText:dataJsonStr[3].content ? JSON.parse(dataJsonStr[3].content):[]
                 });
                 store.dispatch(clearAllLabel(
@@ -509,7 +520,7 @@ function filterDataArr(arrTmp){   //数据处理
             }
         }
     }
-    return (tmpArr.join('')).replace(/^,+/,"").replace(/,+$/,"").replace(/^,+$/,"").replace(/,+$/,"");
+    return (tmpArr.join('')).replace(/^,+/,"").replace(/,+$/,"").replace(/^,+$/,"").replace(/,+$/,"").replace(/^。+/,"").replace(/。+$/,"。");
 }
 // 取消默认行为
 function preventDefault(event) {
@@ -584,22 +595,24 @@ function didPushParamChange(){
   return true;
 }
 //判断页面所有数据是否为空
-function isAllClear(jsonData,jsonStr){
+function isAllClear(jsonData,jsonStr,baseList){
   if (      //结构化和文本数据都为空
     JSON.stringify(jsonData.advice) == '{}' &&
     jsonData.chief.length < 1 &&
     jsonData.present.length < 1 &&
-    jsonData.other.length < 1 &&
-    jsonData.vital.length < 1 &&
+    // jsonData.other.length < 1 && 
+    (jsonData.other.length > 0 ? baseList.otherHistory.isEmpty : true) &&
+    //jsonData.vital.length < 1 &&
+    (jsonData.vital.length > 0 ? baseList.checkBody.isEmpty : true) &&
     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)) == '' &&
+    filterDataArr(JSON.parse(jsonStr.chief)) == '' &&
+    filterDataArr(JSON.parse(jsonStr.present)) == '' &&
+    filterDataArr(JSON.parse(jsonStr.other)) == '' &&           //这里都是filterDataArr不是filterArr,要去符号的
+    filterDataArr(JSON.parse(jsonStr.vital)) == '' &&
     jsonData.diag.length < 1 &&
     jsonData.pacs.length < 1 &&
     jsonData.lis.labelList.length < 1 &&