|
@@ -3,6 +3,7 @@ import style from './index.less';
|
|
import {Button,InlineTag,ItemBox,EditableSpan,Notify} from '@commonComp';
|
|
import {Button,InlineTag,ItemBox,EditableSpan,Notify} from '@commonComp';
|
|
import chooseType from '@containers/eleType.js';
|
|
import chooseType from '@containers/eleType.js';
|
|
import SearchDrop from '@components/SearchDrop';
|
|
import SearchDrop from '@components/SearchDrop';
|
|
|
|
+import {getPageCoordinate} from '@utils/tools';
|
|
|
|
|
|
class CheckBody extends Component{
|
|
class CheckBody extends Component{
|
|
constructor(props){
|
|
constructor(props){
|
|
@@ -17,17 +18,16 @@ class CheckBody extends Component{
|
|
this.getData = this.getData.bind(this);
|
|
this.getData = this.getData.bind(this);
|
|
//this.handleInput = this.handleInput.bind(this);
|
|
//this.handleInput = this.handleInput.bind(this);
|
|
}
|
|
}
|
|
- getLabels(){
|
|
|
|
|
|
+ getLabels(boxLeft,boxTop){
|
|
const {data,showArr,saveText,selecteds} = this.props;
|
|
const {data,showArr,saveText,selecteds} = this.props;
|
|
let arr = [],list=[];
|
|
let arr = [],list=[];
|
|
const {boxMark} = this.state;
|
|
const {boxMark} = this.state;
|
|
if(data){
|
|
if(data){
|
|
list = data;
|
|
list = data;
|
|
arr = list.map((it,i)=>{
|
|
arr = list.map((it,i)=>{
|
|
- return chooseType({item:it,boxMark,i,showArr,saveText,selecteds});
|
|
|
|
|
|
+ return chooseType({item:it,boxMark,i,showArr,saveText,selecteds,boxLeft,boxTop});
|
|
});
|
|
});
|
|
}
|
|
}
|
|
-
|
|
|
|
return arr;
|
|
return arr;
|
|
}
|
|
}
|
|
handleClick(e){//让搜索框跟随鼠标点击移动
|
|
handleClick(e){//让搜索框跟随鼠标点击移动
|
|
@@ -41,11 +41,10 @@ class CheckBody extends Component{
|
|
//若使用e.target,因为是onClick事件中,值可能是itembox的而不是span因此会有bug
|
|
//若使用e.target,因为是onClick事件中,值可能是itembox的而不是span因此会有bug
|
|
const ele = document.activeElement;
|
|
const ele = document.activeElement;
|
|
const height = ele.offsetHeight;
|
|
const height = ele.offsetHeight;
|
|
- let boxTop = (+(ele.offsetTop)+height)+'px';
|
|
|
|
- let boxLeft = ele.offsetLeft + 'px';
|
|
|
|
|
|
+
|
|
this.setState({
|
|
this.setState({
|
|
- boxLeft:boxLeft,
|
|
|
|
- boxTop:boxTop
|
|
|
|
|
|
+ boxLeft:getPageCoordinate(e).boxLeft,
|
|
|
|
+ boxTop:getPageCoordinate(e).boxTop
|
|
});
|
|
});
|
|
}
|
|
}
|
|
handleSearchSelect(obj){
|
|
handleSearchSelect(obj){
|
|
@@ -63,7 +62,7 @@ class CheckBody extends Component{
|
|
return ;
|
|
return ;
|
|
}
|
|
}
|
|
//有主诉时且本身无数据,第一次点击获取数据,(不论获取成功与否)再点击不获取(直到刷新成空白页或清空)
|
|
//有主诉时且本身无数据,第一次点击获取数据,(不论获取成功与否)再点击不获取(直到刷新成空白页或清空)
|
|
- if(hasMain&&isEmpty!=false){
|
|
|
|
|
|
+ if(hasMain&&isEmpty){
|
|
this.props.getInit();
|
|
this.props.getInit();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -72,7 +71,7 @@ class CheckBody extends Component{
|
|
const {boxLeft,boxTop,boxMark} = this.state;
|
|
const {boxLeft,boxTop,boxMark} = this.state;
|
|
return <div className={style['container']}>
|
|
return <div className={style['container']}>
|
|
<ItemBox title='查体' handleClick={this.handleClick}>
|
|
<ItemBox title='查体' handleClick={this.handleClick}>
|
|
- {this.getLabels()}
|
|
|
|
|
|
+ {this.getLabels(boxLeft,boxTop)}
|
|
{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={!totalHide} left={boxLeft} top={boxTop} onSelect={this.handleSearchSelect}></SearchDrop>:''}
|
|
</ItemBox>
|
|
</ItemBox>
|
|
</div>
|
|
</div>
|