|
@@ -47,18 +47,15 @@ class OtherHistory extends Component{
|
|
|
}*/
|
|
|
getData(){
|
|
|
//第一次聚焦其他史时,主诉有数据则获取最近一次其他史记录(没有的话显示初始模板),主诉无数据则显示提示;其他时间其他史模板数据不调接口
|
|
|
- const {hasMain,type,setInitData,data,saveText,changeEditClear} = this.props;
|
|
|
- const hasData = saveText.join("")||data.length>0;
|
|
|
- if(hasData){ //其他史已有数据不获取
|
|
|
- return;
|
|
|
- }
|
|
|
- if(+type===0&&!hasMain){
|
|
|
- document.activeElement.blur(); //修改第一次提示后不再提示bug
|
|
|
- Notify.error("无法操作,请先输入主诉");
|
|
|
- return;
|
|
|
- }
|
|
|
+ const {hasMain,type,setInitData,isEmpty} = this.props;
|
|
|
+
|
|
|
+ console.log(this.props)
|
|
|
+ //无主诉提示在EditableSpan里
|
|
|
//智能模式有主诉或者文本模式获取最近历史
|
|
|
- setInitData();
|
|
|
+ if((+type===0&&hasMain&&isEmpty!=false)||+type===1){
|
|
|
+ setInitData();
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
handleClick(e){//让搜索框跟随鼠标点击移动
|
|
|
//e.stopPropagation();
|
|
@@ -66,7 +63,7 @@ class OtherHistory extends Component{
|
|
|
//fetchPushInfos&&fetchPushInfos();
|
|
|
//若使用e.target,因为是onClick事件中,值可能是itembox的而不是span因此会有bug
|
|
|
const ele = document.activeElement;
|
|
|
-
|
|
|
+ this.getData();
|
|
|
if(ele.toString().indexOf('HTMLSpanElement') == -1){ //点击的不是span无法聚焦就不再设置位置
|
|
|
return;
|
|
|
}
|
|
@@ -85,16 +82,6 @@ class OtherHistory extends Component{
|
|
|
})
|
|
|
},$("#addScrollEvent")[0])
|
|
|
}
|
|
|
- /*componentWillReceiveProps(next){
|
|
|
- const isRead = this.props;
|
|
|
- this.setState({
|
|
|
- isRead:next.isRead !== isRead
|
|
|
- });
|
|
|
- }
|
|
|
- componentDidMount(){
|
|
|
- const {setInitData} = this.props;
|
|
|
- setInitData&&setInitData();
|
|
|
- }*/
|
|
|
render(){
|
|
|
const {data,hasMain,searchData,totalHide,showArr,focusTextIndex,isRead,type,fetchPushInfos,handleInput,saveText,editClear} = this.props;
|
|
|
const {boxTop,boxLeft,boxMark} = this.state;
|
|
@@ -110,7 +97,7 @@ class OtherHistory extends Component{
|
|
|
hasMain={hasMain}/>;
|
|
|
}
|
|
|
return <div>
|
|
|
- <ItemBox title='其他史' editable={hasData?false:true} isRead={isRead} handleClick={this.handleClick} handleFocus={this.getData}>
|
|
|
+ <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>:''}
|
|
|
</ItemBox>
|