diff --git a/src/views/sound/function/trend/index.vue b/src/views/sound/function/trend/index.vue index 9187f48..91347d7 100644 --- a/src/views/sound/function/trend/index.vue +++ b/src/views/sound/function/trend/index.vue @@ -12,9 +12,8 @@ - - {{ item.label }} - + + @@ -24,12 +23,12 @@ - + @@ -43,6 +42,12 @@ + + + + + + @@ -80,11 +85,13 @@ data() { return { queryParams: { - yearList: ["2020", "2021"], - areaList: ['南宁市'], - placeList: [], + yearList: ["2021"], + areaList: [], + placeList: ['广西大学'], // 测点名称 + quarterList: [], // 季度 regionLevel: '市级', // 区域等级 xco: '年度' ,// 横坐标 + functionType: '全部', // 功能区类别 timeSlot: '昼' }, trendData: [], @@ -93,6 +100,7 @@ placeOptions: [], areaOptions: [], yearOptions: [], + functionTypeOptions: [], quarterOptions: [ { label: "第一季度", value: 1 }, { label: "第二季度", value: 2 }, @@ -146,6 +154,15 @@ }; }); }); + getColumnOptions("function_type").then((res) => { + this.functionTypeOptions = res.data.data.map((item) => { + return { + label: item + '类', + value: item, + }; + }); + this.functionTypeOptions.unshift({label: '全部', value: '全部'}) + }); this.getArea() this.getPlace('市级') }, @@ -197,8 +214,29 @@ this.getPlace(value) } }, + handleQuarterChange(value) { + console.log(`selected ${value}`); + this.queryParams.xco = '季度' + }, // 趋势图 drawTrend() { + if (this.queryParams.quarterList.length > 0 && this.queryParams.xco === '年度') { + this.$message.warning('选择季度时, 横坐标不能年度') + return + } + if (this.queryParams.quarterList.length == 0 && this.queryParams.xco === '季度') { + this.$message.warning('横坐标为季度时, 季度至少选择一个') + return + } + if (this.queryParams.yearList.length == 0 && this.queryParams.xco === '年度') { + this.$message.warning('横坐标为年度时, 年度至少选择一个') + return + } + if (this.queryParams.yearList.length > 1 && this.queryParams.xco === '季度') { + this.$message.warning('横坐标为季度时, 不能选择多个年度') + return + } + getTrendChart(this.queryParams).then( res => { console.log('res', res); if (res.data.code == 0) {