소스 검색

代码优化

Luolei 6 년 전
부모
커밋
8e4743ace1

+ 9 - 20
src/common/components/InspectCommon/index.jsx

@@ -1,27 +1,16 @@
-import React from 'react';
 import style from "./index.less";
 import PropTypes from "prop-types";
 
-/**
- * 
- */
-class InspectCommon extends React.Component {
-    constructor(props) {
-        super(props);
-    }
-
-    render() {
-        const { children,handleClear,handleConfirm} = this.props;
-        return <div className={ style.wrapper} id="inspectFill">
-            {children}
-            <div className={style.btnWrap}>
-                <span className={style.clear + ' red'} onClick={handleClear}>清空选项</span>
-                <span className={style.sure} onClick={handleConfirm}>确定</span>
-            </div>
-        </div>
-    }
+const InspectCommon = (props) => {
+  const { children,handleClear,handleConfirm} = props;
+  return <div className={ style.wrapper} id="inspectFill">
+      {children}
+      <div className={style.btnWrap}>
+          <span className={style.clear + ' red'} onClick={handleClear}>清空选项s</span>
+          <span className={style.sure} onClick={handleConfirm}>确定</span>
+      </div>
+  </div>
 }
-
 InspectCommon.propTypes = {
     handleClear: PropTypes.func,
     handleConfirm: PropTypes.func

+ 2 - 1
src/common/components/InspectCommon/index.less

@@ -25,11 +25,12 @@
         float: right;
         color: @blue;
         font-weight: bold;
+        cursor: pointer;
     }
     .clear {
         float: left;
-        // font-weight: bold;
         bottom: 0;
+        cursor: pointer;
     }
 }
 

+ 0 - 34
src/common/components/SlideSide/index.jsx

@@ -1,34 +0,0 @@
-import React from 'react';
-import styles from './index.less';
-import $ from 'jquery';
-
-class SlideSide extends React.Component {
-    constructor(props) {
-        super(props);
-        this.side = React.createRef();
-    }
-    componentDidMount() {
-        const sideNode = this.side.current;
-        // setTimeout(() => {
-        //     $(sideNode).animate({
-        //         "right":'360px'
-        //     },500)
-        // }, 1000);
-        // setTimeout(() => {
-        //     $(sideNode).animate({
-        //         "right":'260px'
-        //     },500)
-        // }, 3000);
-    }
-    render() {
-        return (
-            <div ref={this.side}
-                className={styles['slide-pub']}
-            >
-                侧滑不用了
-            </div>
-        )
-    }
-}
-
-export default SlideSide;

+ 0 - 10
src/common/components/SlideSide/index.less

@@ -1,10 +0,0 @@
-.slide-pub{
-    background-color: #ccc;
-    border: 1px solid #333;
-    width: 100px;
-    height: 300px;
-    position: absolute;
-    top: 0;
-    z-index: 100;
-    right: 260px;
-}

+ 12 - 14
src/common/components/Tab/TabOne/index.jsx

@@ -1,17 +1,15 @@
 import React from 'react'
-import styles from './index.less'
-class TabContain extends React.Component {
-    render() {
-        let { title, id, isSelect ,handleClick} = this.props;
-        return (
-            <div className={isSelect ? `${styles['tabOne']} ${styles['active']}` : styles['tabOne']}
-                onClick={() =>handleClick(id)}
-            >
-                {title}
-                <div className={isSelect ? `${styles['tabLine']} ${styles['activeLine']}` : styles['tabLine']}></div>
-            </div>
-        )
-    }
-}
+import styles from '../index.less'
 
+const TabContain = (props) =>{
+  let { title, id, isSelect ,handleClick} = props;
+  return (
+      <div className={isSelect ? `${styles['tabOne']} ${styles['active']}` : styles['tabOne']}
+          onClick={() =>handleClick(id)}
+      >
+          {title}
+          <div className={isSelect ? `${styles['tabLine']} ${styles['activeLine']}` : styles['tabLine']}></div>
+      </div>
+  )
+}
 export default  TabContain;

+ 0 - 27
src/common/components/Tab/TabOne/index.less

@@ -1,27 +0,0 @@
-@import "~@less/variables.less";
-
-.tabOne {
-  font-size: 18px;
-  color:  #767676;
-  display: inline-block;
-  min-width: 36px;
-  margin-right: 20px;
-  position: relative;
-  font-weight: 800;
-  cursor: pointer;
-}
-.tabOne:hover {
-    // color: @tab-color;
-}
-.tabLine {
-    width: auto;
-    height: 3px;
-    margin: 8px 6px 0 6px;
-    background-color: transparent;
-}
-.active {
-  color: @tab-color;
-}
-.activeLine {
-  background-color: @tab-color;
-}

+ 19 - 25
src/common/components/Tab/index.jsx

@@ -3,32 +3,26 @@ import TabOne from '@commonComp/Tab/TabOne';
 import styles from './index.less'
 import PropTypes from "prop-types"
 
-class RightPart extends React.Component {
-    constructor(props) {
-        super(props)
-    }
-    render() {
-        let { tabs, activeId, children ,handleActiveClick} = this.props;
-        return (
-            <div className={styles['clearfix']} >
-                <div className={`${styles['tabTop']} ${styles['clearfix']}`}>
-                    {
-                        tabs && tabs.map((value, idx) => {
-                            return <TabOne
-                                isSelect={activeId == idx}
-                                title={value.title}
-                                id={idx}
-                                handleClick={handleActiveClick}
-                            ></TabOne>
-                        })
-                    }
-                </div>
-                {children}
-            </div>
-        )
-    }
+const RightPart = (props) => {
+  let { tabs, activeId, children ,handleActiveClick} = props;
+  return (
+      <div className={styles['clearfix']} >
+          <div className={`${styles['tabTop']} ${styles['clearfix']}`}>
+              {
+                  tabs && tabs.map((value, idx) => {
+                      return <TabOne
+                          isSelect={activeId == idx}
+                          title={value.title}
+                          id={idx}
+                          handleClick={handleActiveClick}
+                      ></TabOne>
+                  })
+              }
+          </div>
+          {children}
+      </div>
+  )
 }
-
 RightPart.defaultProps = {
     activeId: '0'
 };

+ 28 - 0
src/common/components/Tab/index.less

@@ -1,3 +1,5 @@
+@import "~@less/variables.less";
+
 .tabWrap {
     
 }
@@ -13,4 +15,30 @@
     height: 0;
     clear: both;
     visibility: hidden;
+}
+
+.tabOne {
+  font-size: 18px;
+  color:  #767676;
+  display: inline-block;
+  min-width: 36px;
+  margin-right: 20px;
+  position: relative;
+  font-weight: 800;
+  cursor: pointer;
+}
+.tabOne:hover {
+    // color: @tab-color;
+}
+.tabLine {
+    width: auto;
+    height: 3px;
+    margin: 8px 6px 0 6px;
+    background-color: transparent;
+}
+.active {
+  color: @tab-color;
+}
+.activeLine {
+  background-color: @tab-color;
 }

+ 0 - 2
src/common/components/index.js

@@ -10,7 +10,6 @@ import ItemBox from './ItemBox';
 import Tab from './Tab';
 import DropList from './DropList';
 import NumberPan from './NumberPan';
-import SlideSide from './SlideSide';
 import ConfirmModal from './ConfirmModal';
 import Calendar from "./Calendar";
 import SearchOption from "./SearchOption";
@@ -37,7 +36,6 @@ module.exports = {
     Tab,
     DropList,
     NumberPan,
-    SlideSide,
     ConfirmModal,
     Calendar,
     SearchOption,

+ 0 - 10
src/components/ChronicInfo/index.jsx

@@ -75,16 +75,6 @@ class ChronicInfo extends React.Component{
       printContainer: true,
       operaSupport: false,
     });
