فهرست منبع

加收起展开按钮

zhouna 6 سال پیش
والد
کامیت
b926b8c33a

+ 18 - 8
src/components/ChronicInfo/index.jsx

@@ -7,13 +7,15 @@ import allTableIcon from '@common/images/all-table.png';
 import add from '@common/images/add-result.png';
 import added from '@common/images/first.png';
 import checkIcon from '@common/images/check.png';
+import up from '@common/images/slide-up.png';
+import down from '@common/images/slide-down.png';
 import {ComplexModal,ConfirmModal,MiniToast, Radio,CheckBtn,Footer,Notify} from '@commonComp';
 import infoShow from '@common/images/info-show.png';
 import infoMove from '@common/images/info-move.png';
 import ScaleTable from '@containers/ScaleTable';
 import {deepClone} from '@utils/tools';
-import className from 'classnames';
 import $ from 'jquery';
+import config from '@config/index';
 
 /***
 慢病右侧推送模块规则:
@@ -59,6 +61,7 @@ class ChronicInfo extends React.Component{
     this.handleForRadio = this.handleForRadio.bind(this);
     this.handleSaveCalcu = this.handleSaveCalcu.bind(this);     //保存评估修改的计算和可能结果
     this.getAddBtnState = this.getAddBtnState.bind(this);
+    this.slideToggle = this.slideToggle.bind(this);
   }
 
   onPrint() {
@@ -486,18 +489,22 @@ class ChronicInfo extends React.Component{
     }
     if(next.slideUp!=this.props.slideUp){
       if(next.slideUp){
-        $(this.$content.current).slideUp(1000);
+        $(this.$content.current).slideUp(config.slideTime);
       }else{
-        $(this.$content.current).slideDown(1000);
+        $(this.$content.current).slideDown(config.slideTime);
       }
     }
   }
+  slideToggle(){
+    const {toggleSlide,slideUp} = this.props;
+    toggleSlide&&toggleSlide(!slideUp);
+  }
   render(){
     const scaleFooter = <Footer print={true}
                                 footText="确定"
                                 handlePrint={this.onPrint}
                                 handleConfirm={this.closeTable}/>;
-    const {chronicMagItem,tableList,chronicDesease,formulaResult,showHide} = this.props;
+    const {chronicMagItem,tableList,chronicDesease,formulaResult,showHide,slideUp} = this.props;
     return <div className={style["tips"]} style={{marginBottom:'15px'}}>
               <div className={`${style["tips-title"]} ${style["chronic"]}`}>
                 <div className={style["tips-name"]}>
@@ -505,15 +512,18 @@ class ChronicInfo extends React.Component{
                   <h2>{chronicMagItem&&chronicMagItem.name||chronicDesease&&chronicDesease.name||'病情提示'}</h2>
                   <span className={style["redTips"]}>(页面信息有更新可能影响评估结果)</span>
                 </div>
-                <div className={style["tips-btn"]} style={{display:chronicMagItem&&chronicMagItem.name||chronicDesease&&chronicDesease.name?'block':'none'}}>
+                <div className={style['toggle-btn']}>
+                  <img src={slideUp?down:up} alt="展开/收起" onClick={this.slideToggle}/>
+                </div>
+                {/*<div className={style["tips-btn"]} style={{display:chronicMagItem&&chronicMagItem.name||chronicDesease&&chronicDesease.name?'block':'none'}}>
                   <span className={style["tipsDetails"]} onClick={() => this.showTableList(chronicDesease&&chronicDesease.name||chronicMagItem&&chronicMagItem.name)}>量表
                   </span>
-                </div>
+                </div>*/}
               </div>
               <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}>
+              {/*<ConfirmModal visible={showHide&&showHide.showList} noFooter='true' title='全部量表' close={this.close} titleBg="#DFEAFE" icon={allTableIcon} height={450} width={450}>
                       <ul className={style['toast-cont']}>
                         {tableList&&tableList.map((v,i)=>{
                           return <li>
@@ -527,7 +537,7 @@ class ChronicInfo extends React.Component{
                           </li>
                         })}
                       </ul>
-              </ConfirmModal>
+              </ConfirmModal>*/}
               {showHide&&showHide.showTable?<ComplexModal onclose={this.closeTable} footer={scaleFooter}
                       title={showHide.name}
                       icon={tableIcon}

+ 10 - 5
src/components/ChronicInfo/index.less

@@ -9,14 +9,14 @@
     background: #EAF7FA;
     font-weight: bold;
     background: rgba(242,150,91,0.1);
-    img {
-      float:left;
-      margin-top: 0px;
-      margin-right: 5px;
-    }
     .tips-name{
       width: 238px;
       display: inline-block;
+      img {
+        float:left;
+        margin-top: 0px;
+        margin-right: 5px;
+      }
     }
     h2{
       display: inline-block;
@@ -46,6 +46,11 @@
       margin: 0 0 -2px 10px;
       }
     }
+    .toggle-btn{
+      display: inline-block;
+      float: right;
+      cursor: pointer;
+    }
     .content{
       font-size: 14px;
       padding:6px 15px;

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

@@ -26,7 +26,10 @@ class PushContainer extends Component {
             },
             {
                 title: '医学知识',
-            }
+            },
+              /*{
+                title: '全部量表',
+              }*/
             ],
             visible:false,
             message:'',                 //提示的内容

+ 1 - 0
src/config/index.js

@@ -33,4 +33,5 @@ export default {
     showCheckNum:16,        //查体默认展开非自由文本标签的个数
     radioOptionPer:'()',     //单选项输入占位符
     textReg:new RegExp("([\u4E00-\uFA29]|[\uE7C7-\uE7F3]|[a-zA-Z0-9])"), //包含中英文或数字
+    slideTime:400,      //右侧指标推送展开/收起动画时间
 };

+ 7 - 1
src/containers/ChronicInfo.js

@@ -1,6 +1,6 @@
 import {connect} from 'react-redux';
 import ChronicInfo from '../components/ChronicInfo';
-import {SHOW_TABLE_LIST,HIDE_TABLE_LIST, SET_CHRONIC_PUSHS} from '@store/types/pushMessage';
+import {SHOW_TABLE_LIST,HIDE_TABLE_LIST, SET_CHRONIC_PUSHS,TOGGLE_CHRONIC_INFO} from '@store/types/pushMessage';
 import {getTableList,getScaleInfo,getConceptDetail} from '../store/async-actions/pushMessage';
 import {ADD_ASSESS_ITEMS,SET_SAVE_ASSESS_DATA,SET_CHRONIC_CALCU_RESULT,ADD_WHOLE_SCALE_ITEMS,SET_CALCU_VALUES} from "@types/assessResult";
 import {saveMessage} from "../store/async-actions/print";
@@ -34,6 +34,12 @@ function mapStateToProps(state){
 
 function mapDispatchToProps(dispatch){
   return {
+    toggleSlide(flag){
+      dispatch({
+        type:TOGGLE_CHRONIC_INFO,
+        flag
+      });
+    },
     getTableList(name){
       dispatch(getTableList(name))
       // dispatch({type:SHOW_TABLE_LIST})