Browse Source

增加最高最低湿度

Co-authored-by: Copilot <copilot@github.com>
meizhou
3067418132@qq.com 2 weeks ago
parent
commit
93f4320f0a
  1. 163
      src/views/centerairC/temHistoryQuery/index.vue

163
src/views/centerairC/temHistoryQuery/index.vue

@ -58,6 +58,8 @@
<el-table-column label="日期" align="center" prop="dateAndWeek" />
<el-table-column label="最高气温" align="center" prop="maxTemp" />
<el-table-column label="最低气温" align="center" prop="minTemp" />
<el-table-column label="最高湿度" align="center" prop="maxHumidity" />
<el-table-column label="最低湿度" align="center" prop="minHumidity" />
<el-table-column label="天气" align="center" prop="weatherConditions" />
<el-table-column label="风向" align="center" prop="windDirection" />
</el-table>
@ -163,23 +165,36 @@ export default {
let timeValue = [];
let hightValue = [];
let lowValue = [];
let maxHumidityValue = [];
let minHumidityValue = [];
data.forEach((element) => {
timeValue.push(element.weatherDate);
hightValue.push(element.maxTemp);
lowValue.push(element.minTemp);
maxHumidityValue.push(element.maxHumidity);
minHumidityValue.push(element.minHumidity);
});
let adapterOption = {};
adapterOption = {
xAxis: {
data: timeValue,
},
yAxis: {
name: "℃",
nameTextStyle: {
color: "rgba(255, 255, 255, 1)",
fontSize: 12,
yAxis: [
{
name: "℃",
nameTextStyle: {
color: "rgba(255, 255, 255, 1)",
fontSize: 12,
},
},
},
{
name: "%",
nameTextStyle: {
color: "rgba(255, 255, 255, 1)",
fontSize: 12,
},
},
],
series: [
{
data: hightValue,
@ -201,6 +216,26 @@ export default {
color: "rgb(250, 169, 19)", //线
},
},
{
data: maxHumidityValue,
//线
itemStyle: {
color: "rgb(52, 197, 94)", //线
},
lineStyle: {
color: "rgb(52, 197, 94)", //线
},
},
{
data: minHumidityValue,
//线
itemStyle: {
color: "rgb(239, 68, 68)", //线
},
lineStyle: {
color: "rgb(239, 68, 68)", //线
},
},
],
};
//.chartInstanceoptiondataoption
@ -220,6 +255,12 @@ export default {
{
data: [],
},
{
data: [],
},
{
data: [],
},
],
};
//.chartInstanceoptiondataoption
@ -248,11 +289,13 @@ export default {
weatherTempData(this.queryParams).then((response) => {
if (response.code == 200) {
import("@/assets/excel/Export2Excel").then((excel) => {
var tHeader = ["日期", "最高气温", "最低气温", "天气", "风向"]; // excel
var tHeader = ["日期", "最高气温", "最低气温", "最高湿度", "最低湿度", "天气", "风向"]; // excel
var filterVal = [
"dateAndWeek",
"maxTemp",
"minTemp",
"maxHumidity",
"minHumidity",
"weatherConditions",
"windDirection",
];
@ -351,40 +394,88 @@ export default {
},
}, //x线
},
yAxis: {
min: 0,
// max:20,
// name: "kwh", // y
// name
nameTextStyle: {
color: "rgba(255, 255, 255, 1)",
fontSize: 12, //y
yAxis: [
{
min: 0,
// max:20,
// name: "kwh", // y
// name
nameTextStyle: {
color: "rgba(255, 255, 255, 1)",
fontSize: 12, //y
},
miniInterval: 5,
type: "value",
// y
axisLabel: {
color: "rgba(255, 255, 255, 1)",
fontSize: titleFontSize, //x
},
// y
axisLine: {
show: true,
lineStyle: {
color: "#365576", // y 线
},
},
//y线
// splitNumber: 10,
// y线
splitLine: {
lineStyle: {
color: "#1a3d62", // 线
type: "dashed", // 线线
},
},
},
miniInterval: 5,
type: "value",
// y
axisLabel: {
color: "rgba(255, 255, 255, 1)",
fontSize: titleFontSize, //x
{
type: "value",
name: "%",
position: "right",
nameTextStyle: {
color: "rgba(255, 255, 255, 1)",
fontSize: 12,
},
axisLabel: {
color: "rgba(255, 255, 255, 1)",
fontSize: titleFontSize,
},
axisLine: {
show: true,
lineStyle: {
color: "#365576",
},
},
splitLine: {
show: false,
},
},
// y
axisLine: {
show: true,
],
series: [
{
type: "line",
//
symbolSize: titleFontSize * 0.5,
lineStyle: {
color: "#365576", // y 线
// 线
width: titleFontSize * 0.1,
},
symbol: "circle",
name: "最高气温",
yAxisIndex: 0,
},
//y线
// splitNumber: 10,
// y线
splitLine: {
{
type: "line",
//
symbolSize: titleFontSize * 0.5,
lineStyle: {
color: "#1a3d62", // 线
type: "dashed", // 线线
// 线
width: titleFontSize * 0.1,
},
symbol: "circle",
name: "最低气温",
yAxisIndex: 0,
},
},
series: [
{
type: "line",
//
@ -394,7 +485,8 @@ export default {
width: titleFontSize * 0.1,
},
symbol: "circle",
name: "最高气温",
name: "最高湿度",
yAxisIndex: 1,
},
{
type: "line",
@ -405,7 +497,8 @@ export default {
width: titleFontSize * 0.1,
},
symbol: "circle",
name: "最低气温",
name: "最低湿度",
yAxisIndex: 1,
},
],
};

Loading…
Cancel
Save