-    // setTimeout(() => {//把生成的图片和iframe删掉
-    //   let imgLis = document.querySelectorAll('.canvasImg')
-    //   let iframe = document.getElementsByTagName('iframe')
-    //   for(let i = 0;i < imgLis.length;i++){
-    //     imgLis[i].remove()
-    //   }
-    //   for(let i = 0;i < iframe.length;i++){
-    //     iframe[i].remove()
-    //   }
-    // }, 500);
   }
   
   showTableList(id){//量表按钮

+ 59 - 0
src/components/PreviewBody/Inspect/index.jsx

@@ -0,0 +1,59 @@
+import style from "../index.less";
+import { normalVal } from '@utils/tools';
+
+const PreviewInspect = (props) => {
+  const { dataJson, toTime ,dateTime,showDetails  } = props;
+    return <tr className={style['patInfoFst']}>
+      <td className={style['patInfoSec']}>化验:</td>
+      <td className={style['patInfoSec']}>
+        {
+          dataJson.lis.getExcelDataList && dataJson.lis.getExcelDataList.map((items) => {
+            return items.lisExcelRes && items.lisExcelRes.map((item) => {
+              return <table style={style.assistTable}>
+                <tr style={style.assistTableTrFst}><td><span>{item.menus}</span></td></tr>
+                {
+                  item.lisExcelItem && item.lisExcelItem.map((value) => {
+                    return <tr className={style.assistTableTrSec}>
+                      <td className={style.assistTableTdFst}>{value.itemName}</td>
+                      <td className={style.assistTableTdSec}><span style={{ color: value.type == 1 ? "red" : null }}>{value.value}</span> {value.unit}</td>
+                      <td className={style.assistTableTdTrd}>
+                        {normalVal(value.min, value.max)}
+                      </td>
+                      <td className={style.assistTableTdFor}>{value.time == '' ? ('导入时间: ' + dateTime) : '化验时间: ' + toTime(value.time)
+                    }</td>
+                    </tr>
+                  })
+                }
+              </table>
+            })
+          })
+        }
+        {
+          dataJson.lis.labelList && dataJson.lis.labelList.map((item, idx) => {
+            return <table style={{ margin: '8px 0', width: '100%' }}>
+              {
+                item.show?<tr className={style.assistTableTrFst}><td><span> {item.name} </span></td></tr>:
+                <tr className={style.assistTableTrFstExcel}><td><span>「{item.name}」</span></td></tr>
+              }
+              {
+                item.details.map((val) => {
+                  if (val.value && val.value != '') {
+                    return <tr className={style.assistTableTrSecExcel}>
+                      <td className={style.assistTableTdFst}>{val.name}</td>
+                      {showDetails(val)}
+                      <td className={style.assistTableTdTrd}>
+                        {normalVal(val.minValue, val.maxValue)}
+                      </td>
+                      <td className={style.assistTableTdFor}>{'化验时间:' + item.time}</td>
+                    </tr>
+                  }
+                })
+              }
+            </table>
+          })
+        }
+      </td>
+    </tr>
+}
+
+export default PreviewInspect;

+ 47 - 0
src/components/PreviewBody/ItemPart/index.jsx

@@ -0,0 +1,47 @@
+import style from "../index.less";
+import { filterDataArr } from '@utils/tools';
+
+const ItemPart = (props) => {
+  const {dataStr,title,type,dataJson,other_yjs} = props;
+  return <tr className={style['patInfoFst']}>
+    <td className={style['patInfoSec']}>{title}</td>
+    {
+      type === 2?
+      <td className={style['patInfoSec']}>
+        {
+          dataStr && dataStr != '' && dataStr.split(';').map((item) => {
+            return <div className={style.checkAssist}>{item}</div>
+          })
+        }
+      </td>:
+      type === 1?
+      <td className={style['patInfoSec']}>
+        {
+          filterDataArr(JSON.parse(dataStr))
+        }
+      </td>:
+      <td className={style['patInfoSec']}>
+      {
+        other_yjs.str1
+      }
+      {dataJson['yjs_1']||dataJson['yjs_2']||dataJson['yjs_3']||dataJson['yjs_4']?<table className={style['formulaTable']}>
+        <tr>
+          <td rowSpan='2' className={style['alignMiddle']}>月经史:(</td>
+          <td rowSpan='2' className={style['alignMiddle']}>{dataJson['yjs_1']||'初潮年龄'}</td>
+          <td className={style['formulaTd']}>{dataJson['yjs_2']||'行经天数'}</td>
+          <td rowSpan='2' className={style['alignMiddle']}>{dataJson['yjs_4']||'停经时间'})</td>
+        </tr>
+        <tr>
+          <td className={style.alignCenter}>{dataJson['yjs_3']||'周期'}</td>
+        </tr>
+      </table>:''}
+      {
+        other_yjs.str2
+      }
+    </td>
+
+    }
+  </tr>
+}
+
+export default ItemPart;

+ 22 - 141
src/components/PreviewBody/index.jsx

@@ -3,6 +3,8 @@ import style from "./index.less";
 import { normalVal, filterDataArr, filterOtherDataArr,timestampToTime } from '@utils/tools';
 import Notify from '@commonComp/Notify';
 import Information from '../Information';
+import PreviewInspect from './Inspect';
+import ItemPart from './ItemPart';
 import $ from "jquery";
 import AssessResultHis from '@containers/AssessResultHis'
 
@@ -52,11 +54,11 @@ class PreviewBody extends Component {
     if (val.questionDetailList.length > 0) {
       return val.questionDetailList.map((item) => {
         if (val.value == item.name) {
-          return <td style={{ width: '16%', fontSize: '12px' }}><span style={{ color: item.abnormal != '0' ? "red" : null }}>{val.value}</span> {val.labelSuffix}</td>
+          return <td className={style.assistTableTdSec}><span style={{ color: item.abnormal != '0' ? "red" : null }}>{val.value}</span> {val.labelSuffix}</td>
         }
       })
     } else {
-      return <td style={{ width: '16%', fontSize: '12px' }}><span style={{ color: (val.value - 0).toString() == 'NaN' ? "red" : (val.maxValue || val.minValue) ? (val.value > val.maxValue || val.value < val.minValue ? "red" : null) : null }}>{val.value}</span> {val.labelSuffix}</td>
+      return <td className={style.assistTableTdSec}><span style={{ color: (val.value - 0).toString() == 'NaN' ? "red" : (val.maxValue || val.minValue) ? (val.value > val.maxValue || val.value < val.minValue ? "red" : null) : null }}>{val.value}</span> {val.labelSuffix}</td>
     }
   }
 
@@ -81,167 +83,46 @@ class PreviewBody extends Component {
       <div className={style['contents']} id="content" style={{ margin: "0 auto", maxWidth: "620px" }}>
         <Information baseObj={baseObj} preInfo={preInfo}></Information>
         <table className={style['infos']}>
-          <tr className={style['patInfoFst']}>
-            <td className={style['patInfoSec']}>主诉:</td>
-            <td className={style['patInfoSec']}>
-              {
-                filterDataArr(JSON.parse(dataStr.chief))
-              }
-            </td>
-          </tr>
-          <tr className={style['patInfoFst']}>
-            <td className={style['patInfoSec']}>现病史:</td>
-            <td className={style['patInfoSec']}>
-              {
-                filterDataArr(JSON.parse(dataStr.present))
-              }
-            </td>
-          </tr>
-          <tr className={style['patInfoFst']}>
-            <td className={style['patInfoSec']}>其他史:</td>
-            <td className={style['patInfoSec']}>
-              {
-                other_yjs.str1
-              }
-              {dataJson['yjs_1']||dataJson['yjs_2']||dataJson['yjs_3']||dataJson['yjs_4']?<table style={{textAlign:'center',verticalAlign: 'middle',display:'inline-block'}}>
-                <tr>
-                  <td rowSpan='2' style={{verticalAlign: 'middle'}}>月经史:(</td>
-                  <td rowSpan='2' style={{verticalAlign: 'middle'}}>{dataJson['yjs_1']||'初潮年龄'}</td>
-                  <td style={{borderBottom:'1px solid #000'}}>{dataJson['yjs_2']||'行经天数'}</td>
-                  <td rowSpan='2' style={{verticalAlign: 'middle'}}>{dataJson['yjs_4']||'停经时间'})</td>
-                </tr>
-                <tr>
-                  <td style={{textAlign:'center'}}>{dataJson['yjs_3']||'周期'}</td>
-                </tr>
-              </table>:''}
-              {
-                other_yjs.str2
-              }
-            </td>
-          </tr>
-          <tr className={style['patInfoFst']}>
-            <td className={style['patInfoSec']}>查体:</td>
-            <td className={style['patInfoSec']}>
-              {
-                filterDataArr(JSON.parse(dataStr.vital))
-              }
-            </td>
-          </tr>
-          <tr className={style['patInfoFst']}>
-            <td className={style['patInfoSec']}>化验:</td>
-            <td className={style['patInfoSec']}>
-              {
-                dataJson.lis.getExcelDataList && dataJson.lis.getExcelDataList.map((items) => {
-                  return items.lisExcelRes && items.lisExcelRes.map((item) => {
-                    return <table style={{ marginBottom: '10px', width: '100%', fontSize: '12px' }}>
-                      <tr style={{ fontSize: '14px', lineHeight: '1.5' }}><td><span style={{ borderBottom: '1px solid #666666' }}>{item.menus}</span></td></tr>
-                      {
-                        item.lisExcelItem && item.lisExcelItem.map((value) => {
-                          return <tr style={{ lineHeight: '1.5', maxWidth: '650px' }}>
-                            <td style={{ width: '32%', fontSize: '12px' }}>{value.itemName}</td>
-                            <td style={{ width: '16%', fontSize: '12px' }}><span style={{ fontSize: '12px', color: value.type == 1 ? "red" : null }}>{value.value}</span> {value.unit}</td>
-                            <td style={{ width: '24%', fontSize: '12px' }}>
-                              {normalVal(value.min, value.max)}
-                            </td>
-                            <td style={{ width: '28%', fontSize: '12px' }}>{value.time == '' ? ('导入时间: ' + this.state.dateTime) : '化验时间: ' + this.toTime(value.time)
-                          }</td>
-                          </tr>
-                        })
-                      }
-                    </table>
-                  })
-                })
-              }
-              {
-                dataJson.lis.labelList && dataJson.lis.labelList.map((item, idx) => {
-                  return <table style={{ margin: '8px 0', width: '100%' }}>
-                    {
-                      item.show?<tr style={{ fontSize: '14px', lineHeight: '1.5' }}><td><span style={{ borderBottom: '1px solid #666666' }}> {item.name} </span></td></tr>:
-                      <tr style={{ fontSize: '14px', lineHeight: '1.5' }}><td><span style={{ position:'relative',left:'-10px' }}>「{item.name}」</span></td></tr>
-                    }
-                    {
-                      item.details.map((val) => {
-                        if (val.value && val.value != '') {
-                          return <tr style={{ lineHeight: '1.5', width: '100%', fontSize: '12px' }}>
-                            <td style={{ width: '32%', fontSize: '12px' }}>{val.name}</td>
-                            {this.showDetails(val)}
-                            <td style={{ width: '24%', fontSize: '12px' }}>
-                              {normalVal(val.minValue, val.maxValue)}
-                            </td>
-                            <td style={{ width: '28%', fontSize: '12px' }}>{'化验时间:' + item.time}</td>
-                          </tr>
-                        }
-                      })
-                    }
-                  </table>
-                })
-              }
-            </td>
-          </tr>
-          <tr className={style['patInfoFst']}>
-            <td className={style['patInfoSec']}>辅检:</td>
-            <td className={style['patInfoSec']}>
-              {
-                dataStr.pacs && dataStr.pacs != '' && dataStr.pacs.split(';').map((item) => {
-                  return <div style={{ fontSize: '14px',wordBreak:"break-all" }}>{item}</div>
-                })
-              }
-            </td>
-          </tr>
-          <tr className={style['patInfoFst']}>
-            <td className={style['patInfoSec']}>诊断:</td>
-            <td className={style['patInfoSec']}>
-              {
-                dataStr.diag && dataStr.diag != '' && dataStr.diag.split(';').map((item) => {
-                  return <div style={{ fontSize: '14px' }}>{item}</div>
-                })
-              }
-            </td>
-          </tr>
+          <ItemPart dataStr={dataStr.chief} title={'主诉:'} type={1}></ItemPart>
+          <ItemPart dataStr={dataStr.present} title={'现病史:'} type={1}></ItemPart>
+          <ItemPart dataStr={dataStr.present} title={'其他史:'} dataJson={dataJson} other_yjs={other_yjs} type={3}></ItemPart>
+          <ItemPart dataStr={dataStr.vital} title={'查体:'} type={1}></ItemPart>
+          <PreviewInspect dataJson={dataJson} toTime={this.toTime} dateTime={this.state.dateTime} showDetails={this.showDetails}></PreviewInspect>
+          <ItemPart dataStr={dataStr.pacs} title={'辅检:'} type={2}></ItemPart>
+          <ItemPart dataStr={dataStr.diag} title={'诊断:'} type={2}></ItemPart>
           <tr className={style['patInfoFst']}>
             <td className={style['patInfoSec']}>医嘱:</td>
-            <td className={style['patInfoSec']} style={{ fontSize: '14px', padding: '1px 0px 8px 0px', lineHeight: '20px' }}>
-              {((dataJson.advice.assay && dataJson.advice.assay.length > 0) || (dataJson.advice.check && dataJson.advice.assay.check > 0)) && <p style={{ fontSize: '14px', marginBottom: '8px', marginTop: '8px' }}><span>开单项目</span></p>}
+            <td className={`${style['patInfoSec']} ${style['pushMessage']} ${style['font14']}`}>
+              {((dataJson.advice.assay && dataJson.advice.assay.length > 0) || (dataJson.advice.check && dataJson.advice.assay.check > 0)) && <p className={style.pushMessageTitle}><span>开单项目</span></p>}
               {
-                ((dataJson.advice.assay && dataJson.advice.assay.length > 0) || (dataJson.advice.check && dataJson.advice.assay.check > 0)) && <div style={{ padding: '0px 0px 5px 0px',wordBreak:"break-all" }}>{dataJson.advice.check?dataJson.advice.check+',':''} {dataJson.advice.assay}</div>
+                ((dataJson.advice.assay && dataJson.advice.assay.length > 0) || (dataJson.advice.check && dataJson.advice.assay.check > 0)) && <div className={style.pushMessageDes}>{dataJson.advice.check?dataJson.advice.check+',':''} {dataJson.advice.assay}</div>
               }
-              {dataJson.advice.commontreatment && dataJson.advice.commontreatment.length > 0 && <p style={{ fontSize: '14px', marginBottom: '8px', marginTop: '8px' }}><span>一般治疗</span></p>}
+              {dataJson.advice.commontreatment && dataJson.advice.commontreatment.length > 0 && <p  className={style.pushMessageTitle}><span>一般治疗</span></p>}
               {
-                dataJson.advice.commontreatment && <div style={{ padding: '0px 0px 5px 0px',wordBreak:"break-all" }}>{dataJson.advice.commontreatment}</div>
+                dataJson.advice.commontreatment && <div className={style.pushMessageDes}>{dataJson.advice.commontreatment}</div>
               }
-              {dataJson.advice.followUp && dataJson.advice.followUp.length > 0 && <p style={{ fontSize: '14px', marginBottom: '8px', marginTop: '8px' }}><span>回访时间:<span className={style['bbtm']}>{dataJson.advice.followUp}</span> 后回访,不适随诊</span></p>}
-              {dataJson.advice.scheme && dataJson.advice.scheme.length > 0 && <p style={{ fontSize: '14px', marginBottom: '8px', marginTop: '8px' }}><span>治疗方案</span></p>}
+              {dataJson.advice.followUp && dataJson.advice.followUp.length > 0 && <p className={style.pushMessageTitle}><span>回访时间:<span className={style['bbtm']}>{dataJson.advice.followUp}</span> 后回访,不适随诊</span></p>}
+              {dataJson.advice.scheme && dataJson.advice.scheme.length > 0 && <p className={style.pushMessageTitle}><span>治疗方案</span></p>}
               {
                 dataJson.advice.scheme && dataJson.advice.scheme.map((item, index) => {
                   return <p>{item.treatment.map((it, ii) => {
                     return (it.treatmentStr && it.treatmentStr.length > 0 ?
-                      <div style={{ padding: '0px 0px 5px 0px' }}>{it.treatmentStr}</div> : '')
+                      <div className={style.pushMessageDes}>{it.treatmentStr}</div> : '')
                     })}</p>
                   })
               }
               {
-                dataJson.advice.adviceInput && <div style={{ padding: '0px 0px 5px 0px',wordBreak:"break-all" }}>{dataJson.advice.adviceInput}</div>
+                dataJson.advice.adviceInput && <div className={style.pushMessageDes}>{dataJson.advice.adviceInput}</div>
               }
             </td>
           </tr>
         </table>
-        <p style={{textAlign:'right',marginTop:'15px'}}>医生签名:<span style={{minWidth: '60px',padding: '0 5px 2px 5px',borderBottom: '1px solid #333',}}>{baseObj ? baseObj.doctorName : (noData ? '' : preInfo.doctorName)}</span></p>
+        <p className={style.docName}>医生签名:<span>{baseObj ? baseObj.doctorName : (noData ? '' : preInfo.doctorName)}</span></p>
         {showAssessBtn?<AssessResultHis isChronic={isChronic?true:false} inquiryId={baseObj&&baseObj.id} inquiryDate={baseObj&&baseObj.inquiryDate}></AssessResultHis>:""}
-        
-        <div onClick={() => { this.surePrint(dataStr) }} style={{
+        <div onClick={() => { this.surePrint(dataStr) }} className={style.printBtn} style={{
           display: show ? 'inline-block' : 'none',
-          padding: '10px 20px',
-          float: 'right',
-          marginTop: '22px',
-          background: '#3B9ED0',
-          color: '#fff',
-          borderRadius: '4px',
-          cursor: 'pointer',
-          position: 'absolute',
-          right: '-40px'
         }}>打印</div>
       </div>
-
     </div>
   }
 }

+ 98 - 0
src/components/PreviewBody/index.less

@@ -60,4 +60,102 @@ table{
 }
 .alignMiddle {
   vertical-align: middle;
+}
+.alignCenter {
+  text-align: center;
+}
+.assistTable {
+  margin-bottom: 10px;
+  width: 100%;
+  font-size: 12px;
+  .assistTableTrSec {
+    line-height: 1.5;
+    max-width: 650px;
+    td {
+      font-size: 12px;
+      span {
+        font-size: 12px;
+      }
+    }
+  }
+}
+.assistTableTrFst {
+  font-size: 14px;
+  line-height: 1.5;
+  span {
+    border-bottom: 1px solid #666666;
+  }
+}
+.assistTableTdFst {
+  width: 32%;
+}
+.assistTableTdSec {
+  width: 16%;
+}
+.assistTableTdTrd {
+  width: 24%;
+}
+.assistTableTdFor {
+  width: 28%;
+}
+.assistTableTrSecExcel {
+  line-height: 1.5;
+  width: 100%;
+  font-size: 12px;
+  td {
+    font-size: 12px;
+  }
+}
+.assistTableTrFstExcel {
+  font-size: 14px;
+  line-height: 1.5;
+  span {
+    position: relative;
+    left: -10px;
+  }
+}
+.checkAssist {
+  font-size: 14px;
+  word-break: break-all;
+}
+.font14 {
+  font-size: 14px;
+}
+.pushMessage {
+  padding: 1px 0px 8px 0px;
+  line-height: 20px;
+}
+.pushMessageTitle {
+  margin-top: 8px;
+  margin-bottom: 8px;
+  font-size: 14px;
+}
+.pushMessageDes {
+  padding: 0 0 5px 0;
+  word-break: break-all;
+}
+.docName {
+  text-align: right;
+  margin-top: 15px;
+  span {
+    min-width: 60px;
+    padding: 0 5px 2px 5px;
+    border-bottom: 1px solid #333;
+  }
+}
+@media print{
+  .printBtn {
+    display: none !important;
+  }
+}
+.printBtn {
+  padding: 10px 20px;
+  float: right;
+  margin-top: 22px;
+  background-color: #3B9ED0;
+  color: #fff;
+  border-radius: 4px;
+  cursor: pointer;
+  position: absolute;
+  right: -40px;
 }

+ 31 - 37
src/components/TemplateItems/TemplateItem/DesItem/index.jsx

@@ -1,43 +1,37 @@
 import PropTypes from "prop-types"
-import React from "react"
 import {filterDataArr} from '@utils/tools'
-import style from "./index.less"
+import style from "../index.less"
 
-class DesItem extends React.Component {
-    constructor(){
-        super();
-    }
-    render(){
-        const {preview} = this.props;
-        return (
-            <div>
-                <p className={style.wrapper} title={'主诉:'+filterDataArr(JSON.parse(preview.chief))}>主诉:
-                    {
-                        filterDataArr(JSON.parse(preview.chief))
-                    }
-                </p>
-                <p className={style.wrapper} title={'现病史:'+filterDataArr(JSON.parse(preview.present))}>现病史:
-                    {
-                        filterDataArr(JSON.parse(preview.present))
-                    }
-                </p>
-                <p className={style.wrapper} title={'其它史:'+filterDataArr(JSON.parse(preview.other))}>其它史:
-                    {
-                        filterDataArr(JSON.parse(preview.other))
-                    }
-                </p>
-                <p className={style.wrapper} title={'查体:'+filterDataArr(JSON.parse(preview.vital))}>查体:
-                    {
-                        filterDataArr(JSON.parse(preview.vital))
-                    }
-                </p>
-                <p className={style.wrapper} title={'化验:'+preview.lis}>化验:{preview.lis}</p>
-                <p className={style.wrapper} title={'辅检:'+preview.pacs}>辅检:{preview.pacs}</p>
-                <p className={style.wrapper} title={'诊断:'+preview.diag}>诊断:{preview.diag}</p>
-                <p className={style.wrapper} title={'医嘱:'+preview.advice}>医嘱:{preview.advice}</p>
-            </div>
-        )
-    }
+const DesItem = (props) => {
+  const {preview} = props;
+  return (
+      <div>
+          <p className={style.wrapperDes} title={'主诉:'+filterDataArr(JSON.parse(preview.chief))}>主诉:
+              {
+                  filterDataArr(JSON.parse(preview.chief))
+              }
+          </p>
+          <p className={style.wrapperDes} title={'现病史:'+filterDataArr(JSON.parse(preview.present))}>现病史:
+              {
+                  filterDataArr(JSON.parse(preview.present))
+              }
+          </p>
+          <p className={style.wrapperDes} title={'其它史:'+filterDataArr(JSON.parse(preview.other))}>其它史:
+              {
+                  filterDataArr(JSON.parse(preview.other))
+              }
+          </p>
+          <p className={style.wrapperDes} title={'查体:'+filterDataArr(JSON.parse(preview.vital))}>查体:
+              {
+                  filterDataArr(JSON.parse(preview.vital))
+              }
+          </p>
+          <p className={style.wrapperDes} title={'化验:'+preview.lis}>化验:{preview.lis}</p>
+          <p className={style.wrapperDes} title={'辅检:'+preview.pacs}>辅检:{preview.pacs}</p>
+          <p className={style.wrapperDes} title={'诊断:'+preview.diag}>诊断:{preview.diag}</p>
+          <p className={style.wrapperDes} title={'医嘱:'+preview.advice}>医嘱:{preview.advice}</p>
+      </div>
+  )
 }
 export default DesItem;
 

+ 0 - 7
src/components/TemplateItems/TemplateItem/DesItem/index.less

@@ -1,7 +0,0 @@
-.wrapper{
-  padding: 2px 0;
-  line-height: 16px;
-  overflow: hidden;
-  text-overflow:ellipsis;
-  white-space: nowrap;
-}

+ 7 - 0
src/components/TemplateItems/TemplateItem/index.less

@@ -134,4 +134,11 @@
     cursor: pointer;
     display: none;
   }
+}
+.wrapperDes{
+  padding: 2px 0;
+  line-height: 16px;
+  overflow: hidden;
+  text-overflow:ellipsis;
+  white-space: nowrap;
 }

+ 0 - 13
src/utils/jqprint.js

@@ -34,19 +34,6 @@ import $ from 'jquery';
         });
       }
     }
-    // var canvasLis = $(this).find('canvas');//页面有canvas需要转换为图片
-    // if (!canvasLis) {
-    //   return
-    // } else {
-    //   $("img").remove('.canvasImg')//删除已添加的图片避免多张图片重叠
-    //   for (var k = 0; k < canvasLis.length; k++) {
-    //     var canvas = canvasLis[k];
-
-    //     var canvasSrc = canvas.toDataURL();
-    //     let canvasImg = "<img class='canvasImg' src='" + canvasSrc + "'>"
-    //     $(canvasLis[k]).parent().append(canvasImg)
-    //   }
-    // }
 
     if (opt.printContainer) { doc.write($element.outer()); }
     else { $element.each(function () { doc.write($(this).html()); }); }