luolei %!s(int64=5) %!d(string=hai) anos
pai
achega
4ad400f869
Modificáronse 3 ficheiros con 210 adicións e 49 borrados
  1. 19 2
      src/components/PreInIcss/RotateImg/index.jsx
  2. 45 47
      src/utils/drag.js
  3. 146 0
      src/utils/tools.js

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

@@ -36,7 +36,7 @@ class RotateImg extends Component {
     const { idx,imgLis,windowHeight } = this.props;
     let currentImg = imgLis[idx];
     let scaleHeight = windowHeight*0.8;
-    let width = currentImg.width,height = currentImg.height;
+    let width = currentImg.width,height = currentImg.height,overLen;
     if(width>height){
       if(width > scaleHeight){
         height=scaleHeight/width*height
@@ -48,6 +48,7 @@ class RotateImg extends Component {
         height = scaleHeight
       }
     }
+    localStorage.setItem("changeImg",true)
     this.setState({
       current:idx,
       length:imgLis.length,
@@ -55,6 +56,10 @@ 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)
     })
   }
   handleNext(){
@@ -62,7 +67,7 @@ class RotateImg extends Component {
     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
@@ -93,6 +98,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)
     })
   }
   handlePrev(){
@@ -130,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)
   }
@@ -142,6 +155,8 @@ class RotateImg extends Component {
       })
       return;
     }
+    localStorage.setItem("changeImg",true)
+
     this.setState({
       imgWidth:1.2*imgWidth,
       imgHeight:1.2*imgHeight,
@@ -158,6 +173,8 @@ class RotateImg extends Component {
       })
       return;
     }
+    localStorage.setItem("changeImg",true)
+
     this.setState({
       imgWidth:imgWidth*0.8,
       imgHeight:imgHeight*0.8,

+ 45 - 47
src/utils/drag.js

@@ -177,7 +177,6 @@ let imgXS = 0,//鼠标距离图片左侧的位置
     drgLeft= 0,
     tmpValL=0,
     tmpNum=0,
-    tmpName='',
     tmpValR=0,
     imgDrag = false;
 function imgDragMove(type){
@@ -200,21 +199,20 @@ function imgDragMove(type){
       imgWXS = wrap.offset().left;
       imgWYS = wrap.offset().top;
 
-      if(tmpName){
-        if(drag.attr("src") != tmpName||drag.attr("data-deg")==0){
-          tmpNum==0
-        }
-      }else{
-        tmpName = drag.attr("src")
+      if(localStorage.getItem('changeImg')){
+        tmpNum == 0
+        // localStorage.setItem("changeImg",false)
+        
       }
       
-      if(tmpNum == 0){
-        tmpValL = imgDXS-imgWXS;
-        tmpValR = imgDYS-imgWYS;
-        tmpName = 
-        ++tmpNum
-      }
+      // if(tmpNum == 0){
+      //   tmpValL = imgDXS-imgWXS;
+      //   tmpValR = imgDYS-imgWYS;
+      //   ++tmpNum
+      // }
+
       console.log(imgDXS,imgWXS,tmpNum,'hahaha')
+
       $(document).on('mousemove',handleMoveImg)
       $(document).on('mouseup',handleUpImg)
     })
@@ -235,44 +233,44 @@ function handleMoveImg(event){
   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)
+    // 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;
 
-    // if(wrapHeight > wrapWidth){
-    //   drag.css({
-    //     width:wrapWidth+'px',
-    //     height:wrapHeight+'px',
-    //     marginLeft:'0px',
-    //     marginTop:'0px',
-    //     left:imgDXS+(de?163:0) + 'px',
-    //     top:imgDYS-(de?163:0) + 'px'
-    //   })
-    // }
-    // else{
-    //   drag.css({
-    //     width:wrapWidth+'px',
-    //     height:wrapHeight+'px',
-    //     marginLeft:'0px',
-    //     marginTop:'0px',
-    //     left:imgDXS-(de?163:0) + 'px',
-    //     top:imgDYS+(de?163:0) + 'px'
-    //   })
-    // }
-    drag.css({
-      width:wrapWidth+'px',
-      height:wrapHeight+'px',
-      marginLeft:'0px',
-      marginTop:'0px',
-      left:imgDXS-(de?tmpValL:0) + 'px',
-      top:imgDYS+(de?tmpValL:0) + '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 = {

+ 146 - 0
src/utils/tools.js

@@ -652,11 +652,157 @@ 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)
+  let obj = {
+    "hosCode": "string",
+    "ruleType": "string",
+    "age": message.patientAge,
+    "sex": 0,
+    "allergy": "string",
+    "chief": "string",
+    "diag": [
+      {
+        "dateValue": "string",
+        "name": "string",
+        "uniqueName": "string"
+      }
+    ],
+    "diagOrder": [
+      {
+        "dateValue": "string",
+        "name": "string",
+        "uniqueName": "string"
+      }
+    ],
+    "diagString": "string",
+    "disType": 0,
+    "diseaseName": {
+      "dateValue": "string",
+      "name": "string",
+      "uniqueName": "string"
+    },
+    "drug": [
+      {
+        "dateValue": "string",
+        "name": "string",
+        "uniqueName": "string"
+      }
+    ],
+    "drugOrder": [
+      {
+        "dateValue": "string",
+        "name": "string",
+        "uniqueName": "string"
+      }
+    ],
+    "drugString": "string",
+    "family": "string",
+    "infectious": "string",
+    "isMapping": 0,
+    "length": 0,
+    "lis": [
+      {
+        "dateValue": "string",
+        "detailName": "string",
+        "maxValue": 0,
+        "minValue": 0,
+        "name": "string",
+        "otherValue": "string",
+        "result": "string",
+        "source": 0,
+        "uniqueName": "string",
+        "units": "string",
+        "value": 0
+      }
+    ],
+    "lisOrder": [
+      {
+        "dateValue": "string",
+        "detailName": "string",
+        "maxValue": 0,
+        "minValue": 0,
+        "name": "string",
+        "otherValue": "string",
+        "result": "string",
+        "source": 0,
+        "uniqueName": "string",
+        "units": "string",
+        "value": 0
+      }
+    ],
+    "lisString": "string",
+    "marital": "string",
+    "marriage": "string",
+    "menstrual": "string",
+    "operation": "string",
+    "operationOrder": [
+      {
+        "dateValue": "string",
+        "name": "string",
+        "uniqueName": "string"
+      }
+    ],
+    "other": "string",
+    "otherOrder": [
+      {
+        "dateValue": "string",
+        "name": "string",
+        "uniqueName": "string"
+      }
+    ],
+    "pacs": [
+      {
+        "dateValue": "string",
+        "desc": "string",
+        "name": "string",
+        "result": "string",
+        "uniqueName": "string"
+      }
+    ],
+    "pacsOrder": [
+      {
+        "dateValue": "string",
+        "desc": "string",
+        "name": "string",
+        "result": "string",
+        "uniqueName": "string"
+      }
+    ],
+    "pacsString": "string",
+    "pasts": "string",
+    "patientId": 0,
+    "personal": "string",
+    "scaleName": "string",
+    "symptom": "string",
+    "sysCode": "string",
+    "sysType": 0,
+    "vaccination": "string",
+    "vital": "string"
+  }
   const main = filterDataArr(mainSuit.saveText)||'',
     current=filterDataArr(currentIll.saveText)||'',
     other = filterDataArr(otherHistory.saveText)||'',