Pārlūkot izejas kodu

只在初始化的时候,季节性图进行时间范围显示

hbchen 1 gadu atpakaļ
vecāks
revīzija
40c08b6f6f

+ 4 - 2
src/views/dataEntry_manage/databaseComponents/chartTrendRender.vue

@@ -228,7 +228,8 @@ export default {
 					this.tableData = DataList || [];
 
 
-					if(this.chart_type==2){
+					if(this.chart_type==2 && !(this.season_year && this.season_year.length>0)){
+						// 第一次进行初始化显示
 						let latestYear = parseInt(this.chartInfo.LatestDate.substring(0,4))
 						this.season_year = [`${latestYear-this.count_year+1}-01-01`,`${latestYear}-12-31`];
 					}
@@ -288,7 +289,8 @@ export default {
 						...this.oldOptions
 					} : EdbInfo;
 					this.tableData = DataList || [];
-					if(this.chart_type==2){
+					if(this.chart_type==2 && !(this.season_year && this.season_year.length>0)){
+						// 第一次进行初始化显示
 						let latestYear = parseInt(this.chartInfo.LatestDate.substring(0,4))
 						this.season_year = [`${latestYear-this.count_year+1}-01-01`,`${latestYear}-12-31`];
 					}

+ 4 - 2
src/views/dataEntry_manage/databaseComponents/createChart.vue

@@ -229,7 +229,8 @@ export default {
 						...this.oldOptions
 					} : EdbInfo;
 					this.tableData = DataList || [];
-					if(this.chart_type==2){
+					if(this.chart_type==2 && !(this.season_year && this.season_year.length>0)){
+						// 第一次进行初始化显示
 						let latestYear = parseInt(this.chartInfo.LatestDate.substring(0,4))
 						this.season_year = [`${latestYear-this.count_year+1}-01-01`,`${latestYear}-12-31`];
 					}
@@ -267,7 +268,8 @@ export default {
 					} : EdbInfo;
 					this.tableData = DataList || [];
 
-					if(this.chart_type==2){
+					if(this.chart_type==2 && !(this.season_year && this.season_year.length>0)){
+						// 第一次进行初始化显示
 						let latestYear = parseInt(this.chartInfo.LatestDate.substring(0,4))
 						this.season_year = [`${latestYear-this.count_year+1}-01-01`,`${latestYear}-12-31`];
 					}