Explorar el Código

指标推送收起展开效果

zhouna hace 6 años
padre
commit
16c48a0629
Se han modificado 1 ficheros con 9 adiciones y 6 borrados
  1. 9 6
      src/components/ChronicInfo/index.jsx

+ 9 - 6
src/components/ChronicInfo/index.jsx

@@ -44,6 +44,7 @@ class ChronicInfo extends React.Component{
       currentIndex: -1 //当前index
     };
 
+    this.$content = React.createRef();
     this.showInfo = this.showInfo.bind(this);
     this.closeInfo = this.closeInfo.bind(this);
     this.showOption = this.showOption.bind(this);
@@ -477,17 +478,19 @@ class ChronicInfo extends React.Component{
                   })
     return list;
   }
-  getSlideClass(){
-    const {slideUp} = this.props;//console.log('slideUp',slideUp);
-    const cls =slideUp?className(style["content"],style["slide"]):style["content"];
-    return cls;
-  }
   componentWillReceiveProps(next){
     if(JSON.stringify(next.calcuValues)!=JSON.stringify(this.props.calcuValues)){
       this.setState({
         calcuValues:next.calcuValues
       })
     }
+    if(next.slideUp!=this.props.slideUp){
+      if(next.slideUp){
+        $(this.$content.current).slideUp(1000);
+      }else{
+        $(this.$content.current).slideDown(1000);
+      }
+    }
   }
   render(){
     const scaleFooter = <Footer print={true}
@@ -507,7 +510,7 @@ class ChronicInfo extends React.Component{
                   </span>
                 </div>
               </div>
-              <div className={this.getSlideClass()}>
+              <div className={style["content"]} ref={this.$content}>
                   {this.getDetail()}
               </div>
               <ConfirmModal visible={showHide&&showHide.showList} noFooter='true' title='全部量表' close={this.close} titleBg="#DFEAFE" icon={allTableIcon} height={450} width={450}>