فهرست منبع

Merge branch 'innterfaceUpdate' of http://192.168.2.236:10080/zhouna/newICSS into innterfaceUpdate

zhangxc 5 سال پیش
والد
کامیت
b24a44f828
64فایلهای تغییر یافته به همراه914 افزوده شده و 368 حذف شده
  1. 5 2
      src/common/components/EditableSpan/index.jsx
  2. 1 2
      src/common/components/ItemBox/index.jsx
  3. 0 1
      src/common/less/base.less
  4. 1 1
      src/components/AddInspect/InspectName/index.jsx
  5. 1 1
      src/components/AddInspect/InspectName/index.less
  6. 42 40
      src/components/Banner/ModeChange/index.jsx
  7. 2 1
      src/components/Banner/ModeChange/index.less
  8. 1 1
      src/components/Banner/index.less
  9. 1 1
      src/components/BodyContainer/index.less
  10. 1 1
      src/components/InfoTitle/index.jsx
  11. 1 1
      src/components/Inspect/index.jsx
  12. 2 2
      src/components/MainSuit/index.jsx
  13. 11 4
      src/components/MedicalInfo/index.jsx
  14. 3 9
      src/components/MultSpread/index.jsx
  15. 4 10
      src/components/Multiple/index.jsx
  16. 8 14
      src/components/NumberDrop/index.jsx
  17. 3 10
      src/components/NumberUnitDrop/index.jsx
  18. 0 1
      src/components/Operation/Search/index.jsx
  19. 68 59
      src/components/Operation/index.jsx
  20. BIN
      src/components/PreInIcss/RotateImg copy/img/closeImg.png
  21. BIN
      src/components/PreInIcss/RotateImg copy/img/imgBgActive.png
  22. BIN
      src/components/PreInIcss/RotateImg copy/img/nextImg.png
  23. BIN
      src/components/PreInIcss/RotateImg copy/img/plus.png
  24. BIN
      src/components/PreInIcss/RotateImg copy/img/prevImg.png
  25. BIN
      src/components/PreInIcss/RotateImg copy/img/reduce.png
  26. BIN
      src/components/PreInIcss/RotateImg copy/img/rotated.png
  27. 229 0
      src/components/PreInIcss/RotateImg copy/index.jsx
  28. 104 0
      src/components/PreInIcss/RotateImg copy/index.less
  29. 60 38
      src/components/PreInIcss/RotateImg/index.jsx
  30. 2 1
      src/components/PreInIcss/SliddleTgl/index.jsx
  31. 2 2
      src/components/PreInIcss/index.jsx
  32. 1 0
      src/components/PreInIcss/index.less
  33. 9 1
      src/components/PreviewBody/Inspect/index.jsx
  34. 2 0
      src/components/PreviewBody/index.jsx
  35. 14 0
      src/components/PreviewBody/index.less
  36. 10 5
      src/components/PushContainer/index.jsx
  37. 4 10
      src/components/RadioDrop/index.jsx
  38. 3 9
      src/components/RadioInpDrop/index.jsx
  39. 6 12
      src/components/SpreadDrop/index.jsx
  40. 5 5
      src/components/TemplateItems/TemplateItem/index.jsx
  41. 1 1
      src/components/TemplateItems/TemplateItem/index.less
  42. 11 5
      src/components/TemplateItems/index.jsx
  43. 3 3
      src/components/Treat/AdverseReactions/index.jsx
  44. 3 0
      src/components/Treat/AdverseReactions/index.less
  45. 1 0
      src/containers/EditableSpan.js
  46. 2 1
      src/containers/MedicalInfoContainer.js
  47. 0 1
      src/containers/OperationContainer.js
  48. 5 2
      src/modules/HomePage/index.jsx
  49. 7 4
      src/store/actions/checkBody.js
  50. 4 4
      src/store/actions/print.js
  51. 2 2
      src/store/actions/treat.js
  52. 1 11
      src/store/async-actions/mainSuit.js
  53. 2 2
      src/store/async-actions/patInfo.js
  54. 6 14
      src/store/async-actions/preIcss.js
  55. 3 4
      src/store/async-actions/tabTemplate.js
  56. 2 2
      src/store/async-actions/treat.js
  57. 7 0
      src/store/reducers/assistCheck.js
  58. 4 0
      src/store/reducers/inspect.js
  59. 6 5
      src/store/reducers/print.js
  60. 1 1
      src/store/types/checkBody.js
  61. 1 1
      src/store/types/print.js
  62. 63 14
      src/utils/drag.js
  63. 155 32
      src/utils/tools.js
  64. 18 15
      src/utils/utils.js

+ 5 - 2
src/common/components/EditableSpan/index.jsx

