浏览代码

Merge remote-tracking branch 'origin/adverseReact' into testedMerge

zhouna 5 年之前
父节点
当前提交
9fc8077081

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

@@ -10,6 +10,7 @@ import React, {Component} from 'react';
 import style from './index.less';
  import wnIcon from '@common/images/wn.png';
 import icon from '@common/images/loading.gif';
+import Notify from '@commonComp/Notify';
 import ReactDom from 'react-dom';
 
 /*const propTypes = {
@@ -43,9 +44,7 @@ class Loading extends React.Component{
             <div className={style['loading']} style={{display: show ? 'block' : 'none'}}>
                 {/*{this.props.shadeIsShow?<div className={style['cover']}/>:null}*/}
                 <div className={style['cover']}/>
-              {type==='warning'?<div className={style['t-info']}>
-                <p><img src={wnIcon} alt=""/>{text}</p>
-              </div>:<div className={style['info']}>
+              {type==='warning'?Notify.info(text,0, false,false):<div className={style['info']}>
                     <img src={icon}/>
                     <p>{text}</p>
                 </div>}

+ 8 - 8
src/common/components/Notify/index.js

@@ -29,19 +29,19 @@ function createNotification() {
 }
 
 let notification
-const notice = (type, content, duration=2000, onClose) => {
+const notice = (type, content, duration=2000, onClose, showClose=true) => {
     if (!notification) notification = createNotification()
-    return notification.addNotice({ type, content, duration, onClose })
+    return notification.addNotice({ type, content, duration, onClose,showClose })
 }
 
 export default {
-    info(content, duration, onClose) {
-        return notice('info', content, duration, onClose)
+    info(content, duration, onClose, showClose) {
+        return notice('info', content, duration, onClose, showClose)
     },
-    success(content = '操作成功', duration, onClose) {
-        return notice('success', content, duration, onClose)
+    success(content = '操作成功', duration, onClose, showClose) {
+        return notice('success', content, duration, onClose, showClose)
     },
-    error(content, duration , onClose) {
-        return notice('error', content, duration, onClose)
+    error(content, duration , onClose, showClose) {
+        return notice('error', content, duration, onClose, showClose)
     }
 }

+ 9 - 9
src/common/components/Notify/index.less

@@ -10,11 +10,11 @@
   top: 0; 
 }
 .notify-box {
-  min-width: 350px;
-  height:70px;
+  // min-width: 350px;
+  // height:70px;
   position: fixed;
-  padding-right: 90px;
-  top:30%;
+  padding-right: 100px;
+  top:40%;
   left:50%;
   transform: translate(-50%, -50%);
   // margin:-35px 0 0  -175px;
@@ -22,13 +22,13 @@
   border-radius: 10px;
   line-height: 70px;
   box-sizing: border-box;
-  border: 1px solid;
+  border: 1px solid #000;
 }
 .notify-text {
-  min-width: 224px;
-  height: 70px;
+  // min-width: 224px;
+  max-height: 280px;
   padding:  0 40px 0 0;
-  // overflow: hidden;
+  overflow-y: auto;
   position: relative;
   left: 66px;
   top: 0;
@@ -76,6 +76,6 @@
 }
 .notify-close {
   position: absolute;
-  right: 10px;
+  right: 0px;
   top: 15px;
 }

+ 1 - 2
src/common/components/Notify/notify.js

@@ -22,7 +22,6 @@ class NotifyBox extends Component {
 
         // notices.push(notice);//展示所有的提示
         notices[0] = notice;//仅展示最后一个提示
-        
         this.setState({ notices })
         if (notice.duration > 0) {
             clearTimeout(this.state.timer);
@@ -70,7 +69,7 @@ class NotifyBox extends Component {
                             <div className={style['notify-box']} style={styles[notice.type]}>
                                 <div className={style[`${icons[notice.type]}`]}></div>
                                 <div className={style['notify-text']}>{notice.content}</div>
-                                <img  className={style['notify-close']} onClick={()=>{this.removeNotice(notice.key)}} src={close}/>
+                                {notice.showClose&&<img  className={style['notify-close']} onClick={()=>{this.removeNotice(notice.key)}} src={close}/>}
                             </div>
                         </div>
                     ))

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

@@ -90,7 +90,7 @@ class Advice extends Component{
         </div>}
         {!isFirstMainDiag && hasFollowUp &&<FollowUp  noHeader="true" textStyle={{padding: '0 10px'}}  setFollowUp={saveFollowUp} followUp = {followUp} isRead={isRead}></FollowUp>}
         {advice.scheme && advice.scheme.length > 0 &&<div contentEditable='false' className={`${style['scheme']} ${setFontColorSize(2)}`}>
-          {advice.scheme && advice.scheme.length > 0  && <h1>治疗方案</h1>}
+          {advice.scheme && advice.scheme.length > 0  && <h1>建议用药</h1>}
           {scheme}
         </div>}
         <div className={`${style['billing']} ${setFontColorSize(2)}`} >