Commit a1c1918b authored by 王亚晖's avatar 王亚晖
parents 6aa28bd2 c9fb80d8
......@@ -3,7 +3,7 @@
<div
class="contentBlock"
id="contentBlock"
v-loading.fullscreen.lock="fullscreenLoading"
v-loading="loading"
element-loading-background="rgba(122, 122, 122, 0.6)"
>
<el-card class="card-contianer">
......@@ -59,7 +59,7 @@
<el-config-provider :locale="zhCn">
<el-date-picker
type="datetime"
value-format="YYYY-MM-DD HH:00:00"
value-format="YYYY-MM-DD HH:mm:ss"
placeholder="选择开始时间"
style="width: 180px"
v-model="enertyInfo.startTime"
......@@ -70,7 +70,7 @@
<el-config-provider :locale="zhCn">
<el-date-picker
type="datetime"
value-format="YYYY-MM-DD HH:00:00"
value-format="YYYY-MM-DD HH:mm:ss"
placeholder="选择结束时间"
style="width: 180px"
v-model="enertyInfo.endTime"
......@@ -635,6 +635,7 @@ import {
postTopBHXLXJ1,
postTopSecondTempAvg,
} from "../../api/ranking";
const loading = ref(false);
const curwidth = ref(1700);
const curheight = ref(1000);
const switchV = ref(false);
......@@ -766,21 +767,66 @@ function exportTableToExcelFun(n, dataList, company) {
}
function exportTableToExcel(title, space, sheetTit, data) {
const worksheet = XLSX.utils.json_to_sheet(data);
const ws = XLSX.utils.json_to_sheet(data);
const workbook = XLSX.utils.book_new();
XLSX.utils.sheet_add_aoa(worksheet, [title], {
const border = {
top: {
style: "thin",
},
bottom: {
style: "thin",
},
left: {
style: "thin",
},
right: {
style: "thin",
},
};
const range = XLSX.utils.decode_range(ws["!ref"]);
const cellList = Object.keys(ws).filter((item) => item.indexOf("!") < 0);
for (let row = range.s.r; row <= range.e.r; row++) {
for (let col = range.s.c; col <= range.e.c; col++) {
const cell = XLSX.utils.encode_cell({ r: row, c: col });
if (cellList.indexOf(cell) < 0) {
ws[cell] = { t: "", v: "", s: { border } };
} else {
ws[cell].s = { border };
}
}
}
XLSX.utils.sheet_add_aoa(ws, [title], {
origin: "A1",
});
worksheet["!cols"] = [{ wch: 5 }, { wch: 20 }, { wch: 20 }, { wch: 20 }];
ws["!cols"] = [{ wch: 5 }, { wch: 20 }, { wch: 20 }, { wch: 20 }];
space.forEach((element) => {
worksheet[element].s = {
ws[element].s = {
fill: {
fgColor: { rgb: "0097d5fd" },
},
border: {
bottom: {
color: "#000000",
style: "thin",
},
left: {
color: "#000000",
style: "thin",
},
right: {
color: "#000000",
style: "thin",
},
top: {
color: "#000000",
style: "thin",
},
},
};
});
XLSX.utils.book_append_sheet(workbook, worksheet, sheetTit);
XLSX.utils.book_append_sheet(workbook, ws, sheetTit);
const excelBuffer = XLSX.write(workbook, { bookType: "xlsx", type: "array" });
const dataBlob = new Blob([excelBuffer], {
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8",
......@@ -791,7 +837,7 @@ function exportTableToExcel(title, space, sheetTit, data) {
}
function exportTableToExcelAll() {
let worksheet = ref();
let ws = ref();
let workbook = ref();
let excelBuffer = ref();
let dataBlob = ref();
......@@ -809,9 +855,22 @@ function exportTableToExcelAll() {
topSecondTempAvg.value,
topSecondTempAvg.value,
];
let dataList = [];
data.forEach((element) => {
let arr = [];
element.forEach((element1) => {
arr.push({
rankingIndex: element1.rankingIndex,
supplyName: element1.supplyName,
transferName: element1.transferName,
uc: element1.uc.toFixed(2),
});
});
dataList.push(arr);
});
let title = [
"热单耗(W/㎡)",
"热耗(W/(㎡×℃",
"热耗(W/(㎡×℃))",
"水单耗(Kg/㎡)",
"电单耗(Kwh/㎡)",
"一网回温(℃)",
......@@ -820,8 +879,10 @@ function exportTableToExcelAll() {
"板换效率(%)",
"二网均温(℃)",
"二网温差(℃)",
"二网瞬时(t/h)",
"流量(t/h/万㎡)"
];
let space = ["A1", "B1", "C1", "D1", "E1"];
let space = ["A1", "B1", "C1", "D1"];
let sheetTit = [
"热单耗排行",
"度日数热耗排行",
......@@ -838,32 +899,76 @@ function exportTableToExcelAll() {
];
workbook = XLSX.utils.book_new();
for (var i = 0; i < 12; i++) {
worksheet = XLSX.utils.json_to_sheet(data[i]);
ws = XLSX.utils.json_to_sheet(dataList[i]);
const border = {
top: {
style: "thin",
},
bottom: {
style: "thin",
},
left: {
style: "thin",
},
right: {
style: "thin",
},
};
const range = XLSX.utils.decode_range(ws["!ref"]);
const cellList = Object.keys(ws).filter((item) => item.indexOf("!") < 0);
for (let row = range.s.r; row <= range.e.r; row++) {
for (let col = range.s.c; col <= range.e.c; col++) {
const cell = XLSX.utils.encode_cell({ r: row, c: col });
if (cellList.indexOf(cell) < 0) {
ws[cell] = { t: "", v: "", s: { border } };
} else {
ws[cell].s = { border };
}
}
}
XLSX.utils.sheet_add_aoa(
worksheet,
[["排名", "机组ID", "供热站名称", "机组名称", title[i]]],
ws,
[["排名", "供热站名称", "机组名称", title[i]]],
{
origin: "A1",
}
);
worksheet["!cols"] = [
ws["!cols"] = [
{ wch: 5 },
{ wch: 20 },
{ wch: 20 },
{ wch: 20 },
{ wch: 20 },
];
worksheet["!cols"][1] = { hidden: true };
// ws["!cols"][1] = { hidden: true };
space.forEach((element) => {
worksheet[element].s = {
ws[element].s = {
fill: {
fgColor: { rgb: "0097d5fd" },
},
border: {
bottom: {
color: "#000000",
style: "thin",
},
left: {
color: "#000000",
style: "thin",
},
right: {
color: "#000000",
style: "thin",
},
top: {
color: "#000000",
style: "thin",
},
},
};
});
XLSX.utils.book_append_sheet(workbook, worksheet, sheetTit[i]);
XLSX.utils.book_append_sheet(workbook, ws, sheetTit[i]);
}
excelBuffer = XLSX.write(workbook, { bookType: "xlsx", type: "array" });
......@@ -876,72 +981,27 @@ function exportTableToExcelAll() {
}
function timeFun() {
var date = new Date();
var year = date.getFullYear();
var dateArr = [
date.getMonth() + 1,
date.getDate(),
date.getHours(),
date.getMinutes(),
date.getSeconds(),
];
var startTimeDay = parseInt(dateArr[1] - 1);
var endTimeHour = parseInt(dateArr[2] - 1);
if (startTimeDay < 10) {
startTimeDay = "0" + startTimeDay;
}
if (endTimeHour < 10) {
endTimeHour = "0" + endTimeHour;
}
if (dateArr[0] < 10) {
dateArr[0] = "0" + dateArr[0];
}
if (dateArr[3] < 10) {
dateArr[3] = "0" + dateArr[3];
}
if (dateArr[4] < 10) {
dateArr[4] = "0" + dateArr[4];
}
let startTimes =
year +
"-" +
dateArr[0] +
"-" +
startTimeDay +
" " +
dateArr[2] +
":" +
dateArr[3] +
":" +
dateArr[4];
let endTimes =
year +
"-" +
dateArr[0] +
"-" +
dateArr[1] +
" " +
endTimeHour +
":" +
dateArr[3] +
":" +
dateArr[4];
enertyInfo.startTime = startTimes;
enertyInfo.endTime = endTimes;
const today = new Date();
const preday = new Date(today);
const prehour = new Date(today.getTime() - 60 * 60 * 1000);
today.setDate(today.getDate());
preday.setDate(preday.getDate() - 1);
var hour = today.getHours();
enertyInfo.startTime =
preday.toISOString().split("T")[0] + " " + hour + ":00:00";
enertyInfo.endTime =
today.toISOString().split("T")[0] + " " + prehour.getHours() + ":00:00";
}
//换热站机组排名页概况
function postOverviewFun(enertySend) {
fullscreenLoading.value = true;
postOverview(enertySend).then((res) => {
if (res.success === true) {
overviewList.value = res.data[0];
} else {
ElMessage.error(res.message);
}
fullscreenLoading.value = false;
loading.value = false;
});
}
......@@ -953,6 +1013,7 @@ function postTopHeatUCFun(enertySend) {
} else {
ElMessage.error(res.message);
}
loading.value = false;
});
}
......@@ -964,6 +1025,7 @@ function postTopDayHeatUCFun(enertySend) {
} else {
ElMessage.error(res.message);
}
loading.value = false;
});
}
......@@ -975,6 +1037,7 @@ function postTopWaterUCFun(enertySend) {
} else {
ElMessage.error(res.message);
}
loading.value = false;
});
}
......@@ -986,6 +1049,7 @@ function postTopElecUCFun(enertySend) {
} else {
ElMessage.error(res.message);
}
loading.value = false;
});
}
......@@ -997,6 +1061,7 @@ function postTopFirsHWFun(enertySend) {
} else {
ElMessage.error(res.message);
}
loading.value = false;
});
}
......@@ -1008,6 +1073,7 @@ function postTopFirsFlowFun(enertySend) {
} else {
ElMessage.error(res.message);
}
loading.value = false;
});
}
......@@ -1019,6 +1085,7 @@ function postTopBHXLFun(enertySend) {
} else {
ElMessage.error(res.message);
}
loading.value = false;
});
}
......@@ -1030,6 +1097,7 @@ function postTopBHXLXJ1Fun(enertySend) {
} else {
ElMessage.error(res.message);
}
loading.value = false;
});
}
......@@ -1041,6 +1109,7 @@ function postTopSecondTempAvgFun(enertySend) {
} else {
ElMessage.error(res.message);
}
loading.value = false;
});
}
......@@ -1078,6 +1147,7 @@ function sendClick() {
}
}
function sendFun(enertySend) {
loading.value = true;
postOverviewFun(enertySend);
postTopHeatUCFun(enertySend.value);
postTopDayHeatUCFun(enertySend.value);
......@@ -1108,9 +1178,7 @@ onMounted(() => {
timeFun();
sendFun(enertySend);
});
onUnmounted(() => {
// window.removeEventListener("resize", setContentHeight);
});
onUnmounted(() => {});
function setContentHeight() {
curheight.value = window.innerHeight - 160;
......
......@@ -2,7 +2,7 @@
<div
class="contentBlock"
id="contentBlock"
v-loading.fullscreen.lock="fullscreenLoading"
v-loading="loading"
element-loading-background="rgba(122, 122, 122, 0.6)"
>
<el-card class="card-contianer">
......@@ -130,6 +130,7 @@
v-loading="tabloading"
:height="tableHeight"
style="width: 100%"
empty-text="暂无数据"
>
<el-table-column
prop="transferName"
......@@ -142,8 +143,11 @@
</el-table>
</div>
<div v-show="switchV" id="echartsLayerBlock">
<div v-show="nodata">
<div class="echartsLayer" id="echartsLayer"></div>
</div>
<div v-show="!nodata"><el-empty description="暂无数据" /></div>
</div>
</div>
</template>
<script setup>
......@@ -167,12 +171,13 @@ import {
postSecAvgTUc,
postSecAbsTUc,
} from "../../api/analysis";
const loading = ref(false);
const options = reactive([]);
const enterpriseId = ref();
const props = { multiple: true, emitPath: false };
const switchV = ref(true);
const echartF = ref(false);
const nodata = ref(false);
const nodata = ref(true);
const tableData = reactive([]);
const echartData = reactive([]);
const echartDataTime = reactive([]);
......@@ -219,110 +224,90 @@ function transferIdChange() {
}
function exportTableToExcel() {
const worksheet = XLSX.utils.json_to_sheet(tableData);
const ws = XLSX.utils.json_to_sheet(tableData);
const workbook = XLSX.utils.book_new();
const border = {
top: {
style: "thin",
},
bottom: {
style: "thin",
},
left: {
style: "thin",
},
right: {
style: "thin",
},
};
const range = XLSX.utils.decode_range(ws["!ref"]);
const cellList = Object.keys(ws).filter((item) => item.indexOf("!") < 0);
for (let row = range.s.r; row <= range.e.r; row++) {
for (let col = range.s.c; col <= range.e.c; col++) {
const cell = XLSX.utils.encode_cell({ r: row, c: col });
if (cellList.indexOf(cell) < 0) {
ws[cell] = { t: "", v: "", s: { border } };
} else {
ws[cell].s = { border };
}
}
}
XLSX.utils.sheet_add_aoa(
worksheet,
ws,
[["换热站机组名称", "时间", "平均温度", enertyTab.value]],
{
origin: "A1",
}
);
worksheet["!cols"] = [{ wch: 20 }, { wch: 20 }, { wch: 20 }, { wch: 20 }];
// worksheet["!rows"] = [{ hpx: 20 }];
worksheet["A1"].s = {
ws["!cols"] = [{ wch: 20 }, { wch: 20 }, { wch: 20 }, { wch: 20 }];
// ws["!rows"] = [{ hpx: 20 }];
const tagList = ["A1", "B1", "C1", "D1"];
tagList.forEach((key, index) => {
ws[key].s = {
fill: {
fgColor: { rgb: "0097d5fd" },
},
};
worksheet["B1"].s = {
fill: {
fgColor: { rgb: "0097d5fd" },
border: {
bottom: {
color: "#000000",
style: "thin",
},
};
worksheet["C1"].s = {
fill: {
fgColor: { rgb: "0097d5fd" },
left: {
color: "#000000",
style: "thin",
},
right: {
color: "#000000",
style: "thin",
},
top: {
color: "#000000",
style: "thin",
},
};
worksheet["D1"].s = {
fill: {
fgColor: { rgb: "0097d5fd" },
},
};
});
XLSX.utils.book_append_sheet(workbook, worksheet, "换热站趋势");
XLSX.utils.book_append_sheet(workbook, ws, "换热站趋势图");
const excelBuffer = XLSX.write(workbook, { bookType: "xlsx", type: "array" });
const dataBlob = new Blob([excelBuffer], {
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8",
});
const downloadUrl = URL.createObjectURL(dataBlob);
saveAs(dataBlob, "tableData.xlsx");
saveAs(dataBlob, "换热站趋势图.xlsx");
ElMessage.success("导出成功!请稍后。。。");
}
function timeFun() {
var date = new Date();
var year = date.getFullYear();
var dateArr = [
date.getMonth() + 1,
date.getDate(),
date.getHours(),
date.getMinutes(),
date.getSeconds(),
];
var startTimeDay = parseInt(dateArr[1] - 2);
var endTimeDay = parseInt(dateArr[1] - 1);
if (startTimeDay < 10) {
startTimeDay = "0" + startTimeDay;
}
if (endTimeDay < 10) {
endTimeDay = "0" + endTimeHour;
}
if (dateArr[0] < 10) {
dateArr[0] = "0" + dateArr[0];
}
if (dateArr[1] < 10) {
dateArr[1] = "0" + dateArr[0];
}
if (dateArr[2] < 10) {
dateArr[2] = "0" + dateArr[0];
}
if (dateArr[3] < 10) {
dateArr[3] = "0" + dateArr[3];
}
if (dateArr[4] < 10) {
dateArr[4] = "0" + dateArr[4];
}
let startTimes =
year +
"-" +
dateArr[0] +
"-" +
startTimeDay +
" " +
"00" +
":" +
"00" +
":" +
"00";
let endTimes =
year +
"-" +
dateArr[0] +
"-" +
dateArr[1] +
" " +
"00" +
":" +
"00" +
":" +
"00";
enertyInfo.startTime = startTimes;
enertyInfo.endTime = endTimes;
const today = new Date();
const preday = new Date(today);
preday.setDate(preday.getDate() - 2);
today.setDate(today.getDate() - 1);
enertyInfo.startTime =
preday.toISOString().split("T")[0] + " " + today.getHours() + ":00:00";
enertyInfo.endTime =
today.toISOString().split("T")[0] + " " + today.getHours() + ":00:00";
}
//获取换热机组列表
......@@ -368,6 +353,7 @@ function sendClick() {
return false;
}
if (valid) {
loading.value = true;
switch (enertyInfo.type) {
case 0:
postQOQlistFun();
......@@ -405,7 +391,6 @@ function sendClick() {
}
enertyTab.value = "能耗值(" + company.value + ")";
} else {
console.log("验证失败");
return false;
}
});
......@@ -421,163 +406,123 @@ function selTypeChange() {
//换热站机组能耗数据接口(用量环比)
function postQOQlistFun() {
tabloading.value = true;
let params = {
supplyIdList: null,
idList: [
"EF0864C6-1A01-41CF-94BE-523B4D6063DB",
"977A50B1-B3E5-40F0-9A16-89A1A4BFE57C",
],
startTime: "2024-01-01 00:00:00",
endTime: "2024-02-01 00:00:00",
energyType: 2,
interval: 1,
};
postQOQlist(enertyInfo).then((res) => {
echarts.dispose(document.getElementById("echartsLayer"));
if (res.success === true) {
pageInitFun(res);
} else {
tabloading.value = false;
ElMessage.error(res.message);
}
loading.value = false;
});
}
//换热站机组能耗数据接口(热单耗)
function postHeatUctFun() {
tabloading.value = true;
let params = {
supplyId: null,
transferId: [
"0B596F22-F40E-4E16-A552-51B24FEBA66A",
"537DBC95-EF89-4261-934E-63652D789702",
],
startTime: "2023-01-01 00:00:00",
endTime: "2024-10-30 00:00:00",
interval: 2,
};
fullscreenLoading.value = true;
postHeatUct(enertyInfo).then((res) => {
echarts.dispose(document.getElementById("echartsLayer"));
// postHeatUct(params).then((res) => {
if (res.success === true) {
pageInitFun(res);
} else {
tabloading.value = false;
ElMessage.error(res.message);
}
fullscreenLoading.value = false;
loading.value = false;
});
}
//换热站机组能耗数据接口(电单耗)
function postElecUcFun() {
tabloading.value = true;
fullscreenLoading.value = true;
postElecUc(enertyInfo).then((res) => {
echarts.dispose(document.getElementById("echartsLayer"));
if (res.success === true) {
pageInitFun(res);
} else {
tabloading.value = false;
ElMessage.error(res.message);
}
fullscreenLoading.value = false;
loading.value = false;
});
}
//换热站机组能耗数据接口(水单耗)
function postWaterUcFun() {
tabloading.value = true;
fullscreenLoading.value = true;
postWaterUc(enertyInfo).then((res) => {
echarts.dispose(document.getElementById("echartsLayer"));
if (res.success === true) {
pageInitFun(res);
} else {
tabloading.value = false;
ElMessage.error(res.message);
}
fullscreenLoading.value = false;
loading.value = false;
});
}
//换热站机组能耗数据接口(度日数热耗)
function postDayHeatFun() {
tabloading.value = true;
fullscreenLoading.value = true;
postDayHeat(enertyInfo).then((res) => {
echarts.dispose(document.getElementById("echartsLayer"));
if (res.success === true) {
pageInitFun(res);
} else {
tabloading.value = false;
ElMessage.error(res.message);
}
fullscreenLoading.value = false;
loading.value = false;
});
}
//换热站机组能耗数据接口(一网回温)
function postFirBackTFun() {
tabloading.value = true;
fullscreenLoading.value = true;
postFirBackT(enertyInfo).then((res) => {
echarts.dispose(document.getElementById("echartsLayer"));
if (res.success === true) {
pageInitFun(res);
} else {
tabloading.value = false;
ElMessage.error(res.message);
}
fullscreenLoading.value = false;
loading.value = false;
});
}
//换热站机组能耗数据接口(一网万平米流量)
function postWPMLLFun() {
tabloading.value = true;
postWPMLL(enertyInfo).then((res) => {
echarts.dispose(document.getElementById("echartsLayer"));
if (res.success === true) {
pageInitFun(res);
} else {
tabloading.value = false;
ElMessage.error(res.message);
}
loading.value = false;
});
}
//换热站机组能耗数据接口(一网万平米流量)
function postHeatEffiUcFun() {
tabloading.value = true;
postHeatEffiUc(enertyInfo).then((res) => {
echarts.dispose(document.getElementById("echartsLayer"));
if (res.success === true) {
pageInitFun(res);
} else if (res.status == 9) {
setInterval(function () {
tabloading.value = false;
this.postHeatEffiUcFun();
}, 600000);
}
loading.value = false;
});
}
//换热站机组能耗数据接口(换热站二网均温)
function postSecAvgTUcFun() {
tabloading.value = true;
postSecAvgTUc(enertyInfo).then((res) => {
echarts.dispose(document.getElementById("echartsLayer"));
if (res.success === true) {
pageInitFun(res);
} else if (res.status == 9) {
setInterval(function () {
tabloading.value = false;
this.postSecAvgTUcFun();
}, 600000);
}
loading.value = false;
});
}
......@@ -592,13 +537,16 @@ function pageInitFun(res) {
};
tableData.push(tableArr);
});
nodata.value = true;
nodata.value = false;
tabloading.value = false;
echartData.length = 0;
echartSeries.length = 0;
echartDataLegend.length = 0;
echartDataTime.length = 0;
if (res.data.hourWater.length > 0) {
nodata.value = true;
echartData.value = dataDeal(res.data.hourWater);
echartData.value[0].listInfo.forEach((element) => {
if (element.gatherTime) {
echartDataTime.push(element.gatherTime);
......@@ -655,6 +603,7 @@ function pageInitFun(res) {
echartDataLegend.push(element.name);
});
echartInit();
}
}
function setContentHeight() {
......@@ -782,12 +731,13 @@ function echartInit() {
}
function changeFun() {
nodata.value = true;
if (nodata.value) {
var divWidth = document.getElementById("contentBlock").offsetWidth;
var divHeight = document.getElementById("contentBlock").scrollHeight;
computedWidth.value = divWidth + "px";
computedHeight.value = divHeight * 0.75 + "px";
echartInit();
}
}
onMounted(() => {
......
<template>
<div class="contentBlock">
<div
class="contentBlock"
v-loading="loading"
element-loading-background="rgba(122, 122, 122, 0.6)"
>
<div class="contentBlockInn" id="printBlock">
<el-card class="card-contianer">
<table
......@@ -111,7 +115,11 @@
</td>
</tr>
</table>
<el-table :data="tableData" style="width: 100%; margin-top: 10px">
<el-table
:data="tableData"
empty-text="暂无数据"
style="width: 100%; margin-top: 10px"
>
<el-table-column type="index" width="60" label="序号" align="center">
</el-table-column>
<el-table-column prop="jurisdictionName" label="区域名称" />
......@@ -213,6 +221,7 @@ import { saveAs } from "file-saver";
import XLSX from "xlsx-js-style";
import { postTransferArea } from "../../api/report";
import print from "vue3-print-nb";
const loading = ref(false);
const radioTitle = ref("供热站");
const options = reactive([]);
const enterpriseId = ref(null);
......@@ -411,7 +420,6 @@ function postTransferAreaFun() {
enertyInfo.jurisdictionIds.forEach((item) => {
options.forEach((item1) => {
if (item1.value == item) {
console.log(item1.lable);
areaName.value.push(item1.lable);
}
});
......@@ -423,7 +431,7 @@ function postTransferAreaFun() {
} else {
supplyYearSend = enertyInfo.supplyYear.split("-")[1];
}
loading.value = true;
let params = {
jurisdictionIds: enertyInfo.jurisdictionIds,
supplyYear: supplyYearSend,
......@@ -448,13 +456,13 @@ function postTransferAreaFun() {
} else {
ElMessage.error(res.message);
}
loading.value = false;
});
}
onMounted(() => {
initRadioList();
postTransferAreaFun();
//postHeatForecastFun();
});
onUnmounted(() => {});
</script>
......
......@@ -673,12 +673,21 @@ function postHeatForecastFun() {
};
postHeatForecast(params).then((res) => {
if (res.success === true) {
temp.value = res.data.temp;
predTemp.value = res.data.predTemp;
weather.value = res.data.weather;
dataList.value = res.data.list;
dataTime.value = res.data.time;
res.data.temp ? (temp.value = res.data.temp) : (temp.value = {});
res.data.predTemp
? (predTemp.value = res.data.predTemp)
: (predTemp.value = {});
res.data.weather
? (weather.value = res.data.weather)
: (weather.value = {});
res.data.list ? (dataList.value = res.data.list) : (dataList.value = {});
res.data.time ? (dataTime.value = res.data.time) : (dataTime.value = {});
} else {
temp.value = {};
predTemp.value = {};
weather.value = {};
dataList.value = {};
dataTime.value = {};
ElMessage.error(res.message);
}
loading.value = false;
......@@ -696,12 +705,21 @@ function postPrintHeatForecastFun() {
};
postPrintHeatForecast(params).then((res) => {
if (res.success === true) {
temp.value = res.data.temp;
predTemp.value = res.data.predTemp;
weather.value = res.data.weather;
dataList.value = res.data.list;
dataTime.value = res.data.time;
res.data.temp ? (temp.value = res.data.temp) : (temp.value = {});
res.data.predTemp
? (predTemp.value = res.data.predTemp)
: (predTemp.value = {});
res.data.weather
? (weather.value = res.data.weather)
: (weather.value = {});
res.data.list ? (dataList.value = res.data.list) : (dataList.value = {});
res.data.time ? (dataTime.value = res.data.time) : (dataTime.value = {});
} else {
temp.value = {};
predTemp.value = {};
weather.value = {};
dataList.value = {};
dataTime.value = {};
ElMessage.error(res.message);
}
loading.value = false;
......
......@@ -800,7 +800,7 @@ function timeFun() {
const prehour = new Date(today.getTime() - 60 * 60 * 1000);
today.setDate(today.getDate());
enertyInfo.queryTime =
today.toISOString().split("T")[0] + " " + prehour.getHours() + ":00:0";
today.toISOString().split("T")[0] + " " + prehour.getHours() + ":00:00";
}
function postHeatAnalysisFun() {
......@@ -809,11 +809,6 @@ function postHeatAnalysisFun() {
return false;
}
loading.value = true;
predictionTemp.value = {};
realTemp.value = {};
comprehensiveTemp.value = {};
analysisSupplys.value = {};
analysisZones.value = {};
let params = {
QueryTime: enertyInfo.queryTime,
};
......@@ -835,6 +830,11 @@ function postHeatAnalysisFun() {
? (analysisZones.value = res.data.analysisZones)
: (analysisZones.value = {});
} else {
predictionTemp.value = {};
realTemp.value = {};
comprehensiveTemp.value = {};
analysisSupplys.value = {};
analysisZones.value = {};
ElMessage.error(res.message);
}
loading.value = false;
......
<template>
<div class="contentBlock">
<div
class="contentBlock"
v-loading="loading"
element-loading-background="rgba(122, 122, 122, 0.6)"
>
<div class="contentBlockInn" id="printBlock">
<el-card class="card-contianer">
<table
......@@ -8,8 +12,13 @@
style="background-color: #99bbe8"
>
<tr>
<th style="text-align:center;">
<span style="font-size:24px;">港益热量汇总实时分析<span style="font-size:14px; margin-left:10px;">当前时间:{{ enertyInfo.nowTime }}</span></span>
<th style="text-align: center">
<span style="font-size: 24px"
>港益热量汇总实时分析<span
style="font-size: 14px; margin-left: 10px"
>当前时间:{{ enertyInfo.nowTime }}</span
></span
>
</th>
</tr>
</table>
......@@ -59,10 +68,26 @@
</div>
</template>
</el-table-column>
<el-table-column prop="predictionHeat" label="预测瞬时热量" width="130" />
<el-table-column prop="currentPredictionHeat" label="当前预测热量累计" width="150" />
<el-table-column prop="currentDifference" label="当前热量偏差量" width="150" />
<el-table-column prop="groupFirstSupplyTemp" width="150" align="center">
<el-table-column
prop="predictionHeat"
label="预测瞬时热量"
width="130"
/>
<el-table-column
prop="currentPredictionHeat"
label="当前预测热量累计"
width="150"
/>
<el-table-column
prop="currentDifference"
label="当前热量偏差量"
width="150"
/>
<el-table-column
prop="groupFirstSupplyTemp"
width="150"
align="center"
>
<template v-slot:header>
<div>
<div>滨海供热集团</div>
......@@ -102,11 +127,7 @@
</div>
</template>
</el-table-column>
<el-table-column
prop="groupSupplyFlow"
width="180"
align="center"
>
<el-table-column prop="groupSupplyFlow" width="180" align="center">
<template v-slot:header>
<div>
<div>滨海供热集团</div>
......@@ -114,11 +135,7 @@
</div>
</template>
</el-table-column>
<el-table-column
prop="groupSupplyHeat"
width="180"
align="center"
>
<el-table-column prop="groupSupplyHeat" width="180" align="center">
<template v-slot:header>
<div>
<div>滨海供热集团</div>
......@@ -126,29 +143,39 @@
</div>
</template>
</el-table-column>
<el-table-column fixed="right" prop="currentRealHeat" label="当前实际热量累计" />
<el-table-column
fixed="right"
prop="currentRealHeat"
label="当前实际热量累计"
/>
</el-table>
<table
cellpadding="0"
cellspacing="1"
class="bottomTable"
style="width: 100%;"
style="width: 100%"
>
<tr>
<td style="text-align:center; width:50%;">预测方案生成 瞬时热量(GJ/H)</td>
<td style="text-align:center;">{{ tableDataList.prePlan }}</td>
<td style="text-align: center; width: 50%">
预测方案生成 瞬时热量(GJ/H)
</td>
<td style="text-align: center">{{ tableDataList.prePlan }}</td>
</tr>
<tr>
<td style="text-align:center;">滨海供热集团汇总 瞬时热量(GJ/H)</td>
<td style="text-align:center;">{{ tableDataList.groupTotal }}</td>
<td style="text-align: center">滨海供热集团汇总 瞬时热量(GJ/H)</td>
<td style="text-align: center">{{ tableDataList.groupTotal }}</td>
</tr>
<tr>
<td style="text-align:center;">预测瞬时热量与汇总 瞬时热量 差两(GJ/H)</td>
<td style="text-align:center;">{{ tableDataList.prePlanDiff }}</td>
<td style="text-align: center">
预测瞬时热量与汇总 瞬时热量 差两(GJ/H)
</td>
<td style="text-align: center">{{ tableDataList.prePlanDiff }}</td>
</tr>
<tr>
<td style="text-align:center;">预测瞬时热量与汇总 瞬时热量 差量比(%)</td>
<td style="text-align:center;">{{ tableDataList.diffPercent }}</td>
<td style="text-align: center">
预测瞬时热量与汇总 瞬时热量 差量比(%)
</td>
<td style="text-align: center">{{ tableDataList.diffPercent }}</td>
</tr>
</table>
<div>
......@@ -170,11 +197,11 @@
style="margin: 15px 0 0 10px"
>导出</el-button
>
<router-link to="/Forecast"><el-button
type="primary"
style="margin: 15px 0 0 10px"
<router-link to="/Forecast"
><el-button type="primary" style="margin: 15px 0 0 10px"
>返回</el-button
></router-link>
></router-link
>
</div>
</div>
</el-card>
......@@ -187,7 +214,11 @@
style="background-color: #ff0"
>
<tr>
<td colspan="17">港益热量汇总实时分析&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;当前时间:{{ enertyInfo.nowTime }}</td>
<td colspan="17">
港益热量汇总实时分析&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;当前时间:{{
enertyInfo.nowTime
}}
</td>
</tr>
<tr>
<td>地点</td>
......@@ -228,22 +259,38 @@
<td>{{ item.currentRealHeat }}</td>
</tr>
<tr>
<td colspan="17">预测方案生成 瞬时热量(GJ/H)&nbsp;&nbsp;&nbsp;&nbsp;{{ tableDataList.prePlan }}</td>
<td colspan="17">
预测方案生成 瞬时热量(GJ/H)&nbsp;&nbsp;&nbsp;&nbsp;{{
tableDataList.prePlan
}}
</td>
</tr>
<tr>
<td colspan="17">滨海供热集团汇总 瞬时热量(GJ/H)&nbsp;&nbsp;&nbsp;&nbsp;{{ tableDataList.groupTotal }}</td>
<td colspan="17">
滨海供热集团汇总 瞬时热量(GJ/H)&nbsp;&nbsp;&nbsp;&nbsp;{{
tableDataList.groupTotal
}}
</td>
</tr>
<tr>
<td colspan="17">预测瞬时热量与汇总 瞬时热量 差两(GJ/H)&nbsp;&nbsp;&nbsp;&nbsp;{{ tableDataList.prePlanDiff }}</td>
<td colspan="17">
预测瞬时热量与汇总 瞬时热量 差两(GJ/H)&nbsp;&nbsp;&nbsp;&nbsp;{{
tableDataList.prePlanDiff
}}
</td>
</tr>
<tr>
<td colspan="17">预测瞬时热量与汇总 瞬时热量 差量比(%)&nbsp;&nbsp;&nbsp;&nbsp;{{ tableDataList.diffPercent }}</td>
<td colspan="17">
预测瞬时热量与汇总 瞬时热量 差量比(%)&nbsp;&nbsp;&nbsp;&nbsp;{{
tableDataList.diffPercent
}}
</td>
</tr>
</table>
</div>
</template>
<script setup>
import { ref, reactive, onMounted, onUnmounted } from "vue";
import { ref, reactive, onMounted, onUnmounted, onActivated } from "vue";
import http from "../../api/http";
import zhCn from "element-plus/dist/locale/zh-cn.mjs";
import { ElMessage } from "element-plus";
......@@ -251,10 +298,11 @@ import { saveAs } from "file-saver";
import XLSX from "xlsx-js-style";
import { postRealAnalysis } from "../../api/report";
import print from "vue3-print-nb";
const loading = ref(false);
const enertyInfo = reactive({
nowTime: null,
queryTime: null
})
queryTime: null,
});
const tableDataList = ref([]);
const tableData = ref([]);
const vPrint = print;
......@@ -390,41 +438,49 @@ function exportTableToExcel() {
ElMessage.success("导出成功!请稍后。。。");
}
function postRealAnalysisFun() {
var date = new Date();
var year = date.getFullYear();
var dateArr = [
date.getMonth() + 1,
date.getDate(),
date.getHours(),
date.getMinutes(),
date.getSeconds(),
];
enertyInfo.nowTime = year + "-" + dateArr[0] + "-" + dateArr[1] + " " + dateArr[2] + ":" + dateArr[3] + ":" + dateArr[4];
enertyInfo.queryTime = year + "-" + dateArr[0] + "-" + dateArr[1] + " " + dateArr[2] + ":" + "00:00";
console.log(enertyInfo.queryTime);
const today = new Date();
const prehour = new Date(today.getTime() - 60 * 60 * 1000);
today.setDate(today.getDate());
enertyInfo.queryTime =
today.toISOString().split("T")[0] + " " + prehour.getHours() + ":00:00";
let params = {
QueryTime: "2024-01-01 09:00:00",
//QueryTime: year + "-" + dateArr[0] + "-" + dateArr[1] + " " + dateArr[2] + ":" + "00:00"
QueryTime: enertyInfo.queryTime,
};
loading.value = true;
postRealAnalysis(params).then((res) => {
if (res.success === true) {
tableDataList.value = res.data[0];
tableData.value = res.data[0].repData;
tableData.value.forEach(element => {
element.firstInstantaneousFlow = parseFloat(element.firstInstantaneousFlow).toFixed(1);
tableData.value.forEach((element) => {
element.firstInstantaneousFlow = parseFloat(
element.firstInstantaneousFlow
).toFixed(1);
element.predictionHeat = parseFloat(element.predictionHeat).toFixed(1);
element.currentPredictionHeat = element.currentPredictionHeat ? element.currentPredictionHeat : "-";
element.currentDifference = element.currentDifference ? element.currentDifference : "-";
element.groupFirstSupplyPress = element.groupFirstSupplyPress ? element.groupFirstSupplyPress : "-";
element.groupFirstBackPress = element.groupFirstBackPress ? element.groupFirstBackPress : "-";
element.currentRealHeat = element.currentRealHeat ? element.currentRealHeat : "-";
})
element.currentPredictionHeat = element.currentPredictionHeat
? element.currentPredictionHeat
: "-";
element.currentDifference = element.currentDifference
? element.currentDifference
: "-";
element.groupFirstSupplyPress = element.groupFirstSupplyPress
? element.groupFirstSupplyPress
: "-";
element.groupFirstBackPress = element.groupFirstBackPress
? element.groupFirstBackPress
: "-";
element.currentRealHeat = element.currentRealHeat
? element.currentRealHeat
: "-";
});
} else {
ElMessage.error(res.message);
}
loading.value = false;
});
}
onActivated(() => {
postRealAnalysisFun();
});
onMounted(() => {
postRealAnalysisFun();
});
......
<template>
<div class="contentBlock">
<div
class="contentBlock"
v-loading="loading"
element-loading-background="rgba(122, 122, 122, 0.6)"
>
<div class="contentBlockInn" id="printBlock">
<el-card class="card-contianer">
<table
cellpadding="0"
cellspacing="1"
style="background-color: #99bbe8"
empty-text="暂无数据"
>
<tr>
<th style="width: 25%">起始时间</th>
......@@ -144,17 +149,17 @@
<td>电量(KWH/㎡)</td>
</tr>
<tr v-for="item in tableData" :key="item.sn">
<td>{{item.sn}}</td>
<td>{{item.jurisdictionName}}</td>
<td>{{item.transferName}}</td>
<td>{{item.area}}</td>
<td>{{item.heat}}</td>
<td>{{item.heatG}}</td>
<td>{{item.heatW}}</td>
<td>{{item.water}}</td>
<td>{{item.waterUsed}}</td>
<td>{{item.electric}}</td>
<td>{{item.electricUsed}}</td>
<td>{{ item.sn }}</td>
<td>{{ item.jurisdictionName }}</td>
<td>{{ item.transferName }}</td>
<td>{{ item.area }}</td>
<td>{{ item.heat }}</td>
<td>{{ item.heatG }}</td>
<td>{{ item.heatW }}</td>
<td>{{ item.water }}</td>
<td>{{ item.waterUsed }}</td>
<td>{{ item.electric }}</td>
<td>{{ item.electricUsed }}</td>
</tr>
</table>
</div>
......@@ -169,6 +174,7 @@ import { saveAs } from "file-saver";
import XLSX from "xlsx-js-style";
import { postTransferEnergy } from "../../api/report";
import print from "vue3-print-nb";
const loading = ref(false);
const radioTitle = ref("供热站");
const options = reactive([]);
const enterpriseId = ref(null);
......@@ -276,9 +282,7 @@ function exportTableToExcel() {
}
}
ws["!cols"] = [
{ wch: 5 }
];
ws["!cols"] = [{ wch: 5 }];
XLSX.utils.sheet_add_aoa(ws, [], {
origin: "A1",
......@@ -294,28 +298,13 @@ function exportTableToExcel() {
ElMessage.success("导出成功!请稍后。。。");
}
function timeFun() {
var date = new Date();
var year = date.getFullYear();
var dateArr = [
date.getMonth() + 1,
date.getDate(),
date.getHours(),
date.getMinutes(),
date.getSeconds(),
];
var endTimeDay = parseInt(dateArr[1] - 1);
if (endTimeDay < 10) {
endTimeDay = "0" + endTimeDay;
}
if (dateArr[0] < 10) {
dateArr[0] = "0" + dateArr[0];
}
if (dateArr[1] < 10) {
dateArr[1] = "0" + dateArr[1];
}
enertyInfo.startTime = year + "-" + dateArr[0] + "-" + endTimeDay;
enertyInfo.endTime = year + "-" + dateArr[0] + "-" + dateArr[1];
console.log(enertyInfo);
const today = new Date();
const preday = new Date(today);
preday.setDate(preday.getDate() - 1);
today.setDate(today.getDate());
enertyInfo.startTime =
preday.toISOString().split("T")[0];
enertyInfo.endTime = today.toISOString().split("T")[0];
}
//根据权限初始化单选列表
......@@ -360,7 +349,6 @@ function postTransferEnergyFun() {
enertyInfo.jurisdictionIds.forEach((item) => {
options.forEach((item1) => {
if (item1.value == item) {
console.log(item1.lable);
areaName.value.push(item1.lable);
}
});
......@@ -370,12 +358,18 @@ function postTransferEnergyFun() {
ElMessage.error("请选择开始时间");
return false;
}
if (enertyInfo.endTime == null) {
ElMessage.error("请选择结束时间");
return false;
}
loading.value = true;
postTransferEnergy(enertyInfo).then((res) => {
if (res.success === true) {
tableData.value = res.data;
} else {
ElMessage.error(res.message);
}
loading.value = false;
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment