Browse Source

填写单下拉改到组件内渲染

zhouna 6 years ago
parent
commit
10f06d7b96

+ 3 - 14
src/common/components/DropList/index.jsx

@@ -1,6 +1,5 @@
 import React,{Component} from 'react';
 import classNames from 'classnames';
-import ReactDom from "react-dom";
 
 import style from "./index.less";
 /****
@@ -24,14 +23,7 @@ class DropList extends Component{
     let isHide = this.props.show?'':style['hide'];
     return classNames(style['list'],name,isHide);
   }
-  
-  getStyle(){
-    const {left,top} = this.props;
-    return {
-      left:left?left+'px':'',
-      top:top?top+'px':''
-    }
-  }
+
   handleSelect(e,item){
     e.stopPropagation();
     const {onSelect} = this.props;
@@ -44,9 +36,7 @@ class DropList extends Component{
   }
   render(){
     const {data,hideTag,boxMark} = this.props;
-    const domNode = document.getElementById('root');
-    return ReactDom.createPortal(
-      <div className={this.getClass()} style={this.getStyle()} contentEditable='false'>
+    return <div className={this.getClass()} contentEditable='false'>
         <ul>
           {data&&data.map((it)=>{
             /*return <li onClick={(e)=>this.handleSelect(e,it)} className={it.selected||(it.selected!==false&&+it.defaultSelect===1)?style['selected']:''}>{it.labelPrefix}{it.questionDetailList&&it.questionDetailList.length>0?it.questionDetailList[0].name:it.name}{it.labelSuffix}</li>*/
@@ -54,8 +44,7 @@ class DropList extends Component{
           })}
           <li onClick={(e)=>this.handleClear(e)} className='red'>清空选项</li>
         </ul>
-      </div>
-    ,domNode)
+      </div>;
   }
 }
 

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

