瀏覽代碼

治疗方案、历史病例loading调整成私有

liucf 6 年之前
父節點
當前提交
0abbc0f66e

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

@@ -8,7 +8,8 @@
 import React, {Component} from 'react';
 /*import PropTypes from 'prop-types';*/
 import style from './index.less';
-import icon from './img/loading.gif';
+// import icon from './img/loading.gif';
+import icon from '@common/images/loading.gif';
 
 /*const propTypes = {
     text: PropTypes.string,
@@ -35,10 +36,11 @@ const defaultProps = {
 
 class Loading extends React.Component{
     render(){
-        const {text, img, show} = this.props;
+        const {text,show} = this.props;
         return (
             <div className={style['loading']} style={{display: show ? 'block' : 'none'}}>
-                {this.props.shadeIsShow?<div className={style['cover']}/>:null}
+                {/*{this.props.shadeIsShow?<div className={style['cover']}/>:null}*/}
+                <div className={style['cover']}/>
                 <div className={style['info']}>
                     <img src={icon}/>
                     <p>{text}</p>
@@ -48,7 +50,4 @@ class Loading extends React.Component{
     }
 }
 
-/*Loading.propTypes = propTypes;
-Loading.defaultProps = defaultProps;*/
-
 export default Loading;

+ 7 - 3
src/common/components/Loading/index.less

