Bladeren bron

基础信息接口顺序请求,容错添加,信息表过长样式

zhouna 6 jaren geleden
bovenliggende
commit
af539911be

+ 1 - 1
src/common/js/func.js

@@ -96,7 +96,7 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
       value = '',
       item={},
       checkHiddenDefault=false;
-  arr.map((it,i)=>{
+  arr&&arr.map((it,i)=>{
     notText = notTextLabel(it);
     value = it.value||'';
     textLabel = !ifEmpty&&i==0?Object.assign({},JSON.parse(config.textLabel),{showInCheck:true}):JSON.parse(config.textLabel);

+ 3 - 3
src/components/PatInfo/index.jsx

@@ -15,16 +15,16 @@ class PatInfo extends Component {
     const {sizeFlag} = this.props;
      return <table className={sizeFlag?`${style["table"]} ${style["newSize"]}`:style["table"]}>
       <tr>
-        <td key='1' className={`${style.tdBorderB} ${style.tdBorderR}`}>卡号:{message.patientIdNo && message.patientIdNo}</td>
+        <td key='1' className={`${style.tdBorderB} ${style.tdBorderR}`} title={'卡号:'+(message.patientIdNo && message.patientIdNo)}>卡号:{message.patientIdNo && message.patientIdNo}</td>
         <td key='2' className={`${style.tdBorderB} ${style.tdBorderR}`} title={sizeFlag&&message.patientName&&message.patientName.length>3?message.patientName:''}>姓名:{sizeFlag&&message.patientName && message.patientName.length>3?message.patientName.slice(0,3)+'...':message.patientName}</td>
         <td key='3' className={`${style.tdBorderB} ${style.tdBorderR}`}>年龄:{message.patientAge && message.patientAge}</td>
         <td key='4' className={`${style.tdBorderB} ${style.tdBorderR}`}>性别:{message.patientSex && message.patientSex}</td>
       </tr>
       <tr>
-        <td key='5' className={`${style.tdBorderR}`} style={{whiteSpace: 'nowrap'}}>就诊时间:{message.systemTime&&message.systemTime.substring(0, 10)}</td>
+        <td key='5' className={`${style.tdBorderR}`} style={{whiteSpace: 'nowrap'}} title={'就诊时间:'+(message.systemTime&&message.systemTime.substring(0, 10))}>就诊时间:{message.systemTime&&message.systemTime.substring(0, 10)}</td>
         <td key='6' className={`${style.tdBorderR}`}>科室:{message.hospitalDeptName && message.hospitalDeptName}</td>
         <td key='7' className={`${style.tdBorderR}`} title={sizeFlag&&message.doctorName&&message.doctorName.length>3?message.doctorName:''}>医生:{sizeFlag&&message.doctorName && message.doctorName.length>3?message.doctorName.slice(0,3)+'...':message.doctorName}</td>
-        <td key='8' className={`${style.tdBorderR}`}>门诊号:{message.recordId && message.recordId}</td>
+        <td key='8' className={`${style.tdBorderR}`} title={'门诊号:'+(message.recordId && message.recordId)}>门诊号:{message.recordId && message.recordId}</td>
       </tr>
     </table>;
   }

+ 9 - 1
src/components/PatInfo/index.less

@@ -12,10 +12,18 @@
     white-space: nowrap;
   }
   .tdBorderB {
-      border-bottom: 1px solid @person-table-color;
+    border-bottom: 1px solid @person-table-color;
+    max-width: 180px;
+    overflow: hidden;
+    white-space: nowrap;
+    text-overflow: ellipsis
   }
   .tdBorderR {
     border-right: 1px solid @person-table-color;
+    max-width: 180px;
+    overflow: hidden;
+    white-space: nowrap;
+    text-overflow: ellipsis
   }
 }
 .newSize{

+ 3 - 1
src/containers/OtherHistory.js

@@ -7,6 +7,7 @@ import {getModule} from '@store/async-actions/fetchModules.js';
 import {billing} from '@store/async-actions/pushMessage';
 import {fullfillText} from '@common/js/func';
 import {didPushParamChange,filterDataArr} from '@utils/tools.js';
+import config from '@config/index.js';
 
 function mapStateToProps(state){
   const {otherHistory,homePage,typeConfig,mainSuit} = state;
@@ -41,7 +42,8 @@ function mapDispatchToProps(dispatch,store){
         const state = getStore();
         const initData = state.homePage.initData;
         const mode = state.typeConfig.typeConfig;
-        const model = JSON.parse(JSON.stringify(initData.otherHisModel));     //查体模板
+        const block = Object.assign(JSON.parse(config.textLabel),{full:true});//空白时保留一个自由文本标签
+        const model = JSON.parse(JSON.stringify(initData.otherHisModel||null))||[block];     //查体模板
         const arr = JSON.parse(JSON.stringify(initData.otherHis||null));        //最近其他史数据
         const arrSave = JSON.parse(JSON.stringify(initData.otherHisSave||null));    //最近其他史saveText
         const selects = JSON.parse(JSON.stringify(initData.otherSelecteds||null));  //其他史杂音类选中项

+ 3 - 3
src/store/actions/currentIll.js

@@ -26,12 +26,12 @@ export const setModule = (state,action)=>{
   res.emptyData = action.emptyData;//空模板
   let data = action.data;
   let sliceIdx;
-  data.map((v,i)=>{
+  data&&data.map((v,i)=>{
     if(v.flag && v.flag==2){
       sliceIdx = i;
     }
   })
-  res.addModule = data.slice(0,sliceIdx+1);//截取到flag=2 有无治疗
+  res.addModule = data&&data.slice(0,sliceIdx+1);//截取到flag=2 有无治疗
   res.update=Math.random();
   return res;
 }
@@ -77,7 +77,7 @@ export const setData = (state,action) =>{
   const symptomFeature = action.info.symptomFeature;//分词
   let useEmpty,mainData;
   let mainModleData = JSON.parse(JSON.stringify(action.info.mainData));//主诉模板数据
-  let moduleData = JSON.parse(JSON.stringify(res.moduleData));//现病史模板
+  let moduleData = JSON.parse(JSON.stringify(res.moduleData||null))||[];//现病史模板
   // let addModule = JSON.parse(JSON.stringify(res.addModule));//拷贝的模板
   let current = JSON.parse(JSON.stringify(moduleData));
   let newMain = [];

+ 1 - 1
src/store/actions/mainSuit.js

@@ -105,7 +105,7 @@ export const insertMain = (state,action) => {
   const res = Object.assign({},state);
   const items = action.item.select;
   const id = action.item.ids;
-  let data = JSON.parse(JSON.stringify(res.moduleData));
+  let data = JSON.parse(JSON.stringify(res.moduleData||null))||[];
   if(items.length>1){
     for(let i=1; i<items.length; i++){
       items[i].name = '、'+items[i].name;

+ 37 - 2
src/store/async-actions/patInfo.js

@@ -73,8 +73,43 @@ export const initHistoryDetails = (dispatch) => {
         })
     }
 }
+//技术部需求,先获取第一个接口再去第二个
+export async function getPatientMessage(dispatch, getState){
+  const state = getState();
+  const urlDatas = state.getInfoByUuid;
+  const params = {
+    hospitalCode:urlDatas.hospitalId,
+    hospitalDeptCode: urlDatas.deptNo,
+    doctorCode: urlDatas.doctorNo,
+    patientCode:urlDatas.patientNo,
+    recordId:urlDatas.recordId
+  };
+  let res1 = await json(api.getPatInfo, params);
+  /*console.log(res1);
+  console.log(1);*/
+  let res2 = await json(api.getPatBaseInfo, params);
+  /*console.log(res2);
+  console.log(2);*/
+  let data1 = {},data2={};
+  if(res1.data.code=='0'){
+    data1 = res1.data.data;
+  }
+  if(res2.data.code=='0'){
+    data2 = res2.data.data;
+  }
+  dispatch({
+    type: GET_PATIENT_MESSAGE,
+    data:Object.assign(data1,data2)
+  });
+  //设置初始模式
+  dispatch({
+    type: CONFIRM_TYPE,
+    confirmType:data1.modeValue
+  });
+  dispatch(getInitModules);     //确保病人信息获取以后再获取模板等数据,否则参数为空
+}
 
-export const getPatientMessage = (dispatch, getState) => {
+/*export const getPatientMessage = (dispatch, getState) => {
   const state = getState();
   const urlDatas = state.getInfoByUuid;
   const params = {
@@ -108,4 +143,4 @@ export const getPatientMessage = (dispatch, getState) => {
       //   dispatch(initItemList(data1.modeValue));        //模板列表没有就获取模板列表用于保存时做数据对比是否保存过
       // }
     })
-};
+};*/

+ 1 - 1
src/store/reducers/mainSuit.js

@@ -36,7 +36,7 @@ export default function(state=initState,action){
       return setMainMoudle(state,action);
     case SET_DATA://主诉使用模板
       // res.data = res.moduleData.concat();
-      res.data = JSON.parse(JSON.stringify(res.moduleData));
+      res.data = JSON.parse(JSON.stringify(res.moduleData||null))||[];
       res.update=Math.random();
       return res;
       // return setMainData(state,action);

+ 1 - 1
src/utils/config.js

@@ -8,6 +8,6 @@ const host='http://192.168.2.241:5050';//后端接口访问地址
 const imageUrlPrefix = 'http://192.168.2.241:82'
 module.exports={
     host,
-    prefix:'/api/icssyz',            //带权限验证的api
+    prefix:'/api/icss',            //带权限验证的api
     imageUrlPrefix
 };

+ 1 - 1
src/utils/tools.js

@@ -586,7 +586,7 @@ function trimDots(str){
 
 //标签间连续标点只保留一个,保留前面一个
 function formatContinueDots(data){
-  let arr=data.filter((it,i)=>{
+  let arr=data&&data.filter((it,i)=>{
     if(i==0||(it.name&&(it.name.match(config.punctuationReg))||(data[i-1].name&&data[i-1].name.match(config.punctuationReg)))){
       return it;
     }