diff --git a/src/views/atmosphere/acid-rain/trend/index.vue b/src/views/atmosphere/acid-rain/trend/index.vue index 3b10fa0..806ce57 100644 --- a/src/views/atmosphere/acid-rain/trend/index.vue +++ b/src/views/atmosphere/acid-rain/trend/index.vue @@ -4,10 +4,14 @@ - + + + - + + + @@ -18,12 +22,12 @@ - + - + @@ -133,6 +137,11 @@ export default { this.getPlaceOptions(value) } }, + handleMonthChange(value) { + if (value.includes('全部')) { + this.queryParams.monthList = [1,2,3,4,5,6,7,8,9,10,11,12] + } + }, // 纵坐标变化 handleYcoChange(value) { if (value.includes('rate') && !this.queryParams.categoryList.includes('酸雨频率')) { diff --git a/src/views/atmosphere/air/trend/index.vue b/src/views/atmosphere/air/trend/index.vue index 24ce4fe..f737520 100644 --- a/src/views/atmosphere/air/trend/index.vue +++ b/src/views/atmosphere/air/trend/index.vue @@ -4,10 +4,14 @@ - + + + - + + + @@ -17,16 +21,18 @@ - + + + - + - + @@ -188,6 +194,11 @@ export default { this.getCountryPlace(); } }, + handleMonthChange(value) { + if (value.includes('全部')) { + this.queryParams.monthList = [1,2,3,4,5,6,7,8,9,10,11,12] + } + }, // 纵坐标变化 handleYcoChange(value) { if (value.length > 2) { @@ -286,10 +297,29 @@ export default { return value.toFixed(1); } }; + let yMax = 0 + this.trendData.series && this.trendData.series.forEach(item => { + yMax = Math.max(...item.data) > yMax ? Math.max(...item.data) : yMax + if (item.name === '二氧化氮') { + yMax = yMax > 40 ? yMax : 40 + } else if (item.name === '二氧化硫') { + yMax = yMax > 60 ? yMax : 60 + } else if (item.name === '可吸入颗粒物') { + yMax = yMax > 70 ? yMax : 70 + } else if (item.name === '一氧化碳') { + yMax = yMax > 4 ? yMax : 4 + } else if (item.name === '臭氧') { + yMax = yMax > 160 ? yMax : 160 + } else if (item.name === '细颗粒物') { + yMax = yMax > 35 ? yMax : 35 + } + }) + console.log("yMax", yMax); this.trendData.yAxis && this.trendData.yAxis.forEach(item=>{ console.log("item", item); if (item.name === '浓度') { item.name = '浓度 单位:微克/立方米(一氧化碳:毫克/立方米)' + item.max = yMax } }) if (trendChart != null && trendChart != '' && trendChart != undefined) {