Jelajahi Sumber

调推送保存信息,刷新iframe跨域待查

zhouna 5 tahun lalu
induk
melakukan
c9d3945df2

+ 23 - 3
src/components/PushEmbed/index.jsx

@@ -1,5 +1,7 @@
 import React,{Component} from 'react';
 import {windowEventHandler,getWindowInnerHeight} from '@utils/tools';
+import {connect} from 'react-redux';
+import $ from 'jquery';
 
 class PushEmbed extends Component{
   constructor(props){
@@ -17,10 +19,28 @@ class PushEmbed extends Component{
         this.setState({height:height});
     });
   }
+  componentWillReceiveProps(next){
+    if(next.update!=this.props.update){
+      //window.frames['embedPage'].contentWindow.location.reload();
+      //console.log(window.frames['embedPage'].contentWindow)
+    }
+  }
   render(){
     const {width,height}=this.state;
-    const url = "http://192.168.2.241:5448/index.html?mrId=191218491565001358&tipsMode=2&plan=1&tipsInfoList=%5B%7B%22name%22%3A%22%E8%A1%80%E5%B8%B8%E8%A7%84%22%2C%22type%22%3A12%2C%22position%22%3A%221%22%7D%2C%7B%22name%22%3A%22%E5%B0%BF%E5%B8%B8%E8%A7%84%22%2C%22type%22%3A12%2C%22position%22%3A%221%22%7D%2C%7B%22name%22%3A%22%E7%B3%96%E5%B0%BF%E7%97%85%22%2C%22type%22%3A7%2C%22position%22%3A%221%22%7D%5D";
-    return <iframe id='embedPage' width={width} height={height} src={url} frameborder="0"></iframe>
+    const {mrId} = this.props;
+    const url = "http://192.168.2.241:5448/index.html?mrId="+mrId+"&plan=1";
+    return <iframe id='embedPage' width={width} height={height} src={url} frameborder="0"></iframe>;
   }
 }
-export default PushEmbed;
+
+function mapStateToProps(state){
+  const {mrId,update} = state.print.mrInfo;
+  //console.log(state);
+  return {mrId,update};
+};
+
+const PushEmbedContainer = connect(
+  mapStateToProps
+)(PushEmbed);
+
+export default PushEmbedContainer;

+ 8 - 0
src/store/actions/print.js

@@ -38,4 +38,12 @@ export const clearSearchParam=(state,action)=>{
   const res=Object.assign({},state);
   res.clearSearch = action.data;
   return res;
+};
+
+export const setMrId=(state,action)=>{
+  const res=Object.assign({},state);
+  const {update} = res.mrInfo;
+  res.mrInfo.update = +update+1;
+  res.mrInfo.mrId = action.data;
+  return res;
 };

+ 1 - 1
src/store/async-actions/patInfo.js

@@ -67,7 +67,7 @@ export const getAdminCheckout = (val1,val2,dispatch) => {
             });
             dispatch(initItemList(1,''));        //模板列表没有就获取模板列表用于保存时做数据对比是否保存过
         } else {
-            console.log(res)
+            //console.log(res)
         }
     })
 }

+ 103 - 13
src/store/async-actions/pushMessage.js

@@ -15,13 +15,113 @@ const api={
   getTableList:'/scale/getList', //获取量表列表
   getTableInfo:'/scale/getContent', //获取量表明细
   getConceptDetail:'/conceptDetail/getConceptDetail', //获取静态提示信息
-  getMRAnalyse: '/mrqc/analyse' //病历质控
+  getMRAnalyse: '/mrqc/analyse', //病历质控
+  setMrInfo:'http://192.168.2.241/api/data/mr/createMr',      //存页面信息,供页面推送模式调取
 }
 import store from '@store';
