|
@@ -111,7 +111,6 @@ export default {
|
|
|
return {
|
|
|
year_select: 10, //年份选择项
|
|
|
year_select_season: 20, //季节性年份选择项 默认最近五年
|
|
|
- year_select_curve: 10, //曲线年份选择项 默认全部
|
|
|
yearSelector: [
|
|
|
{
|
|
|
name: '全部',
|
|
@@ -132,9 +131,9 @@ export default {
|
|
|
isDateDia: false, // 时间段弹窗
|
|
|
dateForm: {},
|
|
|
dateTip: '请选择时间段',
|
|
|
- count_year:0,
|
|
|
+ count_year:5,
|
|
|
count_year_season:5,
|
|
|
- count_year_curve:5,
|
|
|
+ isPredictorChart:true, // 复用了相同的逻辑,为了预测指标图表和正常的图库图表区分开
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
@@ -148,38 +147,44 @@ export default {
|
|
|
DataList:this.edbData.DataList
|
|
|
}
|
|
|
]
|
|
|
- if(this.chartInfo.ChartType==2){
|
|
|
- //季节性图 默认时间 初始化 默认最近5年
|
|
|
- this.year_select=this.year_select_season
|
|
|
- this.count_year=this.count_year_season
|
|
|
- if(!(this.select_date && this.select_date.length>0)){
|
|
|
- let latestYear = parseInt(this.tableData[0].LatestDate.substring(0,4))
|
|
|
- this.season_year = [`${latestYear-this.count_year+1}-01-01`,`${latestYear}-12-31`];
|
|
|
- }
|
|
|
- }else{
|
|
|
- this.year_select=this.year_select_curve
|
|
|
- this.count_year=this.count_year_curve
|
|
|
- }
|
|
|
this.setAddChartDefault();
|
|
|
this.setChartOptionHandle(this.tableData)
|
|
|
},
|
|
|
|
|
|
changeYear(item){
|
|
|
- this.year_select = this.year_select_curve =item.value
|
|
|
+ this.year_select = item.value
|
|
|
this.select_date = [];
|
|
|
this.dateTip = '请选择时间段';
|
|
|
this.$emit('refreshData','saveLimit')
|
|
|
},
|
|
|
+ /* 打开时间段弹窗 */
|
|
|
+ openDateDia() {
|
|
|
+ // 自定义时间段回显
|
|
|
+ let selectDateStart = this.chartInfo.ChartType === 2?this.season_year[0]:this.select_date[0]
|
|
|
+ let selectDateEnd = this.chartInfo.ChartType === 2?this.season_year[1]:this.select_date[1]
|
|
|
+
|
|
|
+ let year_select_real = this.chartInfo.ChartType === 2?this.year_select_season:this.year_select
|
|
|
|
|
|
+ this.dateForm = {
|
|
|
+ date_type: year_select_real,
|
|
|
+ start_date:
|
|
|
+ year_select_real === 5 || year_select_real === 6
|
|
|
+ ? selectDateStart
|
|
|
+ : '',
|
|
|
+ end_date: year_select_real === 5 ? selectDateEnd : '',
|
|
|
+ count_year: year_select_real === 20 ?
|
|
|
+ this.chartInfo.ChartType === 2?this.count_year_season:this.count_year
|
|
|
+ : ''
|
|
|
+ };
|
|
|
+ this.isDateDia = true;
|
|
|
+ },
|
|
|
/* 保存完自定义日期 刷新数据 保存当前的图表配置和上下限 只改变图表*/
|
|
|
dataChangeBack(data) {
|
|
|
- this.year_select = data.dateType;
|
|
|
this.isDateDia = false;
|
|
|
|
|
|
- this.count_year = data.count_year
|
|
|
if(this.chartInfo.ChartType==1){
|
|
|
- this.year_select_curve = data.dateType
|
|
|
- this.count_year_curve = data.count_year
|
|
|
+ this.year_select = data.dateType
|
|
|
+ this.count_year = data.count_year
|
|
|
}else{
|
|
|
this.year_select_season = data.dateType
|
|
|
this.count_year_season = data.count_year
|
|
@@ -196,8 +201,8 @@ export default {
|
|
|
// 回显
|
|
|
dateEnd = this.tableData[0].LatestDate
|
|
|
}
|
|
|
+ this.season_year = [dateStart, dateEnd];
|
|
|
}
|
|
|
- this.season_year = [dateStart, dateEnd];
|
|
|
|
|
|
this.select_date = [dateStart, dateEnd];
|
|
|
|