|
@@ -11,24 +11,11 @@ class AssessResultHis extends Component {
|
|
|
constructor(props) {
|
|
|
super(props);
|
|
|
this.state={
|
|
|
- chooseSelecteds:props.chooseSelecteds, //大数据选择模块
|
|
|
chartTimeTypes:{}, //图表模块
|
|
|
- wholeAssessItems:props.wholeIndexs, //整体评估模块
|
|
|
- wholeAssessText:props.wholeText||'' //整体评估补充说明
|
|
|
};
|
|
|
this.showAssessFn = this.showAssessFn.bind(this);
|
|
|
this.getAssessContent = this.getAssessContent.bind(this);
|
|
|
}
|
|
|
- /*componentWillMount(){
|
|
|
- //获取评估
|
|
|
- this.props.getAssessHis(this.props.inquiryId);
|
|
|
- }*/
|
|
|
- /*componentWillReceiveProps(next){
|
|
|
- const {inquiryId,getAssessHis} = this.props;
|
|
|
- if(next.inquiryId!=inquiryId){
|
|
|
- getAssessHis&&getAssessHis(next.inquiryId);
|
|
|
- }
|
|
|
- }*/
|
|
|
handleChartChange(i,selects){
|
|
|
const {chartTimeTypes} = this.state;
|
|
|
this.setState({
|
|
@@ -40,8 +27,9 @@ class AssessResultHis extends Component {
|
|
|
this.props.getAssessHis(this.props.inquiryId);
|
|
|
}
|
|
|
handoutTypes(obj,item,i){
|
|
|
- const {indexTimeTypes,wholeAssess,wholeIndexs,chooseSelecteds} =obj;
|
|
|
- const {getIndexData,inquiryDate,indexData,inquiryId} = this.props;
|
|
|
+ const {wholeAssess,wholeIndexs,chooseSelecteds} =obj;
|
|
|
+ const {getIndexData,inquiryDate,indexData,inquiryId,timeTypes} = this.props;
|
|
|
+ const {chartTimeTypes} = this.state;
|
|
|
const name = item.regionName+":";
|
|
|
const list = item.data&&item.data.rows;
|
|
|
switch (+item.regionType){
|
|
@@ -52,10 +40,10 @@ class AssessResultHis extends Component {
|
|
|
case 10: //数据来源于后台
|
|
|
return <ChartItem title={name}
|
|
|
data={indexData||{}}
|
|
|
- timeTypes={indexTimeTypes}
|
|
|
+ timeTypes={JSON.stringify(chartTimeTypes||{})=='{}'?timeTypes&&timeTypes[i]:chartTimeTypes[i]}
|
|
|
initFn={getIndexData}
|
|
|
endDate={inquiryDate}
|
|
|
- inquiryId={inquiryId}
|
|
|
+ pindex={i}
|
|
|
handleChange={this.handleChartChange.bind(this,i)}></ChartItem>;
|
|
|
default:
|
|
|
return '';
|
|
@@ -73,6 +61,13 @@ class AssessResultHis extends Component {
|
|
|
return data===null||(data&&data.length==0)?<p className={style['no-data']}>没有历史评估记录!</p>:'';
|
|
|
}
|
|
|
}
|
|
|
+ /*componentDidMount(){
|
|
|
+ const indexTimeTypes = JSON.parse(JSON.stringify(this.props.indexTimeTypes));
|
|
|
+ console.log(indexTimeTypes)
|
|
|
+ this.setState({
|
|
|
+ chartTimeTypes:indexTimeTypes
|
|
|
+ });
|
|
|
+ }*/
|
|
|
render() {
|
|
|
const { list,inquiryId,loading } = this.props;
|
|
|
const data = list&&list[inquiryId]&&list[inquiryId].data;
|