|
@@ -41,6 +41,15 @@ class EditableSpan extends Component{
|
|
|
}
|
|
|
handleFocus(e){
|
|
|
e.stopPropagation();
|
|
|
+ const that = this;
|
|
|
+ let txt = '';
|
|
|
+ //黏贴时去掉html格式
|
|
|
+ $(this.$span.current).on("paste",function(e){
|
|
|
+ setTimeout(function(){
|
|
|
+ txt = that.$span.current.innerText;
|
|
|
+ that.$span.current.innerHTML = txt;
|
|
|
+ });
|
|
|
+ })
|
|
|
const {mainSaveText,full,setFocusIndex,i,boxMark,value}= this.props;
|
|
|
let mainText = filterDataArr(mainSaveText);//主诉字数
|
|
|
if(+boxMark==3||+boxMark==4){ //主诉为空,且第一次聚焦其他史查体时提示且不可输入
|
|
@@ -100,13 +109,10 @@ class EditableSpan extends Component{
|
|
|
clearTimeout(that.state.timer);
|
|
|
temp = newText.replace(searchPre,'');
|
|
|
isEnd = !(newText.indexOf(searchPre)>0);
|
|
|
- // search = temp.replace(/[(^\s*)|(\s*$)|(^\,*)|(\,*$)]/g,'');
|
|
|
search = temp.replace(config.regPreAndAft,'');
|
|
|
- // if(!search&&searchPre){
|
|
|
if(!temp&&searchPre&&newText){
|
|
|
search = searchPre;
|
|
|
}
|
|
|
- //console.log(labelVal,'旧:',searchPre,'新:',newText,'搜索:',search);
|
|
|
if(config.punctuationReg.test(search)){ //只有标点符号时不搜索
|
|
|
handleSearch&&handleSearch({text:search,isEnd,boxMark,mainIds});
|
|
|
}else{//只有标点符号时要清空搜索结果
|
|
@@ -123,16 +129,9 @@ class EditableSpan extends Component{
|
|
|
}
|
|
|
|
|
|
handleBlur(e){//为了阻止冒泡事件
|
|
|
- const {boxMark,handleClear,handleChange,i} = this.props;
|
|
|
e.stopPropagation();
|
|
|
- // 延时清空搜索结果,不延时会影响选中
|
|
|
- /*clearTimeout(this.state.clearTimer);
|
|
|
- const clearTimer = setTimeout(function(){
|
|
|
- handleClear && handleClear({boxMark})
|
|
|
- },config.delayTime);
|
|
|
- this.setState({
|
|
|
- clearTimer
|
|
|
- });*/
|
|
|
+ //解除绑定事件
|
|
|
+ $(this.$span.current).off("paste");
|
|
|
}
|
|
|
|
|
|
moveEnd(obj) {
|