Luolei пре 6 година
родитељ
комит
745d1e449a
1 измењених фајлова са 19 додато и 17 уклоњено
  1. 19 17
      src/components/MainSuit/index.jsx

+ 19 - 17
src/components/MainSuit/index.jsx

@@ -9,6 +9,7 @@ import {isIE,getPageCoordinate,windowEventHandler,filterDataArr,getAllDataList,g
 import $ from 'jquery';
 import store from '@store';
 import {getFeature} from '@store/async-actions/fetchModules';
+let num = 1;
 
 class MainSuit extends Component{
   constructor(props){
@@ -140,22 +141,22 @@ class MainSuit extends Component{
     const {getSearchLocation} = this.props;
     let leftL=0;      //用焦点元素的左边距替换鼠标点击的左边距,高度还是鼠标点击的位置
     let num = this.props.datas.length == 0?0:60
-    if(isIE()){
-      leftL = getPageCoordinate(e).boxLeft
-    }else{
-      const ele = document.activeElement;
-      leftL = ele.offsetLeft+num
-    }
-    getSearchLocation(getPageCoordinate(e).boxTop,leftL)
-    this.setState({
-      tmpScroll: $("#addScrollEvent")[0].scrollTop,
-      tmpTop:getPageCoordinate(e).boxTop
-    });
-    windowEventHandler('scroll',()=>{      //弹窗跟随滚动条滚动或者关闭弹窗
-      let scrollYs = $("#addScrollEvent")[0].scrollTop;
-      let boxTop = this.state.tmpTop - scrollYs + this.state.tmpScroll
-      getSearchLocation(boxTop,this.state.boxLeft)
-    },$("#addScrollEvent")[0])
+    // if(isIE()){
+    //   leftL = getPageCoordinate(e).boxLeft
+    // }else{
+    //   const ele = document.activeElement;
+    //   leftL = ele.offsetLeft+num
+    // }
+    // getSearchLocation(getPageCoordinate(e).boxTop,leftL)
+    // this.setState({
+    //   tmpScroll: $("#addScrollEvent")[0].scrollTop,
+    //   tmpTop:getPageCoordinate(e).boxTop
+    // });
+    // windowEventHandler('scroll',()=>{      //弹窗跟随滚动条滚动或者关闭弹窗
+    //   let scrollYs = $("#addScrollEvent")[0].scrollTop;
+    //   let boxTop = this.state.tmpTop - scrollYs + this.state.tmpScroll
+    //   getSearchLocation(boxTop,this.state.boxLeft)
+    // },$("#addScrollEvent")[0])
   }
 
   handleChange(e){
@@ -271,7 +272,8 @@ class MainSuit extends Component{
     const searchFlag = searchData.length>0 ? true : false;
     const boxTop1 = datas.length>0?boxTop:45;
     const boxLeft1 = datas.length>0?boxLeft:85;
-    if(+type===1){      //文本模式
+    if(+type===1&&num===1){      //文本模式
+      ++num
       return <Textarea title='主诉' boxMark='1' isRead={isRead} value={saveText[0]} handlePush={fetchPushInfos} handleInput={handleInput} />;
     }
     return  <div className={style['main-suit']}>