|
@@ -2,7 +2,7 @@ import React,{Component} from 'react';
|
|
|
import classNames from 'classnames';
|
|
|
import config from '@config/index.js';
|
|
|
import style from './index.less';
|
|
|
-import {setPosition,deepClone,handleEnter,isIE,windowEventHandler,filterDataArr,getIds,getPageCoordinate,setFontColorSize} from '@utils/tools.js';
|
|
|
+import {setPosition,deepClone,handleEnter,isIE,windowEventHandler,filterDataArr,getIds,getPageCoordinate,setFontColorSize,handleMouseUp} from '@utils/tools.js';
|
|
|
import {Notify} from '@commonComp';
|
|
|
import ListItems from '@components/ListItems';
|
|
|
import CommonSymptom from '@components/CommonSymptom';
|
|
@@ -374,12 +374,6 @@ class SpreadDrop extends Component{
|
|
|
const showDefaulted = ((type=='2'&&curDefault)||(type=='3'&&otherDefault))&&showVal;
|
|
|
return showDefaulted;
|
|
|
}
|
|
|
- handleMouseUp(){
|
|
|
- const {select_start,i,setSelectArea,boxMark}= this.props;
|
|
|
- if(select_start!==undefined){
|
|
|
- setSelectArea({i,boxMark,dir:'end'});
|
|
|
- }
|
|
|
- }
|
|
|
handleMouseDown(){
|
|
|
const {i,setSelectArea,boxMark}= this.props;
|
|
|
setSelectArea({i,boxMark,dir:'start'});
|
|
@@ -392,7 +386,7 @@ class SpreadDrop extends Component{
|
|
|
}
|
|
|
}
|
|
|
render(){
|
|
|
- const {placeholder,value,show,data,order,type,tagType,pos,defaulted,showVal,CommonSymptoms} = this.props;
|
|
|
+ const {placeholder,value,show,data,order,type,tagType,pos,defaulted,showVal,CommonSymptoms,select_start,i,boxMark} = this.props;
|
|
|
const {tmpDom,left} = this.state;
|
|
|
let showDefaulted = this.ifDefault();
|
|
|
let showV = showDefaulted&&value===undefined?showVal:value; //未选中过值时展示默认选中
|
|
@@ -414,7 +408,7 @@ class SpreadDrop extends Component{
|
|
|
onBlur={this.handleBlur}
|
|
|
onInput={this.onChange}
|
|
|
onkeydown={handleEnter}
|
|
|
- onMouseUp={this.handleMouseUp.bind(this)}
|
|
|
+ onMouseUp={()=>handleMouseUp({select_start,i,boxMark})}
|
|
|
onMouseDown={this.handleMouseDown.bind(this)}
|
|
|
>{showV||placeholder}</div>
|
|
|
{showCommonData&&show?<CommonSymptom data={CommonSymptoms} show={true} onSelect={this.handleCommonSelect.bind(this)} isCurrent={true} />:
|