فهرست منبع

Merge remote-tracking branch 'origin/optimize' into optimize

# Conflicts:
#	src/store/async-actions/pushMessage.js
zhouna 6 سال پیش
والد
کامیت
0755f5c881
39فایلهای تغییر یافته به همراه657 افزوده شده و 599 حذف شده
  1. 6 6
      src/common/components/ComplexModal/index.jsx
  2. 1 1
      src/common/components/ComplexModal/index.less
  3. 2 2
      src/components/CopyRight/CopyModalSon/index.jsx
  4. 2 2
      src/components/CopyRight/DiscontentSon/index.jsx
  5. 6 2
      src/components/CopyRight/index.jsx
  6. 3 0
      src/components/DiagnosticList/index.jsx
  7. 2 2
      src/components/HistoryCaseContainer/HistoryList/index.jsx
  8. 1 1
      src/components/HistoryCaseContainer/HistoryList/index.less
  9. 4 2
      src/components/HistoryCaseContainer/index.jsx
  10. 7 3
      src/components/Operation/index.jsx
  11. 3 2
      src/components/Preview/index.jsx
  12. 3 2
      src/components/PrintPreview/index.jsx
  13. 4 3
      src/components/PushItems/DetailsModal/index.jsx
  14. 84 0
      src/components/PushItems/RecommendInspect/index.jsx
  15. 56 0
      src/components/PushItems/RecommendInspect/index.less
  16. 61 0
      src/components/PushItems/TipsMsg/index.jsx
  17. 118 0
      src/components/PushItems/TipsMsg/index.less
  18. 29 236
      src/components/PushItems/index.jsx
  19. 1 51
      src/components/PushItems/index.less
  20. 8 9
      src/components/Treat/AdverseReactions/index.jsx
  21. 3 3
      src/components/Treat/DrugHistory/LastDrug/index.jsx
  22. 3 4
      src/components/Treat/DrugTreat/index.jsx
  23. 6 6
      src/components/Treat/index.jsx
  24. 7 6
      src/components/TreatDesc/DrugInfo/index.jsx
  25. 3 7
      src/components/TreatDesc/index.jsx
  26. 7 1
      src/containers/ChronicInfo.js
  27. 2 0
      src/containers/HistoryCases.js
  28. 5 5
      src/containers/Treat.js
  29. 3 2
      src/store/actions/inspect.js
  30. 4 4
      src/store/actions/treat.js
  31. 0 1
      src/store/async-actions/diagnosticSearch.js
  32. 3 3
      src/store/async-actions/inspect.js
  33. 19 8
      src/store/async-actions/pushMessage.js
  34. 48 50
      src/store/async-actions/treat.js
  35. 2 1
      src/store/reducers/inspect.js
  36. 1 0
      src/utils/config.js
  37. 134 90
      src/utils/drag.js
  38. 0 1
      src/utils/jqprint.js
  39. 6 83
      src/utils/tools.js

+ 6 - 6
src/common/components/ComplexModal/index.jsx

@@ -2,7 +2,7 @@ import React, { Component } from "react";
 import ReactDom from "react-dom";
 import style from "./index.less";
 import close from '@common/images/icon_close.png';
