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

Loading…
Cancel
Save