|
@@ -49,7 +49,7 @@ class EditableSpan extends Component{
|
|
return ;
|
|
return ;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- let text = e.target.innerText;
|
|
|
|
|
|
+ let text = e.target.innerText || e.target.innerHTML;
|
|
setFocusIndex&&setFocusIndex({i,boxMark,dom:this.$span});
|
|
setFocusIndex&&setFocusIndex({i,boxMark,dom:this.$span});
|
|
this.setState({
|
|
this.setState({
|
|
labelVal:text,
|
|
labelVal:text,
|
|
@@ -61,7 +61,7 @@ class EditableSpan extends Component{
|
|
e.stopPropagation();
|
|
e.stopPropagation();
|
|
const {handleChange,boxMark,i,handleSearch,value,mainSaveText,mainIds,handleClear} = 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? e.target.innerText : e.target.innerHTML;
|
|
|
|
|
|
+ const text1 = e.target.innerText || e.target.innerHTML;
|
|
let mainText = filterDataArr(mainSaveText);//主诉字数
|
|
let mainText = filterDataArr(mainSaveText);//主诉字数
|
|
if(+boxMark==1){
|
|
if(+boxMark==1){
|
|
if(mainText.length >= config.limited){
|
|
if(mainText.length >= config.limited){
|
|
@@ -89,7 +89,7 @@ class EditableSpan extends Component{
|
|
//延迟搜索
|
|
//延迟搜索
|
|
clearTimeout(this.state.timer);
|
|
clearTimeout(this.state.timer);
|
|
const timer = setTimeout(function(){
|
|
const timer = setTimeout(function(){
|
|
- let newText = e.target.innerText;
|
|
|
|
|
|
+ let newText = e.target.innerText || e.target.innerHTML;
|
|
let temp = '',isEnd=false;
|
|
let temp = '',isEnd=false;
|
|
let search='';
|
|
let search='';
|
|
clearTimeout(that.state.timer);
|
|
clearTimeout(that.state.timer);
|
|
@@ -163,7 +163,7 @@ class EditableSpan extends Component{
|
|
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;
|
|
- let innerVal = target.innerText? target.innerText : target.innerHTML;
|
|
|
|
|
|
+ let innerVal = target.innerText || target.innerHTML;
|
|
if(ev.keyCode==8){
|
|
if(ev.keyCode==8){
|
|
// 主诉现病史去重:删除最后一个字的时候移除该数据(将name、id和value替换成空)并移除id
|
|
// 主诉现病史去重:删除最后一个字的时候移除该数据(将name、id和value替换成空)并移除id
|
|
// 前面是标签,内容为空时再删一次才移除标签;前面是文本,则直接移除;
|
|
// 前面是标签,内容为空时再删一次才移除标签;前面是文本,则直接移除;
|
|
@@ -208,15 +208,13 @@ class EditableSpan extends Component{
|
|
componentWillReceiveProps(next){
|
|
componentWillReceiveProps(next){
|
|
const isRead = this.props.isRead;
|
|
const isRead = this.props.isRead;
|
|
if(next.isRead != isRead){
|
|
if(next.isRead != isRead){
|
|
- this.$span.current.innerText = next.value||''
|
|
|
|
- // this.$span.current.innerText?(this.$span.current.innerText = next.value||''):(this.$span.current.innerHTML = next.value||'');
|
|
|
|
|
|
+ this.$span.current.innerText?(this.$span.current.innerText = next.value||''):(this.$span.current.innerHTML = next.value||'');
|
|
}
|
|
}
|
|
}
|
|
}
|
|
componentDidMount(){
|
|
componentDidMount(){
|
|
const {value} = this.props;
|
|
const {value} = this.props;
|
|
if(value){
|
|
if(value){
|
|
this.$span.current.innerText?(this.$span.current.innerText = value||''):(this.$span.current.innerHTML = value||'');
|
|
this.$span.current.innerText?(this.$span.current.innerText = value||''):(this.$span.current.innerHTML = value||'');
|
|
- // this.$span.current.innerText = value||''
|
|
|
|
}
|
|
}
|
|
if(isIE()){
|
|
if(isIE()){
|
|
$(this.$span.current).onIe8Input(function(e){
|
|
$(this.$span.current).onIe8Input(function(e){
|