-import { dragBox } from '@utils/tools';
+import { dragBox } from '@utils/drag';
 /**
  * title:标题
  * children:弹窗内容
@@ -20,7 +20,7 @@ class ComplexModal extends Component {
     super(props);
   }
   componentDidMount(){
-    // dragBox('complexModalWrap','complexModalTitle','complexModalWrapMove')
+    dragBox('dragModalWrap','dragModalTitle','add')
   }
 
   render() {
@@ -28,13 +28,13 @@ class ComplexModal extends Component {
     const marginLeft = width? -parseInt(width)/2 : '';
     //const marginTop = height? -parseInt(height)/2: '';
     const domNode = document.getElementById('root');
-    return ReactDom.createPortal(<div className={style['container']} id="complexModalWrapMove">
+    return ReactDom.createPortal(<div className={style['container']}>
       <div className={style['shade']} onClick={shadeClose===false?'':onclose}></div>
-      <div id="complexModalWrap" className={style['modal']} style={{width: width?width:'auto', marginLeft:marginLeft, top:top?top+'px':'',bottom:bottom?bottom+'px':''}}>
-        <div className={`${style['close']} drag-title`} id="complexModalTitle">
+      <div id="dragModalWrap" className={style['modal']} style={{width: width?width:'auto', marginLeft:marginLeft, top:top?top+'px':'',bottom:bottom?bottom+'px':''}}>
+        <div className={`${style['close']} drag-title`} id="dragModalTitle">
           {icon?<img src={icon} />:''}
           {title}
-          <img src={close} onClick={onclose} className={style['closeIcon']} />
+          <img src={close} onClick={onclose} className={style['closeIcon']}/>
         </div>
         <div className={style["content"]} style = {{width: width?width:'auto'}}>{children}</div>
         <div className={style['footer']} style = {{width: width?width:'auto'}}>{footer}</div>

+ 1 - 1
src/common/components/ComplexModal/index.less

@@ -1,8 +1,8 @@
 @import "~@less/mixin.less";
 .container {
   // position: relative;
+  // padding-top: 40px;  //改为绝对定位,拖拽元素不在监听document,改为这个
   z-index: 2000;
-  // padding-top: 40px;
   position: absolute;
   width: 100%;
   height: 100%;

+ 2 - 2
src/components/CopyRight/CopyModalSon/index.jsx

@@ -1,14 +1,14 @@
 import React, { Component } from "react";
 import style from "../index.less";
 import close from '../../../common/images/icon_close.png'
-import { dragBox } from '@utils/tools';
+import { dragBox } from '@utils/drag';
 
 class DiscontentSon extends Component {
   constructor(props) {
     super(props);
   }
   componentDidMount(){
-    dragBox('CopyModalWrap','CopyModalTitle')
+    dragBox('CopyModalWrap','CopyModalTitle','add')
   }
 
   render() {

+ 2 - 2
src/components/CopyRight/DiscontentSon/index.jsx

@@ -1,14 +1,14 @@
 import React, { Component } from "react";
 import style from "../index.less";
 import close from '../../../common/images/icon_close.png'
-import { dragBox } from '@utils/tools';
+import { dragBox } from '@utils/drag';
 
 class DiscontentSon extends Component {
   constructor(props) {
     super(props);
   }
   componentDidMount(){
-    dragBox('disContentWrap','DisclatmerTitle')
+    dragBox('disContentWrap','DisclatmerTitle','add')
   }
 
   render() {

+ 6 - 2
src/components/CopyRight/index.jsx

@@ -2,6 +2,7 @@ import React, { Component } from "react";
 import style from "./index.less";
 import close from '../../common/images/icon_close.png'
 import { storageLocal } from "../../utils/tools"
+import { dragBox } from "@utils/drag"
 import DiscontentSon from "./DiscontentSon"
 import CopyModalSon from "./CopyModalSon"
 
@@ -32,6 +33,7 @@ class CopyRight extends Component {
 
   closeCopyModal() {
     this.props.closeCopyModal();
+    dragBox('CopyModalWrap','CopyModalTitle','del')
   }
 
   showDisclatmerModal(){
@@ -39,15 +41,17 @@ class CopyRight extends Component {
   }
 
   closeDisclatmerModal(){
-      this.props.closeDisclatmerModal()
+    dragBox('disContentWrap','DisclatmerTitle','del')
+    this.props.closeDisclatmerModal()
   }
   disclatmerContent() {
     const { disContent } = this.props.copyRight;
     // const disclatmer = disContent.data.data[2].description
     if(disContent.data) {
+      const disclatmerContent = disContent.data.data.find(item => item.title == '免责申明')
       return (
         <div className={style['message']}>
-          <div dangerouslySetInnerHTML={{__html: disContent.data.data[2].description}}></div>
+          <div dangerouslySetInnerHTML={{__html: disclatmerContent.description}}></div>
         </div>
       );
     }

+ 3 - 0
src/components/DiagnosticList/index.jsx

@@ -11,6 +11,7 @@ import Treat from '@containers/Treat'
 import store from '@store';
 import { initItemList ,setInitHistory} from '@store/async-actions/historyTemplates';
 import { pushAllDataList,inspectAndAssist ,deepClone} from '@utils/tools';
+import { dragBox } from '@utils/drag';
 import iconRadioDefault from '@common/images/icon-radio-default.png'
 import iconRadioActive from '@common/images/icon-radio-active.png'
 import AssessResult from '@containers/AssessResult';
@@ -204,6 +205,7 @@ class DiagnosticList extends Component {
               showAssess:false,
               isAssessConfirm:false,
             });
+            dragBox('dragModalWrap','dragModalTitle','del')
         }
     }
     handleSavePossible(obj){
@@ -222,6 +224,7 @@ class DiagnosticList extends Component {
           showAssess:false
         });
       });
+      dragBox('dragModalWrap','dragModalTitle','del')
     }
     componentWillReceiveProps(nextprops) {
       if (this.props.diagnosticStr != nextprops.diagnosticStr) {

+ 2 - 2
src/components/HistoryCaseContainer/HistoryList/index.jsx

@@ -6,7 +6,7 @@ import sort from "./img/sort.png"
 import close from "./img/close.png";
 import PreviewBody from '@components/PreviewBody';
 import Empty from '@components/Empty'
-import { dragBox } from '@utils/tools';
+import { dragBox } from '@utils/drag';
 
 
 class HistoryCaseContainer extends React.Component {
@@ -14,7 +14,7 @@ class HistoryCaseContainer extends React.Component {
         super(props);
     }
     componentDidMount(){
-      dragBox('hisWrapMove','closeHis')
+      dragBox('hisWrapMove','closeHis','add')
     }
     render(){
         const { items,handleCaseClick,handleQuoteClick,handleSortClick,showHistoryBox,activeHistory,preInfo } = this.props;

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

@@ -51,7 +51,7 @@
             height: 100%;
             span {
                 display: inline-block;
-                max-width: 130px;
+                max-width: 120px;
                 overflow: hidden;
                 text-overflow: ellipsis;
                 white-space: nowrap;

+ 4 - 2
src/components/HistoryCaseContainer/index.jsx

@@ -9,6 +9,7 @@ import { ConfirmModal } from '@commonComp';
 import { pushAllDataList } from '@utils/tools';
 import { CONFIRM_TYPE } from "@store/types/typeConfig";
 import {billing} from '@store/async-actions/pushMessage';
+import { dragBox } from '@utils/drag';
 
 class HistoryCaseContainer extends React.Component {
     constructor(props){
@@ -26,6 +27,7 @@ class HistoryCaseContainer extends React.Component {
         store.dispatch({type: CONFIRM_TYPE, confirmType: baseObj.sign});
         pushAllDataList(baseObj.sign,'push',baseObj,'history')       //引用
         store.dispatch(billing())
+        dragBox('hisWrapMove','closeHis','del')
     }
     close(){
       store.dispatch(visibleHistory(false));
@@ -34,7 +36,7 @@ class HistoryCaseContainer extends React.Component {
         const { visible,showHistoryCases,showHistoryBox,items,handleCaseClick,handleQuoteClick,handleSortClick,activeHistory,preInfo } = this.props;
         const domNode = document.getElementById('root');
         return ReactDom.createPortal(
-            <div className={styles.historyCaseWrap} style={{display:showHistoryCases?'block':'none'}}>
+              showHistoryCases?<div className={styles.historyCaseWrap}>
                 <div className={styles.maskHistory} onClick={showHistoryBox}></div>
                 <HistoryList 
                     items={items}
@@ -58,7 +60,7 @@ class HistoryCaseContainer extends React.Component {
                 >
                     <p className={styles['center']}>确认引用该病历?</p>
                 </ConfirmModal>
-            </div>
+            </div>:null
         ,domNode)
     }
 }

+ 7 - 3
src/components/Operation/index.jsx

@@ -9,6 +9,7 @@ import { ConfirmModal, Notify } from '@commonComp';
 import check_circle from './img/check-circle.png';
 import check_right from './img/check-right.png';
 import {getAllDataList,getAllDataStringList,isAllClear,filterDataArr,readyKeepHistory} from '@utils/tools';
+import {dragBox} from '@utils/drag';
 import store from '@store';
 import $ from 'jquery';
 
@@ -49,6 +50,7 @@ class Operation extends Component {
       zIndex:40
     })
     this.props.closePrintPreview()
+    dragBox('previewPrintWrapper','previewPrintStatic','del')
   }
 
 
@@ -58,12 +60,13 @@ class Operation extends Component {
     })
     this.props.showPreview()
   }
-
+  
   closePreview() {
     this.setState({
       zIndex:40
     })
     this.props.closePreview()
+    dragBox('previewWrapper','previewStatic','del')
   }
 
   saveAll(type) {
@@ -320,8 +323,9 @@ class Operation extends Component {
       <span className={style['preButton']} onClick={() => { this.saveHis(3) }}><img src={saveHistory} /> 保存病历模板</span>
       <span className={winWidth<=1082?`${style['saveButton']} ${style['minstyle']}`: style['saveButton']} onClick={() => { this.saveAll(1) }}>保存</span>
       <span className={winWidth<=1082?`${style['clearButton']} ${style['saveButton']} ${style['minstyle']}`:`${style['clearButton']} ${style['saveButton']}`} onClick={() => { this.clearAll(2) }}>清除</span>
-      <PrintPreviewContainer visible={visible} onClose={closePrint} />
-      <PreviewContainer visible={preVisible} onClose={closePreview} />
+      {visible?<PrintPreviewContainer visible={visible} onClose={closePrint} />:null}
+      {preVisible?<PreviewContainer visible={preVisible} onClose={closePreview} />:null}
+      
       <ConfirmModal
         visible={diagShow}        //改为全局控制
         confirm={() => { this.makeSure() }}

+ 3 - 2
src/components/Preview/index.jsx

@@ -1,5 +1,6 @@
 import React, { Component } from "react";
-import {getAllDataList,getAllDataStringList,dragBox} from '@utils/tools';
+import {getAllDataList,getAllDataStringList} from '@utils/tools';
+import {dragBox} from '@utils/drag';
 import PreviewBody from '../PreviewBody';
 import store from '@store';
 import style from "./index.less";
@@ -10,7 +11,7 @@ class Preview extends Component {
     super(props)
   }
   componentDidMount(){
-    dragBox('previewWrapper','previewStatic')
+    dragBox('previewWrapper','previewStatic','add')
   }
   render() {
     const { onClose, visible,preInfo } = this.props;

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

@@ -1,5 +1,6 @@
 import React, { Component } from "react";
-import { getAllDataList, getAllDataStringList,dragBox } from '@utils/tools';
+import { getAllDataList, getAllDataStringList } from '@utils/tools';
+import { dragBox } from '@utils/drag';
 import style from "./index.less";
 import PreviewBody from "../PreviewBody";
 import store from '@store';
@@ -12,7 +13,7 @@ class PrintPreview extends Component {
         super(props)
     }
     componentDidMount(){
-      dragBox('previewPrintWrapper','previewPrintStatic')
+      dragBox('previewPrintWrapper','previewPrintStatic','add')
     }
     render() {
         const { onClose, visible, preInfo,save } = this.props;

+ 4 - 3
src/components/PushItems/DetailsModal/index.jsx

@@ -4,7 +4,7 @@ import NewPortal from './NewPortal'
 import close from "./../img/close.png";
 import $ from "jquery";
 import { imageUrlPrefix } from '@utils/config.js';
-import { dragBox } from '@utils/tools';
+import { dragBox } from '@utils/drag';
 class DetailsModal extends Component {
     constructor(props) {
         super(props);
@@ -14,11 +14,12 @@ class DetailsModal extends Component {
         this.hideTips = this.hideTips.bind(this)
     }
     componentDidMount(){
-      dragBox('detailsContentWrap','detailsContentTitle')
+      dragBox('detailsContentWrap','detailsContentTitle','add')
     }
     hideTips() {
         const { hideTips } = this.props;
         hideTips && hideTips();
+        dragBox('detailsContentWrap','detailsContentTitle','del')
     }
     handleClickMenu(index, item, tipsDetails) {
         const that = this
@@ -57,7 +58,7 @@ class DetailsModal extends Component {
 
                 <div className={styles['details-wrapper']}>
                     <div className={styles['details-content-wrapper']} id="detailsContentWrap">
-                        <h1 id="detailsContentTitle" className={`${styles['details-content-name']} drag-title`} >{tipsDetails && tipsDetails.tagName} <img className={styles['details-close']} onClick={this.hideTips} src={close} /></h1>
+                        <h1 id="detailsContentTitle" className={`${styles['details-content-name']} drag-title`} >{tipsDetails && tipsDetails.name} <img className={styles['details-close']} onClick={this.hideTips} src={close} /></h1>
                         <div className={styles['details-content']} id= 'detailsContent' onScroll={this.handleScrollModal.bind(this, tipsDetails)}>
                             {tipsDetails && tipsDetails.details && tipsDetails.details.map((item, index) => {
                                 return (<div id={item.title}>

+ 84 - 0
src/components/PushItems/RecommendInspect/index.jsx

@@ -0,0 +1,84 @@
+import React, {Component} from 'react';
+import style from './index.less'
+import showImg from "@common/images/show.png";
+import hideImg from "@common/images/close.png";
+
+
+class RecommendInspect extends Component {
+    constructor(props) {
+        super(props)
+        this.state = {
+            showAll: false,
+        }
+        this.renderItem = this.renderItem.bind(this)
+    }
+    changeShowFlag() {
+      this.setState({
+        showAll: !this.state.showAll
+      })
+    }
+    
+    renderItem(item) {
+      const { changeFlag } = this.props
+      return <span>
+          <input
+            id={item.id + item.name}
+            onChange={() =>changeFlag(item)}
+            type="checkbox"
+            checked={item.checked}
+          />
+          <label for={item.id + item.name}>{item.name}</label>
+      </span>
+    }
+
+    render() {
+      const { title,list, changeFlag, border } = this.props
+      const { showAll } = this.state
+      const listAll = list.map(item => {
+          return this.renderItem(item)
+      });
+      let firstLineNum = 0;   //第一行字数
+      let secondLineNum = 0;      //第二行字数
+      const listHide = list.map((item, index) => {
+        firstLineNum = firstLineNum + item.name.length + 2;
+        if (firstLineNum > 26) {
+          secondLineNum = secondLineNum + item.name.length + 2; 
+          if(secondLineNum > 20) {
+            return;
+          } else {
+            return this.renderItem(item)
+          }
+        } else {
+
+          return this.renderItem(item)
+        }
+      });
+
+      return   (
+            <li className={style["inspectItem"]} style={border ? {"borderBottom": "1px solid #DFDFDF"} : ''}>
+              <div className={style["title"]}>{title}:</div>
+              <div className={style["content"]}>
+                {list.length === 0
+                  ?<span >无</span>
+                  : showAll
+                  ? listAll
+                  : listHide}
+                {secondLineNum > 21 ? (
+                  <span
+                    style={{ display: "inline-block" }}
+                    className={style["show"]}
+                    onClick={this.changeShowFlag.bind(this)}
+                  >
+                    {showAll ? '收起' : '更多'}
+                    <img src={showAll ? hideImg : showImg} />
+                  </span>
+                ) : (
+                  ""
+                )}
+              </div>
+            </li>
+        )
+    }
+}
+
+export default RecommendInspect;

+ 56 - 0
src/components/PushItems/RecommendInspect/index.less

@@ -0,0 +1,56 @@
+@import "~@less/variables.less";
+
+    
+        
+        .inspectItem{
+          padding: 10px 0px 4px 0px;
+          overflow: hidden;
+          .title{
+            float: left;
+            height: 26px;
+            line-height: 26px;
+            padding: 0px 0px 0px 0px ;
+          }
+          .content{
+            float: left;
+            width: 349px;
+            line-height: 26px;
+            padding: 0px 0px 0px 0px;
+            span{
+              font-size: 14px;
+              line-height: 14px;
+              display: inline-block;
+              margin: 6px;
+              cursor: pointer;
+              input[type='checkbox']{
+                float: left;
+                width: 14px;
+                height: 14px;
+                margin-right: 2px;
+                background-color: #fff;
+                -webkit-appearance:none;
+                border: 1px solid #c9c9c9;
+                border-radius: 2px;
+                outline: none;
+                cursor: pointer;
+              }
+              input[type=checkbox]:checked{
+                background: url("../../../common/images/checked.png")no-repeat center;
+                background-size: 12px 12px;
+              }
+              label {
+                cursor: pointer;
+              }
+            }
+          }
+        }
+        .show {
+            float: right;
+            color:  #58ACD7;;
+            font-size: 14px;
+            cursor: pointer;
+            img {
+              width: 12px;
+              height: 12px;
+            }
+          }

+ 61 - 0
src/components/PushItems/TipsMsg/index.jsx

@@ -0,0 +1,61 @@
+import React, { Component } from 'react';
+import style from './index.less';
+
+class TipsMsg extends Component {
+    constructor(props) {
+        super(props)
+    }
+
+    render() {
+        const { tips, showTips, tipsDiscalimer, tipsImg, tmpFlg} = this.props
+        return <div className={style["tips"]}>
+        <h1>
+          <img src={tipsImg} />
+          提示信息
+        </h1>
+        <div className={style["content"]}>
+          {tips && tips.details ? (
+            <div>
+              <div className={style["title"]}>
+                {tips.name}
+                <span
+                  className={style["tips-details"]}
+                  onClick={() => showTips()}
+                  style={{display:tmpFlg?'none':'inline-block'}}
+                >
+                  详情
+                </span>
+              </div>
+              {tips.details &&
+                tips.details.map((item, index) => {
+                  return (
+                      <div>
+                        <div
+                          dangerouslySetInnerHTML={{
+                            __html: item.title
+                          }}
+                        />
+                        <div
+                          dangerouslySetInnerHTML={{
+                            __html: item.content
+                          }}
+                        />
+                        {item.isReason === 1 && (
+                          <div className={style["warn"]}>
+                            {tipsDiscalimer.data.data &&tipsDiscalimer.data.data.find(item => item.title == '诊断免责信息')&&tipsDiscalimer.data.data.find(item => item.title == '诊断免责信息').description}
+                          </div>
+                        )}
+                      </div>
+                  );
+                })}
+            </div>
+          ) : (
+            "无"
+          )}
+        </div>
+    </div>
+    }
+}
+
+export default TipsMsg;
+

+ 118 - 0
src/components/PushItems/TipsMsg/index.less

@@ -0,0 +1,118 @@
+@import "~@less/variables.less";
+.tips{
+    border:1px solid #EAEDF1;
+    .tips-title,h1{
+      font-size: 14px;
+      color: #000;
+      padding: 8px 15px;
+      background: #EAF7FA;
+      font-weight: bold;
+      img {
+        float:left;
+        margin-top: 0px;
+        margin-right: 5px;
+      }
+    }
+    .tips-title{
+      .tips-name{
+        width: 255px;
+        display: inline-block;
+      }
+      h2{
+        display: inline-block;
+      }
+      .tips-btn{
+        display: inline-block;
+        float: right;
+      }
+      .redTips{
+        display: inline-block;
+        font-size: 12px;
+        -webkit-transform:scale(0.9);
+        color: red;
+        font-weight: normal;
+        white-space: nowrap;
+      }
+      .tipsDetails {
+        .btnCom;
+        display: inline-block;
+        font-weight: normal;
+        width: 42px;
+        height: 20px;
+        border: 1px solid #262626;
+        font-size: 12px;
+        // color: #3B9ED0;
+        color: #262626;
+        line-height: 18px;
+        margin: 0 0 -2px 10px;
+      }
+    }
+    .chronic{
+      background: rgba(242,150,91,0.1);
+    }
+    .content{
+      font-size: 14px;
+      padding:6px 15px;
+      .title {
+        font-size: 14px;
+        line-height: 18px;
+        margin-bottom:10px;
+        a{
+          .btnCom;
+          display: inline-block;
+          font-size: 14px;
+          color: #3B9ED0;
+          width: 42px;
+          border: 1px solid #3B9ED0;
+          margin-left: 10px;
+          text-decoration: none;
+        }
+        .tips-details {
+          .btnCom;
+          display: inline-block;
+          width: 42px;
+          height: 20px;
+          border: 1px solid #3B9ED0;
+          font-size: 14px;
+          color: #3B9ED0;
+          line-height: 18px;
+          margin: 0 10px -2px;
+        }
+      }
+      .warn{
+        padding: 10px 0px 0px 0px;
+        font-size: 10px;
+        color: #979797;
+        text-align: center;
+      }
+      .list{
+        border-bottom: 1px solid #EAEDF1;
+        padding-bottom: 10px;
+        position: relative;
+        .infoPic{
+          vertical-align: middle;
+          margin: 0 5px;
+        }
+        >p{
+          margin-top: 10px;
+        }
+        .listName{
+          color:#3B9ED0;
+        }
+        .listResult{
+          float: right;
+          color: #000012;
+          i{
+            color: #F98F24;
+          }
+          img{
+            vertical-align: middle;
+          }
+        }
+      }
+      
+      .list:last-child{
+        border-bottom:none;
+      }
+    }
+  }

+ 29 - 236
src/components/PushItems/index.jsx

@@ -16,6 +16,8 @@ import {addAssistLabel} from '@store/actions/assistCheck';
 import {windowEventHandler,getCurrentDate,getWindowInnerHeight} from '@utils/tools'
 import {ConfirmModal} from '@commonComp';
 import ChronicInfo from '@containers/ChronicInfo';//慢病推送模块
+import RecommendInspect from './RecommendInspect';
+import TipsMsg from './TipsMsg'
 
 class PushItems extends Component {
   constructor(props) {
@@ -61,6 +63,7 @@ class PushItems extends Component {
       name: '',
       questionId: '',
       showType: 1,
+      uniqueName:''
     }
     let obj1 = {  //添加辅检
       name: '',
@@ -81,6 +84,7 @@ class PushItems extends Component {
         tmpObj.questionId = checkedAssay[i].id
         tmpObj.name = checkedAssay[i].name
         tmpObj.details = tmpDetail
+        tmpObj.uniqueName = checkedAssay[i].uniqueName||''
         assayArr.push(tmpObj)
       }
       store.dispatch(addLabel(assayArr))
@@ -114,7 +118,7 @@ class PushItems extends Component {
     this.props.changeCheck(item);
   }
 
-  showTips(tips) {
+  showTips() {
     const { getTipsDetails, showTipsDetailsModal } = this.props;
     getTipsDetails && getTipsDetails();
     showTipsDetailsModal && showTipsDetailsModal()
@@ -148,119 +152,12 @@ class PushItems extends Component {
       tmpFlg,
     } = this.props.pushMessage;
     const { tipsDiscalimer,chronicPushItems,wholeIndexs} = this.props;
-    const { moreAssay, moreCheck ,show} = this.state;
     const {
-      showMore,
-      closeMore,
       billing,
       changeCheck,
       changeAssay,
       showTips
     } = this;
-    let assayNum = 0;
-    let assayNum2 = 0; 
-    let assayHide = assay.map((item, index) => {
-      assayNum = assayNum + item.name.length + 2;
-      if (assayNum > 26) {
-        assayNum2 = assayNum2 + item.name.length + 2; 
-        if(assayNum2 > 20) {
-          return;
-        } else {
-          return (
-            <span>
-              
-              <input
-                id={item.id + item.name}
-                onChange={() => changeAssay(item)}
-                type="checkbox"
-                checked={item.checked}
-              />
-              <label for={item.id + item.name}>{item.name}</label>
-            </span>
-          );
-        }
-      } else {
-        return (
-          <span>
-            
-            <input
-              id={item.id + item.name}
-              onChange={() => changeAssay(item)}
-              type="checkbox"
-              checked={item.checked}
-            />
-            <label for={item.id + item.name}>{item.name}</label>
-          </span>
-        );
-      }
-    });
-
-    const assays = assay.map(item => {
-      return (
-        <span>
-          <input
-            id={item.id + item.name}
-            onChange={() => changeAssay(item)}
-            type="checkbox"
-            checked={item.checked}
-          />
-          <label for={item.id + item.name}>{item.name}</label>
-        </span>
-      );
-    });
-
-    let checkNum = 0;
-    let checkNum2 = 0;
-    let checkHide = check.map((item, index) => {
-      checkNum = checkNum + item.name.length + 2;
-      if (checkNum > 26) {
-        checkNum2 = checkNum2 + item.name.length + 2; 
-        if(checkNum2 > 20) {
-          return;
-        }else {
-          return (
-            <span>
-              <input
-                id={item.id + item.name}
-                onChange={() => changeCheck(item)}
-                type="checkbox"
-                checked={item.checked}
-              />
-              <label for={item.id + item.name}>{item.name}</label>
-            </span>
-          );
-        }
-
-
-        
-      } else {
-        return (
-          <span>
-            <input
-              id={item.id + item.name}
-              onChange={() => changeCheck(item)}
-              type="checkbox"
-              checked={item.checked}
-            />
-            <label for={item.id + item.name}>{item.name}</label>
-          </span>
-        );
-      }
-    });
-
-    const checks = check.map(item => {
-      return (
-        <span>
-          <input
-            id={item.id + item.name}
-            onChange={() => changeCheck(item)}
-            type="checkbox"
-            checked={item.checked}
-          />
-          <label for={item.id + item.name}>{item.name}</label>
-        </span>
-      );
-    });
 
     const vigilants = vigilant.map((item, index) => {
       return <div key={item.id} className={style['push-diag-item']}><DiagnosticItem item={item} type='disSelect'/></div>;
@@ -324,142 +221,38 @@ class PushItems extends Component {
                     开单
                 </div>
               </h1>
-              <div>
+              <div  className={style["contentBox"]}>
                 {assay.length === 0 && check.length === 0 ? (
                   <span>无</span>
-                ) : (
-                  <ul>
-                    <li className={style["firstLi"]}>
-                      <div className={style["title"]}>化验:</div>
-                      <div className={style["content"]}>
-                        {assay.length === 0
-                          ?<span >无</span>
-                          : moreAssay
-                          ? assays
-                          : assayHide}
-                        {assayNum2 > 21 ? (
-                          <span
-                            style={
-                              moreAssay
-                                ? { display: "none" }
-                                : { display: "inline-block" }
-                            }
-                            className={style["show"]}
-                            onClick={() => showMore("moreAssay")}
-                          >
-                            更多
-                            <img src={showImg} />
-                          </span>
-                        ) : (
-                          ""
-                        )}
-                        <span
-                          style={
-                            moreAssay
-                              ? { display: "inline-block" }
-                              : { display: "none" }
-                          }
-                          className={style["close"]}
-                          onClick={() => closeMore("moreAssay")}
-                        >
-                          收起
-                          <img src={hideImg} />
-                        </span>
-                      </div>
-                    </li>
-                    <li className={style["lastLi"]}>
-                      <div className={style["title"]}>检查:</div>
-                      <div className={style["content"]}>
-                        {check.length === 0
-                          ? "无"
-                          : moreCheck
-                          ? checks
-                          : checkHide}
-                        {checkNum2 > 21 ? (
-                          <span
-                            style={
-                              moreCheck
-                                ? { display: "none" }
-                                : { display: "inline-block" }
-                            }
-                            className={style["show"]}
-                            onClick={() => showMore("moreCheck")}
-                          >
-                            更多
-                            <img src={showImg} />
-                          </span>
-                        ) : (
-                          ""
-                        )}
-                        <span
-                          style={
-                            moreCheck
-                              ? { display: "inline-block" }
-                              : { display: "none" }
-                          }
-                          className={style["close"]}
-                          onClick={() => closeMore("moreCheck")}
-                        >
-                          收起
-                          <img src={hideImg} />
-                        </span>
-                      </div>
-                    </li>
-                  </ul>
-                )}
+                ) : (<ul>
+                     <RecommendInspect
+                      title = '化验'
+                      list = {assay}
+                      changeFlag = {changeAssay}
+                      border = "true"
+                    >
+                    </RecommendInspect>
+                    <RecommendInspect
+                      title = '检查'
+                      list = {check}
+                      changeFlag = {changeCheck}
+                    >
+                    </RecommendInspect>
+                  </ul>)}
               </div>
             </div>
             {/*{chronicPushItems&&chronicPushItems.length>0?<ChronicInfo data={chronicPushItems}></ChronicInfo>:''}*/}
             {<ChronicInfo></ChronicInfo>}
