ソースを参照

添加获取配置接口

zhouna 6 年 前
コミット
f89d3f2a2b

+ 2 - 2
src/components/NumberDrop/index.jsx

@@ -274,7 +274,7 @@ class NumberDrop extends Component{
             contentEditable={true}
             style={{minWidth:'10px',display:'inline-block',textAlign:'center'}}
             ref = {this.$span}
-            onkeydown={this.handleKeyDowm}
+            onKeyDown={this.handleKeyDowm}
             onBlur={this.numInpBlur}
             onInput={this.handleSpanInp}
             className={this.getSpanClass()}
@@ -282,7 +282,7 @@ class NumberDrop extends Component{
       <span ref = {this.$suf}>&nbsp;{suffix}</span>
       <NumberPan handleSelect={this.select.bind(this)}
                  onClose={handleHide}
-                 show={show} 
+                 show={show}
                  toClear={!hasSelect}
                  left={boxLeft}
                  top={boxTop}/>

+ 18 - 12
src/modules/HomePage/index.jsx

@@ -5,10 +5,10 @@ import BannerContainer from '@containers/TypeConfigContainer';
 import BodyContainer from "@components/BodyContainer";
 import EmergencyProcedure from '@components/EmergencyProcedure';
 
-import {HIDEDROP,SETMINSCREEN} from '@store/types/homePage.js';
+import {HIDEDROP,SETMINSCREEN,SETSYSTEMCONFIG} from '@store/types/homePage.js';
 import style from './index.less';
-import {getInitModules,getChronic} from '@store/async-actions/homePage.js';
-import { getUrlArgObject } from "@utils/tools";
+import {getInitModules,getChronic,getSystemConfig} from '@store/async-actions/homePage.js';
+import { getUrlArgObject,parseNameVal } from "@utils/tools";
 import $ from 'jquery';
 import data from '@components/EmergencyProcedure/emergency';
 import loading from '@common/images/loading.gif';
@@ -22,16 +22,10 @@ class HomePage extends Component {
         this.setDataIdx = this.setDataIdx.bind(this)
     }
     componentDidMount(){
-        const {setWindow,getChronicList} = this.props;
+        const {setWindow,getChronicList,getConfig} = this.props;
+        getConfig();
         getChronicList&&getChronicList();//获取慢病列表
-       /* clearTimeout(this.state.timer);
-        const that = this;
-        const timer = setTimeout(function(){//解决患者信息在获取模板之后的问题
-            that.props.getInit();
-        },200)
-        this.setState({
-            timer
-        }) */ 
+
         // 获取并监听窗口宽度,用于有横向滚动条时患者信息和打印预览跟随滚动
         let width = $(window).width();
         let height = $(window).height();
@@ -98,6 +92,18 @@ const mapDispatchToProps = function (dispatch) {
         },
         getChronicList(){
             dispatch(getChronic)
+        },
+        getConfig(){
+          getSystemConfig().then((res)=>{
+            if(res.data.code=='0'){
+                dispatch({
+                  type:SETSYSTEMCONFIG,
+                  data: parseNameVal(res.data.data)
+                })
+            }else{
+
+            }
+          });
         }
     }
 };

+ 0 - 35
src/store/async-actions/fetchModules.js

@@ -294,41 +294,6 @@ export function getIndexData(range,disName){
   }
 }
 
