浏览代码

Merge remote-tracking branch 'origin/pro_zn' into dev5.3.1

zhouna 5 年之前
父节点
当前提交
db56d55262

+ 12 - 2
src/common/components/ItemBox/index.jsx

@@ -48,7 +48,15 @@ class ItemBox extends Component {
       },this);
     }
   }
-
+componentWillReceiveProps(nextP){
+    if(nextP.children.length>1){
+      const that = this;
+      //数据渲染后更新滚动条
+      setTimeout(function(){
+        that.context.scrollArea.refresh();
+      });
+    }
+}
   render(){
     const {title,children,editable,className,handleFocus,onchange,fuzhen,border,handleBlur,titleTop,backgroundColor,boxId} = this.props;
     return <div className={style["box"]+" "+"clearfix"} >
@@ -59,5 +67,7 @@ class ItemBox extends Component {
     </div>
   }
 }
-
+ItemBox.contextTypes = {
+  scrollArea: React.PropTypes.object
+};
 export default ItemBox;

+ 3 - 0
src/common/components/Textarea/index.jsx

@@ -106,6 +106,9 @@ class Textarea extends Component {
     const isRead = this.props.isRead;
     if(next.isRead != isRead||(next.value!=this.props.value&&next.value&&next.value.indexOf("复诊")!=-1)){    //value对比解决复诊不显示bug,复诊对比解决关标跳到前面bug
       this.$dom.current.innerText?(this.$dom.current.innerText = next.value||''):(this.$dom.current.innerHTML = next.value||'');
+      this.setState({
+        inpText:''
+      });
     }
   }
   componentDidMount(){

+ 3 - 3
src/components/Banner/index.jsx

@@ -41,12 +41,12 @@ class Banner extends Component {
   }
 
   confirmType(){
-    const {typeConfig,confirmType,clearCommS,closeConfigModal} = this.props;
+    const {typeConfig,confirmType,clearCommS,closeConfigModal,readMode} = this.props;
     const mode = this.state.mode;
     // 清空主诉常见症状
     clearCommS();
-    if(mode==typeConfig){
-      closeConfigModal()
+    if(mode==typeConfig&&typeConfig==readMode){
+      closeConfigModal();
       return;
     }
     confirmType&&confirmType(mode);

+ 6 - 6
src/components/CurrentIll/index.jsx

@@ -114,16 +114,16 @@ class CurrentIll extends Component{
       }
     } 
   }
-  componentWillReceiveProps(nextProps){
+  //componentWillReceiveProps(nextProps){
     /*const contHeightDiff =  nextProps.data&&this.props.data&&nextProps.data.length!==this.props.data.length;
     const dataDiff = !!nextProps.data!==!!this.props.data;
     if(contHeightDiff||dataDiff){*/     //走慢病否,现病史消失滚动才出现bug修改
-    if(this.props.data&&this.props.data.length>0){
+   /* if(this.props.data&&this.props.data.length>0){
       return ;
     }
-      this.context.scrollArea.refresh();
+      this.context.scrollArea.refresh();*/
     //}
-  }
+  //}
   render(){
     const {hasMain,readMode,fuzhen,isChronic,type,fetchPushInfos,handleInput,isRead,saveText,searchData,totalHide,editClear,data} = this.props;
     const {forbidInput,boxLeft,boxTop} = this.state;
@@ -153,7 +153,7 @@ class CurrentIll extends Component{
   }
 }
 
-CurrentIll.contextTypes = {
+/*CurrentIll.contextTypes = {
   scrollArea: React.PropTypes.object
-};
+};*/
 export default CurrentIll;

+ 5 - 2
src/components/DiagnosticItem/index.jsx

@@ -72,7 +72,8 @@ class DiagnosticItem extends Component{
          addDiagnostic&&addDiagnostic(item);
          clearInput&&clearInput();
          hideSearch&&hideSearch();
-         document.getElementById("diagnosisResult").scrollIntoView(true)
+        this.context.scrollArea.refresh();
+         //document.getElementById("diagnosisResult").scrollIntoView(true)
     }
     handleMouseEnterDrug() {
         this.setState({
@@ -121,5 +122,7 @@ class DiagnosticItem extends Component{
                 </span>)
     }
 }
-
+DiagnosticItem.contextTypes = {
+  scrollArea: React.PropTypes.object
+};
 export default DiagnosticItem;

+ 4 - 1
src/components/Operation/index.jsx

@@ -284,7 +284,10 @@ class Operation extends Component {
       const chronicFlag = chronicMagItem || chronicDesease?true:false;
       clear(chronicFlag);
       //更新滚动条
-      this.context.scrollArea.refresh();
+      const that = this;
+      setTimeout(function(){
+        that.context.scrollArea.refresh();
+      });
     } else if (type == 3) {
       if (this.state.title.trim() == '') {
         Notify.error('请输入模板名称')

+ 1 - 0
src/containers/TypeConfigContainer.js

@@ -27,6 +27,7 @@ function mapStateToProps(state) {
     hasMain:ifHasData(main.data,main.saveText),
     hasCurrent:ifHasData(current.data,current.saveText),
     hasOther:ifHasData(other.data,other.saveText),
+    readMode:typeConfig.readMode,       //回读模式
   };
 }