|
@@ -54,6 +54,9 @@ export default {
|
|
|
current_search:'',
|
|
|
|
|
|
xAxisRange:[],
|
|
|
+
|
|
|
+ isSpanYear:false,
|
|
|
+ isSpanYearDisable:false,
|
|
|
legendEditDiaShow:false,
|
|
|
legendList:[],
|
|
|
|
|
@@ -312,21 +315,20 @@ export default {
|
|
|
根据选择的时间长度和指标数据区间交集,取最新数据所在年份,修改横坐标显示范围的年份
|
|
|
*/
|
|
|
|
|
|
- if(new Date(data.start_date) > new Date(this.latestDate)){
|
|
|
- let latestYear = parseInt(this.latestDate.substring(0,4))
|
|
|
- this.xAxisRange=[`${latestYear}-01-01`,`${latestYear}-12-31`]
|
|
|
- }else if(new Date(data.end_date) > new Date(this.latestDate)){
|
|
|
- let latestYear = parseInt(this.latestDate.substring(0,4))
|
|
|
- let startMonthAndDate = this.xAxisRange[0].substring(4)
|
|
|
- let endMonthAndDate = this.xAxisRange[1].substring(4)
|
|
|
- this.xAxisRange=[latestYear+startMonthAndDate,latestYear+endMonthAndDate]
|
|
|
- }else{
|
|
|
- let latestYear = parseInt(data.end_date.substring(0,4))
|
|
|
- let startMonthAndDate = this.xAxisRange[0].substring(4)
|
|
|
- let endMonthAndDate = this.xAxisRange[1].substring(4)
|
|
|
- this.xAxisRange=[latestYear+startMonthAndDate,latestYear+endMonthAndDate]
|
|
|
- }
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}else{
|
|
|
this.select_date = [data.start_date, data.end_date];
|
|
|
if(data.dateType==100){
|
|
@@ -342,9 +344,9 @@ export default {
|
|
|
},
|
|
|
|
|
|
|
|
|
- seasonYearChange() {
|
|
|
- this.getPreviewSplineInfo();
|
|
|
- },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
initStatus() {
|
|
@@ -604,29 +606,27 @@ export default {
|
|
|
|
|
|
let latestYear = parseInt(this.latestDate.substring(0,4))
|
|
|
this.season_year=[`${latestYear-4}-01-01`,`${latestYear}-12-31`]
|
|
|
- this.xAxisRange = [`${latestYear}-01-01`,`${latestYear}-12-31`]
|
|
|
+ this.xAxisRange = ['01-01','12-31']
|
|
|
+ this.isSpanYear=false
|
|
|
+ this.isSpanYearDisable=false
|
|
|
}
|
|
|
},
|
|
|
|
|
|
xAxisRangeChange(date){
|
|
|
- console.log(date);
|
|
|
if(date && date.length>0){
|
|
|
+
|
|
|
let xStartDate = date[0]
|
|
|
let xEndDate = date[1]
|
|
|
-
|
|
|
- if(!(parseInt(xEndDate.substring(0,4)) - parseInt(xStartDate.substring(0,4))<2)){
|
|
|
- this.$message.warning("横坐标显示范围不得超过2年")
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- if(new Date(`${xEndDate}`) < new Date(this.latestDate)){
|
|
|
- this.$message.warning("结束日期不得早于时间区间内指标的最新日期,请修改时间区间")
|
|
|
- return
|
|
|
- }
|
|
|
- if(new Date(`${xEndDate}`) > new Date(`${parseInt(this.latestDate.substring(0,4))+1}${this.latestDate.substring(4)}`)){
|
|
|
- this.$message.warning("结束日期不得晚于时间区间内指标的最新日期往后推一年的日期,请修改时间区间")
|
|
|
- return
|
|
|
+ if(new Date(`2013-${xStartDate}`) > new Date(`2013-${xEndDate}`) ||
|
|
|
+ new Date(`2013-${xStartDate}`) == new Date(`2013-${xEndDate}`)){
|
|
|
+
|
|
|
+ this.isSpanYear=true
|
|
|
+ this.isSpanYearDisable=true
|
|
|
+ }else{
|
|
|
+ this.isSpanYearDisable=false
|
|
|
}
|
|
|
+ }else{
|
|
|
+ this.isSpanYearDisable=false
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -645,6 +645,13 @@ export default {
|
|
|
|
|
|
}
|
|
|
console.log(this.legendList,'legendList');
|
|
|
+ },
|
|
|
+
|
|
|
+ saveLegend(copyList){
|
|
|
+ if(copyList && copyList.length>0){
|
|
|
+ this.legendList = copyList
|
|
|
+ this.legendEditDiaShow=false
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|