ソースを参照

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

# Conflicts:
#	src/store/async-actions/homePage.js
liucf 6 年 前
コミット
12ccc4b59d
32 ファイル変更305 行追加217 行削除
  1. 9 11
      src/common/components/Banner/index.jsx
  2. 24 40
      src/common/components/Button/index.jsx
  3. 2 2
      src/common/components/ComplexModal/index.jsx
  4. 6 2
      src/common/components/ComplexModal/index.less
  5. 1 1
      src/common/components/DelToast/index.jsx
  6. 5 8
      src/common/components/DropContainer/index.jsx
  7. 6 9
      src/common/components/Footer/index.jsx
  8. 14 1
      src/common/components/InlineTag/index.jsx
  9. 1 1
      src/common/components/InspectCommon/index.jsx
  10. 3 5
      src/common/components/Loading/index.jsx
  11. 15 18
      src/common/components/MiniToast/index.jsx
  12. 10 19
      src/common/components/Modal/body/ModalBody.jsx
  13. 1 0
      src/common/components/Modal/footer/ModalFooter.jsx
  14. 0 1
      src/common/components/Tab/TabOne/index.jsx
  15. 0 1
      src/common/components/Tab/index.jsx
  16. 2 2
      src/common/less/variables.less
  17. 3 3
      src/components/AddAssistCheck/index.jsx
  18. 11 1
      src/components/AddAssistCheck/index.less
  19. 2 0
      src/components/AddInspect/SlideExcel/index.less
  20. 6 3
      src/components/AddInspect/SlideSelect/index.less
  21. 21 19
      src/components/AddInspect/index.jsx
  22. 4 3
      src/components/AddInspect/index.less
  23. 6 16
      src/components/BodyContainer/index.jsx
  24. BIN
      src/components/DiagnosticList/img/delete-on.png
  25. 14 2
      src/components/DiagnosticList/index.jsx
  26. 8 15
      src/components/Empty/index.jsx
  27. 0 1
      src/components/TreatDesc/index.jsx
  28. 4 1
      src/store/actions/currentIll.js
  29. 1 2
      src/store/async-actions/homePage.js
  30. 3 3
      src/store/async-actions/mainSuit.js
  31. 102 0
      src/utils/drag.js
  32. 21 27
      src/utils/tools.js

+ 9 - 11
src/common/components/Banner/index.jsx

@@ -1,18 +1,16 @@
-import React, { Component } from "react";
 import style from "./index.less";
 import logo from '../../images/logoa.png'
 import setup from '../../images/setup.png';
-class Banner extends Component {
-  render(){
-    const {src,text, children} = this.props;
 
-    return <div className={style['banner-wrapper']+" "+"clearfix"}>
-         <div className={style['logo']}> <img src={logo}/><span >|&nbsp;&nbsp;智能辅助临床决策系统</span>
-            <div className={style['buon']}><img className={style['st']} src={setup}/>设置</div>
-            </div>
-      {children?<div className='fl'>{children}</div>:''}
-    </div>;
-  }
+const Banner = (props) => {
+  const {src,text, children} = props;
+
+  return <div className={style['banner-wrapper']+" "+"clearfix"}>
+       <div className={style['logo']}> <img src={logo}/><span >|&nbsp;&nbsp;智能辅助临床决策系统</span>
+          <div className={style['buon']}><img className={style['st']} src={setup}/>设置</div>
+          </div>
+    {children?<div className='fl'>{children}</div>:''}
+  </div>;
 }
 
 export default Banner;

+ 24 - 40
src/common/components/Button/index.jsx

@@ -1,7 +1,6 @@
 /**
  * Created by ZN on 2018/5/03.
  */
-import React, {Component} from 'react';
 /*import PropTypes from 'prop-types';*/
 import style from './index.less';
 
@@ -17,45 +16,30 @@ import style from './index.less';
     icon: PropTypes.oneOf(['confirm','close','add','aptmts','cancel','print','qa','search','setting','update','tick','submit','more','info']),
     onClick: PropTypes.func
 };*/
