|
@@ -86,7 +86,7 @@ class ChartItem extends Component {
|
|
const obj = this.props.data[range[0]+range[range.length-1]];
|
|
const obj = this.props.data[range[0]+range[range.length-1]];
|
|
let arr = [];
|
|
let arr = [];
|
|
for(let i in obj){
|
|
for(let i in obj){
|
|
- arr.push(<Chart data={obj[i]} type={timeTypes&&timeTypes[i]} index={i} getXAxisArr={this.getXAxisArr} handleRangeChange={this.rangChange}/>)
|
|
|
|
|
|
+ arr.push(<Chart data={obj[i]} inquiryId={this.props.inquiryId||''} type={timeTypes&&timeTypes[i]} index={i} getXAxisArr={this.getXAxisArr} handleRangeChange={this.rangChange}/>)
|
|
}
|
|
}
|
|
return arr;
|
|
return arr;
|
|
}
|
|
}
|
|
@@ -125,9 +125,9 @@ class Chart extends Component{
|
|
this.timeSwitch = this.timeSwitch.bind(this);
|
|
this.timeSwitch = this.timeSwitch.bind(this);
|
|
}
|
|
}
|
|
drawChart(){
|
|
drawChart(){
|
|
- const {index,data,getXAxisArr,type,endDate} = this.props;
|
|
|
|
|
|
+ const {index,data,getXAxisArr,type,inquiryId} = this.props;
|
|
const xAxis = getXAxisArr(type);
|
|
const xAxis = getXAxisArr(type);
|
|
- const id = 'chart'+index;
|
|
|
|
|
|
+ const id = 'chart'+inquiryId+index;
|
|
let series = [],names=[],inx=-1;
|
|
let series = [],names=[],inx=-1;
|
|
let myChart = echarts.init(document.getElementById(id));
|
|
let myChart = echarts.init(document.getElementById(id));
|
|
|
|
|
|
@@ -222,7 +222,7 @@ class Chart extends Component{
|
|
this.drawChart();
|
|
this.drawChart();
|
|
}
|
|
}
|
|
render(){
|
|
render(){
|
|
- const {type,index} = this.props;
|
|
|
|
|
|
+ const {type,index,inquiryId} = this.props;
|
|
return <div className={style['cont']}>
|
|
return <div className={style['cont']}>
|
|
<div className={style['time-range']}>
|
|
<div className={style['time-range']}>
|
|
<span className={type=='year'?style['range']+" "+style['on']:style['range']} onClick={()=>this.timeSwitch("year")}>近一年</span>
|
|
<span className={type=='year'?style['range']+" "+style['on']:style['range']} onClick={()=>this.timeSwitch("year")}>近一年</span>
|
|
@@ -230,7 +230,7 @@ class Chart extends Component{
|
|
<span className={type=='month'?style['range']+" "+style['on']:style['range']} onClick={()=>this.timeSwitch("month")}>近一个月</span>
|
|
<span className={type=='month'?style['range']+" "+style['on']:style['range']} onClick={()=>this.timeSwitch("month")}>近一个月</span>
|
|
<span className={type=='week'?style['range']+" "+style['on']:style['range']} onClick={()=>this.timeSwitch("week")}>近一周</span>
|
|
<span className={type=='week'?style['range']+" "+style['on']:style['range']} onClick={()=>this.timeSwitch("week")}>近一周</span>
|
|
</div>
|
|
</div>
|
|
- <div className={style["chart-box"]} id={'chart'+index}></div>
|
|
|
|
|
|
+ <div className={style["chart-box"]} id={'chart'+inquiryId+index}></div>
|
|
</div>;
|
|
</div>;
|
|
}
|
|
}
|
|
}
|
|
}
|