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