Browse Source

Merge remote-tracking branch 'origin/dev5.4.1' into dev5.4.1

zhouna 5 năm trước cách đây
mục cha
commit
991e109b2e

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

@@ -3,8 +3,7 @@ import logo from '../../images/logoa.png'
 import setup from '../../images/setup.png';
 
 const Banner = (props) => {
-  const {src,text, children} = props;
-
+const {src,text, children} = props;
   return <div className={style['banner-wrapper']+" "+"clearfix"}>
        <div className={style['logo']}> <img src={logo}/><span >|&nbsp;&nbsp;智能辅助临床决策系统</span>
           <div className={style['buon']}><img className={style['st']} src={setup}/>设置</div>

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


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


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


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


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


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


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


+ 199 - 24
src/components/PreInIcss/RotateImg/index.jsx

@@ -1,48 +1,223 @@
 import React, { Component } from "react";
-import style from "../index.less";
-import down from "@common/images/show.png";
+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,
-      imgList:[]
+      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)
   }
-  componentDidMount() {
-    const { src,idx,imgLis } = this.props;
-    console.log(imgLis,idx,src)
-    for(let i = 0;i < imgLis.length;i++){
-      let size = imgLis[i].originalImage.split('?')[1].split('&');
-      let width = size[0].split('=')[1];
-      let height = size[1].split('=')[1];
-      imgLis[i].width = width;
-      imgLis[i].height = height;
+  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({
-      imgList:imgLis
+      imgWidth:1.2*imgWidth,
+      imgHeight:1.2*imgHeight,
+      mgLeft:-imgWidth*1.2/2,
+      mgTop:-imgHeight*1.2/2
     })
   }
-  xunzhaun(flg){
-    console.log(this.refs.rotateImg.getDOMNode())
-    let de = this.state.de;
+  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){
-        de = de-90
+      deg = deg-90
     }else{
-        de = de-0+90
+      deg = deg-0+90
     }
-    de=parseInt(de)
-    // $("#img_id").css("transform", "translateX(-50%) translateY(-50%) rotate(" + de + "deg)" );
-    // $("#img_id").attr("de", de);
+    this.setState({
+      de:deg
+    })
   }
   render() {
-    const { imgDetail,idx,imgLis } = this.props;
+    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}>
-      <img className={style.rotateImg} src={imgDetail.originalImage} ref="rotateImg" alt=""/>
-      <img className={style.rotate} src={down} alt="图片旋转"/>
+      <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)
   }
 }

+ 104 - 0
src/components/PreInIcss/RotateImg/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;
+    }
+  }
+}

+ 34 - 9
src/components/PreInIcss/SliddleTgl/index.jsx

@@ -4,6 +4,7 @@ import style from "../index.less";
 import mimi from '@common/images/mimi.png';
 import down from "@common/images/show.png";
 import up from "@common/images/close.png";
+import {imgDragMove} from '@utils/drag';
 
 class SlideTgl extends Component {
   constructor(props){
@@ -14,11 +15,13 @@ class SlideTgl extends Component {
       slideToggle:false,
       text:'展开',
       tgl:true,//展开收起文本设置
-      imgDetail:{},
-      idx:''
+      imgList:[],
+      idx:'',
+      imgShow:false
     }
     this.slideDown = this.slideDown.bind(this)
     this.prePrecImg = this.prePrecImg .bind(this)
+    this.handleClose = this.handleClose .bind(this)
   }
   componentDidMount() {
     setTimeout(() => {
@@ -26,7 +29,7 @@ class SlideTgl extends Component {
       this.setState({
         height:height,
         slide:height>24?true:false,
-        slideToggle:height>24?true:false,
+        slideToggle:height>24?true:false
       })
     }, 0);
   }
@@ -36,14 +39,30 @@ class SlideTgl extends Component {
       slide:flg
     })
   }
