|
@@ -1,20 +1,28 @@
|
|
import React, { Component } from "react";
|
|
import React, { Component } from "react";
|
|
import style from "./index.less";
|
|
import style from "./index.less";
|
|
-import { Radio} from '@commonComp';
|
|
|
|
|
|
+import { Radio,ComplexModal} from '@commonComp';
|
|
import arrow from '@common/images/icon_tri_blue.png';
|
|
import arrow from '@common/images/icon_tri_blue.png';
|
|
import loadingIcon from '@common/images/loading.gif';
|
|
import loadingIcon from '@common/images/loading.gif';
|
|
import ChooseItem from "../ChooseItem";
|
|
import ChooseItem from "../ChooseItem";
|
|
import ScaleItem from "../ScaleItem";
|
|
import ScaleItem from "../ScaleItem";
|
|
import ChartItem from "../ChartItem";
|
|
import ChartItem from "../ChartItem";
|
|
|
|
+import printIcon from '@common/images/team.png';
|
|
|
|
+import tableIcon from '@common/images/table.png';
|
|
|
|
+import ScaleTableHis from '@components/ScaleTableHis';
|
|
|
|
+import $ from "jquery";
|
|
|
|
|
|
class AssessResultHis extends Component {
|
|
class AssessResultHis extends Component {
|
|
constructor(props) {
|
|
constructor(props) {
|
|
super(props);
|
|
super(props);
|
|
this.state={
|
|
this.state={
|
|
chartTimeTypes:{}, //图表模块
|
|
chartTimeTypes:{}, //图表模块
|
|
|
|
+ tableName:'',
|
|
|
|
+ tableId:'',
|
|
|
|
+ parentIndex:0
|
|
};
|
|
};
|
|
this.showAssessFn = this.showAssessFn.bind(this);
|
|
this.showAssessFn = this.showAssessFn.bind(this);
|
|
this.getAssessContent = this.getAssessContent.bind(this);
|
|
this.getAssessContent = this.getAssessContent.bind(this);
|
|
|
|
+ this.showScaleFn = this.showScaleFn.bind(this);
|
|
}
|
|
}
|
|
handleChartChange(i,selects){
|
|
handleChartChange(i,selects){
|
|
const {chartTimeTypes} = this.state;
|
|
const {chartTimeTypes} = this.state;
|
|
@@ -36,6 +44,7 @@ class AssessResultHis extends Component {
|
|
case 0: //数据来源与右侧手动添加
|
|
case 0: //数据来源与右侧手动添加
|
|
return <ScaleItem title={name}
|
|
return <ScaleItem title={name}
|
|
data={wholeAssess}
|
|
data={wholeAssess}
|
|
|
|
+ showScaleFn={this.showScaleFn}
|
|
indexs={wholeIndexs}
|
|
indexs={wholeIndexs}
|
|
disabled={true}
|
|
disabled={true}
|
|
isRecommend={item.isRecommend}></ScaleItem>;
|
|
isRecommend={item.isRecommend}></ScaleItem>;
|
|
@@ -72,19 +81,55 @@ class AssessResultHis extends Component {
|
|
chartTimeTypes:indexTimeTypes
|
|
chartTimeTypes:indexTimeTypes
|
|
});
|
|
});
|
|
}*/
|
|
}*/
|
|
|
|
+ showScaleFn(item,pid){
|
|
|
|
+ const { list,inquiryId } = this.props;
|
|
|
|
+ const obj = list&&list[inquiryId];
|
|
|
|
+ if(item){
|
|
|
|
+ this.setState({
|
|
|
|
+ tableName:item.name,
|
|
|
|
+ tableId:item.id,
|
|
|
|
+ showScale:!this.state.showScale
|
|
|
|
+ });
|
|
|
|
+ }else{
|
|
|
|
+ this.setState({
|
|
|
|
+ showScale:!this.state.showScale
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ onPrint(){
|
|
|
|
+ let dom = $("#printcontent");
|
|
|
|
+ dom.jqprint({
|
|
|
|
+ debug: false,
|
|
|
|
+ importCSS: true,
|
|
|
|
+ printContainer: true,
|
|
|
|
+ operaSupport: false,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
render() {
|
|
render() {
|
|
- const { loading,isChronic } = this.props;
|
|
|
|
|
|
+ const { loading,isChronic, list,inquiryId } = this.props;
|
|
|
|
+ const {tableName,tableId,showScale} = 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>
|
|
|
|
+ <span className={style['okBtn']} onClick={()=>this.showScaleFn()}>关闭</span>
|
|
|
|
+ </div>;
|
|
return <div className={style['assess-cont']}>
|
|
return <div className={style['assess-cont']}>
|
|
<div className={style['assess-result']}>
|
|
<div className={style['assess-result']}>
|
|
<p className={style['enter']}>{isChronic?'管理和评估':'推荐'}结果:<a onClick={this.showAssessFn}>查看结果<img src={arrow} /></a></p>
|
|
<p className={style['enter']}>{isChronic?'管理和评估':'推荐'}结果:<a onClick={this.showAssessFn}>查看结果<img src={arrow} /></a></p>
|
|
</div>
|
|
</div>
|
|
<div className={style['assess-box']}>
|
|
<div className={style['assess-box']}>
|
|
{loading?<p className={style['loading']}><img src={loadingIcon} alt='loading...'/></p>:''}
|
|
{loading?<p className={style['loading']}><img src={loadingIcon} alt='loading...'/></p>:''}
|
|
- {/*{data?data.map((it,i)=>{
|
|
|
|
- return this.handoutTypes(it,i);
|
|
|
|
- }):data===null?<p className={style['no-data']}>没有历史评估记录!</p>:''}*/}
|
|
|
|
{this.getAssessContent()}
|
|
{this.getAssessContent()}
|
|
</div>
|
|
</div>
|
|
|
|
+ {showScale?<ComplexModal onclose={this.showScaleFn} footer={scaleFooter}
|
|
|
|
+ title={tableName}
|
|
|
|
+ icon={tableIcon}
|
|
|
|
+ top={20}
|
|
|
|
+ bottom={20}
|
|
|
|
+ width={820}>
|
|
|
|
+ <ScaleTableHis title={tableName} tableId={tableId} result={obj.scaleResult&&obj.scaleResult[tableId]} data={obj.scaleInfo&&obj.scaleInfo[tableId]}></ScaleTableHis>
|
|
|
|
+ </ComplexModal>:''}
|
|
</div>;
|
|
</div>;
|
|
}
|
|
}
|
|
}
|
|
}
|