-
-class Button extends Component {
-    constructor(props) {
-        super(props);
-        /* this.handleClick = this.handleClick.bind(this);
-         this.handleLeave = this.handleLeave.bind(this);*/
-    }
-
-    /*handleClick(){
-        this.props.onClick&&this.props.onClick();
-    }*/
-
-    render() {
-        let props = this.props;
-        let type = props.type ? style[props.type] : '';
-        let classes = style["button"] + " " + type;
-        const spanStyle = {
-            position: "relative",
-            left: "-3px",
-            lineHeight: "30px"
-        };
-        if (props.disabled) {
-            return <button contenteditable="false" className={classes} style={props.style}  {...props} disabled>
-                {
-                    React.Children.map(props.children, function (child) {
-                        return <span style={spanStyle}>{child}</span>;
-                    })
-                }
-            </button>;
-        }
-        return <button contenteditable="false" className={classes} style={props.style} {...props}>
-            {
-                React.Children.map(props.children, function (child) {
-                    return <span style={spanStyle}>{child}</span>;
-                })
-            }
-        </button>;
-    }
+const Button = (props) => {
+  let type = props.type ? style[props.type] : '';
+  let classes = style["button"] + " " + type;
+  const spanStyle = {
+      position: "relative",
+      left: "-3px",
+      lineHeight: "30px"
+  };
+  if (props.disabled) {
+      return <button contenteditable="false" className={classes} style={props.style}  {...props} disabled>
+          {
+              React.Children.map(props.children, function (child) {
+                  return <span style={spanStyle}>{child}</span>;
+              })
+          }
+      </button>;
+  }
+  return <button contenteditable="false" className={classes} style={props.style} {...props}>
+      {
+          React.Children.map(props.children, function (child) {
+              return <span style={spanStyle}>{child}</span>;
+          })
+      }
+  </button>;
 }
-/*Button.propTypes = propTypes;*/
 
 export default Button;

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

@@ -20,7 +20,7 @@ class ComplexModal extends Component {
     super(props);
   }
   componentDidMount(){
-    dragBox('complexModalWrap','complexModalTitle')
+    dragBox('complexModalWrap','complexModalTitle','complexModalWrapMove')
   }
 
   render() {
@@ -28,7 +28,7 @@ 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']}>
+    return ReactDom.createPortal(<div className={style['container']} id="complexModalWrapMove">
       <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">

+ 6 - 2
src/common/components/ComplexModal/index.less

@@ -1,8 +1,12 @@
 @import "~@less/mixin.less";
 .container {
-  position: relative;
+  // position: relative;
   z-index: 2000;
-  padding-top: 40px;
+  // padding-top: 40px;
+  position: absolute;
+  width: 100%;
+  height: 100%;
+  top: 0;
   .content{
     overflow: auto;
     position: relative;

+ 1 - 1
src/common/components/DelToast/index.jsx

@@ -29,7 +29,7 @@ class DelToast extends React.PureComponent{
       return <div className={style['del-box']} id="delBox">
         <div className={style['del-con']}>
           <div className={style['del-tri']}></div>
-          <div className={style['del-title']} id="delTit">删除 {name} ?</div>
+          <div className={style['del-title']} id="delTit" title={'删除 '+name+' ?'}>删除 {name} ?</div>
           <div className={style['del-foot']}>
             <span className={`${style['del-btn']} ${style['del-del']}`} onClick={this.handleDel}>删除</span>
             <span className={`${style['del-btn']} ${style['del-cancel']}`} onClick={this.handleCancel}>取消</span>

+ 5 - 8
src/common/components/DropContainer/index.jsx

@@ -6,15 +6,12 @@
  * children:下拉内容
  *
  * ***/
-import React,{Component} from 'react';
 
-class DropContainer extends Component {
-  render(){
-    const {children} = this.props;
-    return <div className="container">
-              {children}
-            </div>;
-  }
+const DropContainer = (props) => {
+  const {children} = props;
+  return <div className="container">
+            {children}
+          </div>;
 }
 
 export default DropContainer;

+ 6 - 9
src/common/components/Footer/index.jsx

@@ -1,4 +1,3 @@
-import React from 'react';
 import style from './index.less';
 import printIcon from '@common/images/team.png';
 /**
@@ -11,14 +10,12 @@ import printIcon from '@common/images/team.png';
  * handleConfirm:另一按钮的点击事件;
 **/
 
-class Footer extends React.PureComponent{
-  render(){
-    const {footText,print,handlePrint,handleConfirm} = this.props;
-    return <div className={style['footer']}>
-      {print?<span className={style['print']} onClick={handlePrint}><img src={printIcon} alt=""/>打印</span>:''}
-          <span className={style['okBtn']} onClick={handleConfirm}>{footText}</span>
-    </div>;
-  }
+const Footer = (props) => {
+  const {footText,print,handlePrint,handleConfirm} = props;
+  return <div className={style['footer']}>
+    {print?<span className={style['print']} onClick={handlePrint}><img src={printIcon} alt=""/>打印</span>:''}
+        <span className={style['okBtn']} onClick={handleConfirm}>{footText}</span>
+  </div>;
 }
 
 export default Footer;

+ 14 - 1
src/common/components/InlineTag/index.jsx

@@ -29,6 +29,7 @@ class InlineTag extends Component {
     this.handleInput = this.handleInput.bind(this);
     this.handleFocus = this.handleFocus.bind(this);
     this.handleFixClick = this.handleFixClick.bind(this);
+    this.handleBoxInput = this.handleBoxInput.bind(this);
   }
   changeToEdit(e){
     const {handledbClick,id} = this.props;
@@ -43,6 +44,14 @@ class InlineTag extends Component {
     //埋点记录
     handledbClick&&handledbClick({id});
   }
+  handleBoxInput(e){
+    const {handleInput,ikey,prefix,suffix} = this.props;
+    const total = e.target.innerText;
+    const text = this.$span.current.innerText;
+    if(!total){
+      handleInput&&handleInput({text:total,ikey});
+    }
+  }
   changeToClick(event){
     event.returnValue = true;
     const {canEditable} = this.props;
@@ -52,6 +61,7 @@ class InlineTag extends Component {
     });
   }
   handleInput(e){       //输入时保存临时值,在修改灰显为黑色时判断用
+    e.stopPropagation();
     const {handleInput,ikey,prefix,suffix} = this.props;
     const text = e.target.innerText || e.target.innerHTML;
     // 内容全部删除时,要把空值存到store,否则会遗留最后一个字且为灰色无法删除
@@ -130,7 +140,10 @@ class InlineTag extends Component {
                  onDoubleClick={this.changeToEdit}
                   onClick={!editable?this.handleFixClick:''}
                  onkeydown={handleEnter}
-                 onBlur={this.changeToClick} ref={this.$box} contentEditable={editable}>
+                 onBlur={this.changeToClick} 
+                 ref={this.$box} 
+                 contentEditable={editable}
+                 onInput={this.handleBoxInput}>
                 {prefix}
                 <span className={style['free-in']}
                       contentEditable={true}

+ 1 - 1
src/common/components/InspectCommon/index.jsx

@@ -6,7 +6,7 @@ const InspectCommon = (props) => {
   return <div className={ style.wrapper} id="inspectFill">
       {children}
       <div className={style.btnWrap}>
-          <span className={style.clear + ' red'} onClick={handleClear}>清空选项s</span>
+          <span className={style.clear + ' red'} onClick={handleClear}>清空选项</span>
           <span className={style.sure} onClick={handleConfirm}>确定</span>
       </div>
   </div>

+ 3 - 5
src/common/components/Loading/index.jsx

@@ -5,7 +5,6 @@
  * text:显示在图标下的文字
  * img:自定义图标
  */
-import React, {Component} from 'react';
 /*import PropTypes from 'prop-types';*/
 import style from './index.less';
 import icon from './img/loading.gif';
@@ -33,9 +32,8 @@ const defaultProps = {
 //     )
 // }
 
-class Loading extends React.Component{
-    render(){
-        const {text, img, show} = this.props;
+const Loading = (props) =>{
+  const {text, img, show} = props;
         return (
             <div className={style['loading']} style={{display: show ? 'block' : 'none'}}>
                 {this.props.shadeIsShow?<div className={style['cover']}/>:null}
@@ -45,9 +43,9 @@ class Loading extends React.Component{
                 </div>
             </div>
         )
-    }
 }
 
+
 /*Loading.propTypes = propTypes;
 Loading.defaultProps = defaultProps;*/
 

+ 15 - 18
src/common/components/MiniToast/index.jsx

@@ -1,4 +1,3 @@
-import React from 'react';
 import style from './index.less';
 import closeIcon from "../../images/close-icon.png";
 /**
@@ -14,24 +13,22 @@ import closeIcon from "../../images/close-icon.png";
 * confirm:确定事件
 * 使用时,父元素需要加相对定位position: relative;
 **/
-class MiniToast extends React.PureComponent{
-  render(){
-    const {show,title,icon,children,footer,close,confirm,confirmText} = this.props;
-    if(show){
-      return <div className={style["infoBox"]}>
-              <p className={style["infoTitle"]}>
-                {icon?<img src={icon} />:''}
-                {title}
-                <img src={closeIcon} onClick={close} className={style["closeIcon"]}/>
-              </p>
-              <div className={style["infoCon"]}>{children}</div>
-              {footer?<div className={style["infoFoot"]}>
-                        <span onClick={confirm}>{confirmText?confirmText:'确定'}</span>
-                      </div>:''}
-            </div>
-    }
-    return ''
+const MiniToast = (props) => {
+  const {show,title,icon,children,footer,close,confirm,confirmText} = props;
+  if(show){
+    return <div className={style["infoBox"]}>
+            <p className={style["infoTitle"]}>
+              {icon?<img src={icon} />:''}
+              {title}
+              <img src={closeIcon} onClick={close} className={style["closeIcon"]}/>
+            </p>
+            <div className={style["infoCon"]}>{children}</div>
+            {footer?<div className={style["infoFoot"]}>
+                      <span onClick={confirm}>{confirmText?confirmText:'确定'}</span>
+                    </div>:''}
+          </div>
   }
+  return ''
 }
 
 export default MiniToast;

+ 10 - 19
src/common/components/Modal/body/ModalBody.jsx

@@ -1,24 +1,15 @@
-import React, {Component} from "react";
-import classNames from 'classnames';
-
 import styles from "./index.less";
 
-class ModalBody extends Component {
-    constructor(props) {
-        super(props);
-    }
-
-    render() {
-        const  {overflow, children} = this.props;
-        let bodyStyle = {
-            overflowY: overflow ? "auto": "hide"
-        };
-        return (
-            <div className={styles['modal-body']} style={bodyStyle}>
-                {children ? children : <div className="paragraph"> </div>}
-            </div>
-        );
-    }
+const ModalBody = (props) => {
+  const  {overflow, children} = props;
+  let bodyStyle = {
+      overflowY: overflow ? "auto": "hide"
+  };
+  return (
+      <div className={styles['modal-body']} style={bodyStyle}>
+          {children ? children : <div className="paragraph"> </div>}
+      </div>
+  );
 }
 
 export default ModalBody;

+ 1 - 0
src/common/components/Modal/footer/ModalFooter.jsx

@@ -3,6 +3,7 @@ import classNames from 'classnames';
 
 import styles from "./index.less";
 
+
 class ModalFooter extends Component {
 
 

+ 0 - 1
src/common/components/Tab/TabOne/index.jsx

@@ -1,4 +1,3 @@
-import React from 'react'
 import styles from '../index.less'
 
 const TabContain = (props) =>{

+ 0 - 1
src/common/components/Tab/index.jsx

@@ -1,4 +1,3 @@
-import React from 'react';
 import TabOne from '@commonComp/Tab/TabOne';
 import styles from './index.less'
 import PropTypes from "prop-types"

+ 2 - 2
src/common/less/variables.less

@@ -45,8 +45,8 @@
 @dropdwon-height:200px;
 @selected-bg:#fff;
 @import-color:#ffad5f;
-@closeIcon:url(../images/del_nor.png);
-@closeHor:url(../images/del_hor.png);
+@closeIcon:url(../images/del_nor.png) no-repeat;
+@closeHor:url(../images/del_hor.png) no-repeat;
 
 /*********推送内容容器宽度*************/
 @push-width: 450px;

+ 3 - 3
src/components/AddAssistCheck/index.jsx

@@ -107,13 +107,13 @@ class AddAssistCheck extends React.Component {
         list && list.map((item, idx) => {
           return <li key={item.id}
             className={styles.searchLi}
-            title={item.name}
+            title={(item.name == item.retrievalName || !item.retrievalName) ? null : '(' + item.retrievalName + ')'}
             onClick={() => {
               handleSign(item.questionId, idx,'search');
               this.setState({ show: false })
             }}
           >
-            {item.name}{item.name == item.retrievalName ? null : '(' + item.retrievalName + ')'}
+            {item.name}{(item.name == item.retrievalName || !item.retrievalName) ? null : '(' + item.retrievalName + ')'}
           </li>
         })
       }
@@ -144,7 +144,7 @@ class AddAssistCheck extends React.Component {
     return <ul className={styles.labelWrap} id="datePick">
       {
         assistLabel.map((item, idx) => {
-          return (<li key={item.questionId} className={styles.assistLists}>
+          return (<li key={item.questionId} className={`${styles.assistLists} ${styles.clearfix}`}>
             <span className={styles.assistName} style={{ width: winWidth < 1200 ? '120px' : 'auto' }}>
               <span className={styles.tagSpan}>
                 {item.name}:

+ 11 - 1
src/components/AddAssistCheck/index.less

@@ -69,7 +69,7 @@
               height: 15px;
               cursor: pointer;
               position: absolute;
-              right: 3px;
+              right: 2px;
               top: 2px;
               background: @closeIcon;
               background-size: 100% 100%;
@@ -140,4 +140,14 @@
     display: block;
     cursor: pointer;
   }
+}
+.clearfix {
+  zoom: 1;
+}
+.clearfix:after {
+  content: "";
+  display: block;
+  height: 0;
+  clear: both;
+  visibility: hidden;
 }

+ 2 - 0
src/components/AddInspect/SlideExcel/index.less

@@ -113,6 +113,7 @@
         td {
             text-align: left;
             padding-top: 6px;
+            cursor: default;
         }
         .excelUnit {
             width: auto;
@@ -157,6 +158,7 @@
   left: 50%;
   margin-left: -8px;
   display: none;
+  cursor: pointer;
 }
 .imgInfo:hover {
   background: url('../img/info3.png') no-repeat center center;

+ 6 - 3
src/components/AddInspect/SlideSelect/index.less

@@ -3,7 +3,7 @@
     // cursor: pointer;
     // color: #767676;
     position: relative;
-    padding: 10px 10px 10px 0;
+    padding: 10px 20px 10px 0;
     border-bottom:1px dashed #989DA3;
     i {
         font-style: normal;
@@ -31,7 +31,7 @@
         cursor: pointer;
         display: inline-block;
         position: absolute;
-        right: 3px;
+        right: 2px;
         top: 13px;
         // background-color: #fff;
         background: @closeIcon;
@@ -83,7 +83,8 @@
         height: 18px;
         width: 100%;
         td {
-            padding-top: 3px;
+          cursor: default;
+          padding-top: 3px;
         }
     }
 }
@@ -130,6 +131,7 @@
             td {
                 text-align: left;
                 padding-top: 6px;
+                cursor: default;
             }
             .excelUnit {
                 width: auto;
@@ -175,6 +177,7 @@
   left: 50%;
   margin-left: -8px;
   display: none;
+  cursor: pointer;
 }
 .imgInfo:hover {
   background: url('../img/info3.png') no-repeat center center;

+ 21 - 19
src/components/AddInspect/index.jsx

@@ -206,23 +206,25 @@ class Inspect extends React.Component {
             return (
               <li className={`${styles.itemPart} ${fillActive.details.length > 1 ? '' : styles.itemPartOne}`}>
                 <span className={styles.itemPartL}>{item.name}</span>
-                <select className={styles.itemPartR} onChange={(e) => {
-                  if (e.target.value == '请选择') {
-                    this.changeActivePart(idx, '')
-                    return;
-                  }
-                  this.changeActivePart(idx, e.target.value);
-                }}
-                >
-                  <option value="请选择">请选择</option>
-                  {
-                    (item.questionDetailList).map((val) => {
-                      return <option value={val.name}
-                        selected={val.name == item.value ? true : false}
-                      >{val.name}</option>
-                    })
-                  }
-                </select>
+                <span className={styles.itemPartT}>
+                  <select className={styles.itemPartR} onChange={(e) => {
+                    if (e.target.value == '请选择') {
+                      this.changeActivePart(idx, '')
+                      return;
+                    }
+                    this.changeActivePart(idx, e.target.value);
+                  }}
+                  >
+                    <option value="请选择">请选择</option>
+                    {
+                      (item.questionDetailList).map((val) => {
+                        return <option value={val.name}
+                          selected={val.name == item.value ? true : false}
+                        >{val.name}</option>
+                      })
+                    }
+                  </select>
+                </span>
               </li>
             )
           } else if (item.controlType == 6) {
@@ -251,13 +253,13 @@ class Inspect extends React.Component {
         list && list.map((item, idx) => {
           return <li key={idx}
             className={styles.searchLi}
-            title={item.name == item.retrievalName ? item.name : item.name + '(' + item.retrievalName + ')'}
+            title={(item.name == item.retrievalName || !item.retrievalName) ? item.name : item.name + '(' + item.retrievalName + ')'}
             onClick={() => {
               handleSign(item.questionId, idx,'search');
               this.setState({ show: false })
             }}
           >
-            {item.name}{item.name == item.retrievalName ? null : '(' + item.retrievalName + ')'}
+            {item.name}{(item.name == item.retrievalName || !item.retrievalName) ? null : '(' + item.retrievalName + ')'}
           </li>
         })
       }

+ 4 - 3
src/components/AddInspect/index.less

@@ -147,7 +147,8 @@
     .itemPartR {
         width: 62px;
         outline: none;
-        float: right;
+        float: left;
+        margin-top: 5px;
     }
     .itemPartT {
         float: right;
@@ -179,8 +180,8 @@
         width: 15px;
         height: 15px;
         position: absolute;
-        top: -10px;
-        right: -6px;
+        top: -5px;
+        right: -5px;
         z-index: 30;
         border-radius: 50%;
         background: @closeIcon;

+ 6 - 16
src/components/BodyContainer/index.jsx

@@ -1,24 +1,14 @@
-import React, { Component } from "react";
-
-//  引入组件
 import SaveDataAll from "@containers/BodyContainer";
 import PushContainer from '@components/PushContainer';
 
 import style from './index.less';
 
-class BodyContainer extends Component {
-    constructor() {
-        super();
-    }
-    
-    render() {
-        const { saveDateAll } = this.props;
-        //console.log(saveDateAll)
-        return <div className={style['container'] + ' clearfix'}>
-            <SaveDataAll saveDateAll={saveDateAll}></SaveDataAll>
-            <PushContainer></PushContainer>
-        </div>;
-    }
+const BodyContainer = (props) =>{
+  const { saveDateAll } = props;
+  return <div className={style['container'] + ' clearfix'}>
+      <SaveDataAll saveDateAll={saveDateAll}></SaveDataAll>
+      <PushContainer></PushContainer>
+  </div>;
 }
 
 export default BodyContainer;

BIN
src/components/DiagnosticList/img/delete-on.png


+ 14 - 2
src/components/DiagnosticList/index.jsx

@@ -1,6 +1,7 @@
 import React, { Component } from 'react';
 import style from './index.less';
 import del_icon from './img/delete.png'
+import del_on from './img/delete-on.png'
 import diagUp from './img/diagUp.png'
 import diagDown from './img/diagDown.png'
 import manageIcon from '@common/images/manage.png';
@@ -32,6 +33,7 @@ class DiagnosticList extends Component {
             isAssessConfirm:false,
             radioVal:{},  //可能结果选择内容
             possible:{},  //可能结果
+            hasOndel: false
         }
         this.deleteItem = this.deleteItem.bind(this);
         this.cancel = this.cancel.bind(this);
@@ -232,9 +234,19 @@ class DiagnosticList extends Component {
           })
       }
     }
+    handleEnterDel() {
+      this.setState({
+        hasOndel: true
+      })
+    }
+    handleLeaveDel() {
+      this.setState({
+        hasOndel: false
+      })
+    }
     render(){
         const { list, treatment, showReferRecord, showHistoryCase ,chronicMagItem} = this.props;
-        const { visible, treatTitle ,showAssess, isAssessConfirm, radioVal, possible,assessId,disName} = this.state;
+        const { visible, treatTitle ,showAssess, isAssessConfirm, radioVal, possible,assessId,disName, hasOndel} = this.state;
         const chronicList = JSON.parse(localStorage.getItem('chronic')||null);
         const chronicLine = chronicMagItem&&chronicMagItem.name;     //当前是否走的慢病流程
         let isChronic = false;      //是否要显示管理评估
@@ -263,7 +275,7 @@ class DiagnosticList extends Component {
                                           onClick={this.showAssessFn.bind(this,item)}>
                                         管理评估
                                     </span>:''}
-                                    <img className={style['diag-del']} src={del_icon} onClick={()=>{this.handleDeleteItem(item)}}/>
+                                    <img className={style['diag-del']} src={hasOndel ? del_on : del_icon} onMouseEnter={this.handleEnterDel.bind(this)} onMouseLeave={this.handleLeaveDel.bind(this)} onClick={()=>{this.handleDeleteItem(item)}}/>
                         </div>)
                     })}
                      {treatment&&<Treat title={treatTitle}></Treat>}

+ 8 - 15
src/components/Empty/index.jsx

@@ -1,22 +1,15 @@
-import React from 'react';
 import styles from './index.less';
 import empty from '@common/images/empty.png';
 
 
-
-class Empty extends React.Component {
-    constructor(props){
-        super(props);
-    }
-    render(){
-        const {message} = this.props;
-        return (
-            <div className={styles.empty}>
-                <img src={empty} alt="暂无数据"/>
-                <p>{message}</p>
-            </div>
-        )
-    }
+const Empty = (props) => {
+  const {message} = props;
+  return (
+      <div className={styles.empty}>
+          <img src={empty} alt="暂无数据"/>
+          <p>{message}</p>
+      </div>
+  )
 }
 
 export default Empty;

+ 0 - 1
src/components/TreatDesc/index.jsx

@@ -59,7 +59,6 @@ class TreatDesc extends Component {
         $('#treatDescBox').css({'display': 'none'});
         $('#treatDescBox').animate({'display': 'none'}, 500);
         $('#treatWrapper').animate({'margin-left': '-340px','left':'50%'}, 500);
-        
     }
 
     render(){

+ 4 - 1
src/store/actions/currentIll.js

@@ -864,7 +864,10 @@ export function setInputLabel(state,action){
     }
   }
   if(text){
-    res.saveText[i] = prefix+text+suffix;
+    res.saveText[i] = prefix ||''+ text + suffix||'';
+  }else if(!text && !prefix && !suffix){//整个标签内容完全删除
+    res.data.splice(i,1);
+    res.saveText.splice(i,1);
   }else{//删除完要清空
     res.saveText[i] = "";
   }

+ 1 - 2
src/store/async-actions/homePage.js

@@ -132,8 +132,7 @@ export const getCommonList = (val)=>{
     const patientInfo = state.patInfo.message;
     const params = {
       "age":patientInfo.patientAge ,   //年龄
-      "deptId": patientInfo.hospitalDeptId,       //科室id
-      // "deptName": patientInfo.selfDeptName,       //科室name-标准化
+      "deptName": patientInfo.hospitalDeptName, //科室名称
       "sexType": patientInfo.sex,        //性别
       "type": val
     }

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

@@ -15,10 +15,10 @@ export const getCommSymptoms = ()=>{//获取常见症状
     const {message} = state.patInfo;
     //从state中拿到门诊号
     const deptCode = message.selfDeptId;
-    // const deptName = message.selfDeptName;//标准化
+    const deptName = message.selfDeptName;//标准化
     const params = {
-      'deptId':deptCode,
-      // 'deptName':deptName,
+      // 'deptId':deptCode,
+      'deptName':deptName,
       'age':message.patientAge,
       'sexType':message.sex,
       'type':1

+ 102 - 0
src/utils/drag.js

@@ -0,0 +1,102 @@
+import $ from 'jquery';
+import { getWindowInnerHeight,getWindowInnerWidth,getPageCoordinate } from './tools'
+/**
+ * 
+ * @param {被拖动的元素} domWrap 
+ * @param {可拖动的区域} domDrag 
+ * @param {鼠标滑动监听的区域} dragMove 
+ * @param {拖动元素/清除拖动事件监听} type 
+ */
+
+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
+    }
+    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)
+  }, 6000);
+}
+
+module.exports = {
+  dragBox
+}

+ 21 - 27
src/utils/tools.js

@@ -11,6 +11,7 @@ import {ISREAD, SETREADDITEMS} from "../store/types/homePage";
 import {CLEAR_FIRST_MAIN_DIAG, CLEAR_ALL_TREAT} from "../store/types/treat";
 import {tabChange} from '@store/actions/tabTemplate';
 import config from '@config/index.js';
+import $ from 'jquery';
 
 /***
  * 工具函数
@@ -634,14 +635,11 @@ function windowRemoveEventHandler(type,func,dom){
       win.detachEvent('on'+type,func);
     }
 }
-
-
 //禁止回车事件
 function handleEnter(event){
     event = event?event:window.event;
     if(event.keyCode==13){return false;}
 }
-
 //获取病例输入的内容
 function getEMRParams(){
   const state = store.getState();
@@ -740,12 +738,12 @@ function normalVal(min,max){
       return null;
   }
 }
-function getPageCoordinate(event){
+function getPageCoordinate(event,stic){//获取鼠标点击的位置
     let e = event || window.event;
     var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
     var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
     var x = e.pageX || (e.clientX + scrollX);
-    var y = (e.pageY+25) || (e.clientY + scrollY + 25);
+    var y = (e.pageY+(stic?25:0)) || (e.clientY + scrollY + (stic?25:0));//弹窗位置偏下25
     let obj = {
       boxLeft : x ,
       boxTop : y
@@ -762,35 +760,29 @@ function timestampToTime(timestamp) {     //excel导入2019年5月1日会转换
   var s = date.getSeconds();
   return Y+M+D+h+m+s;
 }
-function getPageLength(event) {     //兼容ie8获取页面距离左和上的距离,包括滚动距离
-  let e = event || window.event;
-  let scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
-  let scrollY = document.documentElement.scrollTop || document.body.scrollTop;
-  let x = e.pageX || e.clientX + scrollX;
-  let y = e.pageY || e.clientY + scrollY;
-  let page = {
-    pageX:x,
-    pageY:y
-  }
-  return page;
-}
-function dragBox(domWrap,domDrag){
+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 = getPageLength(event);
-    mouseX = page.pageX - wrap.offsetLeft      //鼠标到拖拽元素的左边界的距离
-    mouseY = page.pageY - wrap.offsetTop       //鼠标到拖拽元素的上边界的距离
+    let page = getPageCoordinate(event,'0');
+    mouseX = page.boxLeft - wrap.offsetLeft      //鼠标到拖拽元素的左边界的距离
+    mouseY = page.boxTop - wrap.offsetTop       //鼠标到拖拽元素的上边界的距离
     isDrag = true
     // isMove = false
   },drag)
-  // windowEventHandler('mousemove',handleMove,document)
+  // $(move).mouseup(()=>{
+  //   console.log(123)
+  //   isDrag = false
+  //   return false
+  // })
+  // $(move).mousemove(handleMove)
   windowEventHandler('mousemove',handleMove,document)
   windowEventHandler('mouseup',()=>{
     // if(isMove){ //有move就设置位置没有移动就不处理
@@ -800,11 +792,11 @@ function dragBox(domWrap,domDrag){
     // }
     isDrag = false
     return false
-  },document)
+  },dragMove)
 
   function handleMove(event){      //移动的
     let dragDes = document.getElementById('treatDescBox');//展開区域
-    let page = getPageLength(event);
+    let page = getPageCoordinate(event,'0');
     let maxDragX = 0,dragDesWidth = 0;
     let maxDragY = height - wrapHeight;//最大可拖拽y方向距离
     wrapHeight = wrap.offsetHeight;
@@ -820,8 +812,8 @@ function dragBox(domWrap,domDrag){
       maxDragX = width - wrapWidth
     }
     if(isDrag){
-      dragX = page.pageX - mouseX          //鼠标可拖拽到左边的最大距离
-      dragY = page.pageY - mouseY          //鼠标可拖拽到上边的最大距离
+      dragX = page.boxLeft - mouseX          //鼠标可拖拽到左边的最大距离
+      dragY = page.boxTop - mouseY          //鼠标可拖拽到上边的最大距离
       if(dragX < 0){      //不能超出左边界
         dragX = 0
       }
@@ -847,6 +839,9 @@ function dragBox(domWrap,domDrag){
       wrap.style.top = dragY + 'px'
     }
   }
+  setTimeout(() => {
+    // windowRemoveEventHandler('mousemove',handleMove,document)
+  }, 2000);
 }
 
 function getCurrentDate(){
@@ -1164,7 +1159,6 @@ module.exports = {
     getPageCoordinate,
     windowRemoveEventHandler,
     timestampToTime,
-    getPageLength,
     dragBox,
     formatContinueDots,
     inspectAndAssist,