-  prePrecImg(imgDetail,idx){
+  prePrecImg(imgs,idx,imgShow){
+    let imgLis = imgs&&imgs||[];
+    for(let i = 0;i < imgLis.length;i++){
+      let size = imgLis[i].originalImage.split('?')[1].split('&');
+      let width = size[0].split('=')[1];
+      let height = size[1].split('=')[1];
+      imgLis[i].width = width;
+      imgLis[i].height = height;
+    }
+    this.setState({
+      imgList:imgLis,
+      idx,
+      imgShow
+    })
+  }
+  handleClose(){
+    imgDragMove('del')
+    this.props.setMove(false)
     this.setState({
-      imgDetail:imgDetail,
-      idx
+      imgShow:false
     })
   }
   render() {
-    const { item,showPre } = this.props;
+    const { item,showPre,isMove,setMove } = 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>
@@ -55,7 +74,7 @@ class SlideTgl extends Component {
           item.detail&&item.detail.imageList.map((part,idx)=>{
             return <div className={style.img}>
               <img className={style.report} src={part.originalImage} alt=""/>
-              <img className={style.mimi} onClick={()=>this.prePrecImg(part,idx)} src={mimi} alt=""/>
+              <img className={style.mimi} onClick={()=>this.prePrecImg(item.detail.imageList,idx,true)} src={mimi} alt=""/>
             </div>
           })
         }
@@ -70,7 +89,13 @@ class SlideTgl extends Component {
         <img src={down} alt="展开"/>
       </p>:null}
       <div className={style.pushPre} onClick={()=>showPre(item)}>引用</div>
-      {this.state.src?<RotateImg imgDetail={this.state.imgDetail} imgLis={item.detail&&item.detail.imageList} idx={this.state.idx}></RotateImg>:null}
+      {this.state.imgShow?<RotateImg
+        imgShow={this.state.imgShow}
+        imgLis={this.state.imgList}
+        isMove = {isMove}
+        setMove = {setMove}
+        handleClose={this.handleClose}
+        idx={this.state.idx}></RotateImg>:null}
   </li>
   }
 }

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

@@ -9,7 +9,7 @@ class PreIcss extends Component {
     super(props)
   }
   render() {
-    const { show,data,windowHeight,showPreModal,showPre } = this.props;
+    const { show,data,windowHeight,showPreModal,showPre,isMove,setMove } = this.props;
     const domNode = document.getElementById('root');
     return ReactDom.createPortal(<div className={style['preInIcss']}>
       <div className={style.title}>
@@ -25,7 +25,7 @@ class PreIcss extends Component {
                 <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}></SlideTgl>
+                <SlideTgl showPre={showPre} item={item} isMove={isMove} setMove={setMove}></SlideTgl>
               </ul>
             </div>
           })

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

@@ -106,21 +106,3 @@
     cursor: pointer;
   }
 }
-.rotateImg {
-  
-}
-.rotate{
-
-}
-.preImgWrap {
-  z-index: 100;
-  position: fixed;
-  margin-left: -500px;
-  left: 50%;
-  width: 1000px;
-  top: 7%;
-  bottom: 7%;
-  height: 86%;
-  background-color: #fff;
-  overflow: hidden;
-}

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