@@ -2,7 +2,6 @@
 
 .box{
   margin: 2px 20px;
-  word-break: break-all;
   word-break: break-word;
   .title{
     width: 65px;
@@ -24,7 +23,7 @@
     padding:5px;
     outline: none;
     border-bottom:1px @part-border-color dashed;
-    padding-right: 438px;
+    padding-right: 450px;
     /*border-radius: 4px;*/
   }
   .border {

+ 14 - 7
src/components/EMRContainer/index.jsx

@@ -19,29 +19,36 @@ class EMRContainer extends Component {
         super(props);
         this.$cont = React.createRef();
     }
-    /*componentDidMount(){
+    componentDidMount(){
         // const {initHospital} = this.props;
         // initHospital()
         const height = getWindowInnerHeight() - 175;
-        const width = getWindowInnerWidth() - 480;
+        const width = getWindowInnerWidth() - 20;
         this.$cont.current.style.height = height+"px";
         this.$cont.current.style.width = width + "px";
         windowEventHandler('resize', ()=>{
           const height = getWindowInnerHeight() - 175;
-          const width = getWindowInnerWidth() - 480;
+          const width = getWindowInnerWidth() - 20;
           if(this.$cont.current){
             this.$cont.current.style.height = height + "px";
             this.$cont.current.style.width = width + "px";
           }
         });
-    }*/
+    }
     render() {
-        return <div className={style['EMR-container']} id="addScrollEvent">
+        const contStyle={
+                          opacity:'1',
+                          right:'459px',
+                          width:'14px',
+                          background:'#f1f1f1'};
+        const barStyle={background:'#c1c1c1',width:'100%'};
+        return <div className={style['EMR-container']}
+                    ref={this.$cont} id="addScrollEvent">
           <ScrollArea speed={0.8}
-                      ref={this.$cont}
                       horizontal={false}
                       className={style["area"]}
-                      verticalContainerStyle={{opacity:'0.5',right:'459px'}}
+                      verticalContainerStyle={contStyle}
+                      verticalScrollbarStyle={barStyle}
                       contentClassName="content">
           <InfoTitle></InfoTitle>
             <div className={style['inner']}>

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

@@ -1,8 +1,10 @@
 @import "~@less/variables.less";
 .area{
-   height: 350px;
+   height: 100%;
  }
-
+.area .scrollbar-container.vertical .scrollbar{
+  width: 100%;
+}
 .EMR-container{
   background: #fff;
   margin:60px 20px 0 0;

+ 0 - 4
src/components/MultSpread/index.jsx

@@ -84,8 +84,6 @@ class MultSpread extends Component{
           const list = it.questionDetailList&&it.questionDetailList.length>0?it.questionDetailList:it.questionMapping;
           return <RadioDrop data={list}
                             boxMark={boxMark}
-                            prefix={it.labelPrefix}
-                            suffix={it.labelSuffix}
                             placeholder={it.name}
                             show={show}
                             value = {it.value}
@@ -104,8 +102,6 @@ class MultSpread extends Component{
                            show={showArr&&showArr[inx]}
                            order={it.textGenerate}
                            type={boxMark}
-                           textPrefix={it.labelPrefix}
-                           textSuffix={it.labelSuffix}
                            id={it.id}
                            hideTag={true}></Multiple>;
         case +it.controlType===5://带单位数字键盘

+ 3 - 9
src/components/Multiple/SlideItem/index.jsx

@@ -2,14 +2,12 @@ import react from "react";
 import style from "./index.less";
 import classNames from 'classnames';
 import {deepClone} from '@utils/tools.js';
-import ReactDom from "react-dom";
 /**
   单列多选组件下拉 2019-2-20 By_liucf
   接收参数:
   show:是否展示下拉
   data:下拉数据
   handleConfirm: 确定事件
-  left、top: 下拉框的位置,
   seleData、seleId:选中的数据和id,回读标识选中状态用
 **/
 
@@ -66,10 +64,8 @@ class SlideItem extends react.Component{
   }
 
   getStyle(){
-    const {left,top,show} = this.props;
+    const {show} = this.props;
     return {
-      left:left?left+'px':'0',
-      top:top?top+'px':'0',
       display:show?'table':'none' 
     }
   }
@@ -81,9 +77,7 @@ class SlideItem extends react.Component{
   }
   render(){
     const {data} = this.props;
-    const domNode = document.getElementById('root');
-    return ReactDom.createPortal(
-      <div className={this.getListClass()} style={this.getStyle()} contentEditable="false">
+    return <div className={this.getListClass()} style={this.getStyle()} contentEditable="false">
         <ul>
           {data&&data.map((it)=>{
           return <li onClick={(e)=>this.handleSelect(e,it)} className={this.getSeleStyle(it.id)} title={it.name.length>8?it.name:''}>{it.name&&it.name.length>8?it.name.slice(0,8)+'...':it.name}</li>
@@ -91,7 +85,7 @@ class SlideItem extends react.Component{
           <li onClick={this.handleClear} className={style['mClear']}>清空选项</li>
           <li onClick={this.handleClick} className={style['mConfirm']}>确定</li>
         </ul>
-      </div>,domNode)
+      </div>
   }
 }
 

+ 4 - 26
src/components/Multiple/index.jsx

@@ -2,7 +2,7 @@ import react from "react";
 import style from "./index.less";
 import $ from 'jquery';
 import classNames from 'classnames';
-import {handleEnter,isIE,filterArr,deepClone,filterDataArr,getPageCoordinate} from '@utils/tools.js';
+import {handleEnter,isIE,filterArr,deepClone,filterDataArr} from '@utils/tools.js';
 import {Notify} from '@commonComp';
 import SlideItem from "./SlideItem";
 import config from '@config/index.js';
@@ -27,10 +27,6 @@ class Multiple extends react.Component{
       labelVal:"",
       seleData:seleData||"",
       seleId:seleId||[],
-      boxLeft:null,
-      boxTop:null,
-      tmpScroll:null,
-      tmpTop:null
     }
     this.$div = React.createRef();
     this.handleShow = this.handleShow.bind(this);
@@ -62,29 +58,13 @@ class Multiple extends react.Component{
 
   handleShow(e){//单击
     e&&e.stopPropagation();
-    let boxLeft = e.pageX -133 + 'px';
-    let offsetTop = e.target.offsetTop;
-    const ht = e.target.offsetHeight;   //如杂音选中文字有多行时,写死会遮挡
-    let boxTop = offsetTop + ht +2 + 'px';
-    this.setState({
-      boxLeft:getPageCoordinate(e).boxLeft,
-      boxTop:getPageCoordinate(e).boxTop,
-      tmpScroll: $("#addScrollEvent")[0].scrollTop,
-      tmpTop:getPageCoordinate(e).boxTop
-    })
-    $("#addScrollEvent").scroll(()=>{
-      let scrollYs = $("#addScrollEvent")[0].scrollTop;
-      this.setState({
-        boxTop:this.state.tmpTop - scrollYs + this.state.tmpScroll
-      })
-    })
      this.setStateInit();
     const {ikey,handleShow,placeholder,flag,id,value,tagType,type} = this.props;
     const that = this;
     clearTimeout(this.state.timer);
     this.state.timer = setTimeout(function(){
       if (that.state.editable) {//如果处于编辑状态点击不显示下拉框
-        return
+        return;
       }else{
         handleShow&&handleShow({ikey,placeholder,flag,id,value,tagType,type});
       }
@@ -174,7 +154,7 @@ class Multiple extends react.Component{
   }
   render(){
     const {placeholder,value,show,data,hideTag} = this.props;
-    const {editable,boxTop,boxLeft,seleData,seleId} = this.state;
+    const {editable,seleData,seleId} = this.state;
     return <div className={style["container"]}>
       <div className={this.getClass()}
       ref={this.$div}
@@ -186,9 +166,7 @@ class Multiple extends react.Component{
       contentEditable={editable}>{value||placeholder}</div>
       <div className={this.getListClass()} contentEditable="false">
         <SlideItem 
-          show={show} 
-          left={boxLeft} 
-          top={boxTop} 
+          show={show}
           data={data} 
           seleData={seleData} 
           seleId={seleId} 

+ 2 - 26
src/components/NumberDrop/index.jsx

@@ -2,8 +2,6 @@ import React,{Component} from 'react';
 import className from 'classnames';
 import {NumberPan,Notify} from '@commonComp';
 import style from './index.less';
-import $ from "jquery";
-import {getPageCoordinate} from '@utils/tools.js';
 /***
  * author:zn@2018-11-19
  * 接收参数:
@@ -23,10 +21,6 @@ class NumberDrop extends Component{
       sltTimer:null,
       blurTimer:null,
       hasSelect:false,       //是否点过下拉键盘
-      boxLeft:0,
-      boxTop:0,
-      tmpTop:0,
-      tmpScroll:0,
       placeholder:props.placeholder
     };
     this.$span = React.createRef();
@@ -108,18 +102,6 @@ class NumberDrop extends Component{
         hasSelect:false
       });
       handleShow&&handleShow({ikey,id:patId||id});
-      this.setState({
-        boxLeft:getPageCoordinate(e).boxLeft,
-        boxTop:getPageCoordinate(e).boxTop,
-        tmpScroll: $("#addScrollEvent")[0].scrollTop,
-        tmpTop:getPageCoordinate(e).boxTop
-      });
-      $("#addScrollEvent").scroll(()=>{
-        let scrollYs = $("#addScrollEvent")[0].scrollTop;
-        this.setState({
-          boxTop:this.state.tmpTop - scrollYs + this.state.tmpScroll
-        })
-      })
     }
     e.stopPropagation();
   }
@@ -215,7 +197,7 @@ class NumberDrop extends Component{
   }
   render(){
     const {prefix,suffix,show,value,handleHide,allClick} = this.props;
-    const {placeholder,hasSelect,boxTop,boxLeft} = this.state;
+    const {placeholder,hasSelect} = this.state;
     return <div className={this.getClasses()}
                 style={{position:'relative'}}
                 onClick={allClick?this.handleNumClick:null}>
@@ -231,16 +213,10 @@ class NumberDrop extends Component{
             className={this.getSpanClass()}
             >&nbsp;{value||placeholder}</span>
       <span>{suffix}</span>
-      {/*<div style={{width:'500px',
-        height:'200px',
-        background:'#ccc',
-        position:'absolute',top:'0',zIndex:'300'}}>sss</div>*/}
       <NumberPan handleSelect={this.select.bind(this)}
                  onClose={handleHide}
                  show={show}
-                 toClear={!hasSelect}
-                 left={boxLeft}
-                 top={boxTop}/>
+                 toClear={!hasSelect}/>
     </div>
   }
 }

+ 2 - 18
src/components/NumberUnitDrop/index.jsx

@@ -3,7 +3,7 @@ import className from 'classnames';
 import {NumberUnitPan} from '@commonComp';
 import style from './index.less';
 import config from '@config/index.js';
-import {filterArr,handleEnter,isIE,getPageCoordinate,filterDataArr} from '@utils/tools.js';
+import {filterArr,handleEnter,isIE,filterDataArr} from '@utils/tools.js';
 import {Notify} from '@commonComp';
 import $ from 'jquery';
 /***
@@ -27,10 +27,6 @@ class NumberUnitDrop extends Component{
       value:props.value,
       // placeholderFlag:false,
       labelVal:'',
-      boxLeft:0,
-      boxTop:0,
-      tmpTop:0,
-      tmpScroll:0
     };
     this.$span = React.createRef();
     this.$pre = React.createRef();
@@ -71,17 +67,7 @@ class NumberUnitDrop extends Component{
     },300);
     this.setState({
       timer,
-      boxLeft:getPageCoordinate(e).boxLeft,
-      boxTop:getPageCoordinate(e).boxTop,
-      tmpScroll: $("#addScrollEvent")[0].scrollTop,
-      tmpTop:getPageCoordinate(e).boxTop
     });
-    $("#addScrollEvent").scroll(()=>{
-      let scrollYs = $("#addScrollEvent")[0].scrollTop;
-      this.setState({
-        boxTop:this.state.tmpTop - scrollYs + this.state.tmpScroll
-      })
-    })
     handleHide&&handleHide();
   }
   //数字框失焦,保存值到store中
@@ -186,7 +172,7 @@ class NumberUnitDrop extends Component{
 
   render(){
     const {placeholder,prefix,suffix,show,value,handleHide,hideTag} = this.props;
-    const {editable,hasSelect,boxLeft,boxTop} = this.state;
+    const {editable,hasSelect} = this.state;
     return <div className={this.getClasses()}
                 ref={this.$cont}
                 onClick={this.handleNumClick}
@@ -202,8 +188,6 @@ class NumberUnitDrop extends Component{
       <span ref = {this.$suf}>{suffix?' '+suffix:suffix}</span>
       <NumberUnitPan handleSelect={(obj)=>this.select(obj)}
                  onClose={handleHide}
-                 top={boxTop}
-                 left={boxLeft}
                  show={show} toClear={!hasSelect} value={value}/>
     </div>
   }

+ 3 - 33
src/components/OtherHistory/index.jsx

@@ -11,19 +11,12 @@ class OtherHistory extends Component{
     this.state = {
       boxMark:'3',
       editable:true,
-      boxLeft:0,
-      boxTop:0,
-      tmpScroll:0,
-      tmpTop:0
     };
     this.handleClick = this.handleClick.bind(this);
     this.handleSearchSelect = this.handleSearchSelect.bind(this);
     this.getData = this.getData.bind(this);
   }
-  
-  componentWillReceiveProps(nextProps){
-    this.setState({boxLeft:nextProps.boxLeft})
-  }
+
   handleSearchSelect(obj){
     const {questionId,name} = obj;
     const {fetchModules,focusTextIndex,span,searchInEnd} = this.props;
@@ -48,34 +41,11 @@ class OtherHistory extends Component{
   }
   handleClick(e){//让搜索框跟随鼠标点击移动
     //e.stopPropagation();
-    const {getSearchLocation} = this.props;
     //若使用e.target,因为是onClick事件中,值可能是itembox的而不是span因此会有bug
     this.getData();
-    let leftL=0;      //用焦点元素的左边距替换鼠标点击的左边距,高度还是鼠标点击的位置
-    if(isIE()){
-      leftL = getPageCoordinate(e).boxLeft
-    }else{
-      const ele = document.activeElement;
-      if(ele.toString().indexOf('HTMLSpanElement') != -1){     //点击的不是span无法聚焦就不再设置位置
-        leftL = ele.offsetLeft+90
-      }
-    }
-    getSearchLocation(getPageCoordinate(e).boxTop,leftL)
-    this.setState({
-      // boxLeft:getPageCoordinate(e).boxLeft,
-      // boxLeft:leftL,
-      // boxTop:getPageCoordinate(e).boxTop,
-      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])
   }
   render(){
-    const {hasMain,searchData,totalHide,isRead,type,fetchPushInfos,handleInput,saveText,boxTop,boxLeft} = this.props;
+    const {hasMain,searchData,totalHide,isRead,type,fetchPushInfos,handleInput,saveText} = this.props;
     if(+type===1){      //文本模式
       return <Textarea title='其他史' boxMark='3'
                        isRead={isRead}
@@ -88,7 +58,7 @@ class OtherHistory extends Component{
     return  <div>
       <ItemBox title='其他史' isRead={isRead} handleClick={this.handleClick}>
         {this.getLabels()}
-        {searchData && searchData.length>0?<SearchDrop data={searchData} show={!totalHide} left={boxLeft} top={boxTop} onSelect={this.handleSearchSelect}></SearchDrop>:''}
+        {searchData && searchData.length>0?<SearchDrop data={searchData} show={true} onSelect={this.handleSearchSelect}></SearchDrop>:''}
       </ItemBox>
     </div>
   }

+ 4 - 21
src/components/RadioDrop/index.jsx

@@ -1,5 +1,5 @@
 import React,{Component} from 'react';
-import {handleEnter,getPageCoordinate,windowEventHandler} from '@utils/tools.js';
+import {handleEnter,windowEventHandler} from '@utils/tools.js';
 import {DropList} from '@commonComp';
 import classNames from 'classnames';
 import style from "./index.less";
@@ -24,10 +24,6 @@ class RadioDrop extends Component{
     this.state={
       editable:false,
       timer:null,
-      boxLeft:0,
-      boxTop:0,
-      tmpScroll:0,
-      tmpTop:0,
     };
     this.$cont = React.createRef();
     this.isIE = navigator.appName=="Microsoft Internet Explorer" && navigator.appVersion.split(";")[1].replace(/[ ]/g,"")=="MSIE8.0";
@@ -88,17 +84,7 @@ class RadioDrop extends Component{
     
     this.setState({
       timer,
-      boxLeft:getPageCoordinate(e).boxLeft,
-      boxTop:getPageCoordinate(e).boxTop,
-      tmpScroll: $("#addScrollEvent")[0].scrollTop,
-      tmpTop:getPageCoordinate(e).boxTop
     });
-    windowEventHandler('scroll',()=>{      //弹窗跟随滚动条滚动或者关闭弹窗
-      let scrollYs = $("#addScrollEvent")[0].scrollTop;
-      this.setState({
-        boxTop:this.state.tmpTop - scrollYs + this.state.tmpScroll
-      })
-    },$("#addScrollEvent")[0])
   }
   componentDidMount(){    //默认值选中
     const {data,ikey,handleSelect,hideTag,mainSaveText,value,boxMark} = this.props;
@@ -145,21 +131,18 @@ class RadioDrop extends Component{
     handleDbclick&&handleDbclick({id:patId||id});
   }
   render(){
-    const {data,prefix,suffix,placeholder,show,value,hideTag,boxMark} = this.props;
-    const {boxLeft,boxTop} = this.state;
+    const {data,placeholder,show,value,hideTag,boxMark} = this.props;
     return <div className={style['container']} ref = {this.$cont}>
-      {prefix}
       <div className={this.getClass()}
            onBlur={this.handleEditLabel}
            contentEditable={this.state.editable}
            onDoubleClick={hideTag?null:this.handledbClick}
            onFocus={(e)=>{e.stopPropagation()}}
            onClick={(e)=>this.handleShow(e,true)}
-           onkeydown={handleEnter}>
+           onKeyDown={handleEnter}>
         {value||placeholder}
       </div>
-      {suffix}
-      <DropList onSelect={this.handleSelect} boxMark={boxMark} data={data} left={boxLeft} top={boxTop} show={show} hideTag={hideTag}/>
+      <DropList onSelect={this.handleSelect} boxMark={boxMark} data={data} show={show} hideTag={hideTag}/>
     </div>
   }
 }

+ 2 - 23
src/components/RadioInpDrop/index.jsx

@@ -1,5 +1,5 @@
 import React,{Component} from 'react';
-import {handleEnter,getPageCoordinate,windowEventHandler,filterDataArr,getLabelIndex} from '@utils/tools.js';
+import {handleEnter,windowEventHandler,filterDataArr,getLabelIndex} from '@utils/tools.js';
 import {DropList,Notify} from '@commonComp';
 import config from '@config/index';
 import style from "./index.less";
@@ -22,10 +22,6 @@ class RadioInpDrop extends Component{
     this.state={
       editable:false,
       timer:null,
-      boxLeft:0,
-      boxTop:0,
-      tmpScroll:0,
-      tmpTop:0,
       texts:props.vals||{0:props.value||props.placeholder},
       over:false
     };
@@ -92,10 +88,6 @@ class RadioInpDrop extends Component{
     
     this.setState({
       timer,
-      boxLeft:getPageCoordinate(e).boxLeft,
-      boxTop:getPageCoordinate(e).boxTop,
-      tmpScroll: $("#addScrollEvent")[0].scrollTop,
-      tmpTop:getPageCoordinate(e).boxTop
     });
     windowEventHandler('scroll',()=>{      //弹窗跟随滚动条滚动或者关闭弹窗
       let scrollYs = $("#addScrollEvent")[0].scrollTop;
@@ -190,23 +182,10 @@ class RadioInpDrop extends Component{
         list.push(<span>&nbsp;{temp}</span>);
       }
     }
-    /*if(value&&value.indexOf(config.radioOptionPer)!=-1){
-      let arr = [],inpIndex='';
-      let list = value.split(config.radioOptionPer);
-      list.map((it,i)=>{
-        arr.push(<InputComp value={it}></InputComp>);
-        inpIndex = (i+1)*2-1;
-        if(i!=list.length-1){
-          arr.push(<InputComp handleInp={this.handleInnerInp} editable={true} index={inpIndex}></InputComp>);
-        }
-      });
-      return arr;
-    }*/
     return list;
   }
   render(){
     const {data,show,vals,placeholder,hideTag} = this.props;
-    const {boxLeft,boxTop} = this.state;
     return <div className={style['container']} ref = {this.$cont}>
       <div className={this.getClass()}
            onBlur={this.handleEditLabel}
@@ -216,7 +195,7 @@ class RadioInpDrop extends Component{
            onKeyDown={handleEnter}>
         {vals?this.parseInputDom():<span>{placeholder}</span>}
       </div>
-      <DropList onSelect={this.handleSelect} data={data} left={boxLeft} top={boxTop} show={show}/>
+      <DropList onSelect={this.handleSelect} data={data} show={show}/>
     </div>
   }
 }

+ 3 - 15
src/components/SearchDrop/index.jsx

@@ -1,6 +1,5 @@
 import React,{Component} from 'react';
 import classNames from 'classnames';
-import ReactDom from "react-dom";
 
 import style from "./index.less";
 /****
@@ -41,14 +40,6 @@ class SearchDrop extends Component{
     return classNames(style['list'],name,isHide);
   }
 
-  getStyle(){
-    const {left,top} = this.props;
-    return {
-      left:left?left+'px':'',
-      top:top?top+'px':''
-    }
-  }
-
   handleSelect(e,item){
     // onClick事件换成onmouseup--点击清除后谷歌下搜索结果点击不上去的情况
     e.stopPropagation();
@@ -60,7 +51,7 @@ class SearchDrop extends Component{
     const {mainEmpty} = this.props;
     let litext = '';
     if(mainEmpty){
-      return <div className={this.getClass()} contenteditable="false" id="searchBox" style={this.getStyle()}>
+      return <div className={this.getClass()} contenteditable="false" id="searchBox">
           <ul>
             {this.props.data&&this.props.data.map((it)=>{
               litext = it.showType==1?it.name:it.name+'('+it.retrievalName+')';
@@ -70,17 +61,14 @@ class SearchDrop extends Component{
         </div>
     }else{
       
-      const domNode = document.getElementById('root');
-      return ReactDom.createPortal(
-        <div className={this.getClass()} contenteditable="false" id="searchBox" style={this.getStyle()}>
+      return <div className={this.getClass()} contenteditable="false" id="searchBox">
           <ul>
             {this.props.data&&this.props.data.map((it)=>{
               litext = it.showType==1?it.name:it.name+'('+it.retrievalName+')';
               return <li onClick={(e)=>this.handleSelect(e,it)} title={litext}>{litext}</li>
             })}
           </ul>
-        </div>
-      ,domNode)
+        </div>;
     }
     
   }

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

@@ -4,7 +4,6 @@
   overflow-y: auto;
   overflow-x: hidden;
   .pop;
-  left: 85px;
   padding: 0 0 10px;
   li{
     width: 200px;

+ 7 - 42
src/components/SpreadDrop/index.jsx

@@ -2,9 +2,8 @@ import React,{Component} from 'react';
 import classNames from 'classnames';
 import config from '@config/index.js';
 import style from './index.less';
-import {deepClone,filterArr,handleEnter,isIE,getPageCoordinate,windowEventHandler,filterDataArr,getIds} from '@utils/tools.js';
+import {deepClone,filterArr,handleEnter,isIE,windowEventHandler,filterDataArr,getIds} from '@utils/tools.js';
 import {Notify} from '@commonComp';
-import ReactDom from "react-dom";
 import $ from 'jquery';
 /****
  * 标签组合下拉,选中的项目展开
@@ -45,10 +44,6 @@ class SpreadDrop extends Component{
       ban:{},  //放'伴'字段
       editable:false,      //双击编辑
       labelVal:'',  //存放标签原有的值--主诉字数限制用
-      boxLeft:0,
-      boxTop:0,
-      tmpScroll:0,
-      tmpTop:0,
     };
     this.$div = React.createRef();
     this.handleSelect = this.handleSelect.bind(this);
@@ -66,37 +61,12 @@ class SpreadDrop extends Component{
   handleShow(e){//单击
     e&&e.stopPropagation();
     const {ikey,handleShow,placeholder,flag,id,value,tagType,type,data,windowWidth} = this.props;
-    // let boxLeft = e.pageX -175 + 'px';
-    // let offsetTop = e.target.offsetTop;
-    // const ht = e.target.offsetHeight;   //如杂音选中文字有多行时,写死会遮挡
-    // let boxTop = offsetTop + ht +2 + 'px';
-    // this.setState({
-    //   boxLeft:boxLeft,
-    //   boxTop:boxTop
-    // })
-    let num = 0,leftLen;//判断为五类切超出页面
+    let num = 0;//判断为五类切超出页面
     data && data.map((item)=>{
       if(item.formPosition != 1){
         ++num
       }
-    })
-    if(num >= 5 && windowWidth-getPageCoordinate(e).boxLeft < 760){
-      leftLen = windowWidth-780
-    }else{
-      leftLen = getPageCoordinate(e).boxLeft
-    }
-    this.setState({
-      boxLeft:leftLen,
-      boxTop:getPageCoordinate(e).boxTop,
-      tmpScroll: $("#addScrollEvent")[0].scrollTop,
-      tmpTop:getPageCoordinate(e).boxTop
     });
-    windowEventHandler('scroll',()=>{      //弹窗跟随滚动条滚动或者关闭弹窗
-      let scrollYs = $("#addScrollEvent")[0].scrollTop;
-      this.setState({
-        boxTop:this.state.tmpTop - scrollYs + this.state.tmpScroll
-      })
-    },$("#addScrollEvent")[0])
     // window.event? window.event.cancelBubble = true : e.stopPropagation();
      this.setStateInit();      //恢复初始选中状态
     const that = this;
@@ -366,7 +336,7 @@ class SpreadDrop extends Component{
 
   render(){
     const {placeholder,value,show,data,order} = this.props;
-    const {editable,boxLeft,boxTop} = this.state;
+    const {editable} = this.state;
     return  <div className={style['container']}
               onFocus={(e)=>e.stopPropagation()}
               onBlur={(e)=>e.stopPropagation()}
@@ -381,8 +351,8 @@ class SpreadDrop extends Component{
         onInput={this.onChange}
         onkeydown={handleEnter}
         >{value||placeholder}</div>
-          <ListItems data={data} left={boxLeft} order={order}
-            top={boxTop} show={show} handleSelect={this.handleSelect} handleConfirm={this.handleConfirm} handleClear={this.handleClear} {...this.state}></ListItems>
+          <ListItems data={data} order={order}
+             show={show} handleSelect={this.handleSelect} handleConfirm={this.handleConfirm} handleClear={this.handleClear} {...this.state}></ListItems>
       </div>
   }
 }
@@ -418,18 +388,14 @@ class ListItems extends Component{
     return list;
   }
   getStyle(){
-    const {left,top,show} = this.props;
+    const {show} = this.props;
     return {
-      left:left?left+'px':'',
-      top:top?top+'px':'',
       display:show?'block':'none'
     }
   }
   render (){
     const {handleClear,handleConfirm,order} = this.props;
-    const domNode = document.getElementById('root');
-    return ReactDom.createPortal(
-      <div className={style["drop-list"]} style={this.getStyle()} contentEditable="false" onClick={(e)=>{e.stopPropagation();}}>
+    return <div className={style["drop-list"]} style={this.getStyle()} contentEditable="false" onClick={(e)=>{e.stopPropagation();}}>
         <p className={style['orderTips']}>按{order?'从左到右从上到下':'点击'}顺序成文</p>
         {this.getLabels()}
         <div className="oper">
@@ -437,7 +403,6 @@ class ListItems extends Component{
           <span className={style['confirm']} onClick={handleConfirm}>确定</span>
         </div>
       </div>
-    ,domNode)
   }
 }
 

+ 2 - 2
src/containers/OtherHistory.js

@@ -82,14 +82,14 @@ function mapDispatchToProps(dispatch,store){
         bool:bool
       })
     },
-    getSearchLocation(top,left){
+    /*getSearchLocation(top,left){
       dispatch({
         type:SEARCH_DROP_LOCATION,
         top:top,
         left:left,
         dis:0
       })
-    }
+    }*/
   }
 }
 

+ 0 - 2
src/containers/eleType.js

@@ -29,8 +29,6 @@ export function singleRadio(params){
       const custom= JSON.parse(localStorage.getItem('radio'+data.id));
       const list = data.questionDetailList&&data.questionDetailList.length>0?data.questionDetailList:data.questionMapping;
       return <RadioDrop data={custom&&custom.length?[...custom,...list]:list}
-                        prefix={data.labelPrefix}
-                        suffix={data.labelSuffix}
                         placeholder={data.name}
                         show={showArr&&showArr[showInx]}
                         value = {data.value}