@@ -340,8 +340,11 @@ class EditableSpan extends Component{
     setSelectArea({i,boxMark,dir:'start'});
   }
   selectEnd(){
-    const {i,setSelectArea,boxMark}= this.props;
-    setSelectArea({i,boxMark,dir:'end'});
+    const {i,setSelectArea,boxMark,select_start}= this.props;
+    if(select_start!==i){     //判断不能省,否则无法聚焦
+      setSelectArea({i,boxMark,dir:'end'});
+      window.getSelection().empty();
+    }
   }
   getClass(){
     const {full,value,saveText,i,preIsExt,afterIsExt,mouseSelect} = this.props;

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

@@ -28,7 +28,6 @@ class ItemBox extends Component {
     const sty = {width:boxWidth?boxWidth:undefined,height:boxHeight?boxHeight:undefined,lineHeight:boxLineHeight?boxLineHeight:'22px',marginTop:marginTop,backgroundColor:backgroundColor?backgroundColor:''};
     return style?Object.assign(style,sty):sty;
   }
-
   handleClick(e){
     e.stopPropagation();
     const {handleClick,hideAllDrop} = this.props;
@@ -62,7 +61,7 @@ componentWillReceiveProps(nextP){
     }
 }
 setFontColorSize(){
-  const {data,saveText} = this.props;
+  const {data,saveText,title} = this.props;
   if(data&&data.length==0&&saveText&&saveText[0]){
     return setFontColorSize(2,7)
   }

+ 0 - 1
src/common/less/base.less

@@ -116,7 +116,6 @@ html,body {
 }
 :global(.titleWidth){
     width: 78px !important;
-    margin-top: 8px !important;
     #mainSuit {
         margin-left: 78px;
     }

+ 1 - 1
src/components/AddInspect/InspectName/index.jsx

@@ -53,7 +53,7 @@ class InspectName extends Component {
           <span className={styles.imgInfo1} title='点击i图标可查看详细说明' onClick={()=>getInfomation({name:item.uniqueName || '', position: 1, type: 12})}></span>
         </span>
         {
-          item.inpValue||this.state.isEdit?<div className={styles.iptTipWrap} onClick={this.handleEdit}>
+          item.inpValue||this.state.isEdit?<div title={this.state.value} className={styles.iptTipWrap} onClick={this.handleEdit}>
             <input 
             ref="iptTip"
             onBlur={this.handleBlur}

+ 1 - 1
src/components/AddInspect/InspectName/index.less

@@ -215,7 +215,7 @@
       }
 }
 .iptValue {
-    width: 50px;
+    width: 100px;
     color: #3B9ED0;
     font-size: 12px;
     margin-left: 10px;

+ 42 - 40
src/components/Banner/ModeChange/index.jsx

@@ -34,52 +34,53 @@ class ModeChange extends Component {
               <div className={style['shade']} onClick={closeConfigModal}></div>
               <div className={style['content']}>
                 <div className={style['close']}>设置<img src={close} onClick={closeConfigModal} /></div>
-                <div className={style["oper"]}>
+                <div className="scroller">
+                  <div className={style["oper"]}>
                     <p className={this.getStyle()}>
                       <span>开启模板智能推送:</span>
                       <a className={style['switch']} href="javascript:void(0)" onClick={hideBtn?()=>changeType('config0',isOpen?1:0):null}>
                         <img src={isOpen?sopen:sclose} alt=""/>
                         {isOpen?'开':'关'}
-                        </a>
+                      </a>
                     </p>
-                  <p className={this.getStyle(1)}>
-                    <span>开启一般情况默认值:</span>
-                    <a className={style['switch']} href="javascript:void(0)" onClick={hideBtn&&isOpen?()=>changeType('config1',general?1:0):null}>
-                      <img src={general?sclose:sopen} alt=""/>
-                      {general?'关':'开'}
-                    </a>
-                  </p>
-                  <p className={this.getStyle(1)+" "+style['big-marb']}>
-                    <span>开启其他史默认值:</span>
-                    <a className={style['switch']} href="javascript:void(0)" onClick={hideBtn&&isOpen?()=>changeType('config2',ohis?1:0):null}>
-                      <img src={ohis?sclose:sopen} alt=""/>
-                      {ohis?'关':'开'}
-                    </a>
-                  </p>
-                  <p className={this.getStyle()}>
-                    <span>默认字体大小:</span>
-                    <a className={style['switch']} href="javascript:void(0)" onClick={hideBtn?()=>changeType('config3',0):null}>
-                      <img src={fontsize?radio_on:radio_off} alt=""/>
-                      标准
-                    </a>
-                    <a className={style['switch']} href="javascript:void(0)" onClick={hideBtn?()=>changeType('config3',1):null}>
-                      <img src={fontsize?radio_off:radio_on} alt=""/>
-                      增大
-                    </a>
-                  </p>
-                  <p className={this.getStyle()}>
-                    <span>默认字体颜色:</span>
-                    <a className={style['switch']} href="javascript:void(0)" onClick={hideBtn?()=>changeType('config4',0):null}>
-                      <img src={color?radio_on:radio_off} alt=""/>
-                      标准
-                    </a>
-                    <a className={style['switch']} href="javascript:void(0)" onClick={hideBtn?()=>changeType('config4',1):null}>
-                      <img src={color?radio_off:radio_on} alt=""/>
-                      增黑
-                    </a>
-                  </p>
-                </div>
-                <div className={style["explain"]}>
+                    <p className={this.getStyle(1)}>
+                      <span>开启一般情况默认值:</span>
+                      <a className={style['switch']} href="javascript:void(0)" onClick={hideBtn&&isOpen?()=>changeType('config1',general?1:0):null}>
+                        <img src={general?sclose:sopen} alt=""/>
+                        {general?'关':'开'}
+                      </a>
+                    </p>
+                    <p className={this.getStyle(1)+" "+style['big-marb']}>
+                      <span>开启其他史默认值:</span>
+                      <a className={style['switch']} href="javascript:void(0)" onClick={hideBtn&&isOpen?()=>changeType('config2',ohis?1:0):null}>
+                        <img src={ohis?sclose:sopen} alt=""/>
+                        {ohis?'关':'开'}
+                      </a>
+                    </p>
+                    <p className={this.getStyle()}>
+                      <span>默认字体大小:</span>
+                      <a className={style['switch']} href="javascript:void(0)" onClick={hideBtn?()=>changeType('config3',0):null}>
+                        <img src={fontsize?radio_on:radio_off} alt=""/>
+                        标准
+                      </a>
+                      <a className={style['switch']} href="javascript:void(0)" onClick={hideBtn?()=>changeType('config3',1):null}>
+                        <img src={fontsize?radio_off:radio_on} alt=""/>
+                        增大
+                      </a>
+                    </p>
+                    <p className={this.getStyle()}>
+                      <span>默认字体颜色:</span>
+                      <a className={style['switch']} href="javascript:void(0)" onClick={hideBtn?()=>changeType('config4',0):null}>
+                        <img src={color?radio_on:radio_off} alt=""/>
+                        标准
+                      </a>
+                      <a className={style['switch']} href="javascript:void(0)" onClick={hideBtn?()=>changeType('config4',1):null}>
+                        <img src={color?radio_off:radio_on} alt=""/>
+                        增黑
+                      </a>
+                    </p>
+                  </div>
+                  <div className={style["explain"]}>
                     <p>说明:</p>
                     <p>1、智能推送模式只针对问诊模块中的“主诉”、“现病史”、“其他史”展示科室模版功能;</p>
                     <p>2、慢病模式下,该模版智能推送的设置功能不可用;</p>
@@ -87,6 +88,7 @@ class ModeChange extends Component {
                     <p>4、其他史默认值:既往史无殊、过敏史无殊、个人史无殊;</p>
                     <p>5、病历书写模块,字体大小标准为14px,增大为18px;</p>
                     <p>6、病历书写模块,字体颜色标准为灰黑色,增黑为全黑色;</p>
+                  </div>
                 </div>
                 {hideBtn?<div className={style['btn']} onClick={confirmType}><button>保存修改</button></div>:<div className={style['btn']} onClick={closeConfigModal}><button>&nbsp;&nbsp;关闭&nbsp;&nbsp;</button></div>}
             </div>

+ 2 - 1
src/components/Banner/ModeChange/index.less

@@ -15,10 +15,11 @@
     .content {
       .maskContentZIndex1;
       position: fixed;
-      top: 100px;
+      top: 50%;
       width: 45%;
       min-width: 450px;
       left:27%;
+      margin-top:-265px;
       /*margin-left: -216px;*/
       min-height: 284px;
       background: #fff;

+ 1 - 1
src/components/Banner/index.less

@@ -7,7 +7,7 @@
     height: 50px;
 
     border-bottom: 10px solid #e4e6e7;
-    position: fixed;          //页面布局调整
+    position: absolute;          //页面布局调整
     width: 100%;
     top: 0;
     // z-index: 202;

+ 1 - 1
src/components/BodyContainer/index.less

@@ -4,6 +4,6 @@
   }
 }*/
 .container{
-  padding: 50px 10px 0 10px;
+  padding: 50px 8px 0 10px;
   position: relative;
 }

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

@@ -52,7 +52,7 @@ class InfoTitle extends Component {
     render() {
         const {disVisible,copyVisible,winWidth,loading} = this.props;
         const {le} = this.state;
-        return <div className={style['title-wrapper']} >
+        return <div className={style['title-wrapper']}  style={{left:le}}>
             <PatInfoContainer />
             <div className={style['activeWrap']}>
                 <div className={style["operations"]} onClick={this.showHistoryBox}>

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

@@ -221,7 +221,7 @@ class Inspect extends React.Component {
         <div className={styles.top}>
           <span id="inspectResultData" className={setFontColorSize(2,5)}>化验结果数据</span>
           {/* <div className={this.getStyle()} onClick={ieVersion&&ieVersion<=9?null:this.handleImportExcel}> */}
-          <div className={this.getStyle()} style={{ display: hospitalMsg.import_way_lis == 0 ? 'none' : 'block' }}>
+          <div className={this.getStyle()} style={{ display: hospitalMsg.import_way_lis == 0||hospitalMsg.import_way_lis ==undefined ? 'none' : 'block' }}>
             {/* <button disabled={ieVersion&&ieVersion>9?true:false}onClick={ieVersion && ieVersion <= 9 ? null : this.handleImportExcel}>导入化验结果</button>
             <input accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" type="file" name="uploadfile" id="choose" style={{ display: 'none' }} ref={(DOM) => this.inputRef = DOM} /> */}
             {/* {0没有,1本地,2医院,3本地和医院} */}

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

@@ -269,8 +269,8 @@ class MainSuit extends Component{
       }
   }*/
   render(){
-    const {saveChronic,readMode,type,CommonSymptoms,searchData,fetchPushInfos,isRead,totalHide,handleInput,fuzhen,saveText,editClear,datas,commSymHide,showArr} = this.props;
-    const {symptom,boxLeft,boxTop} = this.state;
+    const {readMode,type,CommonSymptoms,searchData,fetchPushInfos,isRead,totalHide,handleInput,fuzhen,saveText,editClear,datas,commSymHide,showArr} = this.props;
+    const {boxLeft,boxTop} = this.state;
     const symptomFlag = CommonSymptoms.length>0 ? true : false;
     const searchFlag = searchData.length>0 ? true : false;
     const boxTop1 = datas.length>0?boxTop:45;

+ 11 - 4
src/components/MedicalInfo/index.jsx

@@ -37,7 +37,7 @@ class MedicalInfo extends Component {
         const that = this;
         if(searchResult&&searchResult.length>0){
           setTimeout(function(){
-            that.$ul.current.style.height = getWindowInnerHeight()-278+'px';
+            if(that.$ul.current)that.$ul.current.style.height = getWindowInnerHeight()-278+'px';
           },100);
         }
         return searchResult && searchResult.map((item) => {
@@ -129,10 +129,17 @@ class MedicalInfo extends Component {
       }
     });
   }
-  componentWillReceiveProps(){
+  componentWillReceiveProps(next){
     this.setState({
       hasSearch: false
     });
+    //点清空恢复初始状态
+    if(this.props.clearSearch!==next.clearSearch){
+      this.clear();
+      this.setState({
+        typeChecks:['0']
+      });
+    }
   }
     render() {
         const {searchResult,filterList} = this.props;
@@ -141,8 +148,8 @@ class MedicalInfo extends Component {
             <div className={style['search-cont']} ref={this.$cont}>
               <div className={style['search-box']}>
                 <p className={style['cont']}>
-                  <input placeholder="医学知识搜索" type="text" className={style['input']} ref={this.$inp} onInput={this.handleChange} onKeyUp={this.handleEnter}/>
-                  {val?<img src={delIcon} id='clearMedicalInfoSearch' alt="清空" onClick={this.clear}/>:''}
+                  <input placeholder="医学知识搜索" id='medicalInfoSearch' type="text" className={style['input']} ref={this.$inp} onInput={this.handleChange} onKeyUp={this.handleEnter}/>
+                  {val?<img src={delIcon} alt="清空" onClick={this.clear}/>:''}
                   <button onClick={this.search}>搜索</button>
                 </p>
                 <Filters data ={filterList} checkeds={typeChecks} handleCheck={this.handleTypeCheck}></Filters>

+ 3 - 9
src/components/MultSpread/index.jsx

@@ -9,7 +9,7 @@ import addIcon from '@images/addItem.png';
 import addIcon1 from '@images/addItem2.png';
 import style from "./index.less";
 import tools from '@utils/tools';
-import {setFontColorSize} from '@utils/tools';
+import {setFontColorSize,handleMouseUp} from '@utils/tools';
 import NumberUnitDrop from '@containers/NumberUnitDrop';
 
 
@@ -240,12 +240,6 @@ class MultSpread extends Component{
     });
     return list;
   }
-  handleMouseUp(){
-    const {select_start,i,setSelectArea,boxMark}= this.props;
-    if(select_start!==undefined){
-      setSelectArea({i,boxMark,dir:'end'});
-    }
-  }
   handleMouseDown(){
     const {i,setSelectArea,boxMark}= this.props;
     setSelectArea({i,boxMark,dir:'start'});
@@ -270,10 +264,10 @@ class MultSpread extends Component{
     return classNames(orgBorder,ext,selectedArea);
   }
   render(){
-    const {showAdd,addLabelItem,ikey,copyId,textPrefix,textSuffix,isExtBlue} = this.props;
+    const {showAdd,addLabelItem,ikey,copyId,textPrefix,textSuffix,isExtBlue,select_start,i,boxMark} = this.props;
     return (<div className={this.getContClass()}
                  style={{display:'inline-block'}}
-                 onMouseUp={this.handleMouseUp.bind(this)}
+                 onMouseUp={()=>handleMouseUp({select_start,i,boxMark})}
                  onMouseDown={this.handleMouseDown.bind(this)}>
         {textPrefix?<span className="prefixUnset">{textPrefix}</span>:''}
         <div className={this.getClass()}>

+ 4 - 10
src/components/Multiple/index.jsx

@@ -2,7 +2,7 @@ import react from "react";
 import style from "./index.less";
 import $ from 'jquery';
 import classNames from 'classnames';
-import {handleEnter,isIE,filterArr,deepClone,filterDataArr,setFontColorSize} from '@utils/tools.js';
+import {handleEnter,isIE,filterArr,deepClone,filterDataArr,setFontColorSize,handleMouseUp} from '@utils/tools.js';
 import {Notify} from '@commonComp';
 import SlideItem from "./SlideItem";
 import config from '@config/index.js';
@@ -161,15 +161,9 @@ class Multiple extends react.Component{
     handleConfirm&&handleConfirm(params);
     handleHide&&handleHide();
   }
-  handleMouseUp(){
-    const {select_start,i,setSelectArea,boxMark}= this.props;
-    if(select_start!==undefined){
-      setSelectArea({i,boxMark,dir:'end'});
-    }
-  }
   handleMouseDown(){
     const {i,setSelectArea,boxMark}= this.props;
-    setSelectArea({i,boxMark,dir:'start'});
+    !this.state.editable&&setSelectArea({i,boxMark,dir:'start'});
   }
   componentDidMount(){
     if(isIE()){
@@ -179,7 +173,7 @@ class Multiple extends react.Component{
     }
   }
   render(){
-    const {placeholder,value,show,data,hideTag} = this.props;
+    const {placeholder,value,show,data,hideTag,select_start,i,boxMark} = this.props;
     const {editable,seleData,seleId} = this.state;
     return <div className={style["container"]}>
       <div className={this.getClass()}
@@ -189,7 +183,7 @@ class Multiple extends react.Component{
       onBlur={this.handleBlur}
       onInput={this.onChange}
       onKeyDown={handleEnter}
-      onMouseUp={this.handleMouseUp.bind(this)}
+      onMouseUp={()=>handleMouseUp({select_start,i,boxMark})}
       onMouseDown={this.handleMouseDown.bind(this)}
       contentEditable={editable}>{value||placeholder}</div>
       <div className={this.getListClass()} contentEditable="false">

+ 8 - 14
src/components/NumberDrop/index.jsx

@@ -2,7 +2,7 @@ import React,{Component} from 'react';
 import className from 'classnames';
 import {NumberPan,Notify} from '@commonComp';
 import style from './index.less';
-import {setFontColorSize} from '@utils/tools'
+import {setFontColorSize,handleMouseUp} from '@utils/tools'
 /***
  * author:zn@2018-11-19
  * 接收参数:
@@ -154,10 +154,10 @@ class NumberDrop extends Component{
   }
   numInpBlur(e){        //数字框失焦,保存值到store中
     e.stopPropagation();
-    const {handleSelect,ikey,suffix,prefix,mainSaveText,min,max,show,formulaCode} = this.props;
-    /*if(show){      //修改清空后第一次点击键盘不触发click事件bug--失焦placehoder消失,弃用
+    const {handleSelect,ikey,suffix,prefix,mainSaveText,min,max,formulaCode} = this.props;
+    if(!this.$span.current){      //操作为连续选中删除后,不做验证2830
       return;
-    }*/
+    }
     //输入超出合理范围或输入不是数字提示且清空
     const needCompare=min!=undefined&&max!=undefined;
     const txt = e.target.innerHTML.replace(/&nbsp;$|^&nbsp;/,'');//e.target.innerText.trim();
@@ -218,15 +218,9 @@ class NumberDrop extends Component{
   stopBubble(e){
     e.stopPropagation();
   }
-  handleMouseUp(){
-    const {select_start,i,setSelectArea,boxMark}= this.props;
-    if(select_start!==undefined){
-      setSelectArea({i,boxMark,dir:'end'});
-    }
-  }
   handleMouseDown(){
-    const {i,setSelectArea,boxMark}= this.props;
-    setSelectArea({i,boxMark,dir:'start'});
+    const {i,setSelectArea,boxMark,show}= this.props;
+    !show&&setSelectArea({i,boxMark,dir:'start'});
   }
   componentDidMount(){
     //设置最小宽度避免输入后宽度跳动
@@ -259,13 +253,13 @@ class NumberDrop extends Component{
     });
   }
   render(){
-    const {prefix,suffix,show,value,handleHide,allClick,bmi,formulaCode,nospecial,isSelectAll,isExtBlue} = this.props;
+    const {prefix,suffix,show,value,handleHide,allClick,bmi,formulaCode,nospecial,isSelectAll,isExtBlue,select_start,i,boxMark} = this.props;
     const val = formulaCode==="BMI_RES"?(+bmi===Infinity||isNaN(bmi)?'':bmi):value;
     const {placeholder,hasSelect} = this.state;
     return <div className={this.getClasses(nospecial)}
                 style={{position:'relative'}}
                 onClick={allClick?this.handleNumClick:null}
-                onMouseUp={this.handleMouseUp.bind(this)}
+                onMouseUp={()=>handleMouseUp({select_start,i,boxMark})}
                 onMouseDown={this.handleMouseDown.bind(this)}>
       <span className={`${setFontColorSize(val?'':isSelectAll?2:isExtBlue?2:1)} prefixUnset`}>{prefix}</span>
       <span onFocus={this.handleNumFocus}

+ 3 - 10
src/components/NumberUnitDrop/index.jsx

@@ -3,7 +3,7 @@ import className from 'classnames';
 import {NumberUnitPan} from '@commonComp';
 import style from './index.less';
 import config from '@config/index.js';
-import {filterArr,handleEnter,isIE,filterDataArr,setFontColorSize} from '@utils/tools.js';
+import {filterArr,handleEnter,isIE,filterDataArr,setFontColorSize,handleMouseUp} from '@utils/tools.js';
 import {Notify} from '@commonComp';
 import $ from 'jquery';
 /***
@@ -67,13 +67,6 @@ class NumberUnitDrop extends Component{
     });
     handleHide&&handleHide();
   }
-
-  handleMouseUp(){
-    const {select_start,i,setSelectArea,boxMark}= this.props;
-    if(select_start!==undefined){
-      setSelectArea({i,boxMark,dir:'end'});
-    }
-  }
   handleMouseDown(){
     const {i,setSelectArea,boxMark}= this.props;
     setSelectArea({i,boxMark,dir:'start'});
@@ -103,11 +96,11 @@ class NumberUnitDrop extends Component{
   }
 
   render(){
-    const {placeholder,prefix,suffix,show,value,handleHide,hideTag,isExtBlue} = this.props;
+    const {placeholder,prefix,suffix,show,value,handleHide,select_start,i,boxMark} = this.props;
     const {editable,hasSelect} = this.state;
     return <div className={this.getClasses()}
                 ref={this.$cont}
-                onMouseUp={this.handleMouseUp.bind(this)}
+                onMouseUp={()=>handleMouseUp({select_start,i,boxMark})}
                 onMouseDown={this.handleMouseDown.bind(this)}
                 onClick={this.handleNumClick}>
       <span ref = {this.$pre} className="prefixUnset">{prefix?prefix+' ':prefix}</span>

+ 0 - 1
src/components/Operation/Search/index.jsx

@@ -71,7 +71,6 @@ class SearchList extends React.Component {
       this.setState({border:false,val:''})
     }
     componentWillReceiveProps(next){
-        console.log(next.value)
         if(next.value&&(next.value != this.props.value)){
             this.textInput.current.value = next.value;
         }

+ 68 - 59
src/components/Operation/index.jsx

@@ -10,7 +10,7 @@ import { ConfirmModal, Notify } from '@commonComp';
 import Search from './Search';
 import check_circle from './img/check-circle.png';
 import check_right from './img/check-right.png';
-import {getAllDataList,getAllDataStringList,isAllPartClear,isAllClear,filterDataArr,readyKeepHistory} from '@utils/tools';
+import {getAllDataList,getAllDataStringList,isAllPartClear,isAllClear,filterDataArr,readyKeepHistory,checkDeptContent} from '@utils/tools';
 
 import {dragBox} from '@utils/drag';
 import store from '@store';
@@ -101,8 +101,8 @@ class Operation extends Component {
     let jsonData = getAllDataList(baseList);
     let jsonStr = getAllDataStringList(baseList);
     let flg = isAllPartClear(jsonData,jsonStr,baseList);
-    const tpVal = $("#clearTemplateSearch").prev().val();   //模板是否有搜索条件未清空
-    const mdVal = $("#clearMedicalInfoSearch").prev().val();    //知识是否有搜索条件未清空
+    const tpVal = $("#templateSearch").val();   //模板是否有搜索条件未清空
+    const mdVal = $("#medicalInfoSearch").val();    //知识是否有搜索条件未清空
     if(flg||tpVal||mdVal){
       this.setState({
         type: type,
@@ -136,64 +136,51 @@ class Operation extends Component {
   }
   saveHis(type) {
     const { diagShowTmp } = this.props;
-    let flg = this.getAllData();
-    if(flg){
-      this.setState({
-        title: '',
-        sex:'3',
-        type: type,
-        okText: '保存',
-        borderColor: '#3B9ED0',
-        okColor: '#fff',
-        oKBg: '#3B9ED0',
-        msg: this.changeTitle()
-      })
-      diagShowTmp(true)
-    }
-  }
-  getAllData(){
     let baseList = store.getState();
-    let jsonData = getAllDataList(baseList);
     let jsonStr = getAllDataStringList(baseList);
-    let whichSign = baseList.typeConfig.mode;
     let tmpLis = [];
     let flg = isAllClear(jsonStr);
     if(!flg){
-      Notify.info('模板数据不能为空')
-      return false
+      Notify.info('模板数据不能为空');
+      return false;
     }
-    // console.log(jsonStr.chief,'文本')
-    // console.log(jsonData,'结构')       //测试需要用到,不要删了
-    // console.log(tmpLis,'接口返回的')
-    if(this.props.admin){
-      tmpLis = baseList.tabTemplate.adminItems;
-    }else{
+    if(!this.props.admin){
       tmpLis = baseList.tabTemplate.items;
-    }
-    for(let i = 0;i <tmpLis.length;i++){
-      let dataStr = tmpLis[i].preview;
-      if(
-        filterDataArr(JSON.parse(jsonStr.chief)) == filterDataArr(eval('('+JSON.parse(dataStr).chief+')')) && 
-        filterDataArr(JSON.parse(jsonStr.present)) == filterDataArr(eval('('+JSON.parse(dataStr).present+')')) && 
-        filterDataArr(JSON.parse(jsonStr.other)) == filterDataArr(eval('('+JSON.parse(dataStr).other+')')) && 
-        filterDataArr(JSON.parse(jsonStr.vital)) == filterDataArr(eval('('+JSON.parse(dataStr).vital+')')) &&
-        jsonStr.lis == JSON.parse(dataStr).lis &&
-        jsonStr.pacs == JSON.parse(dataStr).pacs &&
-        jsonStr.diag == JSON.parse(dataStr).diag &&
-        jsonStr.advice == JSON.parse(dataStr).advice
-      ){
-        Notify.info('该模板已保存');
-        return false;
+      for(let i = 0;i <tmpLis.length;i++){
+        let dataStr = tmpLis[i].preview;
+        if(
+          filterDataArr(JSON.parse(jsonStr.chief)) == filterDataArr(eval('('+JSON.parse(dataStr).chief+')')) && 
+          filterDataArr(JSON.parse(jsonStr.present)) == filterDataArr(eval('('+JSON.parse(dataStr).present+')')) && 
+          filterDataArr(JSON.parse(jsonStr.other)) == filterDataArr(eval('('+JSON.parse(dataStr).other+')')) && 
+          filterDataArr(JSON.parse(jsonStr.vital)) == filterDataArr(eval('('+JSON.parse(dataStr).vital+')')) &&
+          jsonStr.lis == JSON.parse(dataStr).lis &&
+          jsonStr.pacs == JSON.parse(dataStr).pacs &&
+          jsonStr.diag == JSON.parse(dataStr).diag &&
+          jsonStr.advice == JSON.parse(dataStr).advice
+        ){
+          Notify.info('该模板已保存');
+          return false;
+        }
       }
     }
-    return true;
+    this.setState({
+      title: '',
+      sex:'3',
+      type: type,
+      okText: '保存',
+      borderColor: '#3B9ED0',
+      okColor: '#fff',
+      oKBg: '#3B9ED0',
+      msg: this.changeTitle()
+    })
+    diagShowTmp(true)
   }
   changeTitle() {
     return <div className={style['box']}>
       {/* <div className={style.titleTip}></div> */}
       <div className={style['iptWrap']}>
         <div className={style.name}>
-          <span>模版名称:</span>
+          <span>模名称:</span>
           <input className={style['ipt']}
             placeholder="请输入模板名称"
             type="text"
@@ -272,6 +259,26 @@ class Operation extends Component {
         return;
       }
       if(admin){
+        let baseList = store.getState();
+        let tmpLis = baseList.tabTemplate.adminItems||[];
+        let jsonStr = getAllDataStringList(baseList);
+        for(let i = 0;i <tmpLis.length;i++){
+          let dataStr = tmpLis[i].preview;
+          if(
+            filterDataArr(JSON.parse(jsonStr.chief)) == filterDataArr(eval('('+JSON.parse(dataStr).chief+')')) && 
+            filterDataArr(JSON.parse(jsonStr.present)) == filterDataArr(eval('('+JSON.parse(dataStr).present+')')) && 
+            filterDataArr(JSON.parse(jsonStr.other)) == filterDataArr(eval('('+JSON.parse(dataStr).other+')')) && 
+            filterDataArr(JSON.parse(jsonStr.vital)) == filterDataArr(eval('('+JSON.parse(dataStr).vital+')')) &&
+            jsonStr.lis == JSON.parse(dataStr).lis &&
+            jsonStr.pacs == JSON.parse(dataStr).pacs &&
+            jsonStr.diag == JSON.parse(dataStr).diag &&
+            jsonStr.advice == JSON.parse(dataStr).advice&&
+            deptId == tmpLis[i].hospitalDeptId
+          ){
+            Notify.info('该模板已保存');
+            return false;
+          }
+        }
         saveDataAlls(title,sex,deptId);
       }else{
         saveDataAll(title,sex);
@@ -283,10 +290,10 @@ class Operation extends Component {
     const { type } = this.state;
     if (type == 3){
       diagShowTmp(false)
-      this.setState({ title: '' })
+      this.setState({ title: '',deptId:"",value:"" })
     }else{
       diagShowTmp(false)
-      this.setState({ title: '' }) 
+      this.setState({ title: '',deptId:"",value:"" }) 
     }
   }
   setDeptId(id,name){
@@ -346,17 +353,19 @@ class Operation extends Component {
         {
           admin&&type==3?<div className={style.department}>
               <span>科室归属:</span>
-              <Search handleChangeValue={handleChangeValue} handleChangeIpt={handleChangeIpt} value={value} visible={true}>
-                <ul className={style.departLis}>
-                  {
-                    departLis.map((item,idx)=>{
-                      return <li onClick={()=>this.setDeptId(item.id,item.conceptDeptName)}>
-                        {item.conceptDeptName}
-                      </li>
-                    })
-                  }
-                </ul>
-              </Search>
+                <Search handleChangeValue={handleChangeValue} handleChangeIpt={handleChangeIpt} value={value} visible={true}>
+                {
+                  departLis.length>0&&value&&<ul className={style.departLis}>
+                    {
+                      departLis.map((item,idx)=>{
+                        return <li onClick={()=>this.setDeptId(item.id,item.conceptDeptName)}>
+                          {item.conceptDeptName}
+                        </li>
+                      })
+                    }
+                  </ul>
+                }
+                </Search>
               <span style={{paddingRight:0,color:'#777777'}}>(支持汉字关键字搜索)</span>
           </div>:null
         }

BIN
src/components/PreInIcss/RotateImg copy/img/closeImg.png


BIN
src/components/PreInIcss/RotateImg copy/img/imgBgActive.png


BIN
src/components/PreInIcss/RotateImg copy/img/nextImg.png


BIN
src/components/PreInIcss/RotateImg copy/img/plus.png


BIN
src/components/PreInIcss/RotateImg copy/img/prevImg.png


BIN
src/components/PreInIcss/RotateImg copy/img/reduce.png


BIN
src/components/PreInIcss/RotateImg copy/img/rotated.png


+ 229 - 0
src/components/PreInIcss/RotateImg copy/index.jsx

@@ -0,0 +1,229 @@
+import React, { Component } from "react";
+import $ from "jquery";
+import style from "./index.less";
+import ReactDom from "react-dom";
+import closeImg from "./img/closeImg.png";
+import imgBgActive from "./img/imgBgActive.png";
+import plus from "./img/plus.png";
+import reduce from "./img/reduce.png";
+import nextImg from "./img/nextImg.png";
+import prevImg from "./img/prevImg.png";
+import rotated from "./img/rotated.png";
+import {imgDragMove} from '@utils/drag';
+
+class RotateImg extends Component {
+  constructor(props){
+    super(props);
+    this.state={
+      de:0,
+      current:0,
+      length:0,
+      imgWidth:'auto',
+      imgHeight:'auto',
+      mgLeft:'',
+      mgTop:'',
+      left:'50%',
+      top:'50%'
+    }
+    this.handlePrev = this.handlePrev.bind(this)
+    this.handleNext = this.handleNext.bind(this)
+    this.handleRotate = this.handleRotate.bind(this)
+    this.handlePlus = this.handlePlus.bind(this)
+    this.handleReduce = this.handleReduce.bind(this)
+  }
+  componentWillReceiveProps(next){
+    console.log(next.windowHeight,this.props.windowHeight)
+  }
+  componentDidMount(){
+    imgDragMove('add')
+    const { idx,imgLis } = this.props;
+    let currentImg = imgLis[idx];
+    let width = currentImg.width,height = currentImg.height;
+    if(width>height){
+      if(width > 750){
+        width=750
+        height=height*750/width
+      }
+    }else{
+      if(height > 750){
+        height = 750
+        width = width*750/height
+      }
+    }
+    this.setState({
+      current:idx,
+      length:imgLis.length,
+      imgWidth:width,
+      imgHeight:height,
+      mgLeft:-width/2,
+      mgTop:-height/2
+    })
+  }
+  getStyle(){
+    const { imgDetail,idx,imgLis } = this.props;
+    let currentImg = imgLis[this.state.current];
+    let width = currentImg.width,height = currentImg.height;
+    let isLorR = width > height;
+    return {
+      width:width,
+      height:height,
+      marginLeft:-width/2,
+      marginTop:-height/2
+    }
+  }
+  handleNext(){
+    this.props.setMove(false)
+    const { imgLis,isMove } = this.props;
+    let tmpIdx = this.state.current;
+    let tmpLen = this.state.length,width,height;
+    if(tmpIdx == tmpLen-1){
+      width = imgLis[0].width
+      height = imgLis[0].height
+    }else{
+      width = imgLis[tmpIdx+1].width
+      height = imgLis[tmpIdx+1].height
+    }
+    if(width>height){
+      if(width > 750){
+        width=750
+        height=height*750/width
+      }
+    }else{
+      if(height > 750){
+        height = 750
+        width = width*750/height
+      }
+    }
+    let imgDom = this.refs.rotateImg.getDOMNode();
+    $(imgDom).css({
+      left:'50%',
+      top:'50%'
+    })
+    this.setState({
+      current:tmpIdx == tmpLen-1?0:(tmpIdx+1),
+      imgWidth:width,
+      imgHeight:height,
+      mgLeft:-width/2,
+      mgTop:-height/2,
+      de:0
+    })
+  }
+  handlePrev(){
+    const { imgLis } = this.props;
+    let tmpIdx = this.state.current;
+    let tmpLen = this.state.length,width,height;
+    if(tmpIdx == 0){
+      width = imgLis[tmpLen-1].width
+      height = imgLis[tmpLen-1].height
+    }else{
+      width = imgLis[tmpIdx-1].width
+      height = imgLis[tmpIdx-1].height
+    }
+    if(width>height){
+      if(width > 750){
+        width=750
+        height=height*750/width
+      }
+    }else{
+      if(height > 750){
+        height = 750
+        width = width*750/height
+      }
+    }
+    let imgDom = this.refs.rotateImg.getDOMNode();
+    $(imgDom).css({
+      left:'50%',
+      top:'50%'
+    })
+    this.setState({
+      current:tmpIdx == 0?tmpLen-1:tmpIdx-1,
+      imgWidth:width,
+      imgHeight:height,
+      mgLeft:-width/2,
+      mgTop:-height/2,
+      de:0
+    })
+    this.props.setMove(false)
+  }
+  handlePlus(){
+    const {imgWidth,imgHeight,isMove} = this.state;
+    if(this.props.isMove){
+      this.setState({
+        imgWidth:1.2*imgWidth,
+        imgHeight:1.2*imgHeight
+      })
+      return;
+    }
+    this.setState({
+      imgWidth:1.2*imgWidth,
+      imgHeight:1.2*imgHeight,
+      mgLeft:-imgWidth*1.2/2,
+      mgTop:-imgHeight*1.2/2
+    })
+  }
+  handleReduce(){
+    const {imgWidth,imgHeight} = this.state;
+    if(this.props.isMove){
+      this.setState({
+        imgWidth:imgWidth*0.8,
+        imgHeight:imgHeight*0.8
+      })
+      return;
+    }
+    this.setState({
+      imgWidth:imgWidth*0.8,
+      imgHeight:imgHeight*0.8,
+      mgLeft:-imgWidth*0.8/2,
+      mgTop:-imgHeight*0.8/2
+    })
+  }
+  handleRotate(flg){
+    let deg = this.state.de;
+    if(flg){
+      deg = deg-90
+    }else{
+      deg = deg-0+90
+    }
+    this.setState({
+      de:deg
+    })
+  }
+
+  render() {
+    const { imgLis,handleClose } = this.props;
+    const { current,imgWidth,imgHeight,mgLeft,mgTop,de,left,top } = this.state;
+
+    const domNode = document.getElementById('root');
+    return ReactDom.createPortal(<div className={style.preImgWrap}>
+      <div className={style.modal} onClick={handleClose}></div>
+      <div className={style.mainWrap}>
+        <div className={style.imgWrap} id="previewWrapper">
+            <img className={style.rotateImg}
+              id="drugImg"
+              ref="rotateImg" 
+              src={imgLis[current].originalImage} 
+              style={{
+                width:imgWidth+'px',
+                height:imgHeight+'px',
+                marginLeft:mgLeft+'px',
+                marginTop:mgTop+'px',
+                transform:"rotate(" + de + "deg)",
+                left:left,
+                top:top,
+              }}
+              alt="预览图片"/>
+          <div className={style.activeBar}>
+            <img className={style.plus} src={plus} onClick={this.handlePlus} alt="图片放大"/>
+            <img className={style.reduce} src={reduce} onClick={this.handleReduce} alt="图片缩小"/>
+            <img className={style.rotate} src={rotated} onClick={this.handleRotate} alt="图片旋转"/>
+          </div>
+          <img src={closeImg} onClick={handleClose} className={style.close} alt="close"/>
+        </div>
+          <img src={nextImg} className={style.next} onClick={this.handleNext} alt="下一张"/>
+          <img src={prevImg} className={style.prev} onClick={this.handlePrev} alt="上一张"/>
+      </div>
+    </div>,domNode)
+  }
+}
+
+export default RotateImg;

+ 104 - 0
src/components/PreInIcss/RotateImg copy/index.less

@@ -0,0 +1,104 @@
+.preImgWrap {
+  .modal {
+    position: fixed;
+    left: 0;
+    top: 0;
+    z-index: 100;
+    width: 100%;
+    height: 100%;
+    background-color: #000;
+    opacity: 0.6;
+    filter: alpha(opacity=60);
+    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=60);";
+  }
+  .imgWrap {
+    // margin-left: -500px;
+    // left: 50%;
+    // width: 1000px;
+    // top: 7%;
+    // bottom: 7%;
+    // height: 86%;
+    z-index: 100;
+    position: fixed;
+    width: 750px;
+    height: 750px;
+    left: 50%;
+    top: 50%;
+    margin-left: -375px;
+    margin-top: -375px;
+    background-color: #fff;
+    overflow: hidden;
+    .close {
+      position: absolute;
+      right: 20px;
+      top: 20px;
+      cursor: pointer;
+    }
+    .imgDiv {
+      position: absolute;
+      width: 750px;
+      height: 750px;
+      left: 50%;
+      top: 50%;
+      margin-left: -375px;
+      margin-top: -375px;
+      overflow: hidden;
+    }
+    .rotateImg {
+      position: absolute;
+      cursor: move;
+      // left: 50%;
+      // top: 50%;
+      // transform: translateX(-50%) translateY(-50%);
+    }
+    .activeBar {
+      width: 400px;
+      height: 40px;
+      background-color: #9B979A;
+      position: absolute;
+      bottom: 0;
+      left: 50%;
+      margin-left: -200px;
+      border-radius: 4px 4px 0 0;
+      text-align: center;
+      // display: none;
+      img {
+        margin: 10px 0px;
+        padding: 3px 20px;
+        cursor: pointer;
+      }
+      
+      .rotate {
+    
+      }  
+      .plus,.reduce {
+        border-right: 1px solid #7A7779;
+      }  
+    }
+  }
+  .mainWrap {
+    position: absolute;
+    width: 900px;
+    height: 900px;
+    left: 50%;
+    top: 50%;
+    margin-left: -450px;
+    margin-top: -450px;
+    .next {
+      cursor: pointer;
+      position: absolute;
+      z-index: 102;
+      top: 50%;
+      margin-top: -20px;
+      right: 0;
+    }
+    .prev {
+      cursor: pointer;
+      position: absolute;
+      z-index: 102;
+      top: 50%;
+      margin-top: -20px;
+      left: 0;
+    }
+  }
+}

+ 60 - 38
src/components/PreInIcss/RotateImg/index.jsx

@@ -33,20 +33,22 @@ class RotateImg extends Component {
   }
   componentDidMount(){
     imgDragMove('add')
-    const { idx,imgLis } = this.props;
+    const { idx,imgLis,windowHeight } = this.props;
     let currentImg = imgLis[idx];
-    let width = currentImg.width,height = currentImg.height;
+    let scaleHeight = windowHeight*0.8;
+    let width = currentImg.width,height = currentImg.height,overLen;
     if(width>height){
-      if(width > 750){
-        width=750
-        height=height*750/width
+      if(width > scaleHeight){
+        height=scaleHeight/width*height
+        width=scaleHeight
       }
     }else{
-      if(height > 750){
-        height = 750
-        width = width*750/height
+      if(height > scaleHeight){
+        width = scaleHeight/height*width
+        height = scaleHeight
       }
     }
+    localStorage.setItem("changeImg",true)
     this.setState({
       current:idx,
       length:imgLis.length,
@@ -54,25 +56,18 @@ class RotateImg extends Component {
       imgHeight:height,
       mgLeft:-width/2,
       mgTop:-height/2
+    },()=>{
+      let overLenL = $("#drugImg").offset().left-$("#previewWrapper").offset().left
+      let overLenT = $("#drugImg").offset().top-$("#previewWrapper").offset().top
+      localStorage.setItem("changeImg",width>height?overLenT:overLenL)
     })
   }
-  getStyle(){
-    const { imgDetail,idx,imgLis } = this.props;
-    let currentImg = imgLis[this.state.current];
-    let width = currentImg.width,height = currentImg.height;
-    let isLorR = width > height;
-    return {
-      width:width,
-      height:height,
-      marginLeft:-width/2,
-      marginTop:-height/2
-    }
-  }
   handleNext(){
     this.props.setMove(false)
-    const { imgLis,isMove } = this.props;
+    const { imgLis,isMove,windowHeight } = this.props;
+    let scaleHeight = windowHeight*0.8;
     let tmpIdx = this.state.current;
-    let tmpLen = this.state.length,width,height;
+    let tmpLen = this.state.length,width,height,overLen;
     if(tmpIdx == tmpLen-1){
       width = imgLis[0].width
       height = imgLis[0].height
@@ -81,14 +76,14 @@ class RotateImg extends Component {
       height = imgLis[tmpIdx+1].height
     }
     if(width>height){
-      if(width > 750){
-        width=750
-        height=height*750/width
+      if(width > scaleHeight){
+        height=scaleHeight/width*height
+        width=scaleHeight
       }
     }else{
-      if(height > 750){
-        height = 750
-        width = width*750/height
+      if(height > scaleHeight){
+        width = scaleHeight/height*width
+        height = scaleHeight
       }
     }
     let imgDom = this.refs.rotateImg.getDOMNode();
@@ -103,10 +98,15 @@ class RotateImg extends Component {
       mgLeft:-width/2,
       mgTop:-height/2,
       de:0
+    },()=>{
+      let overLenL = $("#drugImg").offset().left-$("#previewWrapper").offset().left
+      let overLenT = $("#drugImg").offset().top-$("#previewWrapper").offset().top
+      localStorage.setItem("changeImg",width>height?overLenT:overLenL)
     })
   }
   handlePrev(){
-    const { imgLis } = this.props;
+    const { imgLis,windowHeight } = this.props;
+    let scaleHeight = windowHeight*0.8;
     let tmpIdx = this.state.current;
     let tmpLen = this.state.length,width,height;
     if(tmpIdx == 0){
@@ -117,14 +117,14 @@ class RotateImg extends Component {
       height = imgLis[tmpIdx-1].height
     }
     if(width>height){
-      if(width > 750){
-        width=750
-        height=height*750/width
+      if(width > scaleHeight){
+        height=scaleHeight/width*height
+        width=scaleHeight
       }
     }else{
-      if(height > 750){
-        height = 750
-        width = width*750/height
+      if(height > scaleHeight){
+        width = scaleHeight/height*width
+        height = scaleHeight
       }
     }
     let imgDom = this.refs.rotateImg.getDOMNode();
@@ -139,6 +139,10 @@ class RotateImg extends Component {
       mgLeft:-width/2,
       mgTop:-height/2,
       de:0
+    },()=>{
+      let overLenL = $("#drugImg").offset().left-$("#previewWrapper").offset().left
+      let overLenT = $("#drugImg").offset().top-$("#previewWrapper").offset().top
+      localStorage.setItem("changeImg",width>height?overLenT:overLenL)
     })
     this.props.setMove(false)
   }
@@ -151,6 +155,8 @@ class RotateImg extends Component {
       })
       return;
     }
+    localStorage.setItem("changeImg",true)
+
     this.setState({
       imgWidth:1.2*imgWidth,
       imgHeight:1.2*imgHeight,
@@ -167,6 +173,8 @@ class RotateImg extends Component {
       })
       return;
     }
+    localStorage.setItem("changeImg",true)
+
     this.setState({
       imgWidth:imgWidth*0.8,
       imgHeight:imgHeight*0.8,
@@ -176,27 +184,41 @@ class RotateImg extends Component {
   }
   handleRotate(flg){
     let deg = this.state.de;
+    let tmpWidth = this.state.imgWidth;
+    let tmpHeight = this.state.imgHeight;
     if(flg){
       deg = deg-90
     }else{
       deg = deg-0+90
     }
     this.setState({
+      // imgWidth:tmpHeight,
+      // imgHeight:tmpWidth,
+      // mgLeft:-tmpHeight/2,
+      // mgTop:-tmpWidth/2,
       de:deg
     })
   }
+
   render() {
-    const { imgLis,handleClose } = this.props;
+    const { imgLis,handleClose,windowHeight } = this.props;
     const { current,imgWidth,imgHeight,mgLeft,mgTop,de,left,top } = this.state;
-
     const domNode = document.getElementById('root');
     return ReactDom.createPortal(<div className={style.preImgWrap}>
       <div className={style.modal} onClick={handleClose}></div>
       <div className={style.mainWrap}>
-        <div className={style.imgWrap} id="previewWrapper">
+        <div className={style.imgWrap}
+          id="previewWrapper"
+          style={{
+            width:0.8*windowHeight+'px',
+            height:0.8*windowHeight+'px',
+            marginLeft:-0.8*windowHeight/2+'px',
+            marginTop:-0.8*windowHeight/2+'px'
+          }}>
             <img className={style.rotateImg}
               id="drugImg"
               ref="rotateImg" 
+              data-deg={de}
               src={imgLis[current].originalImage} 
               style={{
                 width:imgWidth+'px',

+ 2 - 1
src/components/PreInIcss/SliddleTgl/index.jsx

@@ -62,7 +62,7 @@ class SlideTgl extends Component {
     })
   }
   render() {
-    const { item,showPre,isMove,setMove } = this.props;
+    const { item,showPre,isMove,setMove,windowHeight } = this.props;
     return <li>
     <div className={style.current} ref="current" style={{height:this.state.slide?'18px':'auto'}}>
       <p className={style.curStyle}><span>现病史:</span>{item.detail.xbs}</p>
@@ -93,6 +93,7 @@ class SlideTgl extends Component {
         imgShow={this.state.imgShow}
         imgLis={this.state.imgList}
         isMove = {isMove}
+        windowHeight = {windowHeight}
         setMove = {setMove}
         handleClose={this.handleClose}
         idx={this.state.idx}></RotateImg>:null}

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

@@ -21,11 +21,11 @@ class PreIcss extends Component {
           data.map((item,index)=>{
             return <div className={style.mainPre}>
               <ul>
-                <li><span>预问诊录入时间:</span>{item.gmtCreate}</li>
+                <li><span>预问诊录入时间:</span>{item.gmtModified}</li>
                 <li><span>录入选择医院:</span>{item.sonHospitalName?item.sonHospitalName:item.hospitalName}</li>
                 <li><span>科室:</span>{item.hospitalDeptName}</li>
                 <li><span>主诉:</span>{item.detail.chiefComplaint}</li>
-                <SlideTgl showPre={showPre} item={item} isMove={isMove} setMove={setMove}></SlideTgl>
+                <SlideTgl windowHeight={windowHeight} showPre={showPre} item={item} isMove={isMove} setMove={setMove}></SlideTgl>
               </ul>
             </div>
           })

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

@@ -45,6 +45,7 @@
       }
       .curStyle {
         padding: 0 0 5px 0;
+        line-height: 18px;
       }
       .slideTgl {
         line-height: 18px;

+ 9 - 1
src/components/PreviewBody/Inspect/index.jsx

@@ -35,7 +35,15 @@ const PreviewInspect = (props) => {
           dataJson&&dataJson.labelList && dataJson.labelList.map((item, idx) => {
             return <table style={{ margin: '8px 0', width: '100%' }}>
               {
-                item.show?<tr className={style.assistTableTrFst}><td><span> {item.name} </span></td></tr>:
+                item.show?<tr className={style.assistTableTrFst}>
+                  <td colSpan='4'>
+                    <span> {item.name} </span> 
+                    <p style={{display:item.inpValue?'inline-block':'none'}}>
+                      ({item.inpValue})
+                      <i></i>
+                    </p>
+                    </td>
+                </tr>:
                 <tr className={style.assistTableTrFstExcel}><td><span>「{item.name}」</span></td></tr>
               }
               {

+ 2 - 0
src/components/PreviewBody/index.jsx

@@ -7,6 +7,7 @@ import PreviewInspect from './Inspect';
 import ItemPart from './ItemPart';
 import $ from "jquery";
 import AssessResultHis from '@containers/AssessResultHis';
+import { dragBox } from '@utils/drag';
 
 class PreviewBody extends Component {
   constructor(props) {
@@ -39,6 +40,7 @@ class PreviewBody extends Component {
       return false;
     } else {
       this.onPrint();
+      dragBox('previewPrintWrapper','previewPrintStatic','del')
       this.props.save(true)
     }
   }

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

@@ -82,9 +82,23 @@ table{
 .assistTableTrFst {
   font-size: 14px;
   line-height: 1.5;
+  .ediName {
+    width: 100%;
+  }
   span {
     border-bottom: 1px solid #666666;
   }
+  p {
+    display: inline-block;
+    margin-left: 10px;   
+    color: #3B9ED0;
+    font-size: 12px;
+    margin-left: 10px;
+    background-color: #EDF8FF;
+    padding: 0 5px;
+    max-width: 490px;
+    float: right;
+  }
 }
 .assistTableTdFst {
   width: 32%;

+ 10 - 5
src/components/PushContainer/index.jsx

@@ -43,6 +43,7 @@ class PushContainer extends Component {
       oKBg: '',
       okColor: 'red',
       num: 0,          //计数
+      deptId:'',       //科室id
     }
     this.$cont = React.createRef();
     this.itemList = null;
@@ -71,7 +72,7 @@ class PushContainer extends Component {
    * @param {tab组件切换id} id
    */
   handleActiveClick(id) {
-    if (id == '1') {
+    if (id == '2') {
       store.dispatch(initItemList(1,0));
     }
     store.dispatch(tabChange(id))
@@ -121,7 +122,7 @@ class PushContainer extends Component {
   delDiv() {
     return <p className={style['center']}>确认删除模板?</p>
   }
-  onchange(value) {
+  onchange(value,deptId) {
     this.setState({
       title: value
     }, () => {
@@ -162,13 +163,14 @@ class PushContainer extends Component {
    * 改变模板标题
    * @param {模板id和模板title} obj
    */
-  handleTitleChange(id, text) {
+  handleTitleChange(id, text,deptId) {
     store.dispatch(changeVisible(true))
     this.setState({
       type: 3,
       currId: id,
       title: text,
       text: text,
+      deptId: deptId,
       okText: '保存',
       okBorderColor: '#3B9ED0',
       okColor: '#fff',
@@ -254,7 +256,8 @@ class PushContainer extends Component {
       }
       let tempObj = {
         id: this.state.currId,
-        title: this.state.title
+        title: this.state.title,
+        deptId:this.state.deptId
       }
       if(this.props.admin){
         store.dispatch(changeTitleAsyncAdmin(tempObj))
@@ -274,7 +277,7 @@ class PushContainer extends Component {
     store.dispatch(changeVisible(false));
   }
   render() {
-    const { activeId, checkItems, visible, showMsg,hasMore,current, items, allCheckShow,allCheckShowAdmin,adminItems,admin,checkItemsAdmin } = this.props;
+    const { activeId, checkItems, visible, showMsg,hasMore,current, items, allCheckShow,allCheckShowAdmin,adminItems,admin,checkItemsAdmin,clearSearch } = this.props;
     return <div className={style["container"]} ref={this.$cont} >
       <Tab tabs={this.state.tabs}
         activeId={activeId}
@@ -285,6 +288,7 @@ class PushContainer extends Component {
           <CaseQuailty></CaseQuailty>
           <TemplateItems
             items={items}
+            clearSearch={clearSearch}
             adminItems={adminItems}
             admin={admin}
             handleAllCheckboxAdmin={this.handleAllCheckboxAdmin}
@@ -341,6 +345,7 @@ const mapStateToProps = (state) => {//console.log(state)
     allCheckedAdmin: state.tabTemplate.allCheckedAdmin,
     allCheckShowAdmin: state.tabTemplate.allCheckShowAdmin,
     checkItemsAdmin: state.tabTemplate.checkItemsAdmin,
+    clearSearch:state.print.clearSearch,
   }
 }
 

+ 4 - 10
src/components/RadioDrop/index.jsx

@@ -1,5 +1,5 @@
 import React,{Component} from 'react';
-import {handleEnter,windowEventHandler,setFontColorSize} from '@utils/tools.js';
+import {handleEnter,windowEventHandler,setFontColorSize,handleMouseUp} from '@utils/tools.js';
 import {DropList} from '@commonComp';
 import classNames from 'classnames';
 import style from "./index.less";
@@ -149,18 +149,12 @@ class RadioDrop extends Component{
     })
     handleDbclick&&handleDbclick({id:patId||id});
   }
-  handleMouseUp(){
-    const {select_start,i,setSelectArea,boxMark}= this.props;
-    if(select_start!==undefined){
-      setSelectArea({i,boxMark,dir:'end'});
-    }
-  }
   handleMouseDown(){
     const {i,setSelectArea,boxMark}= this.props;
-    setSelectArea({i,boxMark,dir:'start'});
+    !this.state.editable&&setSelectArea({i,boxMark,dir:'start'});
   }
   render(){
-    const {data,placeholder,show,value,hideTag,boxMark} = this.props;
+    const {data,placeholder,show,value,hideTag,boxMark,select_start,i} = this.props;
     const {tmpDom} = this.state
     if(!show&&tmpDom){
       $(tmpDom).parent().prev().attr({"contentEditable":true})
@@ -172,7 +166,7 @@ class RadioDrop extends Component{
            onDoubleClick={hideTag?null:this.handledbClick}
            onFocus={(e)=>{e.stopPropagation()}}
            onClick={(e)=>this.handleShow(e,true)}
-           onMouseUp={this.handleMouseUp.bind(this)}
+           onMouseUp={()=>handleMouseUp({select_start,i,boxMark})}
            onMouseDown={this.handleMouseDown.bind(this)}
            onKeyDown={handleEnter}>
         {value||placeholder}

+ 3 - 9
src/components/RadioInpDrop/index.jsx

@@ -1,5 +1,5 @@
 import React,{Component} from 'react';
-import {handleEnter,windowEventHandler,filterDataArr,getLabelIndex,setFontColorSize} from '@utils/tools.js';
+import {handleEnter,windowEventHandler,filterDataArr,getLabelIndex,setFontColorSize,handleMouseUp} from '@utils/tools.js';
 import {DropList,Notify} from '@commonComp';
 import config from '@config/index';
 import style from "./index.less";
@@ -96,12 +96,6 @@ class RadioInpDrop extends Component{
     });
     handleSaveInp({values:vals,ikey,boxMark,mainSaveText});
   }
-  handleMouseUp(){
-    const {select_start,i,setSelectArea,boxMark}= this.props;
-    if(select_start!==undefined){
-      setSelectArea({i,boxMark,dir:'end'});
-    }
-  }
   handleMouseDown(){
     const {i,setSelectArea,boxMark}= this.props;
     setSelectArea({i,boxMark,dir:'start'});
@@ -129,11 +123,11 @@ class RadioInpDrop extends Component{
     return list;
   }
   render(){
-    const {data,show,vals,placeholder} = this.props;
+    const {data,show,vals,placeholder,select_start,i,boxMark} = this.props;
     return <div className={style['container']} ref = {this.$cont}>
       <div className={this.getClass()}
            onClick={(e)=>this.handleShow(e)}
-           onMouseUp={this.handleMouseUp.bind(this)}
+           onMouseUp={()=>handleMouseUp({select_start,i,boxMark})}
            onMouseDown={this.handleMouseDown.bind(this)}
            onKeyDown={handleEnter}>
         {vals?this.parseInputDom():<span className='inheritStyle'>{placeholder}</span>}

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

@@ -2,7 +2,7 @@ import React,{Component} from 'react';
 import classNames from 'classnames';
 import config from '@config/index.js';
 import style from './index.less';
-import {setPosition,deepClone,handleEnter,isIE,windowEventHandler,filterDataArr,getIds,getPageCoordinate,setFontColorSize} from '@utils/tools.js';
+import {setPosition,deepClone,handleEnter,isIE,windowEventHandler,filterDataArr,getIds,getPageCoordinate,setFontColorSize,handleMouseUp} from '@utils/tools.js';
 import {Notify} from '@commonComp';
 import ListItems from '@components/ListItems';
 import CommonSymptom from '@components/CommonSymptom';
@@ -374,15 +374,9 @@ class SpreadDrop extends Component{
     const showDefaulted = ((type=='2'&&curDefault)||(type=='3'&&otherDefault))&&showVal;
     return showDefaulted;
   }
-  handleMouseUp(){
-    const {select_start,i,setSelectArea,boxMark}= this.props;
-    if(select_start!==undefined){
-      setSelectArea({i,boxMark,dir:'end'});
-    }
-  }
   handleMouseDown(){
     const {i,setSelectArea,boxMark}= this.props;
-    setSelectArea({i,boxMark,dir:'start'});
+    !this.state.editable&&setSelectArea({i,boxMark,dir:'start'});
   }
   componentDidMount(){
     if(isIE()){
@@ -392,11 +386,11 @@ class SpreadDrop extends Component{
     }
   }
   render(){
-    const {placeholder,value,show,data,order,type,tagType,pos,defaulted,showVal,CommonSymptoms} = this.props;
+    const {placeholder,value,show,data,order,type,tagType,pos,defaulted,showVal,CommonSymptoms,select_start,i,boxMark} = this.props;
     const {tmpDom,left} = this.state;
     let showDefaulted = this.ifDefault();
-    let showV = showDefaulted&&value===undefined?showVal:value;       //未选中过值时展示默认选中
-    const noPushData = (+tagType===11)&&(!data[1]||data[1].questionDetailList.length===0);    //无推送数据
+    let showV = showDefaulted&&value===undefined?showVal:value;      //未选中过值时展示默认选中
+    const noPushData = (+tagType===11)&&(!data[1]||!data[1].questionDetailList||data[1].questionDetailList.length===0);    //无推送数据
     const showCommonData = (+type===2)&&(+tagType===11)&&noPushData&&CommonSymptoms.length>0?true:false;
     if(!show&&tmpDom){
       $(tmpDom).parent().prev().attr({"contentEditable":true})
@@ -414,7 +408,7 @@ class SpreadDrop extends Component{
         onBlur={this.handleBlur}
         onInput={this.onChange}
         onkeydown={handleEnter}
-        onMouseUp={this.handleMouseUp.bind(this)}
+        onMouseUp={()=>handleMouseUp({select_start,i,boxMark})}
         onMouseDown={this.handleMouseDown.bind(this)}
         >{showV||placeholder}</div>
       {showCommonData&&show?<CommonSymptom data={CommonSymptoms} show={true} onSelect={this.handleCommonSelect.bind(this)} isCurrent={true} />:

+ 5 - 5
src/components/TemplateItems/TemplateItem/index.jsx

@@ -113,10 +113,10 @@ class TemplateItem extends React.Component {
     });
   }
 
-  handleEditIconClick(e, name) {
+  handleEditIconClick(e, name,deptId) {
     e.stopPropagation();
     let currId = this.props.id
-    this.props.handleTitleChange(currId, name);
+    this.props.handleTitleChange(currId, name,deptId);
   }
 
   handleTitleClick(e) {
@@ -211,9 +211,9 @@ class TemplateItem extends React.Component {
     }
   }
   render() {
-    const { allCheckShow, id, name, preview,conceptDeptName, sex,admin,checkItemsAdmin,allCheckShowAdmin,adminflg } = this.props;
+    const { allCheckShow, id, name,hospitalDeptId, preview,conceptDeptName, sex,admin,checkItemsAdmin,allCheckShowAdmin,adminflg } = this.props;
     let previewJson = JSON.parse(preview);
-    let sexStr = sex == 2 ? ' (女'+(conceptDeptName&&admin?'-'+conceptDeptName:'')+')' : sex == 1 ? ' (男'+(conceptDeptName&&admin?'-'+conceptDeptName:'')+')' : ' (通用'+(conceptDeptName&&admin?'-'+conceptDeptName:'')+')';
+    let sexStr = sex == 2 ? ' (女'+(conceptDeptName&&'-'+conceptDeptName)+')' : sex == 1 ? ' (男'+(conceptDeptName&&'-'+conceptDeptName)+')' : ' (通用'+(conceptDeptName&&'-'+conceptDeptName)+')';
     return (
       <div className={style.wrapper}>
         <div className={this.getStyleFst()}
@@ -243,7 +243,7 @@ class TemplateItem extends React.Component {
             src={this.getEditIcon()}
             onMouseEnter={() => this.handleEditIconMouseEnter()}
             onMouseLeave={() => this.handleEditIconMouseLeave()}
-            onClick={(e) => this.handleEditIconClick(e, name)}
+            onClick={(e) => this.handleEditIconClick(e, name,hospitalDeptId)}
           />}
         </div>
         <div

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

@@ -59,7 +59,7 @@
       vertical-align: top;
     //   margin-top: 3px;
     // padding: 0 5px;
-      max-width: 150px;
+      max-width: 200px;
       overflow: hidden;
       text-overflow: ellipsis;
       white-space: nowrap;

+ 11 - 5
src/components/TemplateItems/index.jsx

@@ -81,7 +81,7 @@ class TemplateItems extends React.Component {
     }
     templateSearch(){
         const {templateSearch} = this.props
-        templateSearch(this.$search.current.value)
+        templateSearch((this.$search.current.value).trim())
         if(this.$search.current.value.trim()){
             this.setState({
                 msg:'暂无模板信息'
@@ -113,10 +113,16 @@ class TemplateItems extends React.Component {
         this.$search.current.value = '';
         this.setState({
             val:''
-        })
+        });
         this.$search.current.focus();
+        this.templateSearch();
+    }
+  componentWillReceiveProps(next){
+        //点清空恢复初始状态
+      if(this.props.clearSearch!==next.clearSearch){
+        this.clear();
+      }
     }
-
     render() {
         const { checkItemsAdmin,handleAllCheckboxAdmin,handleMangerTemplateAdmin,allCheckShowAdmin,admin,adminItems,allCheckShow, handleMangerTemplate,handleClickGetMore, handleDelList, handleAllCheckbox, items,checkItems,current,hasMore } = this.props;
         const {height} = this.state
@@ -138,7 +144,7 @@ class TemplateItems extends React.Component {
                         <div className={style.wrapperTop}>
                             <div className={style.templateSearch}>
                                 <input placeholder="模板搜索" maxLength="30" ref={this.$search} type="text" onInput={this.handleChange} onPropertyChange={this.handleChange} onKeyUp={this.handleEnter}/>
-                                {this.state.val?<img src={delIcon} id='clearTemplateSearch' alt="清空" onClick={this.clear}/>:''}
+                                {this.state.val?<img src={delIcon} alt="清空" onClick={this.clear}/>:''}
                                 <div className={style.search} onClick={this.templateSearch}>搜索</div>
                             </div>
                             {
@@ -150,7 +156,7 @@ class TemplateItems extends React.Component {
                     items&&!admin ? 
                         <div className={style.wrapperTop}>
                             <div className={style.templateSearch}>
-                                <input placeholder="模板搜索" maxLength="30" ref={this.$search} type="text" onInput={this.handleChange} onPropertyChange={this.handleChange} onKeyUp={this.handleEnter}/>
+                                <input placeholder="模板搜索" id='templateSearch' maxLength="30" ref={this.$search} type="text" onInput={this.handleChange} onPropertyChange={this.handleChange} onKeyUp={this.handleEnter}/>
                                 {this.state.val?<img src={delIcon} alt="清空" onClick={this.clear}/>:''}
                                 <div className={style.search} onClick={this.templateSearch}>搜索</div>
                             </div>

+ 3 - 3
src/components/Treat/AdverseReactions/index.jsx

@@ -75,10 +75,10 @@ class AdverseReactions extends Component {
                         
                     </span>
                         {item.details.map((it, idx) => {
-                            return <span className={style['adverse-reactions-name']} key={item.conceptId + item.name + it.name}>
-                                <input type="radio" checked={it.select} id={item.conceptId +item.name + it.name} onChange={this.changeReact.bind(this, it, index)}/>
+                            return <span className={`style['adverse-reactions-name'] ${it.value == 1 ? style['selectd']:''}`} key={item.conceptId + item.name + it.name}>
+                                <input type="radio" checked={it.value == 1}  id={item.conceptId +item.name + it.name} onChange={this.changeReact.bind(this, it, index)}/>
                                 <label for={item.conceptId +item.name + it.name}> {it.name} </label>
-                                {it.value==1 && <span className={style['adverse-reactions-recommend']}>(智能推荐)</span>}
+                                {/* {it.value==1 && <span className={style['adverse-reactions-recommend']}>(智能推荐)</span>} */}
                             </span>
                         })}
                     </div>)

+ 3 - 0
src/components/Treat/AdverseReactions/index.less

@@ -58,4 +58,7 @@
     }
 
 }
+.selectd{
+    color: #3B9ED0;
+}
 

+ 1 - 0
src/containers/EditableSpan.js

@@ -16,6 +16,7 @@ function mapStateToProps(state){//console.log(state)
     isRead:state.homePage.isRead,
     data:state.currentIll.data,
     select_end:state.homePage.select_end,
+    select_start:state.homePage.select_start,
   }
 }
 

+ 2 - 1
src/containers/MedicalInfoContainer.js

@@ -9,12 +9,13 @@ import {CLEAR_INFO_SEARCH_LIST,SET_FILTER_LIST} from '@types/medicalInfo';
 import {SHOW_TABLE_LIST} from '@store/types/pushMessage';
 
 function mapStateToProps(state) {
-    const {medicalInfo,pushMessage} = state;
+    const {medicalInfo,pushMessage,print} = state;
     return{
         searchResult: medicalInfo.searchResult,
         filterList:medicalInfo.filterList,
         formulaResult: pushMessage.formulaResult,
         scaleInfo: pushMessage.scaleInfo,//量表内容
+        clearSearch:print.clearSearch,
     }
 }
 

+ 0 - 1
src/containers/OperationContainer.js

@@ -117,7 +117,6 @@ function mapDispatchToProps(dispatch) {
               dispatch(billing());
             }
           },200);
-
         }
     };
 }

+ 5 - 2
src/modules/HomePage/index.jsx

@@ -6,7 +6,7 @@ import BodyContainer from "@components/BodyContainer";
 import {ConfirmModal} from '@commonComp';
 import store from '@store';
 
-import {HIDEDROP,SETMINSCREEN,SETSYSTEMCONFIG,SETPRE,SETREADDITEMS,RESET_SELECT_TAG} from '@store/types/homePage.js';
+import {HIDEDROP,SETMINSCREEN,SETSYSTEMCONFIG,SETPRE,SETREADDITEMS,RESET_SELECT_TAG,ISREAD} from '@store/types/homePage.js';
 import {billing} from '@store/async-actions/pushMessage';
 import {CLEAR_SEARCH,DELETE_MAIN_SELECTED_TAGS} from '@types/mainSuit';
 import {CURRENT_CLEAR,DELETE_CURRENT_SELECTED_TAGS} from '@types/currentIll';
@@ -168,7 +168,7 @@ const mapDispatchToProps = function (dispatch) {
         const start = homePage.select_start;
         const end = homePage.select_end;
         const boxMark = homePage.select_boxMark;
-        if(!boxMark)return;
+        if(!boxMark||start===undefined||end===undefined)return;
         //删除后清除选中标记,放在删除事件后面会有清空不及时的问题
         dispatch({
           type:RESET_SELECT_TAG
@@ -179,6 +179,9 @@ const mapDispatchToProps = function (dispatch) {
           end,
           boxMark
         });
+        dispatch({
+          type:ISREAD
+        })
       },
       resetSelect(){
           dispatch({

+ 7 - 4
src/store/actions/checkBody.js

@@ -1,5 +1,5 @@
 import config from '@config/index.js';
-import {formatContinueDots,getLabelIndex,handleLocalDelTag,checkFullfillText,shiftLocalDelTag,getValuedLabels,removeRepeat} from '@utils/tools.js';
+import {formatContinueDots,getLabelIndex,handleLocalDelTag,checkFullfillText,shiftLocalDelTag,getLifeLabels,getValuedLabels,removeRepeat} from '@utils/tools.js';
 
 export function preSetCheckbody(state,action) {
   let res = Object.assign({},state);
@@ -340,9 +340,12 @@ export function recoveTag(state,action) {
 
 export function reflashLabels(state,action) {
   let res = Object.assign({},state);
-  const valuedLabels = getValuedLabels(res.data);
-  const newLabels = removeRepeat(valuedLabels,action.data);
-  const addTextsArr = checkFullfillText(newLabels);
+  const newLifeLabels = getLifeLabels(action.data);     //新生命体征标签
+  const oldLifeLabels = getLifeLabels(res.data);     //旧生命体征标签
+  const oldValuedLabels = getValuedLabels(res.data);    //旧已填值标签
+  const lifeLabels = removeRepeat(newLifeLabels,oldLifeLabels);   //将被保留的生命体征标签
+  const newUnlifeLabels = getLifeLabels(action.data,true);    //新非生命体征标签
+  const addTextsArr = checkFullfillText([...lifeLabels,...oldValuedLabels,...newUnlifeLabels]);
   res.data = addTextsArr.newArr;
   res.saveText = addTextsArr.saveText;
   res.update = Math.random();

+ 4 - 4
src/store/actions/print.js

@@ -34,8 +34,8 @@ export const diagShow=(state,action)=>{
   return res;
 };
 
-export const recoverTag = (state,action)=> {
-  const res = Object.assign({}, state);
-  console.log(res);
+export const clearSearchParam=(state,action)=>{
+  const res=Object.assign({},state);
+  res.clearSearch = action.data;
   return res;
-}
+};

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

@@ -167,9 +167,9 @@ export const changeReact=(state,action)=>{
     const res = JSON.parse(JSON.stringify(state));
     const index = action.index
     res.adversReactionList[index].details = res.adversReactionList[index].details.map(item => {
-      item.select = false;
+      item.value = 0;
       if(item.name == action.it.name){
-        item.select = !item.select
+        item.value = 1
       }
       return item
     })

+ 1 - 11
src/store/async-actions/mainSuit.js

@@ -44,18 +44,8 @@ export async function getCommSymptomPush(){//获取大数据推送症状
       const type = 1;
       const emrData = getEMRParams();
       const params = {
-        "age": emrData.age,
-        "hosCode": emrData.hosCode,
         "featureType": type,//类型1:症状,4:查体,5:化验,6:辅检,7:诊断
-        "diag": emrData.dis,
-        "lis": emrData.lis,
-        "other": emrData.other,
-        "pasts": emrData.other,
-        "pacs": emrData.pacs,
-        "sex": emrData.sex,
-        "vital":emrData.vital,
-        "symptom": emrData.current + emrData.main
       };
-    const bigData = json(api.symptomPush,params);
+    const bigData = json(api.symptomPush,Object.assign({},params,emrData));
     return bigData;
 }

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

@@ -60,6 +60,7 @@ export const getAdminCheckout = (val1,val2,dispatch) => {
               type: SETADMIN,
               admin:data.data
             });
+            dispatch(initItemList(1,''));        //模板列表没有就获取模板列表用于保存时做数据对比是否保存过
         } else {
             console.log(res)
         }
@@ -124,7 +125,6 @@ export const initHistoryDetails = (dispatch) => {
                 dispatch({
                   type:ISREAD
                 });
-                dispatch(initItemList(1,''));        //模板列表没有就获取模板列表用于保存时做数据对比是否保存过
                 dispatch({type:MODI_LOADING,flag:false});
             } else {
                 dispatch({type:MODI_LOADING,flag:false});
@@ -185,12 +185,12 @@ export async function getPatientMessage(dispatch, getState){
   let data1 = {},data2 = {};
   if(res1.data.code=='0'){
     data1 = res1.data.data;
-    getAdminCheckout(data1.doctorId,data1.hospitalId,dispatch)
     getDoctorConfig(data1.doctorId,dispatch);
   }
   if(res2.data.code=='0'){
     data2 = res2.data.data;
   }
+  getAdminCheckout(data1.doctorId,data1.hospitalId,dispatch)
   dispatch({
     type: GET_PATIENT_MESSAGE,
     data:Object.assign(data1,data2)

+ 6 - 14
src/store/async-actions/preIcss.js

@@ -7,22 +7,12 @@ import {Notify} from '@commonComp';
 
 export const getPreMsg = () => {
     let baseList = store.getState().patInfo.message;
-    const inCode = config.preIcss.recordIdVal===-1?getUrlArgObject("recordId"):config.preIcss.recordIdVal;
     json('/api/prec/inquiryInfo/hisInquirys', {
         "isHaveDetail":1,
         "hospitalCode": baseList.hospitalCode,
-        "inquiryCode":inCode,
-        "patientCode": baseList.patientCode,
         "dayLimit":config.preIcss.deadline===-1?undefined:config.preIcss.deadline,
-
-        // "doctorCode": baseList,
-        // "doctorId": baseList.doctorId,
-        // "hospitalDeptCode": baseList.hospitalDeptCode,
-        // "hospitalDeptId": baseList.hospitalDeptId,
-        // "hospitalId": baseList.hospitalId,
-        // "patientId": baseList.patientId,
-        // "patientIdNo": baseList.patientIdNo,
-        // "patientName": baseList.patientName
+        "patientIdNo": baseList.patientIdentityNum?baseList.patientIdentityNum:baseList.patientIdNo,
+        "patientName": baseList.patientName
     },true).then((res) => {
         const data = res.data;
         if (data.code == 0) {
@@ -40,13 +30,15 @@ export const getPreMsg = () => {
 }
 
 export const tellPred = () => {
-    let baseList = store.getState().homePage.item;
+    let baseData = store.getState();
+    let baseList = baseData.homePage.item;
+    let idcon = baseData.patInfo.message;
     const inCode = config.preIcss.recordIdVal===-1?getUrlArgObject("recordId"):config.preIcss.recordIdVal;
     json('/api/prec/inquiryInfo/inquiryQuoteForIcss', {
         "hospitalCode": baseList.hospitalCode,
         "inquiryCode":inCode,
         "patientCode": baseList.patientCode,
-
+        "patientIdentityNum":idcon.patientIdentityNum,
         "doctorCode":baseList.doctorCode,
         "doctorId": baseList.doctorId,
         "doctorName":baseList.doctorName,

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

@@ -40,7 +40,7 @@ export const initCommonItemList = (current,name) => { //初始化数据
   return (dispatch) => {
     axios.json('/templateInfo/getTemplatePageAlls', {
       "doctorId": state.doctorId,
-      "hospitalDeptId": state.hospitalDeptId,
+      "hospitalDeptId": (name == '')?state.hospitalDeptId:null,
       "hospitalId": state.hospitalId,
       "hospitalCode": state.hospitalCode,
       "current": current,
@@ -278,7 +278,7 @@ export const changeTitleAsyncAdmin = (obj) => { //改标题
   return (dispatch) => {
     axios.json('/templateAdmin/updateByAdminNames', {
       "doctorId": state.doctorId,
-      "hospitalDeptId": state.hospitalDeptId,
+      "hospitalDeptId": obj.deptId,
       "hospitalId": state.hospitalId,
       "id": obj.id,
       "modeName": obj.title,
@@ -303,7 +303,7 @@ export const changeTitleAsync = (obj) => { //改标题
   return (dispatch) => {
     axios.json('/templateInfo/updateByIdUsNames', {
       "doctorId": state.doctorId,
-      "hospitalDeptId": state.hospitalDeptId,
+      "hospitalDeptId": obj.deptId,
       "hospitalId": state.hospitalId,
       "id": obj.id,
       "modeName": obj.title,
@@ -368,7 +368,6 @@ export const getDepartments = (value) => { //获取模板结构化数据
     }).then((res) => {
       let data = res.data;
       if (data.code == 0) {
-        console.log(data)
         dispatch(getDptLis(data.data))
       } else {
         Notify.error(data.msg);

+ 2 - 2
src/store/async-actions/treat.js

@@ -183,8 +183,8 @@ function getTreatment(item, dispatch, state,url,params, isChronic) {
                                          if(adverseEvent[j].conceptId == allAdversReactionList[i].adversReactionList[z].conceptId && adverseEvent[j].name == allAdversReactionList[i].adversReactionList[z].name) {
                                              for(let x = 0; x < allAdversReactionList[i].adversReactionList[z].details.length; x++) {
                                                  for(let y = 0; y < adverseEvent[j].details.length; y++) {//判断每一项是否选择过
-                                                     if(allAdversReactionList[i].adversReactionList[z].details[x].name == adverseEvent[j].details[y].name && allAdversReactionList[i].adversReactionList[z].details[x].select) {
-                                                        adverseEvent[j].details[y].select = allAdversReactionList[i].adversReactionList[z].details[x].select
+                                                     if(allAdversReactionList[i].adversReactionList[z].details[x].name == adverseEvent[j].details[y].name && allAdversReactionList[i].adversReactionList[z].details[x].value == '1') {
+                                                        adverseEvent[j].details[y].value = allAdversReactionList[i].adversReactionList[z].details[x].value
                                                      }
                                                  }
                                              }

+ 7 - 0
src/store/reducers/assistCheck.js

@@ -12,6 +12,7 @@ const initSearchList = {
   list: [], //点击的结果
   assistLabel: [], //搜索的结果
   dataString: '', //结果拼接
+  dataArr: '', //结果拼接
   assistVal: '',
 
   hospitalPac: [], //医院检索到的
@@ -43,6 +44,7 @@ export default (state = initSearchList, action) => {
     }
     newState.assistLabel = [...tempArr]
     newState.dataString = getAllString(newState.checkedListImport,newState.assistLabel)
+    newState.dataArr = getAllString(newState.checkedListImport,newState.assistLabel,1)
     return newState;
   }
   if (action.type == GET_ASSIST_SEARCH_LIST) { //右侧推送添加到左侧
@@ -50,6 +52,7 @@ export default (state = initSearchList, action) => {
     newState.list = action.list
     newState.assistVal = action.val
     newState.dataString = getAllString(newState.checkedListImport,newState.assistLabel)
+    newState.dataArr = getAllString(newState.checkedListImport,newState.assistLabel,1)
     return newState;
   }
   if (action.type == GET_ASSIST_LABEL) { //默认
@@ -70,6 +73,7 @@ export default (state = initSearchList, action) => {
         newState.assistLabel = [...tempArrs];
       }
     }
+    newState.dataArr = getAllString(newState.checkedListImport,newState.assistLabel,1)
     newState.dataString = getAllString(newState.checkedListImport,newState.assistLabel)
     return newState;
   }
@@ -87,6 +91,7 @@ export default (state = initSearchList, action) => {
       }
       newState.assistLabel = [...tempArrs]
     }
+    newState.dataArr = getAllString(newState.checkedListImport,newState.assistLabel,1)
     newState.dataString = getAllString(newState.checkedListImport,newState.assistLabel)
     return newState;
   }
@@ -99,6 +104,7 @@ export default (state = initSearchList, action) => {
         newState.assistLabel = [...tempArr]
       }
     }
+    newState.dataArr = getAllString(newState.checkedListImport,newState.assistLabel,1)
     newState.dataString = getAllString(newState.checkedListImport,newState.assistLabel)
     return newState;
   }
@@ -111,6 +117,7 @@ export default (state = initSearchList, action) => {
         newState.assistLabel = [...tempArr]
       }
     }
+    newState.dataArr = getAllString(newState.checkedListImport,newState.assistLabel,1)
     newState.dataString = getAllString(newState.checkedListImport,newState.assistLabel)
     return newState;
   }

+ 4 - 0
src/store/reducers/inspect.js

@@ -185,6 +185,10 @@ export default (state = initSearchList, action) => {
                 tempArr[i].inpValue=action.value
             }
         }
+        let tmpArr = newState.getExcelDataList;
+        newState.pushItem = getPushList(tmpArr,tempArr);
+        newState.pushItems = getPushLists(tmpArr,tempArr);
+        newState.inspectStrPlus = getStringPlus(newState.pushItems)
         return newState;
     }
     return state;

+ 6 - 5
src/store/reducers/print.js

@@ -1,11 +1,12 @@
-import { RECOVER_TAG,SHOW_PRINT_PREVIEW, CLOSE_PRINT_PREVIEW, SAVE_MESSAGE, CLOSE_PREVIEW, SHOW_PREVIEW,DIAG_SHOW } from "../types/print";
-import {recoverTag, showPrintPreview, closePrintPreview, saveMessage, showPreview, closePreview,diagShow } from "../actions/print";
+import { SHOW_PRINT_PREVIEW, CLOSE_PRINT_PREVIEW, SAVE_MESSAGE, CLOSE_PREVIEW, SHOW_PREVIEW,DIAG_SHOW,CLEAR_SEARCH_PARAM } from "../types/print";
+import { showPrintPreview, closePrintPreview, saveMessage, showPreview, closePreview,diagShow,clearSearchParam } from "../actions/print";
 
 const initState = {
   visible: false,
   preVisible: false,
   saveMessage: {},
-  diagShow: false
+  diagShow: false,
+  clearSearch:0,
 };
 export default function(state = initState, action) {
   switch (action.type) {
@@ -21,8 +22,8 @@ export default function(state = initState, action) {
       return saveMessage(state, action);
     case DIAG_SHOW:
       return diagShow(state, action);
-    case RECOVER_TAG:
-      return recoverTag(state,action);
+    case CLEAR_SEARCH_PARAM:
+      return clearSearchParam(state,action);
     default:
       return state;
   }

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

@@ -21,4 +21,4 @@ export const SET_IMPORT_CHECKBODY_LABEL='SET_IMPORT_CHECKBODY_LABEL';
 export const PRESET = 'PRESET_CHECKBODY_DATA';
 export const RECOVER_TAG_CHECK = 'RECOVER_TAG_CHECK';     //恢复已删除标签
 export const DELETE_CHECK_SELECTED_TAGS='DELETE_CHECK_SELECTED_TAGS';
-export const REPUSH_CHECK_LABELS = 'REPUSH_CHECK_LABELS';   //重新获取查体
+export const REPUSH_CHECK_LABELS = 'REPUSH_CHECK_LABELS';   //重新获取查体

+ 1 - 1
src/store/types/print.js

@@ -4,4 +4,4 @@ export const SAVE_MESSAGE = 'SAVE_MESSAGE';
 export const SHOW_PREVIEW = 'SHOW_PREVIEW';
 export const CLOSE_PREVIEW = 'CLOSE_PREVIEW';
 export const DIAG_SHOW = 'DIAG_SHOW';
-export const RECOVER_TAG = 'RECOVER_TAG';
+export const CLEAR_SEARCH_PARAM='CLEAR_SEARCH_PARAM';

+ 63 - 14
src/utils/drag.js

@@ -30,6 +30,7 @@ let width = '',//屏幕宽度
  */
 function handleMove(event) {
   let wrap = $("#"+dragWrapper); //被拖拽的元素
+  if(!wrap[0]){return}
   let dragDes = $("#"+addPart); //展開区域
   let page = getPageCoordinate(event, '0');//获取鼠标位置
   let maxDragX = 0,dragDesWidth = 0;
@@ -168,11 +169,15 @@ function handleMoves(event){
  * 预问诊预览图片可拖拽
  */
 let imgXS = 0,//鼠标距离图片左侧的位置
+    imgWXS = 0,//图片容器距离左侧的位置
+    imgDXS = 0,//图片距离左侧的位置left
     imgYS = 0,//鼠标距离图片顶部的位置
-    imgDXS = 0,//图片距离左侧的位置
-    imgDYS = 0,//图片距离顶部的位置
-    imgWXS = 0,//图片容器距离顶部的位置
     imgWYS = 0,//图片容器距离顶部的位置
+    imgDYS = 0,//图片距离顶部的位置top
+    drgLeft= 0,
+    tmpValL=0,
+    tmpNum=0,
+    tmpValR=0,
     imgDrag = false;
 function imgDragMove(type){
   let wrap = $("#previewWrapper");
@@ -188,12 +193,26 @@ function imgDragMove(type){
       imgXS = page.boxLeft - drag.offset().left;
       imgYS = page.boxTop - drag.offset().top;       
       imgDrag = true;
-      
+
       imgDXS = drag.offset().left;
       imgDYS = drag.offset().top;
-      imgWXS = wrap.offset().left
-      imgWYS = wrap.offset().top
+      imgWXS = wrap.offset().left;
+      imgWYS = wrap.offset().top;
+
+      if(localStorage.getItem('changeImg')){
+        tmpNum == 0
+        // localStorage.setItem("changeImg",false)
         
+      }
+      
+      // if(tmpNum == 0){
+      //   tmpValL = imgDXS-imgWXS;
+      //   tmpValR = imgDYS-imgWYS;
+      //   ++tmpNum
+      // }
+
+      console.log(imgDXS,imgWXS,tmpNum,'hahaha')
+
       $(document).on('mousemove',handleMoveImg)
       $(document).on('mouseup',handleUpImg)
     })
@@ -208,20 +227,50 @@ function handleMoveImg(event){
   !isMove&&store.dispatch({type:SET_MOVE,isMove:true})
   let wrap = $("#previewWrapper");
   let drag = $("#drugImg");
+  let de = (Math.abs(drag.attr("data-deg")%180)==90)?true:false;
   let page = getPageCoordinate(event,'0');
   let wrapWidth = drag[0].offsetWidth;
   let wrapHeight = drag[0].offsetHeight;
   if(imgDrag){
+      
+    // console.log('鼠标左:'+page.boxLeft)
+    // console.log('鼠标图左:'+imgXS)
+    // console.log('容器左:'+imgWXS)
+    // console.log('被拖图左:'+drag.offset().left)
+    // console.log('bian1:'+tmpValL)
+    // console.log('bian2:'+tmpValR)
+
     imgDXS = page.boxLeft - imgXS - imgWXS;//相对于父元素定位
     imgDYS = page.boxTop - imgYS - imgWYS;
-    drag.css({
-      width:wrapWidth+'px',
-      height:wrapHeight+'px',
-      marginLeft:'0px',
-      marginTop:'0px',
-      left:imgDXS + 'px',
-      top:imgDYS + 'px'
-    })
+
+    if(wrapHeight > wrapWidth){
+      drag.css({
+        width:wrapWidth+'px',
+        height:wrapHeight+'px',
+        marginLeft:'0px',
+        marginTop:'0px',
+        left:imgDXS+(de?tmpValL:0) + 'px',
+        top:imgDYS-(de?tmpValL:0) + 'px'
+      })
+    }
+    else{
+      drag.css({
+        width:wrapWidth+'px',
+        height:wrapHeight+'px',
+        marginLeft:'0px',
+        marginTop:'0px',
+        left:imgDXS-(de?tmpValR:0) + 'px',
+        top:imgDYS+(de?tmpValR:0) + 'px'
+      })
+    }
+    // drag.css({
+    //   width:wrapWidth+'px',
+    //   height:wrapHeight+'px',
+    //   marginLeft:'0px',
+    //   marginTop:'0px',
+    //   left:imgDXS-(de?tmpValR:0) + 'px',
+    //   top:imgDYS+(de?tmpValR:0) + 'px'
+    // })
   }
 }
 module.exports = {

+ 155 - 32
src/utils/tools.js

@@ -7,7 +7,7 @@ import {clearAssistData,addAssistLabel} from '@store/actions/assistCheck';
 import {clearAllLabel,addLabel} from '@store/actions/inspect';
 import {CLEAR_ALL_DIAG} from '@store/types/diagnosticList';
 import {CLEAR_ALL_PUSH_MESSAGE, SET_TIPS,BILLING_ADVICE,PUSHCHANGE} from '@store/types/pushMessage';
-import {ISREAD, SETREADDITEMS} from "../store/types/homePage";
+import {ISREAD, SETREADDITEMS,SET_SELECTED_AREA} from "../store/types/homePage";
 import {CLEAR_FIRST_MAIN_DIAG, CLEAR_ALL_TREAT} from "../store/types/treat";
 import {tabChange} from '@store/actions/tabTemplate';
 import {CLEAR_ASSESS_RESULT_VALUE} from '@types/assessResult';
@@ -16,6 +16,7 @@ import config from '@config/index';
 import up from '@images/up.png';
 import down from '@images/down.png';
 import $ from 'jquery';
+import {CLEAR_SEARCH_PARAM} from "../store/types/print";
 
 
 /***
@@ -166,7 +167,10 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
         store.dispatch(clearAssistData([],'',[]));
         store.dispatch(clearAllLabel([],[],''));
         //右侧搜索条件清空
-        $("#clearTemplateSearch,#clearMedicalInfoSearch,#medicalInfoFilter:first-child").click();
+        store.dispatch({
+          type: CLEAR_SEARCH_PARAM,
+          data: Math.random()
+        });
         //tab跳回辅助信息
         store.dispatch(tabChange('0'));
         store.dispatch({
@@ -652,25 +656,72 @@ function handleEnter(event){
     if(event.keyCode==13){return false;}
 }
 //获取病例输入的内容
+// function getEMRParams(){
+//   const state = store.getState();
+//   const {message} = state.patInfo;
+//   const {mainSuit,currentIll,otherHistory,checkBody,inspect,assistCheck,diagnosticList} = state;
+//   //console.log('message', message)
+//   const main = filterDataArr(mainSuit.saveText)||'',
+//     current=filterDataArr(currentIll.saveText)||'',
+//     other = filterDataArr(otherHistory.saveText)||'',
+//     vital = filterDataArr(checkBody.saveText)||'',
+//     lis = inspect.pushItem,    //化验推送所需数据
+//     pacs = assistCheck.dataString||'',
+//     dis=diagnosticList.diagnosticStrNoType||'',
+//     advice = '',
+//     diseaeId = [];
+//   const age = message.patientAge;
+//   const sex = message.sex;
+//   const patientId = message.patientId //病人id,取上次用药
+//   const hosCode = message.hospitalCode
+//   return {main,current,other,vital,lis,pacs,dis,advice,diseaeId,sex,age, patientId, hosCode};
+// };
 function getEMRParams(){
   const state = store.getState();
   const {message} = state.patInfo;
   const {mainSuit,currentIll,otherHistory,checkBody,inspect,assistCheck,diagnosticList} = state;
   //console.log('message', message)
-  const main = filterDataArr(mainSuit.saveText)||'',
-    current=filterDataArr(currentIll.saveText)||'',
-    other = filterDataArr(otherHistory.saveText)||'',
-    vital = filterDataArr(checkBody.saveText)||'',
-    lis = inspect.pushItem,    //化验推送所需数据
-    pacs = assistCheck.dataString||'',
-    dis=diagnosticList.diagnosticStrNoType||'',
-    advice = '',
-    diseaeId = [];
-  const age = message.patientAge;
-  const sex = message.sex;
-  const patientId = message.patientId //病人id,取上次用药
-  const hosCode = message.hospitalCode
-  return {main,current,other,vital,lis,pacs,dis,advice,diseaeId,sex,age, patientId, hosCode};
+  
+  const diag = []
+  for(let i = 0; i < diagnosticList.diagnosticList.length; i++) {
+    diag.push({"dateValue": "","name": "","uniqueName": diagnosticList.diagnosticList[i].name})
+  }
+  let obj = {
+    "hosCode": message.hospitalCode,
+    "ruleType": "string",
+    "age": message.patientAge,
+    "sex": message.sex,
+    "chief": filterDataArr(mainSuit.saveText)||'',
+    "symptom": filterDataArr(currentIll.saveText)||'',
+    "vital": filterDataArr(checkBody.saveText)||'',
+    "pasts": filterDataArr(otherHistory.saveText)||'',
+    "infectious": "",
+    "operation": "",
+    "allergy": "",
+    "vaccination": "",
+    "personal": "",
+    "marital": "",
+    "family": "",
+    "menstrual": "",
+    "other": filterDataArr(otherHistory.saveText)||'',
+    "lisString": "",
+    "pacsString": "",
+    "diagString": "",
+    "drugString": "",
+    "lis": inspect.pushItem,
+    "pacs": assistCheck.dataArr||'',
+    "diag": diag,
+    "lisOrder": [],
+    "pacsOrder": [],
+    "diagOrder": [],
+    "drugOrder": [],
+    "operationOrder": [],
+    "otherOrder": [],
+    "patientId": message.patientId,
+    "drug": [],
+    "marriage": ""
+  }
+  return obj;
 };
 
 function didPushParamChange(){
@@ -1219,10 +1270,12 @@ function getStringPlus(dataList){
   let strPlus = '';
   dataList && dataList.map((item)=>{
     if(item.detailName){
-      let strTmp = item.name + ',' + item.detailName + ',' + (item.otherValue ? item.otherValue : (item.value + item.units)) +';'
+      let strTmp = item.name + ','+ item.detailName + ',' + (item.otherValue ? item.otherValue : (item.value + item.units)) +';'
+      // let strTmp = item.name + ','+(item.inpValue?(item.inpValue+','):'') + item.detailName + ',' + (item.otherValue ? item.otherValue : (item.value + item.units)) +';'
       strPlus += strTmp;
     }else{
-      let strTmp = item.name+';'
+      // let strTmp = item.name+ (item.inpValue?(','+item.inpValue):';')
+      let strTmp = item.name+ ';'
       strPlus += strTmp;
     }
   })
@@ -1248,7 +1301,7 @@ function getPushList(data1,data2){     //推送数据
                 tmpObj.source = '1';//数据来源
                 tmpObj.maxValue = part.max || ''; 
                 tmpObj.minValue = part.min || '';
-                tmpObj.time = part.time ||now;
+                tmpObj.dateValue = part.time ||now;
                 tmpObj.units = part.unit || '';//单位
                 tmpObj.value = (part.value-0) === (part.value-0) ? part.value:'';//值
                 tmpObj.otherValue = (part.value-0) === (part.value-0) ?'':part.value; //阴性阳性
@@ -1266,7 +1319,7 @@ function getPushList(data1,data2){     //推送数据
                 tmpObj.source = '0';     //数据来源
                 tmpObj.maxValue = val.maxValue ? val.maxValue : '';
                 tmpObj.minValue = val.minValue ? val.minValue : '';
-                tmpObj.time = val.time || now;
+                tmpObj.dateValue = val.time || now;
                 tmpObj.units = val.labelSuffix || '';
                 tmpObj.value = (val.value-0) === (val.value-0) ? val.value:'';
                 tmpObj.otherValue = (val.value-0) === (val.value-0) ?'':val.value;
@@ -1304,6 +1357,7 @@ function getPushLists(data1,data2){     //推送数据
             if(val.value != undefined && val.value != ''){
                 let tmpObj = {};
                 tmpObj.name = item.name || '';
+                tmpObj.inpValue = item.inpValue || '';//套餐名
                 tmpObj.detailName = val.name || '';
                 tmpObj.uniqueName = val.uniqueName || '';//公表名称
                 tmpObj.source = '0';     //数据来源
@@ -1318,6 +1372,7 @@ function getPushLists(data1,data2){     //推送数据
       }else{
         let tmpObj = {};
         tmpObj.name = item.name;
+        tmpObj.inpValue = item.inpValue;
         tmpArr2.push(tmpObj);
       }
     })
@@ -1325,8 +1380,8 @@ function getPushLists(data1,data2){     //推送数据
     return totalTmpArr;
 }
 
-function getAllString(checkedListImport,assistLabel){
-  let tmpImportLis = [],tmpString='';
+function getAllString(checkedListImport,assistLabel,flg){
+  let tmpImportLis = [],tmpString='',tmpArr=[];
   for(let i = 0;i < checkedListImport.length;i++){
     for(let j = 0;j < checkedListImport[i].length;j++){
       tmpImportLis.push(checkedListImport[i][j])
@@ -1335,9 +1390,21 @@ function getAllString(checkedListImport,assistLabel){
   let tempArr = tmpImportLis.concat(assistLabel)
   for (let i = 0; i < tempArr.length; i++) {
     let tmpVal = tempArr[i].value ? tempArr[i].value.trim() : tempArr[i].value;
+    let obj = {
+      "dateValue": tempArr[i].time,
+      "name": "",
+      "uniqueName": tempArr[i].name,
+      "desc": tempArr[i].imagingDiagnose,
+      "result": tempArr[i].imagingDiagnose,
+    }
+    tmpArr.push(obj)
     tmpString += (tempArr[i].name + (tmpVal ? (':' + tmpVal) + ', ' : ': ') + (tempArr[i].time ? '报告日期:' + tempArr[i].time : '') + '^;')
   }
-  return tmpString;
+  if(flg){
+    return tmpArr;
+  }else{
+    return tmpString;
+  }
 }
 
 // 模板中处理tagType==4的数据
@@ -1443,7 +1510,7 @@ const setFontColorSize = (flg,pacs) => {
         }else if(pacs == 6){
           classStr = `largeFontSize selectColor`
         }else if(pacs == 7){
-          classStr = `largeFontSize fontWeight`
+          classStr = `largeFontSize fontWeight selectColor`
         }else{
           classStr = `largeFontSize`
         }
@@ -1457,7 +1524,7 @@ const setFontColorSize = (flg,pacs) => {
         if(pacs == 6){
           classStr = `simpleFontSize selectColor`
         }else if(pacs == 7){
-          classStr = `simpleFontSize fontWeight`
+          classStr = `simpleFontSize fontWeight selectColor`
         }else{
           classStr = `simpleFontSize`
         }
@@ -1490,7 +1557,11 @@ const setFontColorSize = (flg,pacs) => {
       }
     }else{//都是标准的
       if(flg == 2){
-        classStr = `simpleFontSize`
+        if(pacs == 7){
+          classStr = `simpleFontSize fontWeight`
+        }else{
+          classStr = `simpleFontSize`
+        }
       }else if(pacs == 7){
         classStr = `simpleFontSize fontWeight`
       }else if(flg == 1){
@@ -1503,25 +1574,43 @@ const setFontColorSize = (flg,pacs) => {
   // }, 0);
 }
 
-//获取查体体征和已选中的标签
+//获取生命体征或非生命体征标签
+function getLifeLabels(arr,flag){     //flag=true获取非生命体征
+  const newArr = arr.filter((it)=>{
+    return flag?+it.specFlag!==4:+it.specFlag===4;
+  });
+  return newArr;
+}
+
+//获取已选中的标签
 function getValuedLabels(arr){
   const newArr = arr.filter((it)=>{
     if(it.tagType=='3'){      //血压类型
-      if(it.questionMapping.findIndex((i)=>i.value!==undefined)!==-1||+it.specFlag===4){
+      if(+it.specFlag!==4&&it.questionMapping.findIndex((i)=>i.value!==undefined)!==-1){
         return true;
       }
       return false;
     }
-    return it.value||+it.specFlag===4;
+    return +it.specFlag!==4&&it.value;
   });
   return newArr;
 }
 
 //对象数组去重
 function removeRepeat(arr1,arr2){     //arr1被完全保留的数组
-  const arr = arr2.reduce(function(newArr,item){
+  const arr = arr2.reduce(function(newArr,item,inx){
     const it = newArr.findIndex((i)=>i.id===item.id);
-    if(it===-1){
+    const firstInx = arr2.findIndex((i)=>i.id===item.id);
+    //旧体征标签比新体征标签多出的标签,已填值的保留,未填值的舍弃
+    if(it!==-1){
+      //多个相同标签,保留已填值的
+      if(firstInx!==inx&&(item.value!==undefined||(item.tagType=='3'&&item.questionMapping.findIndex((i)=>i.value!==undefined)!==-1))){     //重复的已填值标签
+        newArr.splice(inx-firstInx+it,0,item);
+      }
+      if(firstInx===inx){
+        newArr.splice(it,1,item);
+      }
+    }else if(item.value!==undefined||(it.tagType=='3'&&it.questionMapping.findIndex((i)=>i.value!==undefined)!==-1)){
       newArr.push(item);
     }
     return newArr;
@@ -1529,6 +1618,37 @@ function removeRepeat(arr1,arr2){     //arr1被完全保留的数组
   return arr;
 }
 
+function handleMouseUp(param){
+  const {select_start,i,boxMark}= param;
+  if(select_start!==undefined){
+    store.dispatch({
+      type:SET_SELECTED_AREA,
+      data:{i,boxMark,dir:'end'}
+    });
+    window.getSelection().empty();
+  }
+}
+
+//判断不同科室内容是否相同
+function checkDeptContent(jsonStr,tmpLis){
+  for(let i = 0;i <tmpLis.length;i++){
+    let dataStr = tmpLis[i].preview;
+    if(
+      filterDataArr(JSON.parse(jsonStr.chief)) == filterDataArr(eval('('+JSON.parse(dataStr).chief+')')) &&
+      filterDataArr(JSON.parse(jsonStr.present)) == filterDataArr(eval('('+JSON.parse(dataStr).present+')')) &&
+      filterDataArr(JSON.parse(jsonStr.other)) == filterDataArr(eval('('+JSON.parse(dataStr).other+')')) &&
+      filterDataArr(JSON.parse(jsonStr.vital)) == filterDataArr(eval('('+JSON.parse(dataStr).vital+')')) &&
+      jsonStr.lis == JSON.parse(dataStr).lis &&
+      jsonStr.pacs == JSON.parse(dataStr).pacs &&
+      jsonStr.diag == JSON.parse(dataStr).diag &&
+      jsonStr.advice == JSON.parse(dataStr).advice
+    ){
+      // Notify.info('该模板已保存');
+      return false;
+    }
+  }
+}
+
 module.exports = {
     getIds,
     getWindowInnerWidth,
@@ -1582,6 +1702,9 @@ module.exports = {
     setFontColorSize,
     moveEnd,
     setFontColorSize,
+    getLifeLabels,
     getValuedLabels,
-    removeRepeat
+    removeRepeat,
+    handleMouseUp,
+    checkDeptContent
 };

+ 18 - 15
src/utils/utils.js

@@ -140,11 +140,23 @@ export const setRadioInputValue = (state,action)=>{
 export function recoveTag(state,action) {
   let res = Object.assign({},state);
   let arr = [...res.data];
-  arr.splice(action.index,0,action.data);
+  //arr.splice(action.index,0,action.data);
   const isArr= !action.data.tagType;
   if(!isArr){
     arr.splice(action.index,0,action.data);
   }else{
+    //恢复连续选中删除的标签,先判断需恢复的标签中是否有子模板,有则删除数据中的子模板标签,然后恢复被删除的标签(子模板只有一个)
+    const sonModuleInx =  action.data.findIndex((it)=>it.flag=='3');    //是否有子模板
+    if(sonModuleInx!==-1){
+      const sonMInx = arr.findIndex((it)=>it.flag=='3');
+      arr.splice(sonMInx,1);
+    }
+    const lastReTag = [...action.data].reverse()[0];
+    if(lastReTag.tagType=='8'&&arr[action.index].tagType=='8'){
+      //要恢复的标签组最后为文本标签,插入位置也为文本标签,则将2个合并为一个文本标签
+      arr[action.index]=Object.assign(arr[action.index],lastReTag,{value:lastReTag.value+arr[action.index].value});
+      action.data.length=action.data.length-1;
+    }
     arr.splice(action.index,0,...action.data);
   }
   const dataArr = fullfillText(arr);
@@ -221,25 +233,15 @@ export function setInputLabel(state,action){
 export async function getBigPush(type,symData,save){
   const emrData = getEMRParams();
   const params = {
-    "age": emrData.age,
-    "hosCode": emrData.hosCode,
-    "featureType": type,  //类型1:症状,4:查体,5:化验,6:辅检,7:诊断
     "ruleType":config.ruleTypeMap[type],
-    "diag": emrData.dis,
-    "lis": emrData.lis,
-    "other": emrData.other,
-    "pasts": emrData.other,
-    "pacs": emrData.pacs,
-    "sex": emrData.sex,
-    "vital":emrData.vital,
-    "symptom": symData||emrData.current + emrData.main
+    "featureType": type,  //类型1:症状,4:查体,5:化验,6:辅检,7:诊断
   };
   if(save){
     let savePm = Object.assign({},params);
     delete savePm.featureType;
     storageLocal.set('emrParam',savePm);      //推送数据存储,用作推送前对比是否有变,有变才推送
   }
-  return json(api.push,params);
+  return json(api.push,Object.assign({},params,emrData));
 }
 
 //删除选中标签
@@ -248,18 +250,19 @@ export function deleteSelectedLabels(state,action){
   const {start,end,boxMark} = action;
   let n = Math.abs(end-start)+1;
   const arr = res.data;
+  const sonModuleInx = arr.findIndex((it)=>it.flag=='3');
   const startIsText = arr[start].tagType=='8';
   const endIsText = arr[end].tagType=='8';
   if(!startIsText&&!endIsText){
     n=Math.abs(end-start)+2;
   }
   if(start>end){      //从后往前选中
-    const temp = arr.splice(end,n);
+    const temp = end<sonModuleInx&&sonModuleInx<start?arr.splice(end,n,arr[sonModuleInx]):arr.splice(end,n);
     handleLocalDelTag(boxMark,end,temp);
   }else if(start===end){
     return res;
   }else{
-    const temp = arr.splice(start,n);
+    const temp = start<sonModuleInx&&sonModuleInx<end?arr.splice(start,n,arr[sonModuleInx]):arr.splice(start,n);
     handleLocalDelTag(boxMark,start,temp);
   }
   const newObj = boxMark=='4'?checkFullfillText(arr):fullfillText(arr);