@@ -26,7 +26,7 @@ class TemplateItems extends React.Component {
     }  
     componentDidMount(){
         const height = getWindowInnerHeight()-195;
-        this.$cont.current.style.height = height+"px";
+        this.$cont.current.style.height = height/2+"px";
         windowEventHandler('resize', ()=>{
             if(this.$cont.current){
                 const height = getWindowInnerHeight()-195;

+ 1 - 1
src/config/index.js

@@ -45,7 +45,7 @@ export default {
     recoverTagNum:3,    //可回退标签的个数
     regPreAndAft:/[^\u4e00-\u9fa5|0-9|a-z|A-Z|Ⅰ|Ⅱ|Ⅲ|Ⅳ|Ⅴ|Ⅵ|Ⅶ|Ⅷ|Ⅸ|Ⅹ]+$|^[^\u4e00-\u9fa5|0-9|a-z|A-Z|Ⅰ|Ⅱ|Ⅲ|Ⅳ|Ⅴ|Ⅵ|Ⅶ|Ⅷ|Ⅸ|Ⅹ]+/g,  //搜索去掉前后的标点
     ruleTypeMap:{     //大数据推送参数featureType对应
-      '22':'1,2',
+      '22':'1,2,6',
       '11':'3',
       '8':'4,5'
     }

+ 1 - 0
src/containers/CheckBody.js

@@ -23,6 +23,7 @@ function mapStateToProps(state){
     span:checkBody.span,
     searchInEnd:checkBody.searchInEnd,      //是否在搜索末尾插入结果
     importLabel:checkBody.importLabel,    //需高亮的标签id
+    typeConfig: state.typeConfig,  //bug2764
   }
 }
 

+ 5 - 1
src/containers/PreInIcss.js

@@ -1,7 +1,7 @@
 import {connect} from 'react-redux';
 import PreInIcss from '@components/PreInIcss';
 import {getPreMsg} from '@store/async-actions/preIcss';
-import { GET_PREC_LIST,SET_PREC_SHOW } from "@store/types/preIcss";
+import { GET_PREC_LIST,SET_PREC_SHOW,SET_MOVE } from "@store/types/preIcss";
 import {SETPRE,SETPREDATA} from "@store/types/homePage";
 
 const mapStateToProps = function(state){//console.log(state)
@@ -9,11 +9,15 @@ const mapStateToProps = function(state){//console.log(state)
     data:state.preIcss.preData,
     show:state.preIcss.preShow,
     windowHeight:state.homePage.windowHeight,
+    isMove:state.preIcss.isMove
   }
 }
 
 const mapDispatchToProps = function(dispatch){
   return {
+    setMove(flg){
+      dispatch({type:SET_MOVE,isMove:flg})
+    },
     showPreModal(){
       dispatch({type:SET_PREC_SHOW})
     },

+ 1 - 0
src/modules/HomePage/index.jsx

@@ -81,6 +81,7 @@ class HomePage extends Component {
             <BodyContainer></BodyContainer>
           <ConfirmModal visible={showPre} okText='是' cancelText='否' confirm={referRecord}  cancel={noReferRecord} close={noReferRecord}>
               <div className={style['confirm-info']}>是否引用预问诊信息?</div>
+              <p className={style.tip}>(引用数据会清除当前内容)</p>
           </ConfirmModal>
           {flag?<div className={style['mask']}>
                 <img src={loading} className={style['load']}/>

+ 5 - 1
src/modules/HomePage/index.less

@@ -23,5 +23,9 @@
     text-align: center;
     font-size: 16px;
     padding-top: 10px;
-    padding-bottom: 50px;
+    padding-bottom: 10px;
+}
+.tip {
+    text-align: center;
+    padding-bottom: 30px;
 }

+ 6 - 0
src/store/actions/preIcss.js

@@ -9,4 +9,10 @@ export const setPrecShow=(state,action)=>{
   const show = res.preShow
   res.preShow = action.preShow?action.preShow:!show
   return res;
+};
+
+export const setMove=(state,action)=>{
+  const res=Object.assign({},state);
+  res.isMove = action.isMove
+  return res;
 };

+ 6 - 3
src/store/reducers/preIcss.js

@@ -1,9 +1,10 @@
-import { GET_PREC_LIST,SET_PREC_SHOW } from "../types/preIcss";
-import {getPrecList,setPrecShow} from "../actions/preIcss";
+import { GET_PREC_LIST,SET_PREC_SHOW,SET_MOVE } from "../types/preIcss";
+import {getPrecList,setPrecShow,setMove} from "../actions/preIcss";
 
 const initState = {
   preData: [],
-  preShow: false
+  preShow: false,
+  isMove:false
 };
 export default function(state = initState, action) {
   switch (action.type) {
@@ -11,6 +12,8 @@ export default function(state = initState, action) {
       return getPrecList(state, action);
     case SET_PREC_SHOW:
       return setPrecShow(state, action);
+    case SET_MOVE:
+      return setMove(state, action);
     default:
       return state;
   }

+ 1 - 0
src/store/types/preIcss.js

@@ -1,2 +1,3 @@
 export const GET_PREC_LIST = 'GET_PREC_LIST';
 export const SET_PREC_SHOW = 'SET_PREC_SHOW';
+export const SET_MOVE = 'SET_MOVE';

+ 71 - 6
src/utils/drag.js

@@ -8,6 +8,8 @@ import {
   getWindowInnerWidth,
   getPageCoordinate
 } from './tools'
+import { SET_MOVE } from "@store/types/preIcss";
+import store from "@store";
 
 let width = '',//屏幕宽度
   height = '', //屏幕高度
@@ -17,7 +19,8 @@ let width = '',//屏幕宽度
   dragX = 0,//鼠标可拖拽到左边的最大距离(元素定位左侧距离)
   dragY = 0,//鼠标可拖拽到上边的最大距离(元素定位上边距离)
   isDrag = false,//元素是否处于拖拽中
-  addPart = null;//展开区域,这个展开的宽度应当是固定宽度了
+  addPart = null,//展开区域,这个展开的宽度应当是固定宽度了
+  free=false;//有无边界限制
 /**
  * 
  * @param {事件对象} event 
@@ -34,9 +37,9 @@ function handleMove(event) {
   let maxDragY = height - wrapHeight; //最大可拖拽y方向距离
   if (dragDes[0]) { //存在就有类似治疗方案的弹窗,最大可推拽x方向距离
     dragDesWidth = dragDes[0].offsetWidth//展开元素的宽度
-    maxDragX = width - wrapWidth - dragDesWidth
+    maxDragX = free?'10000':width - wrapWidth - dragDesWidth
   } else {
-    maxDragX = width - wrapWidth
+    maxDragX = free?'10000':width - wrapWidth
   }
   if (isDrag) {
     dragX = page.boxLeft - mouseX //鼠标可拖拽到左边的最大距离
@@ -81,12 +84,13 @@ function handleUp(){
  * @param {拖动元素/清除拖动事件监听} type add:添加事件监听  del:移除事件监听
  * @param {展开元素id} addDom 
  */
-function dragBox(dragWrap,dragTop,type,addDom,img) {
+function dragBox(dragWrap,dragTop,type,addDom,img,free) {
   let drag = $("#"+dragTop); //拖拽区域
   let wrap = $("#"+dragWrap); //被拖拽的元素
   width = getWindowInnerWidth(); 
   height = getWindowInnerHeight();
   addPart = addDom||null;
+  free = free||false;
   dragWrapper = dragWrap;
   if (type === 'del') {
     $(document).off('mousemove', handleMove)
@@ -126,7 +130,7 @@ function dragBoxs(type){
       canDrag = true;
     })
     $(document).on('mousemove',handleMoves)
-    $(document).on('mousemove',handleUps)
+    $(document).on('mouseup',handleUps)
   }
 }
 function handleUps(){
@@ -148,7 +152,68 @@ function handleMoves(event){
     wrap.css({left:dragXS + 'px',marginLeft:0 + 'px',top:dragYS + 'px'})
   }
 }
+/**
+ * 预问诊预览图片可拖拽
+ */
+let imgXS = 0,//鼠标距离图片左侧的位置
+    imgYS = 0,//鼠标距离图片顶部的位置
+    imgDXS = 0,//图片距离左侧的位置
+    imgDYS = 0,//图片距离顶部的位置
+    imgWXS = 0,//图片容器距离顶部的位置
+    imgWYS = 0,//图片容器距离顶部的位置
+    imgDrag = false;
+function imgDragMove(type){
+  let wrap = $("#previewWrapper");
+  let drag = $("#drugImg");
+  if(type == 'del'){
+    $(document).off('mousemove', handleMoveImg)
+    $(document).off('mouseup', handleUpImg)
+    return
+  }else{
+    drag.on('mousedown',function(event){
+      event.preventDefault()
+      let page = getPageCoordinate(event,'0');
+      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
+        
+      $(document).on('mousemove',handleMoveImg)
+      $(document).on('mouseup',handleUpImg)
+    })
+  }
+}
+function handleUpImg(){
+  imgDrag = false;
+  return;
+}
+function handleMoveImg(event){  
+  let isMove = store.getState().preIcss.isMove;
+  !isMove&&store.dispatch({type:SET_MOVE,isMove:true})
+  let wrap = $("#previewWrapper");
+  let drag = $("#drugImg");
+  let page = getPageCoordinate(event,'0');
+  let wrapWidth = drag[0].offsetWidth;
+  let wrapHeight = drag[0].offsetHeight;
+  if(imgDrag){
+    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'
+    })
+  }
+}
 module.exports = {
   dragBox,
-  dragBoxs
+  dragBoxs,
+  imgDragMove
 }

+ 43 - 0
src/utils/tools.js

@@ -230,6 +230,49 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
           data:reData.checkBody,
           isText:true,    //查体只显示文本
       });
+      store.dispatch({type:SETREADDITEMS});     //清空已存的血压加号项
+        store.dispatch(clearAssistData([],'',[]));
+        store.dispatch(clearAllLabel([],[],''));
+        store.dispatch({
+            type: SET_TIPS,
+            tips: {}
+        })
+        store.dispatch({
+            type: CLEAR_ALL_DIAG,
+            data:[],
+            saveText:'',
+            mainSuitStr: '',
+            chronicMagItem:null
+        });
+        store.dispatch({
+            type: CLEAR_ALL_PUSH_MESSAGE,
+            data:{},
+            saveText:'',
+        });
+        store.dispatch({
+          type:CLEAR_FIRST_MAIN_DIAG,
+          flag:true
+        });
+        store.dispatch({
+          type: CLEAR_ALL_TREAT,
+        });
+        //清空已选的指标推送数据及填的值
+        store.dispatch({
+          type: CLEAR_ASSESS_RESULT_VALUE,
+        });
+        store.dispatch({//推送重置
+          type: BILLING_ADVICE,
+          determine:[],
+          doubt:[],
+          possible:[],
+          vigilant: [],
+          likely:[],
+          lab: [],
+          pacs:[],
+          setPushEmergency:{},
+          setPushEmergencyIdx:''
+        });
+        storageLocal.remove('emrParam');
     }else{
         let dataJson = JSON.parse(reData.dataJson);
         const docConfig = dataJson.docConfigs;