-            <div className={style["tips"]}>
-              <h1>
-                <img src={tipsImg} />
-                提示信息
-              </h1>
-              <div className={style["content"]}>
-                {tips && tips.details ? (
-                  <div>
-                    <div className={style["title"]}>
-                      {tips.name}
-                      <span
-                        className={style["tips-details"]}
-                        onClick={() => showTips(tips)}
-                        style={{display:tmpFlg?'none':'inline-block'}}
-                      >
-                        详情
-                      </span>
-                    </div>
-                    {tips.details &&
-                      tips.details.map((item, index) => {
-                        return (
-                            <div>
-                              <div
-                                dangerouslySetInnerHTML={{
-                                  __html: item.title
-                                }}
-                              />
-                              <div
-                                dangerouslySetInnerHTML={{
-                                  __html: item.content
-                                }}
-                              />
-                              {item.isReason === 1 && (
-                                <div className={style["warn"]}>
-                                  {tipsDiscalimer.data.data[0]&&tipsDiscalimer.data.data[0].description}
-                                </div>
-                              )}
-                            </div>
-                        );
-                      })}
-                  </div>
-                ) : (
-                  "无"
-                )}
-              </div>
-            </div>
+            <TipsMsg
+             tmpFlg = {tmpFlg}
+             tipsImg = {tipsImg}
+              tips = {tips}
+              showTips = {showTips}
+              tipsDiscalimer = {tipsDiscalimer}
+            ></TipsMsg>
           </div>
         </div>
