|
@@ -1,7 +1,8 @@
|
|
|
import React, { Component } from "react";
|
|
|
import style from "./index.less";
|
|
|
import { Radio,ComplexModal} from '@commonComp';
|
|
|
-import arrow from '@common/images/icon_tri_blue.png';
|
|
|
+import arrow from '@common/images/show.png';
|
|
|
+import arrowDown from '@common/images/close.png';
|
|
|
import loadingIcon from '@common/images/loading.gif';
|
|
|
import ChooseItem from "../ChooseItem";
|
|
|
import ScaleItem from "../ScaleItem";
|
|
@@ -18,7 +19,8 @@ class AssessResultHis extends Component {
|
|
|
chartTimeTypes:{}, //图表模块
|
|
|
tableName:'',
|
|
|
tableId:'',
|
|
|
- parentIndex:0
|
|
|
+ parentIndex:0,
|
|
|
+ showAssess:false, //显示收起数据
|
|
|
};
|
|
|
this.showAssessFn = this.showAssessFn.bind(this);
|
|
|
this.getAssessContent = this.getAssessContent.bind(this);
|
|
@@ -32,7 +34,13 @@ class AssessResultHis extends Component {
|
|
|
}
|
|
|
showAssessFn(){
|
|
|
//获取历史评估数据
|
|
|
- this.props.getAssessHis(this.props.inquiryId);
|
|
|
+ const {showAssess} = this.state;
|
|
|
+ this.setState({
|
|
|
+ showAssess:!showAssess
|
|
|
+ });
|
|
|
+ if(!showAssess){
|
|
|
+ this.props.getAssessHis(this.props.inquiryId);
|
|
|
+ }
|
|
|
}
|
|
|
handoutTypes(obj,item,i){
|
|
|
const {wholeAssess,wholeIndexs,chooseSelecteds,scaleResult,wholeResults} =obj;
|
|
@@ -108,9 +116,16 @@ class AssessResultHis extends Component {
|
|
|
operaSupport: false,
|
|
|
});
|
|
|
}
|
|
|
+ componentWillReceiveProps(next){
|
|
|
+ if(next.inquiryId!=this.props.inquiryId){
|
|
|
+ this.setState({
|
|
|
+ showAssess:false
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
render() {
|
|
|
const { loading,isChronic, list,inquiryId } = this.props;
|
|
|
- const {tableName,tableId,showScale} = this.state;
|
|
|
+ const {tableName,tableId,showScale,showAssess} = this.state;
|
|
|
const obj = list&&list[inquiryId];
|
|
|
const scaleFooter = <div className={style['footer']}>
|
|
|
<span className={style['print']} onClick={this.onPrint}><img src={printIcon} alt=""/>打印</span>
|
|
@@ -118,9 +133,9 @@ class AssessResultHis extends Component {
|
|
|
</div>;
|
|
|
return <div className={style['assess-cont']}>
|
|
|
<div className={style['assess-result']}>
|
|
|
- <p className={style['enter']}>{isChronic?'管理和评估':'推荐'}结果:<a onClick={this.showAssessFn}>查看结果<img src={arrow} /></a></p>
|
|
|
+ <p className={style['enter']}>{isChronic?'管理和评估':'推荐'}结果:{showAssess?<a onClick={this.showAssessFn}>收起结果<img src={arrowDown} /></a>:<a onClick={this.showAssessFn}>查看结果<img src={arrow} /></a>}</p>
|
|
|
</div>
|
|
|
- <div className={style['assess-box']}>
|
|
|
+ <div className={style['assess-box']} style={{display:showAssess?"block":'none'}}>
|
|
|
{loading?<p className={style['loading']}><img src={loadingIcon} alt='loading...'/></p>:''}
|
|
|
{this.getAssessContent()}
|
|
|
</div>
|