소스 검색

保存mr数据接口对接

zhouna 5 년 전
부모
커밋
47b4b08324
4개의 변경된 파일10개의 추가작업 그리고 11개의 파일을 삭제
  1. 2 2
      src/components/PushEmbed/index.jsx
  2. 4 6
      src/store/async-actions/pushMessage.js
  3. 3 3
      src/utils/ajax.js
  4. 1 0
      src/utils/config.js

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

@@ -1,7 +1,7 @@
 import React,{Component} from 'react';
 import {windowEventHandler,getWindowInnerHeight} from '@utils/tools';
 import {connect} from 'react-redux';
-import $ from 'jquery';
+import {pushPage} from '@utils/config';
 
 class PushEmbed extends Component{
   constructor(props){
@@ -30,7 +30,7 @@ class PushEmbed extends Component{
   render(){
     const {width,height,hashNum}=this.state;
     const {mrId} = this.props;
-    const url = "http://192.168.2.241:5448/index.html?mrId="+mrId+"&plan=1&data="+hashNum;
+    const url = pushPage+"?mrId="+mrId+"&plan=1&data="+hashNum;
     return <iframe id='embedPage' width={width} height={height} src={url} frameborder="0"></iframe>;
   }
 }

+ 4 - 6
src/store/async-actions/pushMessage.js

@@ -5,8 +5,6 @@ import { SET_DRUG_INFO, SHOW_DRUG_INFO } from '@store/types/treat';
 import { SET_CLICK_DIAG } from '../types/diagnosticList';
 import {storageLocal,getEMRParams, getMRInfo,getAllDataStringList,isAllClear} from '@utils/tools';
 import {getBigPush} from '@utils/utils';
-import {SET_IMPORT_CHECKBODY_LABEL,PRESET} from "../types/checkBody";
-import dataLis from '@components/EmergencyProcedure/emergency';
 import  Notify from '@commonComp/Notify';
 import {pregetCheckbodyData} from '@store/async-actions/fetchModules';
 import {tabChange} from '@store/actions/tabTemplate';
@@ -16,7 +14,7 @@ const api={
   getTableInfo:'/scale/getContent', //获取量表明细
   getConceptDetail:'/conceptDetail/getConceptDetail', //获取静态提示信息
   getMRAnalyse: '/mrqc/analyse', //病历质控
-  setMrInfo:'http://192.168.2.241/api/data/mr/createMr',      //存页面信息,供页面推送模式调取
+  setMrInfo:'/api/data/mrv2/createMr',      //存页面信息,供页面推送模式调取
 }
 import store from '@store';
 import {SET_MR_INFO} from "../types/print";
@@ -24,14 +22,14 @@ import {SET_MR_INFO} from "../types/print";
 
 export const billing = () => {
   return (dispatch, getState) =>{
-    const state = 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);*/
+    //console.log(state)
     const param = getEMRParams();
-    console.log(state)
     /*const param={
       "hosCode": hospitalCode,
       "age": patientAge,
@@ -107,7 +105,7 @@ export const billing = () => {
       "vaccination": "",
       "vital": ""
     };*/
-    json(api.setMrInfo,param).then((res)=>{
+    json(api.setMrInfo,param,true).then((res)=>{
       const data = res.data;
       if(data.code==='0'){
         //存mrId

+ 3 - 3
src/utils/ajax.js

@@ -5,7 +5,7 @@ $.support.cors = true;
 const axios=require('axios');
 const qs=require('querystring');
 const isLocal = window.location.hostname.indexOf('localhost')!=-1;
-const orgin = window.location.origin
+const orgin = window.location.origin;
 const qhost = isLocal?host+prefix:prefix;
 axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
 //axios.defaults.baseURL = host;       //默认地址
@@ -66,11 +66,11 @@ const post=(url,data)=>{
 };
 
 //json传参
-const json=(url,data,spec)=>{     //spec:请求地址前缀不是api/icss,预问诊结果引用时添加
+const json=(url,data,noPrefix)=>{     //noPrefix:请求地址不加前缀,如预问诊、页面推送接口
   //兼容ie8,axios在ie8下content-type设置不成功且会把headers置为null
   return axios({
     method:'post',
-    url:url.indexOf('http:')!=-1?url:((spec&&isLocal)?host+url:((spec&&!isLocal)?orgin+url:qhost+url)),
+    url:url.indexOf('http:')!=-1?url:((noPrefix&&isLocal)?host+url:((noPrefix&&!isLocal)?orgin+url:qhost+url)),
     data
   });
 };

+ 1 - 0
src/utils/config.js

@@ -11,5 +11,6 @@ const imageUrlPrefix = 'http://192.168.2.121:82';
 module.exports={
     host,
     prefix:'/api/icss',            //带权限验证的api
+    pushPage:'http://192.168.2.236:5544/index.html',        //右侧推送页面的地址
     imageUrlPrefix
 };