|
@@ -50,7 +50,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} = this.props;
|
|
- const {labelVal,oldText,searchPre} = this.state;
|
|
|
|
|
|
+ const {labelVal,searchPre} = this.state;
|
|
const text1 =e.target.innerText;
|
|
const text1 =e.target.innerText;
|
|
let mainText = filterArr(mainSaveText);//主诉字数
|
|
let mainText = filterArr(mainSaveText);//主诉字数
|
|
if(+boxMark==1){
|
|
if(+boxMark==1){
|
|
@@ -83,14 +83,14 @@ class EditableSpan extends Component{
|
|
let temp = '';
|
|
let temp = '';
|
|
let search='';
|
|
let search='';
|
|
clearTimeout(that.state.timer);
|
|
clearTimeout(that.state.timer);
|
|
- // temp = newText.replace(oldText.replace(/(^\s*)|(\s*$)/g,''),'');
|
|
|
|
temp = newText.replace(searchPre.replace(/(^\s*)|(\s*$)|(^\,*)|(\,*$)/g,''),'');
|
|
temp = newText.replace(searchPre.replace(/(^\s*)|(\s*$)|(^\,*)|(\,*$)/g,''),'');
|
|
search = temp.replace(/(^\s*)|(\s*$)|(^\,*)|(\,*$)/g,'');
|
|
search = temp.replace(/(^\s*)|(\s*$)|(^\,*)|(\,*$)/g,'');
|
|
- // console.log(111,labelVal,searchPre,333,newText,444,search);
|
|
|
|
|
|
+ //console.log(labelVal,'旧:',searchPre,'新:',newText,'搜索:',search);
|
|
handleSearch&&handleSearch({text:search,boxMark,mainIds});
|
|
handleSearch&&handleSearch({text:search,boxMark,mainIds});
|
|
- /*that.setState({
|
|
|
|
- oldText:newText.replace(search,'')
|
|
|
|
- })*/
|
|
|
|
|
|
+ //搜索后保持现在的值,继续输入时要用于对比
|
|
|
|
+ that.setState({
|
|
|
|
+ searchPre:newText
|
|
|
|
+ });
|
|
},config.delayTime);
|
|
},config.delayTime);
|
|
this.setState({
|
|
this.setState({
|
|
timer
|
|
timer
|