Bläddra i källkod

Merge remote-tracking branch 'origin/dev/otherHis' into dev/new1

zhouna 6 år sedan
förälder
incheckning
a1c28c3d77

+ 4 - 3
src/common/less/variables.less

@@ -77,15 +77,15 @@
   text-align: left;
   border: none;
   color:#000000;
-  padding-left: 40px;
+  /*padding-left: 40px;*/
   cursor: pointer;
   background: rgba(59,158,208,0.1);
   background-image: url(../images/first.png);
   background-repeat: no-repeat;
-  background-position: 20px 10px;
+  background-position: 0px 10px;
 }
 .clear{
-  width: 88px;
+  width: 60px;
   height: 44px;
   line-height: 44px;
   font-size: 12px;
@@ -96,6 +96,7 @@
   outline: none;
   text-align: center;
   cursor: pointer;
+  margin-left: 22px;
 }
 .confirm{
   width: 120px;

+ 4 - 4
src/components/Banner/index.jsx

@@ -11,7 +11,7 @@ class Banner extends Component {
     super(props)
     this.state = {
       mode: props.typeConfig,
-      zIndex:40
+      zIndex:204
     };
     this.showConfigModal = this.showConfigModal.bind(this);
     this.closeConfigModal = this.closeConfigModal.bind(this);
@@ -22,7 +22,7 @@ class Banner extends Component {
   showConfigModal(){
     this.setState({
       mode:this.props.typeConfig,
-      zIndex:202
+      zIndex:206
     });
     this.props.showConfigModal()
   }
@@ -30,7 +30,7 @@ class Banner extends Component {
   closeConfigModal(){
     this.props.closeConfigModal();
     this.setState({
-      zIndex:40
+      zIndex:204
     })
   }
 
@@ -50,7 +50,7 @@ class Banner extends Component {
     confirmType&&confirmType(mode);
     this.closeConfigModal()
     this.setState({
-      zIndex:40
+      zIndex:204
     })
   }
   /*componentDidUpdate(){

+ 5 - 3
src/components/CheckBody/index.jsx

@@ -38,9 +38,11 @@ class CheckBody extends Component{
     if(totalHide){
       return ;
     }
-
-    let boxLeft = e.pageX -102 + 'px';
-    let boxTop =  (+e.target.offsetTop+22)+'px';
+    //若使用e.target,因为是onClick事件中,值可能是itembox的而不是span因此会有bug
+    const ele = document.activeElement;
+    const height = ele.offsetHeight;
+    let boxTop = (+(ele.offsetTop)+height)+'px';
+    let boxLeft = ele.offsetLeft + 'px';
     this.setState({
       boxLeft:boxLeft,
       boxTop:boxTop

+ 5 - 4
src/components/CurrentIll/index.jsx

@@ -77,10 +77,11 @@ class CurrentIll extends Component{
 
   handleClick(e){//让搜索框跟随鼠标点击移动
     // e.stopPropagation(); //冒泡到最顶层关闭其他下拉
-    let boxLeft = e.pageX -62 + 'px';
-    // let boxTop = e.pageY - 164 + 'px';console.log(124,e.pageY,boxTop);
-    let offsetTop = e.target.offsetTop;
-    let boxTop = offsetTop + 28 + 'px';
+    //若使用e.target,因为是onClick事件中,值可能是itembox的而不是span因此会有bug
+    const ele = document.activeElement;
+    const height = ele.offsetHeight;
+    let boxTop = (+(ele.offsetTop)+height)+'px';
+    let boxLeft = +ele.offsetLeft+90 + 'px';
     this.setState({
       boxLeft:boxLeft,
       boxTop:boxTop

+ 1 - 1
src/components/InfoTitle/index.less

@@ -9,7 +9,7 @@
   left: 10px;
   top: 50px;
   right: 480px;
-  z-index: 200;
+  z-index: 204;
 }
 .operations, .health{
   float: left;

+ 6 - 2
src/components/OtherHistory/index.jsx

@@ -51,6 +51,7 @@ class OtherHistory extends Component{
       return;
     }
     if(+type===0&&!hasMain){
+      document.activeElement.blur();        //修改第一次提示后不再提示bug
       Notify.error("无法操作,请先输入主诉");
       return;
     }
@@ -69,8 +70,11 @@ class OtherHistory extends Component{
     //e.stopPropagation();
     const {fetchPushInfos} = this.props;
     //fetchPushInfos&&fetchPushInfos();
-    let boxLeft = e.pageX - 102 + 'px';
-    let boxTop = (+e.target.offsetTop+22)+'px';
+    //若使用e.target,因为是onClick事件中,值可能是itembox的而不是span因此会有bug
+    const ele = document.activeElement;
+    const height = ele.offsetHeight;
+    let boxTop = (+(ele.offsetTop)+height)+'px';
+    let boxLeft = ele.offsetLeft + 'px';
     this.setState({
       boxLeft:boxLeft,
       boxTop:boxTop

+ 1 - 1
src/components/PushContainer/index.less

@@ -7,7 +7,7 @@
   padding-top: 20px;
   position: absolute;
   right: 10px;
-  z-index: 201;
+  z-index: 205;
 
   position: fixed;
   top: 50px;

+ 2 - 0
src/components/SearchDrop/index.less

@@ -1,5 +1,7 @@
 @import "~@less/variables.less";
 .list{
+  max-height:300px;
+  overflow-y: auto;
   .pop;
   left: 85px;
   padding: 0 0 10px;

+ 3 - 2
src/components/SpreadDrop/index.jsx

@@ -55,7 +55,8 @@ class SpreadDrop extends Component{
     e&&e.stopPropagation();
     let boxLeft = e.pageX -175 + 'px';
     let offsetTop = e.target.offsetTop;
-    let boxTop = offsetTop + 29 + 'px';
+    const ht = e.target.offsetHeight;   //如杂音选中文字有多行时,写死会遮挡
+    let boxTop = offsetTop + ht + 'px';
     this.setState({
       boxLeft:boxLeft,
       boxTop:boxTop
@@ -174,7 +175,7 @@ class SpreadDrop extends Component{
     const {handleConfirm,ikey,type,tagType,order,mainSaveText,copyType} = this.props;
     const params = Object.assign({},this.state,{ikey,type,tagType,order,mainSaveText,copyType});
     handleConfirm&&handleConfirm(params);
-	this.btnClickFlag = true;
+	  this.btnClickFlag = true;
     //点确定后隐藏弹窗
     this.props.handleHide();
   }

+ 2 - 2
src/components/SpreadDrop/index.less

@@ -6,7 +6,7 @@
 }
 .drop-list{
   .pop;
-  padding:20px;
+  padding:20px 20px 20px 0;
   .row{
     display: inline-block;
     // width: 200px;
@@ -21,7 +21,7 @@
     border-bottom: 1px @disable-border-color solid;
   }
   li{
-    padding-left: 40px;
+    padding-left: 20px;
     cursor: pointer;
     .mult-li;
   }

+ 5 - 5
src/modules/HomePage/index.jsx

@@ -6,7 +6,7 @@ import BodyContainer from "@components/BodyContainer";
 
 import {HIDEDROP} from '@store/types/homePage.js';
 import style from './index.less';
-import {getInitModules} from '@store/async-actions/homePage.js';
+/*import {getInitModules} from '@store/async-actions/homePage.js';*/
 import { getUrlArgObject } from "@utils/tools";
 
 class HomePage extends Component {
@@ -17,7 +17,7 @@ class HomePage extends Component {
         }
     }
     
-    componentDidMount(){
+    /*componentDidMount(){
         clearTimeout(this.state.timer);
         const that = this;
         const timer = setTimeout(function(){//解决患者信息在获取模板之后的问题
@@ -26,7 +26,7 @@ class HomePage extends Component {
         this.setState({
             timer
         })      
-    }
+    }*/
     render() {
         return <div className={style['home-page']} onClick={this.props.hideAllDrop}>
             <BannerContainer />
@@ -48,9 +48,9 @@ const mapDispatchToProps = function (dispatch) {
               type:HIDEDROP
             });
         },
-        getInit(){
+        /*getInit(){
             dispatch(getInitModules);
-        }
+        }*/
     }
 };
 

+ 9 - 7
src/store/actions/checkBody.js

@@ -142,20 +142,22 @@ export function insertLabelData(state,action){
   const searchStr = res.searchStr;
   const {index,data,isReplace,span,searchInEnd}=action;
   const showText = res.saveText[index];
-  const spreadLabels = data;
+  const spreadLabels = data.tagType==4?fullfillText(data.questionMapping).newArr:[data];
   let reg = searchInEnd?new RegExp(searchStr+"$"):new RegExp("^"+searchStr);
   const newText=showText.replace(reg,'')||'';
   if(!isReplace){
     span.current.innerText = newText;
     const pText = Object.assign({},text,{value:newText});
     if(searchInEnd){
-      res.data.splice(index,1,pText,spreadLabels,text);
-      res.saveText.splice(index,1,newText,'','');
-      res.selecteds.splice(index,1,null,null,null);
+      res.data.splice(index,1,pText,...spreadLabels,text);
+      res.saveText = fullfillText(res.data).saveText;
+      //res.saveText.splice(index,1,newText,'','');
+      res.selecteds.splice(index,1,null,new Array(spreadLabels.length).fill(null),null);
     }else{
-      res.data.splice(index,1,text,spreadLabels,pText);
-      res.saveText.splice(index,1,'','',newText);
-      res.selecteds.splice(index,1,null,null,null);
+      res.data.splice(index,1,text,...spreadLabels,pText);
+      res.saveText = fullfillText(res.data).saveText;
+      //res.saveText.splice(index,1,'','',newText);
+      res.selecteds.splice(index,1,null,new Array(spreadLabels.length).fill(null),null);
     }
 
   }else{

+ 7 - 5
src/store/actions/otherHistory.js

@@ -32,6 +32,7 @@ export const confirm = (state,action) =>{
   if(items.length==0&&nones){
     arr[ikey-1].value = newPreText;
     res.saveText[ikey-1] = newPreText;
+    res.selecteds[ikey] = null;       //无殊选中状态遗留bug修改
     res.update=Math.random();
     return res;
   }
@@ -182,18 +183,19 @@ export function insertLabelData(state,action){
   const searchStr = res.searchStr;
   const {index,data,isReplace,span,searchInEnd}=action;
   const showText = res.saveText[index];
-  const spreadLabels = data;
+  const spreadLabels = data.tagType==4?fullfillText(data.questionMapping).newArr:[data];
   let reg = searchInEnd?new RegExp(searchStr+"$"):new RegExp("^"+searchStr);
   const newText=showText.replace(reg,'')||' ';
   if(!isReplace){
     span.current.innerText = newText;
     const pText = Object.assign({},text,{value:newText});
     if(searchInEnd){
-      res.data.splice(index,1,pText,spreadLabels,text);
-      res.saveText.splice(index,1,newText,'','');
+      res.data.splice(index,1,pText,...spreadLabels,text);
+      res.saveText = fullfillText(res.data).saveText;
+      //res.saveText.splice(index,1,newText,'','');
     }else{
-      res.data.splice(index,1,spreadLabels,pText,text);
-      res.saveText.splice(index,1,'',newText,'');
+      res.data.splice(index,1,...spreadLabels,pText,text);
+      res.saveText = fullfillText(res.data).saveText;//.splice(index,1,'',newText,'');
     }
   }else{
     span.current.innerText = ' ';

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

@@ -21,7 +21,7 @@ export const initPersonInfo = (dispatch, getState) => {
         const data = res.data;
         if (data.code == 0) {
             dispatch(getInfos(data.data));
-            console.log(data.data)
+            //console.log(data.data)
             getPatientMessage(dispatch, getState);
         } else {
             console.log(res)
@@ -94,6 +94,7 @@ export const getPatientMessage = (dispatch, getState) => {
         type: CONFIRM_TYPE,
         confirmType:data1.modeValue
       });
+      dispatch(getInitModules);     //确保病人信息获取以后再获取模板等数据,否则参数为空
       if(state.tabTemplate.items.length == 0){
         dispatch(initItemList(data1.modeValue));        //模板列表没有就获取模板列表用于保存时做数据对比是否保存过
       }