Parcourir la source

治疗方案loading

liucf il y a 6 ans
Parent
commit
20165599a9

+ 9 - 5
src/store/async-actions/diagnosticList.js

@@ -1,4 +1,4 @@
-import { SET_DIAG_TO_MAINSUIT, SET_CHRONIC_MAG_ITEM, SHOW_REFER_RECORD } from '@store/types/diagnosticList';
+import { SET_DIAG_TO_MAINSUIT, SET_CHRONIC_MAG_ITEM, SHOW_REFER_RECORD,SHOW_LOADING } from '@store/types/diagnosticList';
 import {getAllDataList,getAllDataStringList,isAllClear,filterDataArr} from '@utils/tools';
 import {getChronic,getInitModules} from '@store/async-actions/homePage.js';
 import {storageLocal} from '@utils/tools'
@@ -52,10 +52,12 @@ export const isChronicMag = (item) => {
                                 chronicMagItem: item
                             })
                             // loading
-                            dispatch({type:MODI_LOADING,flag:true});
+                            // dispatch({type:MODI_LOADING,flag:true}); //全局
+                            dispatch({type:SHOW_LOADING,flag:true}); //私有
                             // 获取慢病模板
                             dispatch(getInitModules).then(()=>{
-                                dispatch({type:MODI_LOADING,flag:false});
+                                // dispatch({type:MODI_LOADING,flag:false});
+                                dispatch({type:SHOW_LOADING,flag:false});
                                 dispatch({
                                     type: SHOW_REFER_RECORD
                                 })
@@ -73,10 +75,12 @@ export const isChronicMag = (item) => {
                             chronicMagItem: item
                         })
                         // loading
-                        dispatch({type:MODI_LOADING,flag:true});
+                        // dispatch({type:MODI_LOADING,flag:true});
+                        dispatch({type:SHOW_LOADING,flag:true});
                         // 获取慢病模板
                         dispatch(getInitModules).then(()=>{
-                            dispatch({type:MODI_LOADING,flag:false});
+                            // dispatch({type:MODI_LOADING,flag:false});
+                            dispatch({type:SHOW_LOADING,flag:false});
                             dispatch({
                                 type: SHOW_REFER_RECORD
                             })

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

@@ -197,7 +197,8 @@ export const getTreatResult = (item) =>{
 function getTreatment(item, dispatch, state,url,params, isChronic) {
     json(url, params).then((data) =>{
         if(data.data.code == '0') {
-            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) {

+ 1 - 1
src/utils/tools.js

@@ -645,7 +645,7 @@ function getEMRParams(){
   const state = store.getState();
   const {message} = state.patInfo;
   const {mainSuit,currentIll,otherHistory,checkBody,inspect,assistCheck,diagnosticList} = state;
-  console.log('message', message)
+  // console.log('message', message)
   const main = filterDataArr(mainSuit.saveText)||'',
     current=filterDataArr(currentIll.saveText)||'',
     other = filterDataArr(otherHistory.saveText)||'',