|
@@ -51,7 +51,7 @@ class EditableSpan extends Component{
|
|
}
|
|
}
|
|
onChange(e){
|
|
onChange(e){
|
|
e.stopPropagation();
|
|
e.stopPropagation();
|
|
- const {handleChange,boxMark,i,handleSearch,value,mainSaveText,mainIds} = this.props;
|
|
|
|
|
|
+ const {handleChange,boxMark,i,handleSearch,value,mainSaveText,mainIds,handleClear} = this.props;
|
|
const {labelVal,searchPre} = this.state;
|
|
const {labelVal,searchPre} = this.state;
|
|
const text1 =e.target.innerText;
|
|
const text1 =e.target.innerText;
|
|
let mainText = filterDataArr(mainSaveText);//主诉字数
|
|
let mainText = filterDataArr(mainSaveText);//主诉字数
|
|
@@ -91,11 +91,13 @@ class EditableSpan extends Component{
|
|
//console.log(labelVal,'旧:',searchPre,'新:',newText,'搜索:',search);
|
|
//console.log(labelVal,'旧:',searchPre,'新:',newText,'搜索:',search);
|
|
if(config.punctuationReg.test(search)){ //只有标点符号时不搜索
|
|
if(config.punctuationReg.test(search)){ //只有标点符号时不搜索
|
|
handleSearch&&handleSearch({text:search,isEnd,boxMark,mainIds});
|
|
handleSearch&&handleSearch({text:search,isEnd,boxMark,mainIds});
|
|
|
|
+ }else{//只有标点符号时要清空搜索结果
|
|
|
|
+ handleClear && handleClear({boxMark})
|
|
}
|
|
}
|
|
//搜索后保持现在的值,继续输入时要用于对比
|
|
//搜索后保持现在的值,继续输入时要用于对比
|
|
- that.setState({
|
|
|
|
|
|
+ /*that.setState({
|
|
searchPre:newText
|
|
searchPre:newText
|
|
- });
|
|
|
|
|
|
+ });*/
|
|
},config.delayTime);
|
|
},config.delayTime);
|
|
this.setState({
|
|
this.setState({
|
|
timer
|
|
timer
|
|
@@ -149,7 +151,7 @@ class EditableSpan extends Component{
|
|
|
|
|
|
}
|
|
}
|
|
handleKeyup(e){
|
|
handleKeyup(e){
|
|
- const {boxMark,handleKeydown,i,value,removeId} = this.props;
|
|
|
|
|
|
+ const {boxMark,handleKeydown,i,value,removeId,handleClear} = this.props;
|
|
const {preVal,index} = this.state;
|
|
const {preVal,index} = this.state;
|
|
const ev = e||window.event;
|
|
const ev = e||window.event;
|
|
const target = ev.target||ev.srcElement;
|
|
const target = ev.target||ev.srcElement;
|
|
@@ -160,6 +162,7 @@ class EditableSpan extends Component{
|
|
let preObj = $(this.$span.current).prev();
|
|
let preObj = $(this.$span.current).prev();
|
|
if(index!==0&&preVal.trim().length==1){
|
|
if(index!==0&&preVal.trim().length==1){
|
|
removeId && removeId({boxMark,i:index,text:""});
|
|
removeId && removeId({boxMark,i:index,text:""});
|
|
|
|
+ handleClear && handleClear({boxMark});//删除最后一个字时清空搜索结果,避免现病史搜索框不立即消失的情况
|
|
if(preObj[0].nodeName !=="DIV"){
|
|
if(preObj[0].nodeName !=="DIV"){
|
|
this.moveEnd(preObj[0]);
|
|
this.moveEnd(preObj[0]);
|
|
}
|
|
}
|