浏览代码

Merge remote-tracking branch 'origin/optimize' into optimize

zhouna 6 年之前
父节点
当前提交
2211364473

+ 4 - 3
src/components/Advice/Textarea/index.jsx

@@ -18,7 +18,7 @@ class Textarea extends Component {
   handleInput(e){
     e.stopPropagation();
     const {handleChangeAssistValue,idx,handlePush} = this.props;
-    const text = e.target.innerText || e.target.innerHTML;
+    const text =  e.target.innerHTML;
     const stimer = this.state.timer;
     handleChangeAssistValue&&handleChangeAssistValue(text);
    
@@ -36,7 +36,7 @@ class Textarea extends Component {
     //   // this.$dom.current.innerText?(this.$dom.current.innerText = next.value||''):(this.$dom.current.innerHTML = next.value||'');
     // }
     if(next.isRead != isRead && next.value || next.isRead != isRead && next.value!=this.props.value){      //value对比解决复诊不显示bug
-      next.value ? this.$dom.current.innerText = next.value :  this.$dom.current.innerText = '' 
+      next.value ? this.$dom.current.innerHTML = next.value :  this.$dom.current.innerHTML = '' 
       // this.$dom.current.innerText?(this.$dom.current.innerText = next.value||''):(this.$dom.current.innerHTML = next.value||'');
     }
     if(next.typeConfig != typeConfig) {
@@ -46,7 +46,7 @@ class Textarea extends Component {
   componentDidMount(){
     const {value} = this.props;
     if(value && value.trim()){
-      this.$dom.current.innerText = value
+      this.$dom.current.innerHTML = value
       // this.$dom.current.focus()
       // this.$dom.current.innerText ? (this.$dom.current.innerText = value) : (this.$dom.current.innerHTML = value)
     //   this.$dom.current.nextSibling.innerText?(this.$dom.current.nextSibling.innerText = ''):(this.$dom.current.nextSibling.innerHTML = '')
@@ -62,6 +62,7 @@ class Textarea extends Component {
             ref={this.$dom}
             onInput={this.handleInput}
             onKeyUp={this.handleInput}
+            onkeydown={(e) => {e.stopPropagation()}}
         ></div>
       </div>
     );

+ 2 - 1
src/store/actions/pushMessage.js

@@ -73,7 +73,8 @@ function getAdviceStr(advice) {
 	if(adviceInput)  { 
 		AdviceStr = AdviceStr +'; ' + adviceInput;
 	}	
-	
+	let reg=/<[^>]+>/gim;
+	AdviceStr = AdviceStr.replace(reg,"");
 	return AdviceStr;
 }
 

+ 1 - 1
src/store/async-actions/pushMessage.js

@@ -136,7 +136,7 @@ export const getConceptDetail = (item) => {
         }
 
         json(api.getConceptDetail, params).then((res) => {
-            if(res.data.code == '0') {
+            if(res.data.code == '0'&& res.data.data.details && res.data.data.details.length > 0) {
                 if(item.position == '1') {  //右侧提示信息
                     dispatch({
                         type: SET_CLICK_DIAG,