Sfoglia il codice sorgente

化验添加上升下降图标

Luolei 6 anni fa
parent
commit
ea0e6b1423

+ 2 - 2
src/components/AddInspect/SlideExcel/index.jsx

@@ -34,7 +34,7 @@ class SlideExcel extends Component {
     const {items,item,idx,dateTime,getInfomation} = this.props;
     const {show} = this.state;
     return (
-      <li className={styles.excelDataLis} style={{border:items.lisExcelRes.length-1 == idx? 0:''}}>
+      <li className={`${styles.excelDataLis} clearfix`} style={{border:items.lisExcelRes.length-1 == idx? 0:''}}>
           <span className={styles.excelDataTitle}>
               <span className={styles.tagSpan}>
                 {item.menus}
@@ -71,7 +71,7 @@ class SlideExcel extends Component {
                         </td>
                         <td style={{width:'20%'}}>
                           {
-                            getStatusImg(value.type,value.value,0)
+                            getStatusImg(value.type,value.value,1)
                           } 
                           {value.unit}</td>
                         <td style={{width:'25%'}}>

+ 1 - 1
src/components/AddInspect/SlideExcel/index.less

@@ -42,7 +42,7 @@
 .table {
   color: #000;
   width: 80%;
-  display: inline-block;
+  // display: inline-block;
   tr {
       line-height: 18px;
       height: 18px;

+ 6 - 4
src/components/AddInspect/SlideSelect/index.less

@@ -3,8 +3,9 @@
     // cursor: pointer;
     // color: #767676;
     position: relative;
-    padding: 10px 20px 10px 0;
+    padding: 10px 0px 10px 0;
     border-bottom:1px dashed #989DA3;
+    margin-top: 5px;
     i {
         font-style: normal;
         display: inline-block;
@@ -31,10 +32,10 @@
         cursor: pointer;
         display: inline-block;
         position: absolute;
-        right: 2px;
-        top: 13px;
-        // background-color: #fff;
+        right: -4px;
+        top: 0px;
         background: @closeIcon;
+        background-color: #fff;
         background-size: 100% 100%;
     }
 }
@@ -43,6 +44,7 @@
     border-radius: 4px;
        .partDel{
         background: @closeHor;
+        background-color: #fff;
         background-size: 100% 100%;
       } 
 }

+ 29 - 2
src/components/AddInspect/index.jsx

@@ -2,7 +2,7 @@ import React from 'react';
 import { SearchOption, InspectCommon, Calendar ,Notify,ConfirmModal,Add,DelToast} from '@commonComp';
 import SlideExcel from './SlideExcel';
 import SlideSelect from './SlideSelect';
-import { deepClone,getPageCoordinate } from '@utils/tools';
+import { deepClone,getPageCoordinate,getStatusImg } from '@utils/tools';
 import styles from './index.less';
 import date1 from './img/date1.png';
 import close from './img/close.png';
@@ -288,6 +288,32 @@ class Inspect extends React.Component {
     </ul>
   }
   showDetails(val) {
+  let min = val.minValue,max = val.maxValue,value = val.value,dom = '';
+  if(!isNaN(min) && !isNaN(max)){//有最大值最小值
+    if(isNaN(value)){//输入的不是数据
+      dom = getStatusImg(1,value,1)
+    }else if(value <= min){//下降
+      dom = getStatusImg(3,value,1)
+    }else if(value >= max){//上升
+      dom = getStatusImg(2,value,1)
+    }else{//正常
+      dom = getStatusImg(0,value,1)
+    }
+  }else if(isNaN(min) && !isNaN(max)){//有最大值无最小值
+    if(value >= max){//上升
+      dom = getStatusImg(2,value,1)
+    }else{//正常
+      dom = getStatusImg(0,value,1)
+    }
+  }else if(!isNaN(min) && isNaN(max)){//有最小值无最大值
+    if(value <= min){//下降
+      dom = getStatusImg(3,value,1)
+    }else{//正常
+      dom = getStatusImg(0,value,1)
+    }
+  }else{//无最大最小值
+    dom = getStatusImg(1,value,1)
+  }
     if (val.questionDetailList.length > 0) {
       return val.questionDetailList.map((item) => {
         if (val.value == item.name) {
@@ -295,7 +321,8 @@ class Inspect extends React.Component {
         }
       })
     } else {
-      return <td style={{ width: '20%' }}><span className={(val.value - 0).toString() == 'NaN' ? "red" : (val.maxValue || val.minValue) ? (val.value > val.maxValue || val.value < val.minValue ? "red" : '') : ''}>{val.value}</span> {val.labelSuffix}</td>
+      // return <td style={{ width: '20%' }}><span className={(val.value - 0).toString() == 'NaN' ? "red" : (val.maxValue || val.minValue) ? (val.value > val.maxValue || val.value < val.minValue ? "red" : '') : ''}>{val.value}</span> {val.labelSuffix}</td>
+      return <td style={{ width: '20%' }}>{dom} {val.labelSuffix}</td>
     }
   }
   render() {

+ 0 - 1
src/components/CurrentIll/index.jsx

@@ -140,7 +140,6 @@ class CurrentIll extends Component{
     const {fuzhen,isChronic,type,fetchPushInfos,handleInput,isRead,saveText,searchData,totalHide,editClear,data,boxLeft,boxTop} = this.props;
     const {forbidInput} = this.state;
     const searchFlag = searchData.length > 0 ? true : false;
-
     if(+type===1){      //文本模式
       return <Textarea  title='现病史' boxMark='2'
                         isRead={isRead}

+ 1 - 1
src/components/Inspect/index.jsx

@@ -61,7 +61,7 @@ class Inspect extends React.Component {
     $(document).click((event) => {
       let searchWrap = $('#importInspectBtn')[0];   // 导入按钮按钮
       let searchOption = $('#importList')[0];   // 下拉列表
-      if (searchOption) {
+      if (searchOption&&$('#importList').css("display")=="block") {
         if(searchWrap != event.target){
           this.setState({ importLis: false });
         }

+ 1 - 1
src/components/WrapModalBody/WrapModalTableSon/index.jsx

@@ -58,7 +58,7 @@ class WrapModalTableSon extends React.Component {
                 <td title={item.itemName} className={`${style.trd}`}>{item.itemName}</td>
                 <td title={item.value} className={`${style.four}`}>
                   {
-                    getStatusImg(item.type,item.value,0)
+                    getStatusImg(item.type,item.value,1)
                   }
                 </td>
                 <td title={item.unit} className={`${style.fif}`}>{item.unit}</td>

+ 2 - 1
src/modules/HomePage/index.jsx

@@ -55,7 +55,8 @@ class HomePage extends Component {
     }
     render() {
         const {flag,setPushEmergencyIdx,sysConfig} = this.props;
-        return <div className={style['home-page']} onClick={this.props.hideAllDrop}>
+        return <div className={style['home-page']}>
+        {/* return <div className={style['home-page']} onClick={this.props.hideAllDrop}> */}
             <BannerContainer />
             {/* <InfoTitle /> */}
             <BodyContainer></BodyContainer>

+ 2 - 2
src/utils/config.js

@@ -1,8 +1,8 @@
 // const host='http://192.168.3.1:5050';//赵
 // const host='http://192.168.3.100:5050';//王峰
-// const host='http://192.168.2.241:5050';//后端接口访问地址
+const host='http://192.168.2.241:5050';//后端接口访问地址
 // const host='http://192.168.2.121:5050';//后端接口访问地址
-const host='http://192.168.2.236:5050';//后端接口访问地址
+// const host='http://192.168.2.236:5050';//后端接口访问地址
 // const host='http://192.168.3.11:5050';//王宇
 //const host='http://192.168.2.164:8080';
 // const host='http://192.168.3.117:5050'; //周铁刚

+ 9 - 13
src/utils/tools.js

@@ -713,18 +713,14 @@ function ifOtherClear(jsonData,jsonStr,baseList){
   }
 }
 function normalVal(min,max){
-  if((min-0) && (max-0)){
+  if(min == ''&&max==''){
+    return null;
+  }else if(!isNaN(min) && !isNaN(max)){
       return `正常值: (${min}~${max})`
-  }else if((min-0) && !(max-0)){
-      return `正常值: (>=${min})`
-  }else if(!(min-0) && (max-0)){
-      if(min == '' || min == null){
-          return `正常值: (<=${max})`
-      }else{
-          return `正常值: (${min}~${max})`
-      }
-  }else{
-      return null;
+  }else if(!isNaN(min) && isNaN(max)){
+      return `正常值: (>${min})`
+  }else if(isNaN(min) && !isNaN(max)){
+      return `正常值: (<${max})`
   }
 }
 /**
@@ -1160,9 +1156,9 @@ function downloadExportedData(data, fileName) {
 }
 
 function getStatusImg(type,val,status){
-  if(type == 0){
+  if(type == 0){//正常
     return <span>{val} </span>
-  }else if(type == 1){
+  }else if(type == 1){//异常(表单输入的话非数字显示为异常)
     return <span className={'red'}>{val} </span>
   }
   if(status == 1){