فهرست منبع

1024兼容处理,现病史搜索展开处理

liucf 6 سال پیش
والد
کامیت
e99ea8a85c

+ 1 - 1
index.html

@@ -8,6 +8,6 @@
     <title>ICSS</title>
 </head>
 <body>
-<div id="root"></div>
+<div id="root" style="min-width: 1024px;"></div>
 </body>
 </html>

+ 2 - 1
src/components/EMRContainer/index.less

@@ -6,7 +6,8 @@
   padding: 0px 0 10px 0 ;
   box-sizing: border-box;
   position: absolute;
-  min-width: 700px;
+  // min-width: 700px;
+  min-width: 548px;
   float: left;
   overflow-y:auto;
   overflow-x: hidden;

+ 22 - 4
src/components/InfoTitle/index.jsx

@@ -8,20 +8,37 @@ import store from '@store';
 import { showHistory } from '@store/actions/historyTemplates';
 import { initItemList } from '@store/async-actions/historyTemplates';
 import HistoryCases from '@containers/HistoryCases';
+import $ from 'jquery';
 
 class InfoTitle extends Component {
     constructor(props){
         super(props);
+        this.state={
+            le:''
+        }
         this.showHistoryBox = this.showHistoryBox.bind(this)
     }
     showHistoryBox(){
         store.dispatch(initItemList());
         store.dispatch(showHistory(true))
     }
+    componentWillReceiveProps(next){
+        const that = this;
+        if(next.winWidth <= 1024){
+          $(window).scroll(function(){
+            let scrollLeft = document.body.scrollLeft || document.documentElement.scrollLeft;
+            let left = -(scrollLeft - 10) +'px';
+            that.setState({
+              le:left
+            })
+          })
+        }
+    }
     render() {
-        const {disVisible,copyVisible} = this.props;
-        return <div className={style['title-wrapper']} style={{zIndex:disVisible||copyVisible?40:204}}>
-            <PatInfoContainer />
+        const {disVisible,copyVisible,winWidth} = this.props;
+        const {le} = this.state;
+        return <div className={style['title-wrapper']} style={{zIndex:disVisible||copyVisible?40:204,left:le}}>
+            <PatInfoContainer sizeFlag={winWidth <= 1035?true:false}/>
             <div className={style["operations"]} onClick={this.showHistoryBox}>
                 <span><img src={historyCase} />&nbsp;历史病历</span>
             </div>
@@ -35,7 +52,8 @@ class InfoTitle extends Component {
 function mapStateToProps(state) {
   return {
     disVisible: state.copyRight.disVisible,
-    copyVisible:state.copyRight.copyVisible
+    copyVisible:state.copyRight.copyVisible,
+    winWidth:state.homePage.windowWidth
   }
 }
 

+ 4 - 0
src/components/InfoTitle/index.less

@@ -10,6 +10,7 @@
   top: 50px;
   right: 470px;
   z-index: 204;
+  min-width: 548px;
 }
 .operations, .health{
   float: left;
@@ -39,5 +40,8 @@
     filter:alpha(opacity=30);
     -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=30);";
 }
+.font{
+  font-size: 13px;
+}
 
 

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

@@ -137,7 +137,7 @@ class MainSuit extends Component{
     // e.stopPropagation(); //冒泡到最顶层关闭其他下拉
     //若使用e.target,因为是onClick事件中,值可能是itembox的而不是span因此会有bug  
     const ele = document.activeElement;
-    console.log(ele.toString())
+    // console.log(ele.toString())
     if(ele.toString().indexOf('HTMLSpanElement') == -1){     //点击的不是span无法聚焦就不再设置位置
       return;
     }

+ 27 - 6
src/components/Operation/index.jsx

@@ -8,7 +8,7 @@ import PreviewContainer from '@containers/PreviewContainer';
 import { ConfirmModal, Notify } from '@commonComp';
 import {getAllDataList,getAllDataStringList,isAllClear,filterArr} from '@utils/tools';
 import store from '@store';
-
+import $ from 'jquery';
 
 class Operation extends Component {
   constructor(props) {
@@ -21,7 +21,8 @@ class Operation extends Component {
       oKBg: '',
       msg: '',
       type: '',
-      zIndex:40
+      zIndex:40,
+      le:'',
     }
     this.showPrint = this.showPrint.bind(this);
     this.closePrint = this.closePrint.bind(this);
@@ -270,16 +271,36 @@ class Operation extends Component {
       this.setState({ title: '' }) 
     }
   }
+  componentWillReceiveProps(next){//监听滚动事件
+    const that = this;
+    if(next.winWidth <= 1024){
+      /*$(document).on('scroll',function(){
+        let left = -($(document).scrollLeft() - 10) + 'px';
+        that.setState({
+          le:left
+        })
+      })*/
+      $(window).scroll(function(){
+        let scrollLeft = document.body.scrollLeft || document.documentElement.scrollLeft;
+        let left = -(scrollLeft - 10) +'px';
+        that.setState({
+          le:left
+        })
+      })
+    }
+  }
+
   render() {
     const { showPrint, closePrint, showPreview, closePreview } = this;
     const { visible, preVisible,diagShow } = this.props.print;
-    const {zIndex} = this.state;
-    return <div className={style['container']} style={{zIndex:zIndex}}>
+    const {winWidth} = this.props;
+    const {zIndex,le} = this.state;
+    return <div className={style['container']} style={{zIndex:zIndex,left:le}}>
       <span className={style['button']} onClick={showPrint}><img src={printImg} /> 打印病历</span>
       <span className={style['preButton']} onClick={showPreview}><img src={preview} /> 预览</span>
       <span className={style['preButton']} onClick={() => { this.saveHis(3) }}><img src={saveHistory} /> 保存病历模板</span>
-      <span className={style['saveButton']} onClick={() => { this.saveAll(1) }}>保存</span>
-      <span className={`${style['clearButton']} ${style['saveButton']}`} onClick={() => { this.clearAll(2) }}>清除</span>
+      <span className={winWidth<=1082?`${style['saveButton']} ${style['b1024']}`: style['saveButton']} onClick={() => { this.saveAll(1) }}>保存</span>
+      <span className={winWidth<=1082?`${style['clearButton']} ${style['saveButton']} ${style['b1024']}`:`${style['clearButton']} ${style['saveButton']}`} onClick={() => { this.clearAll(2) }}>清除</span>
       <PrintPreviewContainer visible={visible} onClose={closePrint} />
       <PreviewContainer visible={preVisible} onClose={closePreview} />
       <ConfirmModal

+ 8 - 1
src/components/Operation/index.less

@@ -6,7 +6,8 @@
     bottom: 0;
     left: 10px;
     right: 470px;
-    min-width: 720px;
+    // min-width: 720px;
+    min-width: 548px;
     background-color: #fff;
     // z-index: 240;
     padding-bottom: 10px;
@@ -66,6 +67,12 @@
         background-color: #fff;
         color: #000;
     }
+    .b1024{
+        width: 60px;
+        margin-left: 15px;
+        margin-right: 10px;
+        font-size: 13px;
+    }
     .modal{
         position: fixed;
         left: 50%;

+ 2 - 1
src/components/PatInfo/index.jsx

@@ -12,7 +12,8 @@ class PatInfo extends Component {
 
   render(){
     const {message} = this.props.patInfo;
-     return <table className={style["table"]}>
+    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='2' className={`${style.tdBorderB} ${style.tdBorderR}`}>姓名:{message.patientName && message.patientName}</td>

+ 5 - 0
src/components/PatInfo/index.less

@@ -17,3 +17,8 @@
     border-right: 1px solid @person-table-color;
   }
 }
+.newSize{
+  td{
+  font-size: 13px;
+  }
+}

+ 1 - 1
src/containers/CurrentIll.js

@@ -12,7 +12,7 @@ import {getModule} from '@store/async-actions/fetchModules.js';
 import {didPushParamChange} from '@utils/tools.js';
 
 
-function mapStateToProps(state) { 
+function mapStateToProps(state) { //console.log(111,state);
   const {homePage} = state;
     return {
         data:state.currentIll.data,//主诉模板

+ 5 - 2
src/containers/OperationContainer.js

@@ -12,9 +12,12 @@ import {saveMessage,clearMessages} from "../store/async-actions/print";
 import {saveTemplateDetail} from '@store/async-actions/tabTemplate';
 import {saveClickNum} from '@store/async-actions/homePage';
 
-function mapStateToProps({print}) {
+// function mapStateToProps({print}) {
+function mapStateToProps(state) {
+    const {print,homePage} = state;
     return ({
-        print
+        print,
+        winWidth:homePage.windowWidth
     });
 }
 

+ 24 - 6
src/modules/HomePage/index.jsx

@@ -4,11 +4,11 @@ import BannerContainer from '@containers/TypeConfigContainer';
 //  引入组件
 import BodyContainer from "@components/BodyContainer";
 
-import {HIDEDROP} from '@store/types/homePage.js';
+import {HIDEDROP,SETMINSCREEN} from '@store/types/homePage.js';
 import style from './index.less';
 /*import {getInitModules} from '@store/async-actions/homePage.js';*/
 import { getUrlArgObject } from "@utils/tools";
-
+import $ from 'jquery';
 class HomePage extends Component {
     constructor() {
         super();
@@ -17,16 +17,28 @@ class HomePage extends Component {
         }
     }
     
-    /*componentDidMount(){
-        clearTimeout(this.state.timer);
+    componentDidMount(){
+        const {setWindow} = this.props;
+       /* clearTimeout(this.state.timer);
         const that = this;
         const timer = setTimeout(function(){//解决患者信息在获取模板之后的问题
             that.props.getInit();
         },200)
         this.setState({
             timer
-        })      
-    }*/
+        }) */ 
+        // 获取并监听窗口宽度,用于有横向滚动条时患者信息和打印预览跟随滚动
+        let width = $(window).width();
+        let height = $(window).height();
+        setWindow && setWindow({width,height});
+        
+        $(window).resize(function(){
+            let reWidth = $(window).width(); 
+            let reHeight = $(window).height();  
+            setWindow && setWindow({width:reWidth,height:reHeight});
+        })    
+
+    }
     render() {
         return <div className={style['home-page']} onClick={this.props.hideAllDrop}>
             <BannerContainer />
@@ -51,6 +63,12 @@ const mapDispatchToProps = function (dispatch) {
         /*getInit(){
             dispatch(getInitModules);
         }*/
+        setWindow(obj){
+            dispatch({
+                type:SETMINSCREEN,
+                obj:obj
+            })
+        }
     }
 };
 

+ 67 - 21
src/store/actions/currentIll.js

@@ -255,8 +255,8 @@ export const confirm = (state,action) =>{
   if(withs && withs.length>0){
     // for(let i in withs){
     for(let i=0;i<withs.length; i++){
-      // withsArr.splice(parseInt(ikey)+length,0,banText,getLabel(withs[i].id,withs[i].name),...(withs[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==2;})));
-      withsArr.splice(parseInt(ikey)+length,0,getLabel(withs[i].id,withs[i].questionMapping && withs[i].questionMapping.length==0?(ban.name+withs[i].name+','):(ban.name+withs[i].name)),...(withs[i].questionMapping && withs[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==2;})));
+      withsArr.splice(parseInt(ikey)+length,0,banText,getLabel(withs[i].id,withs[i].questionMapping && withs[i].questionMapping.length==0?(withs[i].name+','):(withs[i].name)),...(withs[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==2;})));
+      /*withsArr.splice(parseInt(ikey)+length,0,getLabel(withs[i].id,withs[i].questionMapping && withs[i].questionMapping.length==0?(ban.name+withs[i].name+','):(ban.name+withs[i].name)),...(withs[i].questionMapping && withs[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==2;})));*/
     }
   }
 
@@ -498,6 +498,8 @@ export function insertLabelData(state,action){
   res.symptomIds.push(id);
   const text = Object.assign(JSON.parse(config.textLabel),{name:searchData},{id:id});
   let focusIndex = res.focusIndex;
+  let saveText = res.saveText;
+  let banIdx = saveText.indexOf("伴");
   
   if(isReplace){
     span.current.innerText = '';
@@ -516,26 +518,70 @@ export function insertLabelData(state,action){
     let innerText = span.current.innerText;
     let strIndex = innerText.indexOf(searchStr);
     const value = innerText.replace(searchStr,"");
-    // let value;
-    // if(strIndex <= 1){//前
-    if(strIndex < 1){//前
-      res.data.splice(focusIndex,0,text);
-      res.saveText.splice(focusIndex,0,searchData);
-      res.data[focusIndex+1].value = value;
-      res.saveText[focusIndex+1] = value;
-      resData = JSON.parse(JSON.stringify(res.data));
-      resData.splice(focusIndex+1,0,...(data.questionMapping.filter((item)=>{
-                              return item.symptomType==0||item.symptomType==2;
-                            })));
+    // 没有伴展开主诉symptomType=0/1的尾巴,有伴一>第一个点选上去的伴为依据,伴前展开主诉,伴后展开伴随;多余的伴以及手动输入的伴不做处理(2-25)
+    if(banIdx==-1){
+      // if(strIndex <= 1){//前
+      if(strIndex < 1){//前
+        res.data.splice(focusIndex,0,text);
+        res.saveText.splice(focusIndex,0,searchData);
+        res.data[focusIndex+1].value = value;
+        res.saveText[focusIndex+1] = value;
+        resData = JSON.parse(JSON.stringify(res.data));
+        resData.splice(focusIndex+1,0,...(data.questionMapping.filter((item)=>{
+                                return item.symptomType==0||item.symptomType==1;
+                              })));
+      }else{
+        res.data.splice(focusIndex+1,0,text);
+        res.saveText.splice(focusIndex+1,0,searchData);
+        res.data[focusIndex].value = value;
+        resData = JSON.parse(JSON.stringify(res.data));
+        // +2是因为插入一个文本标签  
+        resData.splice(focusIndex+2,0,...(data.questionMapping.filter((item)=>{
+                                return item.symptomType==0||item.symptomType==1;
+                              })));
+      }
     }else{
-      res.data.splice(focusIndex+1,0,text);
-      res.saveText.splice(focusIndex+1,0,searchData);
-      res.data[focusIndex].value = value;
-      resData = JSON.parse(JSON.stringify(res.data));
-      // +2是因为插入一个文本标签  
-      resData.splice(focusIndex+2,0,...(data.questionMapping.filter((item)=>{
-                              return item.symptomType==0||item.symptomType==2;
-                            })));
+      if(focusIndex > banIdx){//伴后
+        if(strIndex < 1){//前
+          res.data.splice(focusIndex,0,text);
+          res.saveText.splice(focusIndex,0,searchData);
+          res.data[focusIndex+1].value = value;
+          res.saveText[focusIndex+1] = value;
+          resData = JSON.parse(JSON.stringify(res.data));
+          resData.splice(focusIndex+1,0,...(data.questionMapping.filter((item)=>{
+                                  return item.symptomType==0||item.symptomType==2;
+                                })));
+        }else{
+          res.data.splice(focusIndex+1,0,text);
+          res.saveText.splice(focusIndex+1,0,searchData);
+          res.data[focusIndex].value = value;
+          resData = JSON.parse(JSON.stringify(res.data));
+          // +2是因为插入一个文本标签  
+          resData.splice(focusIndex+2,0,...(data.questionMapping.filter((item)=>{
+                                  return item.symptomType==0||item.symptomType==2;
+                                })));
+        }
+      }else{//伴前
+        if(strIndex < 1){//前
+          res.data.splice(focusIndex,0,text);
+          res.saveText.splice(focusIndex,0,searchData);
+          res.data[focusIndex+1].value = value;
+          res.saveText[focusIndex+1] = value;
+          resData = JSON.parse(JSON.stringify(res.data));
+          resData.splice(focusIndex+1,0,...(data.questionMapping.filter((item)=>{
+                                  return item.symptomType==0||item.symptomType==1;
+                                })));
+        }else{
+          res.data.splice(focusIndex+1,0,text);
+          res.saveText.splice(focusIndex+1,0,searchData);
+          res.data[focusIndex].value = value;
+          resData = JSON.parse(JSON.stringify(res.data));
+          // +2是因为插入一个文本标签  
+          resData.splice(focusIndex+2,0,...(data.questionMapping.filter((item)=>{
+                                  return item.symptomType==0||item.symptomType==1;
+                                })));
+        }
+      }
     }
     span.current.innerText = value;
     res.data = fullfillText(resData).newArr;

+ 5 - 1
src/store/reducers/homePage.js

@@ -1,5 +1,5 @@
 import {HIDE,RESET,SETINITDATA,SETDROPSHOW,SETADDITEMINIT,SETT0EDIT,SETREADDITEMS,
-  HIDEDROP,CLICKCOUNT,ISREAD,SETOTHERHISTORY} from '../types/homePage.js';
+  HIDEDROP,CLICKCOUNT,ISREAD,SETOTHERHISTORY,SETMINSCREEN} from '../types/homePage.js';
 import {showDrop,setAddItemInit,setLabelToEdit,confirmHide,clickNum} from '../actions/homePage.js';
 
 const initState = {
@@ -50,6 +50,10 @@ export default function (state=initState,action) {
       res.focusTextIndex = action.index;
       res.span=action.$span;
       return res;*/
+    case SETMINSCREEN:
+      res.windowWidth = action.obj.width;
+      res.windowHeight = action.obj.height;
+      return res;
     default:
       return res;
   }

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

@@ -9,4 +9,5 @@ export const SETTEXTFOCUS = 'set_focus_text_index';
 export const HIDEDROP = 'set_box_drop_hide';//点击确定隐藏
 export const CLICKCOUNT = 'click_count';//埋点
 export const ISREAD = 'is_history_or_template';     //是否回读或模板数据
-export const SETOTHERHISTORY = 'set_otherHis_history';    //其他史历史数据暂存
+export const SETOTHERHISTORY = 'set_otherHis_history';    //其他史历史数据暂存
+export const SETMINSCREEN = 'SETMINSCREEN';    //1024标识