@@ -8,9 +8,9 @@
   .cover{
     width: 100%;
     height: 100%;
-    background: #333;
-    opacity: .6;
-    filter:alpha(opacity=60);
+    background: #000;
+    opacity: .4;
+    filter:alpha(opacity=40);
     -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=60);";
   }
   .info{
@@ -18,6 +18,10 @@
     top: 40%;
     left: 45%;//calc(50% - 50px);
     text-align: center;
+    img{
+      width: 40px;
+      height: 40px;
+    }
   }
   p{
     color: #fff;

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

@@ -5,7 +5,7 @@ import diagUp from './img/diagUp.png'
 import diagDown from './img/diagDown.png'
 import printIcon from '@common/images/team.png';
 import manageIcon from '@common/images/manage.png';
-import {ConfirmModal, Message,ComplexModal} from '@commonComp';
+import {ConfirmModal, Message,ComplexModal,Loading} from '@commonComp';
 import Notify from '@commonComp/Notify';
 import Treat from '@containers/Treat'
 import store from '@store';
@@ -234,7 +234,7 @@ class DiagnosticList extends Component {
       }
     }
     render(){
-        const { list, treatment, showReferRecord, showHistoryCase ,chronicMagItem} = this.props;
+        const { list, treatment, showReferRecord, showHistoryCase ,chronicMagItem,loading} = this.props;
         const { visible, treatTitle ,showAssess, isAssessConfirm, radioVal, possible,assessId,disName} = this.state;
         const chronicList = JSON.parse(localStorage.getItem('chronic')||null);
         const chronicLine = chronicMagItem&&chronicMagItem.name;     //当前是否走的慢病流程
@@ -299,6 +299,7 @@ class DiagnosticList extends Component {
                         {this.getHistoryCase()}
                         <div className={style['confirm-history']}><span className={style['confirm-history-btn']} onClick={this.referCase}>确定</span></div>
                     </ConfirmModal>
+                    <Loading show={loading}/>
                 </div>
                
         )

+ 11 - 6
src/components/InfoTitle/index.jsx

@@ -9,8 +9,9 @@ import { showHistory } from '@store/actions/historyTemplates';
 import { initItemList,setInitHistory } from '@store/async-actions/historyTemplates';
 import HistoryCases from '@containers/HistoryCases';
 import $ from 'jquery';
-import Notify from '@commonComp/Notify';
-import {MODI_LOADING} from '@store/types/homePage.js';
+import {Notify,Loading} from '@commonComp';
+// import {MODI_LOADING} from '@store/types/homePage.js';
+import {SHOW_LOADING} from '@store/types/copyRight.js';
 class InfoTitle extends Component {
     constructor(props){
         super(props);
@@ -49,7 +50,7 @@ class InfoTitle extends Component {
         }
     }
     render() {
-        const {disVisible,copyVisible,winWidth} = this.props;
+        const {disVisible,copyVisible,winWidth,loading} = this.props;
         const {le} = this.state;
         return <div className={style['title-wrapper']} style={{zIndex:disVisible||copyVisible?40:204,left:le}}>
             <PatInfoContainer sizeFlag={winWidth <= 1065?true:false}/>
@@ -60,6 +61,7 @@ class InfoTitle extends Component {
                 <span><img src={health} />&nbsp;健康档案</span>
             </div>
             <HistoryCases></HistoryCases>
+            <Loading show={loading}/>
         </div>;
     }
 }
@@ -67,17 +69,20 @@ function mapStateToProps(state) {
   return {
     disVisible: state.copyRight.disVisible,
     copyVisible:state.copyRight.copyVisible,
-    winWidth:state.homePage.windowWidth
+    winWidth:state.homePage.windowWidth,
+    loading:state.copyRight.loading,
   }
 }
 
 function mapDispatchToProps(dispatch){
     return{
         showLoading(){
-            dispatch({type:MODI_LOADING,flag:true});
+            // dispatch({type:MODI_LOADING,flag:true});
+            dispatch({type:SHOW_LOADING,flag:true});
         },
         hideLoading(){
-            dispatch({type:MODI_LOADING,flag:false});
+            // dispatch({type:MODI_LOADING,flag:false});
+            dispatch({type:SHOW_LOADING,flag:false});
         }
     }
 }

+ 4 - 2
src/containers/DiagnosticList.js

@@ -1,7 +1,7 @@
 import React from 'react';
 import { connect } from 'react-redux';
 import DiagnosticList from '@components/DiagnosticList';
-import { ADD_DIAGNOSTIC,  DEL_DIAGNOSTIC, UP_DIAGNOSTIC, DOWN_DIAGNOSTIC, GET_DIAGNOSTIC_STR, GET_IS_FIRST, HIDE_REFER_RECORD, SHOW_HISTORY_CASE,HIDE_HISTORY_CASE } from '@store/types/diagnosticList'; 
+import { ADD_DIAGNOSTIC,  DEL_DIAGNOSTIC, UP_DIAGNOSTIC, DOWN_DIAGNOSTIC, GET_DIAGNOSTIC_STR, GET_IS_FIRST, HIDE_REFER_RECORD, SHOW_HISTORY_CASE,HIDE_HISTORY_CASE ,SHOW_LOADING} from '@store/types/diagnosticList'; 
 import { getTreatResult } from '@store/async-actions/treat';
 import { SHOW_TREAT, DEL_REACT, DEL_FOLLOW_UP } from '@store/types/treat.js';
 import {billing, getTips} from '../store/async-actions/pushMessage';
@@ -28,6 +28,7 @@ function mapStateToProps(state) {
         wholeResults:assessResult.wholeResults,
         scaleInfo: pushMessage.scaleInfo,//量表内容
         showHide: pushMessage.showHide,
+        loading: diagnosticList.loading,
     }
 }
 
@@ -81,7 +82,8 @@ function mapDispatchToProps(dispatch) {
             })
         },
         getTreatResult: (item) => {
-            dispatch({type:MODI_LOADING,flag:true});
+            // dispatch({type:MODI_LOADING,flag:true});
+            dispatch({type:SHOW_LOADING,flag:true});
             dispatch(getTreatResult(item));
         },
         getTips: (diagItem) => {

+ 3 - 2
src/store/async-actions/treat.js

@@ -1,6 +1,6 @@
 import { json } from "@utils/ajax";
 // import { SET_TREAT } from '@store/types/diagnosticList';
-import { ADD_DIAGNOSTIC, GET_DIAGNOSTIC_STR,SET_TREAT} from '@store/types/diagnosticList';
+import { ADD_DIAGNOSTIC, GET_DIAGNOSTIC_STR,SET_TREAT,SHOW_LOADING} from '@store/types/diagnosticList';
 import { SET_COMMONTREATMENT } from '@store/types/pushMessage'
 import { SET_DRUG_INFO, SET_TREATMENT, SET_TREAT_INFO, SET_RECOMMEND_BASIC, SET_DRUG_INFO_LIST, IS_FIRST_MAIN_DIAG, SET_ADVERSE_REACTIONS, SET_ALL_ADVERSE_REACTIONS, SET_FOLLOW_UP, DEL_FOLLOW_UP, SET_ALL_FOLLOW_UP } from '@store/types/treat';
 import {storageLocal,getEMRParams} from '@utils/tools';
@@ -196,7 +196,8 @@ export const getTreatResult = (item) =>{
 //获取治疗方案
 function getTreatment(item, dispatch, state,url,params, isChronic) {
     json(url, params).then((data) =>{
-        dispatch({type:MODI_LOADING,flag:false});
+        // dispatch({type:MODI_LOADING,flag:false});
+        dispatch({type:SHOW_LOADING,flag:false});
         dispatch({type: SHOW_TREAT})
         let treat;
         if(data.data.data) {

+ 6 - 2
src/store/reducers/copyRight.js

@@ -1,4 +1,4 @@
-import { SHOW_COPY_MODAL, CLOSE_COPY_MODAL, GET_COPY_MESSAGE, SHOW_DISCLAIMER_MODAL, CLOSE_DISCLAIMER_MODAL, GET_DISCLAIMER_MESSAGE, GET_VERSION } from "../types/copyRight";
+import { SHOW_COPY_MODAL, CLOSE_COPY_MODAL, GET_COPY_MESSAGE, SHOW_DISCLAIMER_MODAL, CLOSE_DISCLAIMER_MODAL, GET_DISCLAIMER_MESSAGE, GET_VERSION ,SHOW_LOADING} from "../types/copyRight";
 import { showCopyModal, closeCopyModal, getMessage, showDisclatmerModal,  closeDisclatmerModal, getDisMessage, getVersion} from "../actions/copyRight";
 
 const initState = {
@@ -11,6 +11,7 @@ const initState = {
   hasNewVersion: false
 };
 export default function(state = initState, action) {
+  const res = Object.assign({},state);
   switch (action.type) {
     case SHOW_COPY_MODAL:
       return showCopyModal(state, action);
@@ -25,7 +26,10 @@ export default function(state = initState, action) {
     case GET_DISCLAIMER_MESSAGE:
       return getDisMessage(state, action);
     case GET_VERSION: 
-      return getVersion(state, action)
+      return getVersion(state, action);
+    case SHOW_LOADING:
+      res.loading = action.flag;
+      return res;
     default:
       return state;
   }

+ 4 - 1
src/store/reducers/diagnosticList.js

@@ -1,6 +1,6 @@
 import { ADD_DIAGNOSTIC,  DEL_DIAGNOSTIC, UP_DIAGNOSTIC, DOWN_DIAGNOSTIC, SET_TREAT, GET_DIAGNOSTIC_STR, SET_DIAG_TO_MAINSUIT, 
             GET_IS_FIRST,CLEAR_ALL_DIAG, SET_CLICK_DIAG ,CLEAR_DIAGNOSE, SET_CHRONIC_MAG_ITEM, SHOW_REFER_RECORD, HIDE_REFER_RECORD, 
-            SHOW_HISTORY_CASE,  HIDE_HISTORY_CASE} from '../types/diagnosticList';
+            SHOW_HISTORY_CASE,  HIDE_HISTORY_CASE,SHOW_LOADING} from '../types/diagnosticList';
 import { addDiagnostic,  delDiagnostic, upDiagnostic, downDiagnostic, setTreat, getDiagnosticStr, setDiagToMainSuit, 
         getIsFirst,clearAllDiag, setClickDiag, setChronicMagItem, showReferRecord, hideReferRecord, showHistoryCase, hideHistoryCase} from '../actions/diagnosticList';
 
@@ -74,6 +74,9 @@ export default function (state=initState, action) {
         case CLEAR_DIAGNOSE: 
             res.mainSuitStr = "";
             return res;
+        case SHOW_LOADING: 
+            res.loading = action.flag;
+            return res;
         default:
             return state;
     }

+ 2 - 1
src/store/types/copyRight.js

@@ -4,4 +4,5 @@ export const GET_COPY_MESSAGE = 'GET_COPY_MESSAGE'
 export const GET_DISCLAIMER_MESSAGE = 'GET_DISCLAIMER_MESSAGE'
 export const SHOW_DISCLAIMER_MODAL = 'SHOW_DISCLAIMER_MODAL'
 export const CLOSE_DISCLAIMER_MODAL = 'CLOSE_DISCLAIMER_MODAL'
-export const GET_VERSION = 'GET_VERSION' //获取版本信息
+export const GET_VERSION = 'GET_VERSION' ;//获取版本信息
+export const SHOW_LOADING = 'SHOW_LOADING'; //loading

+ 8 - 7
src/store/types/diagnosticList.js

@@ -8,12 +8,13 @@ export const GET_DIAGNOSTIC_STR = 'GET_DIAGNOSTIC_STR';
 export const SET_DIAG_TO_MAINSUIT = 'SET_DIAG_TO_MAINSUIT'; //判断第一次添加诊断是否添加到主诉
 export const GET_IS_FIRST = 'GET_IS_FIRST'; //判断是否第一次添加诊断
 export const CLEAR_ALL_DIAG = 'CLEAR_ALL_DIAG'; //清除所有诊断
-export const SET_CLICK_DIAG = 'SET_CLICK_DIAG' //设置点击的诊断,获取提示详情时需要
-export const CLEAR_DIAGNOSE = 'CLEAR_DIAGNOSE' //
-export const SET_CHRONIC_MAG_ITEM = 'SET_CHRONIC_MAG_ITEM'  //设置慢病信息
-export const SHOW_REFER_RECORD = 'SHOW_REFER_RECORD'  //显示引用历史病历弹窗
-export const HIDE_REFER_RECORD = 'HIDE_REFER_RECORD'  //隐藏引用历史病历弹窗
-export const SHOW_HISTORY_CASE = 'SHOW_HISTORY_CASE'  //显示历史病历列表弹窗
-export const HIDE_HISTORY_CASE = 'HIDE_HISTORY_CASE'  //隐藏历史病历列表弹窗
+export const SET_CLICK_DIAG = 'SET_CLICK_DIAG' ;//设置点击的诊断,获取提示详情时需要
+export const CLEAR_DIAGNOSE = 'CLEAR_DIAGNOSE'; //
+export const SET_CHRONIC_MAG_ITEM = 'SET_CHRONIC_MAG_ITEM';  //设置慢病信息
+export const SHOW_REFER_RECORD = 'SHOW_REFER_RECORD';  //显示引用历史病历弹窗
+export const HIDE_REFER_RECORD = 'HIDE_REFER_RECORD';  //隐藏引用历史病历弹窗
+export const SHOW_HISTORY_CASE = 'SHOW_HISTORY_CASE';  //显示历史病历列表弹窗
+export const HIDE_HISTORY_CASE = 'HIDE_HISTORY_CASE' ; //隐藏历史病历列表弹窗
+export const SHOW_LOADING = 'SHOW_LOADING';    //显示loading
 
 

+ 13 - 13
src/store/types/treat.js

@@ -10,16 +10,16 @@ export const SHOW_DRUG_INFO = 'SHOW_DRUG_INFO';
 export const HIDE_DRUG_INFO = 'HIDE_DRUG_INFO';
 export const SET_GENERAL_TREAT = 'SET_GENERAL_TREAT'; //设置一般治疗
 export const SET_SURGERY_TREAT = 'SET_SURGERY_TREAT'; //设置手术治疗
-export const SET_TREATMENT = 'SET_TREATMENT' //设置治疗方案
-export const SET_RECOMMEND_BASIC = 'SET_RECOMMEND_BASIC'//设置其他推荐推荐依据
-export const SET_TREAT_INFO = 'SET_TREAT_INFO' //设置治疗方案信息(name,id等)
-export const SET_DRUG_INFO_LIST = 'SET_DRUG_INFO_LIST' //查询多个药品说明书(添加数据时查看药品说明用)
-export const IS_FIRST_MAIN_DIAG = 'IS_FIRST_MAIN_DIAG' //是否为主诊断第一次开单
-export const CLEAR_FIRST_MAIN_DIAG = 'CLEAR_FIRST_MAIN_DIAG' //回读清空是否为主诊断第一次开单
-export const SET_ADVERSE_REACTIONS = 'SET_ADVERSE_REACTIONS'    //设置不良反应
-export const SET_ALL_ADVERSE_REACTIONS = 'SET_ALL_ADVERSE_REACTIONS'    //设置所有不良反应
-export const CHANGE_REACT = 'CHANGE_REACT'  //改变不良反应状态
-export const DEL_REACT = 'DEL_REACT'  //删除不良反应
-export const SET_FOLLOW_UP = 'SET_FOLLOW_UP'    //设置回访时间
-export const DEL_FOLLOW_UP = 'DEL_FOLLOW_UP'    //删除回访时间
-export const SET_ALL_FOLLOW_UP = 'SET_ALL_FOLLOW_UP'    //设置所有回访时间
+export const SET_TREATMENT = 'SET_TREATMENT'; //设置治疗方案
+export const SET_RECOMMEND_BASIC = 'SET_RECOMMEND_BASIC';//设置其他推荐推荐依据
+export const SET_TREAT_INFO = 'SET_TREAT_INFO' ;//设置治疗方案信息(name,id等)
+export const SET_DRUG_INFO_LIST = 'SET_DRUG_INFO_LIST' ;//查询多个药品说明书(添加数据时查看药品说明用)
+export const IS_FIRST_MAIN_DIAG = 'IS_FIRST_MAIN_DIAG' ;//是否为主诊断第一次开单
+export const CLEAR_FIRST_MAIN_DIAG = 'CLEAR_FIRST_MAIN_DIAG'; //回读清空是否为主诊断第一次开单
+export const SET_ADVERSE_REACTIONS = 'SET_ADVERSE_REACTIONS' ;   //设置不良反应
+export const SET_ALL_ADVERSE_REACTIONS = 'SET_ALL_ADVERSE_REACTIONS';    //设置所有不良反应
+export const CHANGE_REACT = 'CHANGE_REACT' ; //改变不良反应状态
+export const DEL_REACT = 'DEL_REACT' ; //删除不良反应
+export const SET_FOLLOW_UP = 'SET_FOLLOW_UP'  ;  //设置回访时间
+export const DEL_FOLLOW_UP = 'DEL_FOLLOW_UP'  ;  //删除回访时间
+export const SET_ALL_FOLLOW_UP = 'SET_ALL_FOLLOW_UP' ;   //设置所有回访时间