-        {tipsDiscalimer.data && <div className={style['disTips']} dangerouslySetInnerHTML={{__html: tipsDiscalimer.data.data[1]&&tipsDiscalimer.data.data[1].description}}></div>}
+        {tipsDiscalimer.data && <div className={style['disTips']} dangerouslySetInnerHTML={{__html: tipsDiscalimer.data.data &&tipsDiscalimer.data.data.find(item => item.title == '推送免责信息')&&tipsDiscalimer.data.data.find(item => item.title == '推送免责信息').description}}></div>}
         {showTipsDetails && <DetailsModal  
             showTipsDetails = {showTipsDetails}
             hideTips = {this.hideTips}

+ 1 - 51
src/components/PushItems/index.less

@@ -122,59 +122,9 @@
         font-size: 12px;
       }
     }
-    div{
+    .contentBox {
       font-size: 14px;
       padding:6px 0px 6px 15px;
-      ul{
-        .firstLi{
-          border-bottom: 1px solid #DFDFDF;
-        }
-        .lastLi{
-          padding-bottom: 0px;
-        }
-        li{
-          padding: 10px 0px 4px 0px;
-          overflow: hidden;
-          .title{
-            float: left;
-            height: 26px;
-            line-height: 26px;
-            padding: 0px 0px 0px 0px;
-          }
-          .content{
-            float: left;
-            width: 349px;
-            line-height: 26px;
-            padding: 0px 0px 0px 0px;
-            span{
-              font-size: 14px;
-              line-height: 14px;
-              display: inline-block;
-              margin: 6px;
-              cursor: pointer;
-              input[type='checkbox']{
-                float: left;
-                width: 14px;
-                height: 14px;
-                margin-right: 2px;
-                background-color: #fff;
-                -webkit-appearance:none;
-                border: 1px solid #c9c9c9;
-                border-radius: 2px;
-                outline: none;
-                cursor: pointer;
-              }
-              input[type=checkbox]:checked{
-                background: url("../../common/images/checked.png")no-repeat center;
-                background-size: 12px 12px;
-              }
-              label {
-                cursor: pointer;
-              }
-            }
-          }
-        }
-      }
     }
   }
   .tips{

+ 8 - 9
src/components/Treat/AdverseReactions/index.jsx

@@ -37,15 +37,16 @@ class AdverseReactions extends Component {
         this.setState({
             hasEnterImg: false
         })
-    }
+
+     }
     setDrugInfo(item) {
         const { setDrugInfo } = this.props;
-        setDrugInfo && setDrugInfo(item, 10, 6);
+        setDrugInfo && setDrugInfo({name: item.name, type: 10, position: 6});
     }
 
 
     render() {
-        const { icon, titleStyle,titleBg, filter, title,  adversReactionList, showDrugInfo, setDrugInfo } = this.props
+        const { icon, titleStyle,titleBg, filter, title,  adversReactionList, setDrugInfo } = this.props
         const  { currentIndex, hasEnterImg } = this.state
         return(
             <div className={style['last-treat-wrapper']}>
@@ -54,22 +55,20 @@ class AdverseReactions extends Component {
                 {/* {console.log('adversReactionList', adversReactionList)} */}
 
                 {adversReactionList.map((item, index) => {
-                    return (<div className={style['adverse-reactions-item']} key={item.id}>
-                    <span className={style['last-treat-name-box']}
-                        
-                    >   
+                    return (<div className={style['adverse-reactions-item']} key={item.conceptId}>
+                    <span className={style['last-treat-name-box']}>   
                         <span   
                                 className={style['last-treat-big-name-box']} 
                                 onMouseEnter={this.handleMouseEnterDrug.bind(this, index, item)}
                                 onMouseLeave = {this.handleMouseLeaveDrug}
                         >
-                            <span className={style['last-treat-big-name']} >{item.tagName}:
+                            <span className={style['last-treat-big-name']} >{item.name}:
                                 {<img className={style['info-img']}  
                                     style ={currentIndex === index  ? {display: "inline-block"} : {display: "none"}}
                                     src={currentIndex === index ?(hasEnterImg ? info3 : info2 ): info2} 
                                     onMouseEnter={this.handleMouseEnterImg.bind(this)}
                                     onMouseLeave = {this.handleMouseLeaveImg}
-                                    onClick={() =>{this.setDrugInfo(item);showDrugInfo();}}/>}
+                                    onClick={this.setDrugInfo.bind(this, item)}/>}
                             </span>
                         </span>
                         

+ 3 - 3
src/components/Treat/DrugHistory/LastDrug/index.jsx

@@ -39,12 +39,12 @@ class LastDrug extends Component {
     }
     setDrugInfo(item) {
         const { setDrugInfo } = this.props;
-        setDrugInfo && setDrugInfo(item,8,5);
+        setDrugInfo && setDrugInfo({name: item.medicitionName,type: 8,position: 5});
     }
 
 
     render() {
-        const { icon, titleStyle,titleBg, filter, title, lastDrugList, showDrugInfo } = this.props
+        const { icon, titleStyle,titleBg, filter, title, lastDrugList } = this.props
         const  { currentIndex, hasEnterImg } = this.state
         return(
              <div className={style['last-common-box']}>
@@ -63,7 +63,7 @@ class LastDrug extends Component {
                                 src={currentIndex === index ?(hasEnterImg ? info3 : info2 ): info2} 
                                 onMouseEnter={this.handleMouseEnterImg.bind(this)}
                                 onMouseLeave = {this.handleMouseLeaveImg}
-                                onClick={() =>{this.setDrugInfo(item);showDrugInfo();}}/>}
+                                onClick={this.setDrugInfo.bind(this, item)}/>}
                             {index == lastDrugList.length-1 ?  '' : <span>,</span>}
                         </span>
                     })}

+ 3 - 4
src/components/Treat/DrugTreat/index.jsx

@@ -67,15 +67,14 @@ class DrugTreat extends Component {
     }
     //搜索药品说明书(查看数据用)
     searchDrug() {
-        const { showDrugInfo, setDrugInfoMore } = this.props
+        const { setDrugInfoMore } = this.props
         const drugIdList = this.state.drugIdList.split(' ')
         setDrugInfoMore({drugIdList: drugIdList})
-        showDrugInfo && showDrugInfo();
     }
     
     showTreatDesc() {
         $('#treatDescBox').css({'display': 'block'});
-        $('#treatWrapper').animate({'margin-left': '-471px','left':'50%'}, 300);
+        $('#dragModalWrap').animate({'margin-left': '-471px','left':'50%'}, 300);
         $('#treatDescBox').animate({'width': '260px'}, 500);
     }
 
@@ -110,7 +109,7 @@ class DrugTreat extends Component {
                                               src={currentIndex === index ? (ii === currentImg ? (hasEnterImg ? info3 : info2) : info2): info2} 
                                               onMouseEnter={this.handleMouseEnterImg.bind(this, ii, index)}
                                               onMouseLeave = {this.handleMouseLeaveImg}
-                                              onClick={() =>{this.setDrugInfo(it);showDrugInfo();}}/>}
+                                              onClick={this.setDrugInfo.bind(this,it)}/>}
                                         </span>
                                         
                                         

+ 6 - 6
src/components/Treat/index.jsx

@@ -6,7 +6,6 @@ import DrugHistory from './DrugHistory/index.jsx';
 import FollowUp from './FollowUp/index.jsx';
 import AdverseReactions from './AdverseReactions/index.jsx';
 import TreatDesc from '@components/TreatDesc'
-import {dragBox,windowRemoveEventHandler} from '@utils/tools'
 import DrugInfo from '@components/TreatDesc/DrugInfo';
 import Notify from '@commonComp/Notify'
 import close from './img/close.png';
@@ -16,6 +15,7 @@ import followUpIcon from './img/followUp.png';
 import drugIcon from './img/drug.png';
 import adverseReactionIcon from './img/adverseReaction.png';
 import $ from "jquery";
+import {dragBox} from '@utils/drag';
 
 class Treat extends Component {
     constructor(props){
@@ -29,7 +29,7 @@ class Treat extends Component {
         this.setTreatBox = this.setTreatBox.bind(this);
     }
     componentDidMount(){
-      dragBox('treatWrapper','dragTreatTitle')
+      dragBox('dragModalWrap','dragModalTitle','add','treatDescBox')
     }
     
     hideTreat() {
@@ -38,7 +38,7 @@ class Treat extends Component {
         clearTreat && clearTreat();
         hideTreat && hideTreat();
         hideDrugInfo && hideDrugInfo();
-        // windowRemoveEventHandler('mousemove',handleMove,document)
+        dragBox('dragModalWrap','dragModalTitle','del')
     }
     handlePrescription() {
         Notify.info('该功能即将上线,敬请期待。', 2000)
@@ -57,7 +57,7 @@ class Treat extends Component {
     }
    
     setTreatBox(){
-      $('#treatWrapper').css({'z-index': 302});
+      $('#dragModalWrap').css({'z-index': 302});
       $('#drugWrapper').css({'z-index': 301});
     }
     render(){
@@ -69,9 +69,9 @@ class Treat extends Component {
             <div   className={style['treat-wrapper']}>
                 <div className={style['treat-mask']} onClick={this.hideTreat}>
                 </div>
-                <div id="treatWrapper" className={style['treat-box']}  onselectstart="return false">
+                <div id="dragModalWrap" className={style['treat-box']}  onselectstart="return false">
                     <img className={style.close} onClick={this.hideTreat} src={close}/>
-                    <div onMouseDown={this.setTreatBox} id="dragTreatTitle" className={style['treat-title']}>治疗方案 ({treatItem.name})</div>
+                    <div onMouseDown={this.setTreatBox} id="dragModalTitle" className={style['treat-title']}>治疗方案 ({treatItem.name})</div>
 
                     <div className={style['treat-inner-box']}>
                         <GeneralTreat icon={generalIcon} title='一般治疗'   generalTreat={generalTreat}></GeneralTreat>

+ 7 - 6
src/components/TreatDesc/DrugInfo/index.jsx

@@ -2,7 +2,9 @@ import React, { Component } from 'react';
 import style from './index.less';
 import close from './../img/close.png';
 import $ from "jquery";
-import {dragBox} from '@utils/tools'
+import {dragBoxs} from '@utils/drag'
+import { imageUrlPrefix } from '@utils/config.js';
+
 
 
 class DrugInfo extends Component {
@@ -15,7 +17,7 @@ class DrugInfo extends Component {
         this.setDragBox = this.setDragBox.bind(this)
     }
     componentDidMount(){
-      dragBox('drugWrapper','drugTitle')
+      dragBoxs('add')
     }
     handleClickMenu(index, item, drugDesc) {
         const that = this
@@ -24,8 +26,7 @@ class DrugInfo extends Component {
                 currentIndex: index
             })
         },0)
-        
-        let scrollTop = 60 //标题高度为60px
+        let scrollTop = 60; //标题高度为60px
         drugDesc.map((it, ii) => {
             if( ii < index) {
                 scrollTop = scrollTop + parseInt($('#' + it.title.trim()).css('height'))
@@ -47,7 +48,7 @@ class DrugInfo extends Component {
         }
     }
     setDragBox(){
-      $('#treatWrapper').css({'z-index': 301});
+      $('#dragModalWrap').css({'z-index': 301});
       $('#drugWrapper').css({'z-index': 302});
     }
     render() {
@@ -61,7 +62,7 @@ class DrugInfo extends Component {
                     {drugInfo.drugDesc.map((item, index) =>{
                         return <div className={style['drug-desc-item']} id={item.title.trim()}>
                             <div className={style['drug-desc-title']} >{item.title.trim()}</div> 
-                            <div className={style['drug-desc-content']} dangerouslySetInnerHTML ={{__html: item.content}}></div> 
+                            <div className={style['drug-desc-content']} dangerouslySetInnerHTML ={{__html: item.content.replace(/{imageUrlPrefix}/g, imageUrlPrefix)}}></div> 
                         </div>
                     })}
                     <div className={style['content-menu-box']}>

+ 3 - 7
src/components/TreatDesc/index.jsx

@@ -58,15 +58,14 @@ class TreatDesc extends Component {
     hideTreatDesc() {
         $('#treatDescBox').css({'display': 'none'});
         $('#treatDescBox').animate({'display': 'none'}, 500);
-        $('#treatWrapper').animate({'margin-left': '-340px','left':'50%'}, 500);
+        $('#dragModalWrap').animate({'margin-left': '-340px','left':'50%'}, 500);
     }
 
     render(){
-        const  { treatment, treatDesc, setDrugInfo, showDrugInfo} = this.props
+        const  { treatment, treatDesc, setDrugInfo} = this.props
         const { title, basic, otherDrugIndex, drugDesc} = treatDesc
         const { currentIndex, hasEnterImg } = this.state
         return (treatment && treatment.length >0 && <div  className={style['treat-desc-box']}>
-            
             {title && title === '药品推荐' ? <div className={style['similar-drug-box']} id='treatDescBox'>
                 {/* { basic && basic.length > 0 && <div> //推荐依据不需要展示
                     <h3 className={style['recommend-title']}>推荐依据</h3>
@@ -74,7 +73,6 @@ class TreatDesc extends Component {
                         return (<div className={style['drug-desc-item']} dangerouslySetInnerHTML ={{__html: item.content}}>
                         </div>)
                     })}
-                    
                 </div> } */}
                 { otherDrugIndex > -1 && <div  className={style['similar-drug']}>
                     <h3 className={style['drug-desc-title']}><span className={style['drug-desc-class-title']} title={'同类药物(' + treatment[otherDrugIndex].bigdrugsName + ')'}>同类药物({treatment[otherDrugIndex].bigdrugsName})</span>  <img src={packUp} onClick={this.hideTreatDesc} className={style['close-drug-desc']} /></h3>
@@ -98,7 +96,7 @@ class TreatDesc extends Component {
                                 src={currentIndex === index ?  (hasEnterImg ? info3 : info2) : info2} 
                                 onMouseEnter={this.handleMouseEnterImg.bind(this, index)}
                                 onMouseLeave = {this.handleMouseLeaveImg}
-                                onClick={() =>{setDrugInfo(item,8,5);showDrugInfo();}}
+                                onClick={() =>{setDrugInfo({name: item.medicitionName, type: 8, position: 5})}}
                                 />}
                         </span>              
                         
@@ -122,8 +120,6 @@ class TreatDesc extends Component {
                     })}
                 </div> }
             </div>: '' } */}
-            
-            
         </div>)
     }
 }

+ 7 - 1
src/containers/ChronicInfo.js

@@ -8,6 +8,7 @@ import {saveClickNum} from '@store/async-actions/homePage';
 import { getFormulaResult } from '@store/async-actions/fetchModules'
 import {deepClone} from '@utils/tools';
 import Notify from '@commonComp/Notify';
+import {dragBox} from '@utils/drag';
 
 function mapStateToProps(state){
   const {pushMessage,assessResult} = state;
@@ -44,6 +45,9 @@ function mapDispatchToProps(dispatch){
         value:param.value,
         item:item?Object.assign({},item):undefined
       })
+      if(!param.value){
+        dragBox('dragModalWrap','dragModalTitle','del')
+      }
     },
     getScaleInfo(item){
       dispatch(getScaleInfo(item))
@@ -123,4 +127,6 @@ function mapDispatchToProps(dispatch){
 }
 
 const ChronicInfoContainer = connect(mapStateToProps,mapDispatchToProps)(ChronicInfo);
-export default ChronicInfoContainer;
+export default ChronicInfoContainer;
+
+

+ 2 - 0
src/containers/HistoryCases.js

@@ -3,6 +3,7 @@ import { connect } from 'react-redux';
 import HistoryCaseContainer from '@components/HistoryCaseContainer';
 import { showHistory,sortHistory,activeHistory,visibleHistory } from '@store/actions/historyTemplates'
 import {keepPushData} from '@store/actions/tabTemplate';
+import { dragBox } from '@utils/drag';
 
 function mapStateToProps(state) {
     return {
@@ -18,6 +19,7 @@ function mapStateToProps(state) {
 function mapDispatchToProps(dispatch) {
     return {
         showHistoryBox(){
+            dragBox('hisWrapMove','closeHis','del')
             dispatch(showHistory(false))
         },
         handleCaseClick(e,val){

+ 5 - 5
src/containers/Treat.js

@@ -4,7 +4,8 @@ import Treat from '@components/Treat';
 import { SELECT_DRUG, SET_OTHER_DRUG, SET_DRUG_INFO, CLEAR_DRUG_INFO,HIDE_TREAT, CLEAR_TREAT, SHOW_DRUG_INFO, HIDE_DRUG_INFO, CHANGE_REACT,  DEL_REACT, SET_FOLLOW_UP } from '@store/types/treat.js';
 import { getInstroduce, getRecommendBasic, getInstroduceMore, commonTreatAddToAdvice, saveAllAdverseReactions, setAllFollowUp } from '@store/async-actions/treat';
 import { ADD_SCHEME } from '@store/types/pushMessage.js'
-import { showDrugInfo } from '../store/actions/treat';
+import { getConceptDetail } from '@store/async-actions/pushMessage';
+import {dragBoxs} from '@utils/drag';
 
 
 function mapStateToProps(state){
@@ -51,7 +52,7 @@ function mapDispatchToProps(dispatch) {
             // dispatch(getRecommendBasic(item))
         },
         setDrugInfo: (item) => {
-            dispatch(getInstroduce(item));
+            dispatch(getConceptDetail(item));
         },
         hideTreat: () => {
             dispatch({
@@ -64,11 +65,10 @@ function mapDispatchToProps(dispatch) {
             })
         },
         showDrugInfo: () => {
-            dispatch({
-                type: SHOW_DRUG_INFO
-            })
+            
         },
         hideDrugInfo: () =>{
+            dragBoxs('del')            
             dispatch({
                 type: CLEAR_DRUG_INFO
             })

+ 3 - 2
src/store/actions/inspect.js

@@ -15,9 +15,10 @@ export const addLabel = (lis) => ({          //右侧开单
     type:ADD_LABEL,
     lis
 })
-export const resetLabel = (list) => ({          //搜索后点击选中的结果重组
+export const resetLabel = (list,uniqueName) => ({          //搜索后点击选中的结果重组
     type:RESET_LABEL,
-    list
+    list,
+    uniqueName
 })
 
 export const fillActived = (id,idx) => ({

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

@@ -149,7 +149,7 @@ export const setALLAdverseReactions =(state, action) => {
     let allAdversReactionList = res.allAdversReactionList
     let hasAdversReactionList = false
     for( let i = 0; i < allAdversReactionList.length; i++) {
-        if (action.adversReactionList.id == allAdversReactionList[i].id) {
+        if (action.adversReactionList.conceptId == allAdversReactionList[i].conceptId) {
             allAdversReactionList[i] = action.adversReactionList
             hasAdversReactionList = true
         } 
@@ -179,7 +179,7 @@ export const delReact = (state, action) => {
     const res = JSON.parse(JSON.stringify(state));
     let allAdversReactionList = res.allAdversReactionList;
     for( let i = 0; i < allAdversReactionList.length; i++) {
-        if (action.item.id == allAdversReactionList[i].id) {
+        if (action.item.conceptId == allAdversReactionList[i].conceptId) {
             allAdversReactionList.splice(i, 1)
         } 
     }
@@ -202,7 +202,7 @@ export const setAllFollowUp = (state, action) => {
     let followUpList = res.followUpList
     let hasfollowUp = false
     for( let i = 0; i < followUpList.length; i++) {
-        if (action.followUp.id == followUpList[i].id) {
+        if (action.followUp.conceptId == followUpList[i].conceptId) {
             followUpList[i] = action.followUp
             hasfollowUp = true
         } 
@@ -218,7 +218,7 @@ export const delFollowUp = (state, action) => {
     const res = JSON.parse(JSON.stringify(state));
     let followUpList = res.followUpList;
     for( let i = 0; i < followUpList.length; i++) {
-        if (action.delItem.id == followUpList[i].id) {
+        if (action.delItem.conceptId == followUpList[i].conceptId) {
             followUpList.splice(i, 1)
         } 
     }

+ 0 - 1
src/store/async-actions/diagnosticSearch.js

@@ -14,7 +14,6 @@ export const getSearchList = (val) => {
     return (dispatch, getState) => {
         const state = getState();
         const diagnosticList = state.diagnosticList.diagnosticList
-        console.log('diagnosticList', diagnosticList)
         let noIds = []
         for(let i = 0; i < diagnosticList.length; i++) {
             if(diagnosticList[i].conceptId) {

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

@@ -37,15 +37,15 @@ export const getSublableList = (id,idx) => {
         .then((res)=>{
             const data = res.data.data;
             if (data.controlType == 0) {
-                dispatch(resetLabel(data.questionMapping,idx));
+                dispatch(resetLabel(data.questionMapping,data.uniqueName||''));
             }else if(data.controlType == 1){
                 let arr = [];
                 arr[0] = data;
-                dispatch(resetLabel(arr,idx));
+                dispatch(resetLabel(arr));
             }else if(data.controlType == 6) {
                 let arr =[];
                 arr[0] = data;
-                dispatch(resetLabel(arr,idx));
+                dispatch(resetLabel(arr));
             } 
         })
     }

+ 19 - 8
src/store/async-actions/pushMessage.js

@@ -1,5 +1,6 @@
 import { get, post, json } from "@utils/ajax";
 import { BILLING_ADVICE, SET_TIPS, SET_TIPS_DETAILS ,SET_CHRONIC_TABLELIST,SET_SCALE_INFO,SET_CHRONIC_PUSHS,SHOW_TABLE_LIST,TOGGLE_CHRONIC_INFO} from '../types/pushMessage';
+import { SET_DRUG_INFO, SHOW_DRUG_INFO } from '@store/types/treat';
 import { SET_CLICK_DIAG } from '../types/diagnosticList';
 import {storageLocal,getEMRParams} from '@utils/tools';
 import {SET_IMPORT_CHECKBODY_LABEL,PRESET} from "../types/checkBody";
@@ -31,7 +32,8 @@ export const billing = (mdata,boxMark) => {
     pacs: emrData.pacs,
     sex: emrData.sex,
     vital:emrData.vital,
-    symptom: mdata?(emrData.current + mdata):(emrData.current + emrData.main)
+    symptom: mdata?(emrData.current + mdata):(emrData.current + emrData.main),
+    hosCode: emrData.hosCode
   };
   let savePm = Object.assign({},params);
    delete savePm.featureType;
@@ -110,10 +112,7 @@ export const billing = (mdata,boxMark) => {
 //获取提示信息(静态信息)
 export const getConceptDetail = (item) => {
     return(dispatch, getState) => {
-        dispatch({
-            type: SET_CLICK_DIAG,
-            clickDiag: item
-        })
+
         const params ={
             name: item.name,
             position: item.position,
@@ -122,7 +121,11 @@ export const getConceptDetail = (item) => {
 
         json(api.getConceptDetail, params).then((res) => {
             if(res.data.code == '0') {
-                if(item.position == '1') {
+                if(item.position == '1') {  //右侧提示信息
+                    dispatch({
+                        type: SET_CLICK_DIAG,
+                        clickDiag: item
+                    })
                     if(item.type == '5' || item.type == '6') {
                         dispatch({
                             type: SET_TIPS,
@@ -140,8 +143,16 @@ export const getConceptDetail = (item) => {
                         });
                     }
                     
-                } else if(item.position == '2'){
-
+                } else if(item.position == '5' || item.position == '6'){    //药品或不良反应说明
+                    dispatch({
+                        type: SET_DRUG_INFO,
+                        instroduce: res.data.data.details,
+                        name: item.name,
+                        tagType: item.type
+                    })
+                    dispatch({
+                        type: SHOW_DRUG_INFO
+                    })
                 }
             } else {
                 Notify.info('提示信息未维护')

+ 48 - 50
src/store/async-actions/treat.js

@@ -19,7 +19,6 @@ export const addDiagnostic = (item) => {
             const state = getState();
             let url = api.pushTreatment;
             const emrData = getEMRParams();
-            console.log('emrData', emrData)
             const diagnosticList = state.diagnosticList.diagnosticList;
             let diag = '';
             if(diagnosticList) {
@@ -62,7 +61,7 @@ export const addDiagnostic = (item) => {
                     getChronic().then(() =>{
                     chronicList = JSON.parse(storageLocal.get('chronic'));
                         for(let i=0; i<chronicList.length; i++){
-                            if(chronicList[i].id==item.id&&chronicList[i].name==item.name){ //判断某个病是否为慢病
+                            if(chronicList[i].conceptId==item.conceptId&&chronicList[i].name==item.name){ //判断某个病是否为慢病
                                 params.disType = 1
                             }
                         }
@@ -71,7 +70,7 @@ export const addDiagnostic = (item) => {
                     });
                 } else {
                     for(let i=0; i<chronicList.length; i++){
-                        if(chronicList[i].id==item.id&&chronicList[i].name==item.name){
+                        if(chronicList[i].conceptId==item.conceptId&&chronicList[i].name==item.name){
                             params.disType = 1
                         }
                     }
@@ -170,7 +169,7 @@ export const getTreatResult = (item) =>{
                 getChronic().then(() =>{
                     chronicList = JSON.parse(storageLocal.get('chronic'));
                     for(let i=0; i<chronicList.length; i++){
-                        if(chronicList[i].id==item.id&&chronicList[i].name==item.name){
+                        if(chronicList[i].conceptId==item.conceptId&&chronicList[i].name==item.name){
                             params.disType = 1
                         }
                     }
@@ -179,7 +178,7 @@ export const getTreatResult = (item) =>{
                 });
             } else {
                 for(let i=0; i<chronicList.length; i++){
-                    if(chronicList[i].id==item.id&&chronicList[i].name==item.name){
+                    if(chronicList[i].conceptId==item.conceptId&&chronicList[i].name==item.name){
                         params.disType = 1
                     }
                 }
@@ -217,10 +216,10 @@ function getTreatment(item, dispatch, state,url,params, isChronic) {
                      const allAdversReactionList = state.treat.allAdversReactionList
                      if(allAdversReactionList) {
                          for(let i = 0; i < allAdversReactionList.length; i++) {
-                             if(item.id == allAdversReactionList[i].id) {    //判断是否存过不良反应
+                             if(item.conceptId == allAdversReactionList[i].conceptId) {    //判断是否存过不良反应
                                  for (let j = 0; j < adverseReactions.length; j++) { //判断不良反应是否有相同的不良反应,如果有,替换
                                      for(let z = 0; z < allAdversReactionList[i].adversReactionList.length; z++) {
-                                         if(adverseReactions[j].id == allAdversReactionList[i].adversReactionList[z].id) {
+                                         if(adverseReactions[j].conceptId == allAdversReactionList[i].adversReactionList[z].conceptId) {
                                              for(let x = 0; x < allAdversReactionList[i].adversReactionList[z].details.length; x++) {
                                                  for(let y = 0; y < adverseReactions[j].details.length; y++) {//判断每一项是否选择过
                                                      if(allAdversReactionList[i].adversReactionList[z].details[x].name == adverseReactions[j].details[y].name && allAdversReactionList[i].adversReactionList[z].details[x].select) {
@@ -241,7 +240,7 @@ function getTreatment(item, dispatch, state,url,params, isChronic) {
                  if(isChronic) {
                      let chronicList = JSON.parse(storageLocal.get('chronic'));
                      for(let i=0; i<chronicList.length; i++){
-                         if(chronicList[i].id==item.id&&chronicList[i].name==item.name){ //判断某个病是否为慢病
+                         if(chronicList[i].conceptId==item.conceptId&&chronicList[i].name==item.name){ //判断某个病是否为慢病
                              followUp = '2周';
                          }
                      }
@@ -251,7 +250,7 @@ function getTreatment(item, dispatch, state,url,params, isChronic) {
                      const followUpList = state.treat.followUpList
                      if(followUpList) {  //判断之前有没有保存过的回访时间,如果有替换掉
                          for(let i = 0; i < followUpList.length; i++) {
-                             if(item.id == followUpList[i].id) {
+                             if(item.conceptId == followUpList[i].conceptId) {
                                  followUp = followUpList[i].followUp
                              }
                          }
@@ -287,7 +286,7 @@ export const saveAllAdverseReactions = (item) => {
         dispatch({
             type: SET_ALL_ADVERSE_REACTIONS,
             adversReactionList: {
-                'id': item.id,
+                'conceptId': item.conceptId,
                 'adversReactionList': adversReactionList
             }
         })
@@ -303,7 +302,7 @@ export const setAllFollowUp = (item) => {
         dispatch({
             type: SET_ALL_FOLLOW_UP,
             followUp: {
-                'id': item.id,
+                'conceptId': item.conceptId,
                 'followUp': followUp
             }
         })
@@ -313,27 +312,26 @@ export const setAllFollowUp = (item) => {
 export const getInstroduce = (item, type, position)=>{
 
     return (dispatch, getState) =>{
-        const url = '/conceptDetail/getConceptDetail';
         const params = {
             name: item.name,
             type: item.type,
             position: item.position
         }
-        json(url, params)
+        json(api.getConceptDetail, params)
         .then((data)=>{
-                if(data.data.data) {
+                if(data.data.code == '0') {
                     dispatch({
                         type: SET_DRUG_INFO,
                         instroduce: data.data.data.introduceDetailList,
-                        name: type ==8 ?item.medicitionName : type == 10 ? item.tagName : '',
-                        tagType: type
+                        name: item.name,
+                        tagType: item.type
                     })
                 } else {
                     dispatch({
                         type: SET_DRUG_INFO,
                         instroduce: [],
-                        name: type ==8 ?item.medicitionName : type == 10 ? item.tagName : '',
-                        tagType: type
+                        name: item.name,
+                        tagType: item.type
                     })
                 }
                 
@@ -345,51 +343,51 @@ export const getInstroduce = (item, type, position)=>{
 
 }
 
-export const  getInstroduceMore = (drugIdList) =>{
-    return (dispatch, getState) =>{
-        let drugInfoList = [];
-        for (let i = 0; i < drugIdList.drugIdList.length; i++ ) {
-            const url = '/conceptDetail/getConceptDetail';
-            const params = {
-                questionId: drugIdList.drugIdList[i],
-                type: 8,
-                position: 5
-            }
-            json(url, params)
-            .then((data)=>{
-                    if(data.data.data) {
-                        drugInfoList.push(data.data.data)
-                        dispatch({
-                            type: SET_DRUG_INFO_LIST,
-                            drugInfoList: drugInfoList,
-                        })
-                    } else {
-                        drugInfoList.push([])
-                        dispatch({
-                            type: SET_DRUG_INFO_LIST,
-                            drugInfoList: drugInfoList,
-                        })
-                    }
+// export const  getInstroduceMore = (drugIdList) =>{
+//     return (dispatch, getState) =>{
+//         let drugInfoList = [];
+//         for (let i = 0; i < drugIdList.drugIdList.length; i++ ) {
+//             const url = '/conceptDetail/getConceptDetail';
+//             const params = {
+//                 questionId: drugIdList.drugIdList[i],
+//                 type: 8,
+//                 position: 5
+//             }
+//             json(url, params)
+//             .then((data)=>{
+//                     if(data.data.data) {
+//                         drugInfoList.push(data.data.data)
+//                         dispatch({
+//                             type: SET_DRUG_INFO_LIST,
+//                             drugInfoList: drugInfoList,
+//                         })
+//                     } else {
+//                         drugInfoList.push([])
+//                         dispatch({
+//                             type: SET_DRUG_INFO_LIST,
+//                             drugInfoList: drugInfoList,
+//                         })
+//                     }
                     
-            }).catch((e) => {
-                console.log(e)
-            })
+//             }).catch((e) => {
+//                 console.log(e)
+//             })
 
 
 
 
-        }
+//         }
         
 
-    }
-}
+//     }
+// }
 
 //一般治疗添加到医嘱
 export const commonTreatAddToAdvice = () => {
     return (dispatch, getState) => {
         const state = getState();
         const followUp = state.treat.followUp
-        if(state.treat.treatItem.id === state.diagnosticList.diagnosticList[0].id && state.treat.isFirstMainDiag) {
+        if(state.treat.treatItem.conceptId === state.diagnosticList.diagnosticList[0].conceptId && state.treat.isFirstMainDiag) {
             dispatch({
                 type: IS_FIRST_MAIN_DIAG
             })

+ 2 - 1
src/store/reducers/inspect.js

@@ -11,7 +11,7 @@ import {
     DEL_EXCEL_LIST,
     ADD_LABEL
 } from '../types/inspect';
-import store from '@store'
+import store from '@store';
 import {dateParser} from '@utils/tools.js';
 
 const initSearchList = {
@@ -63,6 +63,7 @@ export default (state = initSearchList, action) => {
         const newState = Object.assign({}, state);
         const tempArr = newState.labelList;
         tempArr[tempArr.length-1].details = action.list;
+        tempArr[tempArr.length-1].uniqueName = action.uniqueName;
         return newState;
     } 
     if (action.type == ADD_LABEL) {             //右侧推送的化验辅检项,点击开单放到左侧化验辅检的位置上

+ 1 - 0
src/utils/config.js

@@ -1,6 +1,7 @@
 // const host='http://192.168.3.1:5050';//赵
 // const host='http://192.168.3.100:5050';//王峰
 // const host='http://192.168.2.241:5050';//后端接口访问地址
+// const host='http://192.168.2.121:5050';//后端接口访问地址
 const host='http://192.168.2.236:5050';//后端接口访问地址
 // const host='http://192.168.3.11:5050';//王宇
 //const host='http://192.168.2.164:8080';

+ 134 - 90
src/utils/drag.js

@@ -1,102 +1,146 @@
+/**
+ * 弹窗页面同一时间只能渲染一个,可拖拽元素的id都一样'dragModalWrap','dragModalTitle'
+ * 保证能在关闭的时候移除move事件
+ */
 import $ from 'jquery';
-import { getWindowInnerHeight,getWindowInnerWidth,getPageCoordinate } from './tools'
+import {
+  getWindowInnerHeight,
+  getWindowInnerWidth,
+  getPageCoordinate
+} from './tools'
+
+let width = '',//屏幕宽度
+  height = '', //屏幕高度
+  dragWrapper = '',//拖拽元素
+  mouseX = 0,//鼠标距离页面左侧
+  mouseY = 0,//鼠标距离页面上部
+  dragX = 0,//鼠标可拖拽到左边的最大距离(元素定位左侧距离)
+  dragY = 0,//鼠标可拖拽到上边的最大距离(元素定位上边距离)
+  isDrag = false,//元素是否处于拖拽中
+  addPart = null;//展开区域,这个展开的宽度应当是固定宽度了
 /**
  * 
- * @param {被拖动的元素} domWrap 
- * @param {可拖动的区域} domDrag 
- * @param {鼠标滑动监听的区域} dragMove 
- * @param {拖动元素/清除拖动事件监听} type 
+ * @param {事件对象} event 
+ * @param {被拖动的元素} dragModalWrap 
+ * @param {可拖动的区域} dragModalTitle 
  */
-
-function dragBox(domWrap,domDrag,dragMove){
-  // console.log(domWrap,domDrag,'拖拽')
-  let drag = $("#"+domDrag);
-  let wrap = $("#"+domWrap);
-  let wrapHeight = wrap.height();//被拖拽的元素高度
-  let wrapWidth = wrap.width();//被拖拽的元素宽度
-  let width = getWindowInnerHeight();//屏幕宽度
-  let height = getWindowInnerWidth();//屏幕高度
-  let mouseX = 0,mouseY = 0,dragX = 0,dragY = 0,isDrag = false,isMove = false;
-  // windowEventHandler('mousedown',function(event){    //鼠标位置获取,计算点击位置到拖拽元素左边的距离
-  //   let page = getPageCoordinate(event,'0');
-  //   mouseX = page.boxLeft - wrap.offsetLeft      //鼠标到拖拽元素的左边界的距离
-  //   mouseY = page.boxTop - wrap.offsetTop       //鼠标到拖拽元素的上边界的距离
-  //   isDrag = true
-  //   // isMove = false
-  // },drag)
-  drag.on('mousedown',function(event){
-    let page = getPageCoordinate(event,'0');
-    mouseX = page.boxLeft - wrap.offsetLeft      //鼠标到拖拽元素的左边界的距离
-    mouseY = page.boxTop - wrap.offsetTop       //鼠标到拖拽元素的上边界的距离
-    isDrag = true
-  })
-  $(document).on('mousemove',handleMove)
-  $(document).on('mouseup',function(){
-    isDrag = false
-    return false
-  })
-  // windowEventHandler('mousemove',handleMove,document)
-  // windowEventHandler('mouseup',()=>{
-  //   // if(isMove){ //有move就设置位置没有移动就不处理
-  //   //   console.log(dragX)
-  //   //   wrap.style.left = dragX + 'px'
-  //   //   wrap.style.top = dragY + 'px'
-  //   // }
-  //   isDrag = false
-  //   return false
-  // },document)
-
-  function handleMove(event){      //移动的
-    console.log(99)
-    let dragDes = document.getElementById('treatDescBox');//展開区域
-    let page = getPageCoordinate(event,'0');
-    let maxDragX = 0,dragDesWidth = 0;
-    let maxDragY = height - wrapHeight;//最大可拖拽y方向距离
-    wrapHeight = wrap.offsetHeight;
-    wrapWidth = wrap.offsetWidth;
-    if(domDrag == 'dragTreatTitle'){//最大可推拽x方向距离
-      if(dragDes != null){
-        dragDesWidth = dragDes.offsetWidth
-      }else{
-        dragDesWidth = 0
-      }
-      maxDragX = width - wrapWidth - dragDesWidth
-    }else{
-      maxDragX = width - wrapWidth
+function handleMove(event) {
+  let wrap = $("#"+dragWrapper); //被拖拽的元素
+  let dragDes = $("#"+addPart); //展開区域
+  let page = getPageCoordinate(event, '0');//获取鼠标位置
+  let maxDragX = 0,dragDesWidth = 0;
+  let wrapHeight = wrap[0].offsetHeight;//直接用.height()获取的高度不准确
+  let wrapWidth = wrap[0].offsetWidth;
+  let maxDragY = height - wrapHeight; //最大可拖拽y方向距离
+  if (dragDes[0]) { //存在就有类似治疗方案的弹窗,最大可推拽x方向距离
+    dragDesWidth = dragDes[0].offsetWidth//展开元素的宽度
+    maxDragX = width - wrapWidth - dragDesWidth
+  } else {
+    maxDragX = width - wrapWidth
+  }
+  if (isDrag) {
+    dragX = page.boxLeft - mouseX //鼠标可拖拽到左边的最大距离
+    dragY = page.boxTop - mouseY //鼠标可拖拽到上边的最大距离
+    if (dragX < 0) { //不能超出左边界
+      dragX = 0
     }
-    if(isDrag){
-      dragX = page.boxLeft - mouseX          //鼠标可拖拽到左边的最大距离
-      dragY = page.boxTop - mouseY          //鼠标可拖拽到上边的最大距离
-      if(dragX < 0){      //不能超出左边界
-        dragX = 0
-      }
-      if(dragY < 0){      //不能超出上边界
-        dragY = 0
-      }
-      if(domDrag == 'dragTreatTitle'){
-        if(width-dragX-dragDesWidth < wrapWidth){    //不能超出右边界
-          dragX = maxDragX
-        }
-      }else{
-        // console.log(width,dragX,maxDragX,wrapWidth)
-        if(width-dragX < wrapWidth){    //不能超出右边界
-          dragX = maxDragX
-        }
+    if (dragY < 0) { //不能超出上边界
+      dragY = 0
+    }
+    if (dragDes[0]) {
+      if (width - dragX - dragDesWidth < wrapWidth) { //不能超出右边界
+        dragX = maxDragX
       }
-      if(height-dragY < wrapHeight){     //不能超出下边界
-        dragY = maxDragY
+    } else {
+      if (width - dragX < wrapWidth) { //不能超出右边界
+        dragX = maxDragX
       }
-      // isMove = true
-      wrap.style.left = dragX + 'px'
-      wrap.style.marginLeft = 0 + 'px'
-      wrap.style.top = dragY + 'px'
     }
+    if (height - dragY < wrapHeight) { //不能超出下边界
+      dragY = maxDragY
+    }
+    // isMove = true
+    wrap.css({
+      left: dragX + 'px',
+      marginLeft: 0 + 'px',
+      top: dragY + 'px'
+    })
+  }
+}
+/**
+ * 鼠标弹起弹窗不在跟随鼠标移动
+ */
+function handleUp(){
+  isDrag = false;
+  return
+}
+/**
+ * @param {拖动元素/清除拖动事件监听} type add:添加事件监听  del:移除事件监听
+ * @param {展开元素id} addDom 
+ */
+function dragBox(dragWrap,dragTop,type,addDom) {
+  let drag = $("#"+dragTop); //拖拽区域
+  let wrap = $("#"+dragWrap); //被拖拽的元素
+  width = getWindowInnerWidth(); 
+  height = getWindowInnerHeight();
+  addPart = addDom||null;
+  dragWrapper = dragWrap;
+  if (type === 'del') {
+    $(document).off('mousemove', handleMove)
+    $(document).off('mouseup', handleUp)
+  } else {
+    drag.on('mousedown', function (event) {
+      let page = getPageCoordinate(event, '0');
+      mouseX = page.boxLeft - wrap.offset().left; //鼠标到拖拽元素的左边界的距离
+      mouseY = page.boxTop - wrap.offset().top; //鼠标到拖拽元素的上边界的距离
+      isDrag = true
+    })
+    $(document).on('mousemove', handleMove)
+    $(document).on('mouseup', handleUp)
   }
-  setTimeout(() => {
-    // windowRemoveEventHandler('mousemove',handleMove,document)
-  }, 6000);
 }
 
+/**
+ * 同时出现两个弹窗,第二个弹窗写死
+ */
+let mouseXS = 0,mouseYS = 0,dragXS = 0,dragYS = 0,canDrag = false;
+function dragBoxs(type){
+  let drag = $("#drugTitle"),wrap = $("#drugWrapper");
+  if(type == 'del'){
+    $(document).off('mousemove', handleMoves)
+    $(document).off('mouseup', handleUps)
+    return
+  }else{
+    drag.on('mousedown',function(event){
+      let page = getPageCoordinate(event,'0');
+      mouseXS = page.boxLeft - wrap.offset().left;
+      mouseYS = page.boxTop - wrap.offset().top;       
+      canDrag = true;
+    })
+    $(document).on('mousemove',handleMoves)
+    $(document).on('mousemove',handleUps)
+  }
+}
+function handleUps(){
+  $(document).on('mouseup',function(){canDrag = false;return;})
+}
+function handleMoves(event){   
+  let wrap = $("#drugWrapper");
+  let wrapHeight = wrap[0].offsetHeight,wrapWidth = wrap[0].offsetWidth;
+  let width = getWindowInnerWidth(),height = getWindowInnerHeight(),page = getPageCoordinate(event,'0');
+  let maxDragY = height - wrapHeight;
+  let maxDragX = width - wrapWidth
+  if(canDrag){
+    dragXS = page.boxLeft - mouseXS;
+    dragYS = page.boxTop - mouseYS;
+    if(dragXS < 0){dragXS = 0}
+    if(dragYS < 0){dragYS = 0}
+    if(width-dragXS < wrapWidth){dragXS = maxDragX}
+    if(height-dragYS < wrapHeight){dragYS = maxDragY}
+    wrap.css({left:dragXS + 'px',marginLeft:0 + 'px',top:dragYS + 'px'})
+  }
+}
 module.exports = {
-  dragBox
-}
+  dragBox,
+  dragBoxs
+}

+ 0 - 1
src/utils/jqprint.js

@@ -1,5 +1,4 @@
 import $ from 'jquery';
-
 (function ($) {
   var opt;
   $.fn.jqprint = function (options) {

+ 6 - 83
src/utils/tools.js

@@ -739,6 +739,10 @@ function normalVal(min,max){
       return null;
   }
 }
+/**
+ * 
+ * @param {弹窗显示位置是否往下设置} stic 
+ */
 function getPageCoordinate(event,stic){//获取鼠标点击的位置
     let e = event || window.event;
     var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
@@ -761,89 +765,7 @@ function timestampToTime(timestamp) {     //excel导入2019年5月1日会转换
   var s = date.getSeconds();
   return Y+M+D+h+m+s;
 }
-function dragBox(domWrap,domDrag,dragMove){
-  // console.log(domWrap,domDrag,'拖拽')
-  let drag = document.getElementById(domDrag);//拖拽区域
-  let wrap = document.getElementById(domWrap);//被拖拽的元素
-  let move = document.getElementById(dragMove);//被拖拽的元素
-  let wrapHeight = wrap.offsetHeight;//被拖拽的元素高度
-  let wrapWidth = wrap.offsetWidth;//被拖拽的元素宽度
-  let width = window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;//屏幕宽度
-  let height = window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;//屏幕高度
-  let mouseX = 0,mouseY = 0,dragX = 0,dragY = 0,isDrag = false,isMove = false;
-  windowEventHandler('mousedown',function(event){    //鼠标位置获取,计算点击位置到拖拽元素左边的距离
-    let page = getPageCoordinate(event,'0');
-    mouseX = page.boxLeft - wrap.offsetLeft      //鼠标到拖拽元素的左边界的距离
-    mouseY = page.boxTop - wrap.offsetTop       //鼠标到拖拽元素的上边界的距离
-    isDrag = true
-    // isMove = false
-  },drag)
-  // $(move).mouseup(()=>{
-  //   console.log(123)
-  //   isDrag = false
-  //   return false
-  // })
-  // $(move).mousemove(handleMove)
-  windowEventHandler('mousemove',handleMove,document)
-  windowEventHandler('mouseup',()=>{
-    // if(isMove){ //有move就设置位置没有移动就不处理
-    //   console.log(dragX)
-    //   wrap.style.left = dragX + 'px'
-    //   wrap.style.top = dragY + 'px'
-    // }
-    isDrag = false
-    return false
-  },dragMove)
 
-  function handleMove(event){      //移动的
-    let dragDes = document.getElementById('treatDescBox');//展開区域
-    let page = getPageCoordinate(event,'0');
-    let maxDragX = 0,dragDesWidth = 0;
-    let maxDragY = height - wrapHeight;//最大可拖拽y方向距离
-    wrapHeight = wrap.offsetHeight;
-    wrapWidth = wrap.offsetWidth;
-    if(domDrag == 'dragTreatTitle'){//最大可推拽x方向距离
-      if(dragDes != null){
-        dragDesWidth = dragDes.offsetWidth
-      }else{
-        dragDesWidth = 0
-      }
-      maxDragX = width - wrapWidth - dragDesWidth
-    }else{
-      maxDragX = width - wrapWidth
-    }
-    if(isDrag){
-      dragX = page.boxLeft - mouseX          //鼠标可拖拽到左边的最大距离
-      dragY = page.boxTop - mouseY          //鼠标可拖拽到上边的最大距离
-      if(dragX < 0){      //不能超出左边界
-        dragX = 0
-      }
-      if(dragY < 0){      //不能超出上边界
-        dragY = 0
-      }
-      if(domDrag == 'dragTreatTitle'){
-        if(width-dragX-dragDesWidth < wrapWidth){    //不能超出右边界
-          dragX = maxDragX
-        }
-      }else{
-        // console.log(width,dragX,maxDragX,wrapWidth)
-        if(width-dragX < wrapWidth){    //不能超出右边界
-          dragX = maxDragX
-        }
-      }
-      if(height-dragY < wrapHeight){     //不能超出下边界
-        dragY = maxDragY
-      }
-      // isMove = true
-      wrap.style.left = dragX + 'px'
-      wrap.style.marginLeft = 0 + 'px'
-      wrap.style.top = dragY + 'px'
-    }
-  }
-  setTimeout(() => {
-    // windowRemoveEventHandler('mousemove',handleMove,document)
-  }, 2000);
-}
 
 function getCurrentDate(){
   let myDate = new Date();
@@ -875,6 +797,7 @@ function inspectAndAssist(){
       name: '',
       questionId: '',
       showType: 1,
+      uniqueName:''
     }
     if (tmpInspect[i].controlType == 0) {
       tmpDetail = tmpInspect[i].questionMapping
@@ -884,6 +807,7 @@ function inspectAndAssist(){
     tmpObj.questionId = tmpInspect[i].id
     tmpObj.name = tmpInspect[i].name
     tmpObj.details = tmpDetail
+    tmpObj.uniqueName = tmpInspect[i].uniqueName || ''
     assayArr.push(tmpObj)
   }
   for(let i = 0;i < tmpAssist.length;i++){//辅检数据处理
@@ -1165,7 +1089,6 @@ module.exports = {
     getPageCoordinate,
     windowRemoveEventHandler,
     timestampToTime,
-    dragBox,
     formatContinueDots,
     inspectAndAssist,
     getCurrentDate,