+import {SET_MR_INFO} from "../types/print";
 
 
+export const billing = () => {
+  return (dispatch, getState) =>{
+    const state = getState();
+    /*const {hospitalCode,sex,patientAge} = state.patInfo.message;
+    const checkBody = state.checkBody.data;
+    let diagMain = state.diagnosticList.diagnosticList.length>0&&state.diagnosticList.diagnosticList[0];
+    //mdata为主诉无标签直接输入时的内容,symptom参数传主诉+现病史文本
+    const mainData =  mdata?(emrData.current + mdata):(emrData.current + emrData.main);*/
+    const param = getEMRParams();
+    console.log(state)
+    /*const param={
+      "hosCode": hospitalCode,
+      "age": patientAge,
+      "sex": sex,
+      "disType": 0,
+      "chief": mainData,
+      "allergy": "",
+      "diag": [
+        {
+          "dateValue": "",
+          "name": "",
+          "uniqueName": ""
+        }
+      ],
+      "diagOrder": [],
+      "diagString": "",
+      "diseaseName": {
+        "dateValue": "",
+        "name": "",
+        "uniqueName": ""
+      },
+      "drug": [
+        {
+          "dateValue": "",
+          "name": "",
+          "uniqueName": ""
+        }
+      ],
+      "drugOrder": [],
+      "drugString": "",
+      "family": "",
+      "infectious": "",
+      "lis": [
+        {
+          "dateValue": "",
+          "detailName": "",
+          "maxValue": 0,
+          "minValue": 0,
+          "name": "",
+          "otherValue": "",
+          "result": "",
+          "source": 0,
+          "uniqueName": "",
+          "units": "",
+          "value": 0
+        }
+      ],
+      "lisOrder": [],
+      "lisString": "",
+      "marital": "",
+      "marriage": "",
+      "menstrual": "",
+      "operation": "",
+      "operationOrder": [],
+      "other": "",
+      "otherOrder": [],
+      "pacs": [
+        {
+          "dateValue": "",
+          "desc": "",
+          "name": "",
+          "result": "",
+          "uniqueName": ""
+        }
+      ],
+      "pacsOrder": [],
+      "pacsString": "",
+      "pasts": "",
+      "personal": "",
+      "scaleName": "",
+      "symptom": "",
+      "unknown": "",
+      "vaccination": "",
+      "vital": ""
+    };*/
+    json(api.setMrInfo,param).then((res)=>{
+      const data = res.data;
+      if(data.code==='0'){
+        //存mrId
+        dispatch({
+          type:SET_MR_INFO,
+          data:data.data
+        });
+      }
+    });
+  };
+};
+
 //获取右侧推送信息
-export const billing = (mdata,boxMark) => {
+/*export const billing = (mdata,boxMark) => {
  return (dispatch, getState) =>{
   const state = getState();
    const checkBody = state.checkBody.data;
@@ -93,10 +193,6 @@ export const billing = (mdata,boxMark) => {
             setPushEmergency: setPushEmergency||[],
             setPushEmergencyIdx:setPushEmergencyIdx
         });
-        /*dispatch({
-          type:PRESET,
-          data:moduleVital
-        });*/
         //查体高亮标签
         dispatch({
           type:SET_IMPORT_CHECKBODY_LABEL,
@@ -116,14 +212,8 @@ export const billing = (mdata,boxMark) => {
    }).catch((e) =>{
      console.log(e)
    });
-
-   //调查体,现病史触发推送且查体无数据时获取查体模板
-   /*const checkBody = state.checkBody.data;
-   if(boxMark==2&&!(checkBody&&checkBody.length>0&&!checkBody[0].full)){
-     dispatch(pregetCheckbodyData());
-   }*/
  }
-};
+};*/
 
 //获取提示信息(静态信息) 
 export const getConceptDetail = (item,noTips,noDetails,noNotify) => {

+ 10 - 2
src/store/reducers/print.js

@@ -1,5 +1,7 @@
-import { SHOW_PRINT_PREVIEW, CLOSE_PRINT_PREVIEW, SAVE_MESSAGE, CLOSE_PREVIEW, SHOW_PREVIEW,DIAG_SHOW,CLEAR_SEARCH_PARAM } from "../types/print";
-import { showPrintPreview, closePrintPreview, saveMessage, showPreview, closePreview,diagShow,clearSearchParam } from "../actions/print";
+import { SHOW_PRINT_PREVIEW, CLOSE_PRINT_PREVIEW, SAVE_MESSAGE, CLOSE_PREVIEW, SHOW_PREVIEW,
+  DIAG_SHOW,CLEAR_SEARCH_PARAM,SET_MR_INFO } from "../types/print";
+import { showPrintPreview, closePrintPreview, saveMessage, showPreview, closePreview,diagShow,
+  clearSearchParam,setMrId } from "../actions/print";
 
 const initState = {
   visible: false,
@@ -7,6 +9,10 @@ const initState = {
   saveMessage: {},
   diagShow: false,
   clearSearch:0,
+  mrInfo:{
+    update:0,
+    mrId:''
+  }
 };
 export default function(state = initState, action) {
   switch (action.type) {
@@ -24,6 +30,8 @@ export default function(state = initState, action) {
       return diagShow(state, action);
     case CLEAR_SEARCH_PARAM:
       return clearSearchParam(state,action);
+    case SET_MR_INFO:
+      return setMrId(state,action);
     default:
       return state;
   }

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

@@ -4,4 +4,5 @@ export const SAVE_MESSAGE = 'SAVE_MESSAGE';
 export const SHOW_PREVIEW = 'SHOW_PREVIEW';
 export const CLOSE_PREVIEW = 'CLOSE_PREVIEW';
 export const DIAG_SHOW = 'DIAG_SHOW';
-export const CLEAR_SEARCH_PARAM='CLEAR_SEARCH_PARAM';
+export const CLEAR_SEARCH_PARAM='CLEAR_SEARCH_PARAM';
+export const SET_MR_INFO='SET_MR_INFO';