-// 计算接口
-/*export const getFormulaResult = (item)=>{
-  // type:1-量表 2-计算公式
-  const type = item.type;
-  let param = {
-      type:type,
-      data:item.data
-    }
-  return (dispatch,getState) => {
-    const state = getState();
-    json(api.getFormulaResult,param).then((res)=>{
-      if(+res.data.code==0){
-        if(type==1){//量表
-          dispatch({
-            type:SAVE_TABLE_RESULT,
-            // id:item.pId, //外层疾病id
-            id:item.id,  //量表id
-            data:Object.assign({},res.data.data,{pIndex:item.pIndex})
-          })
-        }else if(type==2){//计算公式
-          const data = state.pushMessage.chronicPushItems
-          data[item.ppIndex].details[item.pIndex].content.result =  res.data.data.result
-          dispatch({
-            type: SET_CHRONIC_PUSHS,
-            data: JSON.parse(JSON.stringify(data))
-          })
-          console.log('resss', res)
-        }
-        
-      }else{
-        Notify.error(res.data.msg);
-      }
-    })
-  }
-}*/
 export const getFormulaResult = (item)=>{
   // type:1-量表 2-计算公式
   const type = item.type;

+ 8 - 3
src/store/async-actions/homePage.js

@@ -3,18 +3,23 @@ import {SETINITDATA,MODI_LOADING,GET_ASSIST_LIST,GET_INSPECT_LIST,SETALLMODULES}
 import {SET_CURRENT} from '@store/types/currentIll';
 import {SET_MAINSUIT} from '@store/types/mainSuit';
 import config from '@config/index.js';
-import {formatContinueDots} from '@utils/tools';
+import {formatContinueDots,getUrlArgObject,storageLocal,fullfillText,checkFullfillText} from '@utils/tools';
 import {getOtherHisRecord,getInitData} from '@store/async-actions/fetchModules.js';
 import {initHistoryDetails} from '@store/async-actions/patInfo';
-import {storageLocal,fullfillText,checkFullfillText} from '@utils/tools';
 
 const api = {
   getModules:'/moduleInfo/getAll',
   clickCount:'/buriedSomeStatistical/saveBuriedSomeStatisticals', //埋点统计
   getChronic:'/disType/getDisType', //慢病列表
-  getQuestionUsual:'/questionUsual/getQuestionUsual' //化验常用标签
+  getQuestionUsual:'/questionUsual/getQuestionUsual', //化验常用标签
+  getSystemConfig:'/sysSet/getSysSetInfoDatas',     //获取系统配置
 };
 
+//获取系统配置
+export const getSystemConfig = ()=>{
+  const code = getUrlArgObject('hospitalId');
+  return json(api.getSystemConfig,{hospitalCode:code});
+};
 function modulesParseJson(data){
   let json = {},obj={},saveTextJson={},moduleName={};
   data.map((it)=>{

+ 4 - 5
src/store/reducers/homePage.js

@@ -1,5 +1,5 @@
 import {HIDE,RESET,SETINITDATA,SETDROPSHOW,SETADDITEMINIT,SETT0EDIT,SETREADDITEMS,
-  HIDEDROP,CLICKCOUNT,ISREAD,SETOTHERHISTORY,SETMINSCREEN,MODI_LOADING,SEARCH_DROP_LOCATION,GET_INSPECT_LIST,GET_ASSIST_LIST,SETALLMODULES} from '../types/homePage.js';
+  HIDEDROP,CLICKCOUNT,ISREAD,SETOTHERHISTORY,SETMINSCREEN,MODI_LOADING,SEARCH_DROP_LOCATION,GET_INSPECT_LIST,GET_ASSIST_LIST,SETALLMODULES,SETSYSTEMCONFIG} from '../types/homePage.js';
 import {showDrop,setAddItemInit,setLabelToEdit,confirmHide,clickNum,searchDropLocation,getInspectList,getAssistList} from '../actions/homePage.js';
 import SearchDrop from '../../components/SearchDrop/index.jsx';
 
@@ -17,6 +17,7 @@ const initState = {
   allModules:[],
   assistList:[],
   inspectList:[],
+  sysConfig:{}
 };
 
 export default function (state=initState,action) {
@@ -55,10 +56,6 @@ export default function (state=initState,action) {
       res.initData.otherIsHis = action.otherIsHis!=undefined?action.otherIsHis:true;
       res.initData.period = action.period;
       return res;
-    /*case SETTEXTFOCUS:
-      res.focusTextIndex = action.index;
-      res.span=action.$span;
-      return res;*/
     case SETMINSCREEN:
       res.windowWidth = action.obj.width;
       res.windowHeight = action.obj.height;
@@ -76,6 +73,8 @@ export default function (state=initState,action) {
     case SETALLMODULES:
       res.allModules = action.data;
       return res;
+    case SETSYSTEMCONFIG:
+      res.sysConfig = action.data;
     default:
       return res;
   }

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

@@ -15,4 +15,5 @@ export const MODI_LOADING = 'MODI_LOADING';    //1024标识
 export const SEARCH_DROP_LOCATION = 'SEARCH_DROP_LOCATION';    //1024标识
 export const GET_ASSIST_LIST = 'GET_ASSIST_LIST';    //辅检
 export const GET_INSPECT_LIST = 'GET_INSPECT_LIST';    //化验
-export const SETALLMODULES = 'SETALLMODULES';    //储存所有模板数据
+export const SETALLMODULES = 'SETALLMODULES';    //储存所有模板数据
+export const SETSYSTEMCONFIG = 'SETSYSTEMCONFIG';   //设置配置数据

+ 12 - 1
src/utils/tools.js

@@ -1179,6 +1179,16 @@ function getStatusImg(type,val,status){
     }
   }
 }
+
+//键值对转换
+function parseNameVal(arr){
+  let obj = {};
+  Array.isArray(arr)&&arr.map((it)=>{
+    obj[it.code]=it.value;
+  });
+  return obj;
+}
+
 module.exports = {
     checkType: Type.checkType,
     getIds,
@@ -1225,5 +1235,6 @@ module.exports = {
     parseChartData,
     getCalendarDate,
     downloadExportedData,
-    getStatusImg
+    getStatusImg,
+    parseNameVal
 };