Commit 407f011b authored by qjeslks's avatar qjeslks
parents e7f8cf6f d032ca7b
export const ExternalSERVEICE='http://218.69.97.198:8001'
export const WithinSERVEICE='http://192.168.1.252:8001'
// export const ExternalSERVEICE='http://localhost:5013'
// export const WithinSERVEICE='http://localhost:5013'
// export const ExternalSERVEICE='http://218.69.97.198:8001'
// export const WithinSERVEICE='http://192.168.1.252:8001'
export const ExternalSERVEICE='http://localhost:5013'
export const WithinSERVEICE='http://localhost:5013'
export const CURRLOGO="LOGO_gangyi.png"
......@@ -2,85 +2,97 @@
"hash": "76d29559",
"configHash": "2effb732",
"lockfileHash": "415b4f88",
"browserHash": "685fa378",
"browserHash": "5ddfa83a",
"optimized": {
"vue": {
"src": "../../vue/dist/vue.runtime.esm-bundler.js",
"file": "vue.js",
"fileHash": "6309e73d",
"fileHash": "6e724a88",
"needsInterop": false
},
"element-plus": {
"src": "../../element-plus/es/index.mjs",
"file": "element-plus.js",
"fileHash": "146301e4",
"fileHash": "db311218",
"needsInterop": false
},
"@element-plus/icons-vue": {
"src": "../../@element-plus/icons-vue/dist/index.js",
"file": "@element-plus_icons-vue.js",
"fileHash": "93e2c300",
"fileHash": "466ff16a",
"needsInterop": false
},
"vue3-smooth-scroll": {
"src": "../../vue3-smooth-scroll/dist/vue-smooth-scroll.min.js",
"file": "vue3-smooth-scroll.js",
"fileHash": "27f6c3ba",
"fileHash": "73ac546b",
"needsInterop": true
},
"@kyvg/vue3-notification": {
"src": "../../@kyvg/vue3-notification/dist/index.es.js",
"file": "@kyvg_vue3-notification.js",
"fileHash": "c12b6fc2",
"fileHash": "7913f170",
"needsInterop": false
},
"jquery": {
"src": "../../jquery/dist/jquery.js",
"file": "jquery.js",
"fileHash": "e06fd542",
"fileHash": "953bbb02",
"needsInterop": true
},
"element-plus/dist/locale/zh-cn.mjs": {
"src": "../../element-plus/dist/locale/zh-cn.mjs",
"file": "element-plus_dist_locale_zh-cn__mjs.js",
"fileHash": "42051261",
"fileHash": "7c795d35",
"needsInterop": false
},
"axios": {
"src": "../../axios/index.js",
"file": "axios.js",
"fileHash": "00e1ad23",
"fileHash": "67fae377",
"needsInterop": false
},
"vue-router": {
"src": "../../vue-router/dist/vue-router.mjs",
"file": "vue-router.js",
"fileHash": "e89cca3b",
"fileHash": "036d0e44",
"needsInterop": false
},
"vuex": {
"src": "../../vuex/dist/vuex.esm-bundler.js",
"file": "vuex.js",
"fileHash": "fb2c9771",
"fileHash": "9c4ab673",
"needsInterop": false
},
"echarts": {
"src": "../../echarts/index.js",
"file": "echarts.js",
"fileHash": "9784809e",
"fileHash": "a587f8e5",
"needsInterop": false
},
"@amap/amap-jsapi-loader": {
"src": "../../@amap/amap-jsapi-loader/dist/index.js",
"file": "@amap_amap-jsapi-loader.js",
"fileHash": "70af1a04",
"fileHash": "58817286",
"needsInterop": true
},
"mitt": {
"src": "../../mitt/dist/mitt.mjs",
"file": "mitt.js",
"fileHash": "3e8c4b6d",
"fileHash": "a116a557",
"needsInterop": false
},
"jsencrypt": {
"src": "../../jsencrypt/lib/index.js",
"file": "jsencrypt.js",
"fileHash": "5f3dd49a",
"needsInterop": false
},
"lodash/cloneDeep": {
"src": "../../lodash/cloneDeep.js",
"file": "lodash_cloneDeep.js",
"fileHash": "7a95577d",
"needsInterop": true
}
},
"chunks": {
......
// export const ExternalSERVEICE='http://218.69.97.198:8001'
// export const WithinSERVEICE='http://192.168.1.252:8001'
export const ExternalSERVEICE='http://localhost:5013'
export const WithinSERVEICE='http://localhost:5013'
export const ExternalSERVEICE='http://218.69.97.198:8001'
export const WithinSERVEICE='http://192.168.1.252:8001'
// export const ExternalSERVEICE='http://localhost:5013'
// export const WithinSERVEICE='http://localhost:5013'
export const CURRLOGO="LOGO_gangyi.png"
......@@ -243,18 +243,18 @@
transferName:"",
isDisabled: true,
transferStatus: 0,
holidayAction: null,
holidayMonStart: null,
holidayDayStart: null,
holidayHourStart: null,
holidayMonEnd: null,
holidayDayEnd: null,
holidayHourEnd: null,
holidayWeekStart: null,
holidayWeekEnd: null,
holidayConstantTemp: null,
weekHourStart: null,
weekHourEnd: null
holidayAction: false,
holidayMonStart: 0,
holidayDayStart: 0,
holidayHourStart: 0,
holidayMonEnd: 0,
holidayDayEnd: 0,
holidayHourEnd: 0,
holidayWeekStart: 0,
holidayWeekEnd: 0,
holidayConstantTemp: 0,
weekHourStart: 0,
weekHourEnd: 0
});
onMounted(() => {
......@@ -419,46 +419,46 @@
try{
//console.log("write row:"+element.transferName);
var writeValue = "";
if(forms.holidayAction != null && forms.holidayAction != ""){
//if(forms.holidayAction != null && forms.holidayAction != ""){
element.holidayAction=forms.holidayAction;
writeValue +="HolidayAction:"+forms.holidayAction + ";";
}
if(element.holidayMonStart != null && forms.holidayMonStart != ""){
writeValue ="HolidayAction:"+ (forms.holidayAction===true ? "1;":"0;");
// }
// if(element.holidayMonStart != null && forms.holidayMonStart != ""){
element.holidayMonStart=forms.holidayMonStart;
writeValue +="HolidayMonStart:"+forms.holidayMonStart + ";";
}
if(element.holidayDayStart != null && forms.holidayDayStart != ""){
// }
// if(element.holidayDayStart != null && forms.holidayDayStart != ""){
element.holidayDayStart=forms.holidayDayStart;
writeValue +="HolidayDayStart:"+forms.holidayDayStart + ";";
}
if(element.holidayHourStart != null && forms.holidayHourStart != ""){
//}
//if(element.holidayHourStart != null && forms.holidayHourStart != ""){
element.holidayHourStart=forms.holidayHourStart;
writeValue +="HolidayHourStart:"+forms.holidayHourStart + ";";
}
if(element.holidayMonEnd != null && forms.holidayMonEnd != ""){
//}
//if(element.holidayMonEnd != null && forms.holidayMonEnd != ""){
element.holidayMonEnd=forms.holidayMonEnd;
writeValue +="HolidayMonEnd:"+forms.holidayMonEnd + ";";
}
if(element.holidayDayEnd != null && forms.holidayDayEnd != ""){
//}
//if(element.holidayDayEnd != null && forms.holidayDayEnd != ""){
element.holidayDayEnd=forms.holidayDayEnd;
writeValue +="HolidayDayEnd:"+forms.holidayDayEnd + ";";
}
if(element.holidayHourEnd != null && forms.holidayHourEnd != ""){
//}
//if(element.holidayHourEnd != null && forms.holidayHourEnd != ""){
element.holidayHourEnd=forms.holidayHourEnd;
writeValue +="HolidayHourEnd:"+forms.holidayHourEnd + ";";
}
if(element.holidayWeekStart != null && forms.holidayWeekStart != ""){
//}
//if(element.holidayWeekStart != null && forms.holidayWeekStart != ""){
element.holidayWeekStart=forms.holidayWeekStart;
writeValue +="HolidayWeekStart:"+forms.holidayWeekStart + ";";
}
if(element.holidayWeekEnd != null && forms.holidayWeekEnd != ""){
//}
//if(element.holidayWeekEnd != null && forms.holidayWeekEnd != ""){
element.holidayWeekEnd=forms.holidayWeekEnd;
writeValue +="HolidayWeekEnd:"+forms.holidayWeekEnd + ";";
}
if(element.holidayConstantTemp != null && forms.holidayConstantTemp != ""){
//}
//if(element.holidayConstantTemp != null && forms.holidayConstantTemp != ""){
element.holidayConstantTemp=forms.holidayConstantTemp;
writeValue +="HolidayConstantTemp:"+forms.holidayConstantTemp + ";";
}
//}
if(element.weekHourStart != null && forms.weekHourStart != ""){
element.weekHourStart=forms.weekHourStart;
writeValue +="WeekHourStart:"+forms.weekHourStart + ";";
......
......@@ -71,7 +71,7 @@
<el-form-item label="4#电调阀给定:" v-if="forms.ecv4OpeningSet != null">
<el-input v-model="forms.ecv4OpeningSet" style="width: 200px;" v-float-number/>
</el-form-item>
<el-form-item label="1#循环泵频率给定" v-if="forms.criclePump1FreqGiven != null">
<el-form-item label="1#循环泵频率给定" v-if="forms.criclePump1FreqGiven != null">
<el-input v-model="forms.criclePump1FreqGiven" style="width: 200px;" v-float-number/>
</el-form-item>
<el-form-item label="2#循环泵频率给定:" v-if="forms.criclePump2FreqGiven != null">
......
......@@ -392,6 +392,14 @@ const routes = [
title: "循环泵压差控制",
},
},
{
path: "/Remote/CtrlSecondTemp",
name: "CtrlSecondTemp",
component: () => import("@/views/RemotePage/CtrlSecondTemp.vue"),
meta: {
title: "二次网方案",
},
},
{
path: "/Video",
name: "VideoPage",
......
<template>
<el-card class="card-contianer">
<label>二次网供水方案列表:</label>
<!-- <el-select v-model="value" class="m-2" placeholder="Select" size="large">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> -->
</el-card>
</template>
\ No newline at end of file
<template>
<div class="contentBlock">
<div class="contentBlockInn">
<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"
......@@ -70,25 +74,26 @@
</table>
</td>
<th rowspan="3">
<div>
<div class="printHidden">
<div class="btngrounp">
<el-button type="primary" @click="postTransferAreaFun"
>查询</el-button
><el-button
type="primary"
@click="exportTableToExcel"
style="margin: 0 0 0 5px"
v-print="printObj"
style="margin: 0 0 0 10px"
>打印</el-button
><el-button
>
<!-- <el-button
type="primary"
@click="exportTableToExcel"
style="margin: 0 0 0 5px"
>打印预览</el-button
>
> -->
<el-button
type="primary"
@click="exportTableToExcel"
style="margin: 0 0 0 5px"
style="margin: 0 0 0 10px"
>导出</el-button
>
</div>
......@@ -110,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="区域名称" />
......@@ -135,6 +144,71 @@
</el-table>
</el-card>
</div>
<table
cellpadding="0"
cellspacing="1"
class="exlBlock"
id="exlBlock"
style="background-color: #99bbe8"
>
<tr>
<td colspan="3">年度:{{ enertyInfo.supplyYear }}</td>
<td colspan="2">
类型:{{ enertyInfo.nature == -1 ? "全部" : ""
}}{{ enertyInfo.nature == 0 ? "民用" : ""
}}{{ enertyInfo.nature == 1 ? "公建" : "" }}
</td>
<td colspan="3">
节能方式:{{ enertyInfo.energyType == -1 ? "全部" : ""
}}{{ enertyInfo.energyType == 1 ? "一步节能" : ""
}}{{ enertyInfo.energyType == 2 ? "二步节能" : ""
}}{{ enertyInfo.energyType == 3 ? "三步节能" : ""
}}{{ enertyInfo.energyType == 4 ? "四步节能" : "" }}
</td>
<td colspan="6">
供热站:<span v-for="item in areaName" :key="item"
>{{ item }}&nbsp;&nbsp;&nbsp;&nbsp;</span
>
</td>
</tr>
<tr>
<td rowspan="2">序号</td>
<td rowspan="2">区域名称</td>
<td rowspan="2">换热站名称</td>
<td rowspan="2">年度</td>
<td colspan="2">居民(应供收费面积)</td>
<td colspan="2">大公建(应供建筑面积)</td>
<td colspan="2">小公建(应供建筑面积)</td>
<td rowspan="2">应供建筑面积</td>
<td rowspan="2">实供建筑面积C</td>
<td rowspan="2">实供收费面积D</td>
<td rowspan="2">计算面积</td>
</tr>
<tr>
<td>收费面积</td>
<td>停暖面积</td>
<td>实供建筑面积</td>
<td>停暖建筑面积</td>
<td>实供建筑面积</td>
<td>停暖建筑面积</td>
</tr>
<tr v-for="(item, index) in tableData" :key="index">
<td>{{ index + 1 }}</td>
<td>{{ item.jurisdictionName }}</td>
<td>{{ item.stationName }}</td>
<td>{{ item.supplyYear }}</td>
<td>{{ item.realCostCiviled }}</td>
<td>{{ item.realCostSPB }}</td>
<td>{{ item.realBuildBPB }}</td>
<td>{{ item.stopBuildBPB }}</td>
<td>{{ item.realBuildSPB }}</td>
<td>{{ item.stopBuildSPB }}</td>
<td>{{ item.supplyArea }}</td>
<td>{{ item.realBuild }}</td>
<td>{{ item.realCost }}</td>
<td>{{ item.calculateArea }}</td>
</tr>
</table>
</div>
</template>
<script setup>
......@@ -146,11 +220,14 @@ import { ElMessage } from "element-plus";
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);
const checkboxList = ref([]);
const tableData = ref([]);
const areaName = ref([]);
const yearList = [
"2016-2017",
"2017-2018",
......@@ -178,7 +255,127 @@ const enertyInfo = reactive({
energyType: -1,
supplyYear: "2024-2025",
});
const vPrint = print;
const printObj = {
id: "printBlock",
popTitle: "明日预测报表",
extraHead: '<meta http-equiv="Content-Language"content="zh-cn"/>',
zIndex: 20002,
};
function exportTableToExcel() {
const workbook = XLSX.utils.book_new();
var ws = XLSX.utils.table_to_sheet(document.getElementById("exlBlock"));
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 };
}
}
}
for (const key in ws) {
if (
key === "A1" ||
key === "A2" ||
key === "B1" ||
key === "C1" ||
key === "D1" ||
key === "E1" ||
key === "F1" ||
key === "G1" ||
key === "H1" ||
key === "I1" ||
key === "J1" ||
key === "K1" ||
key === "L1" ||
key === "M1" ||
key === "N1" ||
ws[key].v === "序号" ||
ws[key].v === "区域名称" ||
ws[key].v === "换热站名称" ||
ws[key].v === "年度" ||
ws[key].v === "居民(应供收费面积)" ||
ws[key].v === "大公建(应供建筑面积)" ||
ws[key].v === "小公建(应供建筑面积)" ||
ws[key].v === "收费面积" ||
ws[key].v === "停暖面积" ||
ws[key].v === "实供建筑面积" ||
ws[key].v === "停暖建筑面积" ||
ws[key].v === "应供建筑面积" ||
ws[key].v === "实供建筑面积C" ||
ws[key].v === "实供收费面积D" ||
ws[key].v === "计算面积"
) {
ws[key].s = {
alignment: {
horizontal: "center",
vertical: "center",
},
border: {
bottom: {
color: "#000000",
style: "thin",
},
left: {
color: "#000000",
style: "thin",
},
right: {
color: "#000000",
style: "thin",
},
top: {
color: "#000000",
style: "thin",
},
},
fill: {
fgColor: { rgb: "0097d5fd" },
},
font: {
bold: true,
family: 2,
size: 12,
},
};
}
}
ws["!cols"] = [{ wch: 5 }];
XLSX.utils.sheet_add_aoa(ws, [], {
origin: "A1",
});
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, "面积统计报表.xlsx");
ElMessage.success("导出成功!请稍后。。。");
}
//根据权限初始化单选列表
function initRadioList() {
var result = store.getters.getEnterprise();
......@@ -219,7 +416,14 @@ function initRadioList() {
}
function postTransferAreaFun() {
console.log(enertyInfo);
areaName.value.length = 0;
enertyInfo.jurisdictionIds.forEach((item) => {
options.forEach((item1) => {
if (item1.value == item) {
areaName.value.push(item1.lable);
}
});
});
var date = new Date();
let supplyYearSend = ref();
if (date.getMonth() + 1 < 7) {
......@@ -227,7 +431,7 @@ function postTransferAreaFun() {
} else {
supplyYearSend = enertyInfo.supplyYear.split("-")[1];
}
loading.value = true;
let params = {
jurisdictionIds: enertyInfo.jurisdictionIds,
supplyYear: supplyYearSend,
......@@ -252,13 +456,13 @@ function postTransferAreaFun() {
} else {
ElMessage.error(res.message);
}
loading.value = false;
});
}
onMounted(() => {
initRadioList();
postTransferAreaFun();
//postHeatForecastFun();
});
onUnmounted(() => {});
</script>
......@@ -310,4 +514,20 @@ table.botList td {
text-align: left;
font-weight: bolder;
}
.exlBlock {
display: none;
}
@media print {
.printHidden {
display: none;
}
@page {
size: auto;
margin: 3mm;
}
body,
html {
height: auto !important;
}
}
</style>
\ No newline at end of file
<template>
<div class="contentBlock">
<div class="contentBlockInn">
<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"
......@@ -28,6 +32,8 @@
type="primary"
style="min-width: 70px"
@click="postHeatForecastFun"
class="printHidden"
v-show="printHidden"
>历史查询</el-button
>
</th>
......@@ -51,6 +57,8 @@
<el-button
type="primary"
style="min-width: 70px"
class="printHidden"
v-show="printHidden"
@click="postPrintHeatForecastFun"
>打印查询</el-button
>
......@@ -213,9 +221,19 @@
</tr>
<tr>
<th>时间</th>
<td colspan="5">{{ dataTime.createBillTime ? dataTime.createBillTime : "-" }}</td>
<td>{{ dataTime.datePrediction ? dataTime.datePrediction : "-" }}</td>
<td>{{ dataTime.degreeDatePrediction ? dataTime.degreeDatePrediction : "-" }}</td>
<td colspan="5">
{{ dataTime.createBillTime ? dataTime.createBillTime : "-" }}
</td>
<td>
{{ dataTime.datePrediction ? dataTime.datePrediction : "-" }}
</td>
<td>
{{
dataTime.degreeDatePrediction
? dataTime.degreeDatePrediction
: "-"
}}
</td>
</tr>
</table>
<table
......@@ -231,18 +249,19 @@
</tr>
</table>
<div>
<div class="btngrounp">
<div class="btngrounp printHidden" v-show="printHidden">
<el-button
type="primary"
@click="sendClick"
v-print="printObj"
style="margin: 15px 0 0 0"
>打印</el-button
><el-button
>
<!-- <el-button
type="primary"
@click="exportTableToExcel"
style="margin: 15px 0 0 10px"
>打印预览</el-button
>
-->
<el-button
type="primary"
@click="exportTableToExcel"
......@@ -251,19 +270,192 @@
>
<el-button
type="primary"
@click="exportTableToExcel"
style="margin: 15px 0 0 10px"
@click="handleExport"
>导出PDF</el-button
>
<router-link to="/RealAnalysis"><el-button
type="primary"
style="margin: 15px 0 0 10px"
<router-link to="/RealAnalysis"
><el-button type="primary" style="margin: 15px 0 0 10px"
>实时分析</el-button
></router-link>
></router-link
>
</div>
</div>
</el-card>
</div>
<table
cellpadding="0"
cellspacing="3"
class="exlBlock"
id="exlBlock"
style="background-color: #ff0"
>
<tr>
<td colspan="15">
记录时间:{{
enertyInfo.queryTime
}}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;打印时间:{{
enertyInfo.printTime
}}
</td>
</tr>
<tr>
<td colspan="15">
天气状况:{{
weather.weatherCondition ? weather.weatherCondition : "-"
}}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;风力:{{
weather.wind ? weather.wind : "-"
}}
</td>
</tr>
<tr>
<th rowspan="6">00:00-24:00<br />数据分析</th>
<th>白天</th>
<th>01:00</th>
<th>02:00</th>
<th>03:00</th>
<th>04:00</th>
<th>05:00</th>
<th>06:00</th>
<th>07:00</th>
<th>08:00</th>
<th>09:00</th>
<th>10:00</th>
<th>11:00</th>
<th>12:00</th>
<th>制表编号</th>
</tr>
<tr class="gc">
<td>室外预测值(℃)</td>
<td>{{ temp.temp1 ? temp.temp1 : "-" }}</td>
<td>{{ temp.temp2 ? temp.temp2 : "-" }}</td>
<td>{{ temp.temp3 ? temp.temp3 : "-" }}</td>
<td>{{ temp.temp4 ? temp.temp4 : "-" }}</td>
<td>{{ temp.temp5 ? temp.temp5 : "-" }}</td>
<td>{{ temp.temp6 ? temp.temp6 : "-" }}</td>
<td>{{ temp.temp7 ? temp.temp7 : "-" }}</td>
<td>{{ temp.temp8 ? temp.temp8 : "-" }}</td>
<td>{{ temp.temp9 ? temp.temp9 : "-" }}</td>
<td>{{ temp.temp10 ? temp.temp10 : "-" }}</td>
<td>{{ temp.temp11 ? temp.temp11 : "-" }}</td>
<td>{{ temp.temp12 ? temp.temp12 : "-" }}</td>
<td>-</td>
</tr>
<tr class="gc">
<td>室外体感预测值(℃)</td>
<td>{{ predTemp.temp1 ? predTemp.temp1 : "-" }}</td>
<td>{{ predTemp.temp2 ? predTemp.temp2 : "-" }}</td>
<td>{{ predTemp.temp3 ? predTemp.temp3 : "-" }}</td>
<td>{{ predTemp.temp4 ? predTemp.temp4 : "-" }}</td>
<td>{{ predTemp.temp5 ? predTemp.temp5 : "-" }}</td>
<td>{{ predTemp.temp6 ? predTemp.temp6 : "-" }}</td>
<td>{{ predTemp.temp7 ? predTemp.temp7 : "-" }}</td>
<td>{{ predTemp.temp8 ? predTemp.temp8 : "-" }}</td>
<td>{{ predTemp.temp9 ? predTemp.temp9 : "-" }}</td>
<td>{{ predTemp.temp10 ? predTemp.temp10 : "-" }}</td>
<td>{{ predTemp.temp11 ? predTemp.temp11 : "-" }}</td>
<td>{{ predTemp.temp12 ? predTemp.temp12 : "-" }}</td>
<td>-</td>
</tr>
<tr>
<th>夜间</th>
<th>13:00</th>
<th>14:00</th>
<th>15:00</th>
<th>16:00</th>
<th>17:00</th>
<th>18:00</th>
<th>19:00</th>
<th>20:00</th>
<th>21:00</th>
<th>22:00</th>
<th>23:00</th>
<th>24:00</th>
<th>
<div>预测室外</div>
<div>平均温度</div>
</th>
</tr>
<tr class="gc">
<td>室外预测值(℃)</td>
<td>{{ temp.temp13 ? temp.temp13 : "-" }}</td>
<td>{{ temp.temp14 ? temp.temp14 : "-" }}</td>
<td>{{ temp.temp15 ? temp.temp15 : "-" }}</td>
<td>{{ temp.temp16 ? temp.temp16 : "-" }}</td>
<td>{{ temp.temp17 ? temp.temp17 : "-" }}</td>
<td>{{ temp.temp18 ? temp.temp18 : "-" }}</td>
<td>{{ temp.temp19 ? temp.temp19 : "-" }}</td>
<td>{{ temp.temp20 ? temp.temp20 : "-" }}</td>
<td>{{ temp.temp21 ? temp.temp21 : "-" }}</td>
<td>{{ temp.temp22 ? temp.temp22 : "-" }}</td>
<td>{{ temp.temp23 ? temp.temp23 : "-" }}</td>
<td>{{ temp.temp24 ? temp.temp24 : "-" }}</td>
<td style="background-color: #ffffff">
{{ temp.avgTemp ? temp.avgTemp : "-" }}
</td>
</tr>
<tr class="gc">
<td>室外体感预测值(℃)</td>
<td>{{ predTemp.temp13 ? predTemp.temp13 : "-" }}</td>
<td>{{ predTemp.temp14 ? predTemp.temp14 : "-" }}</td>
<td>{{ predTemp.temp15 ? predTemp.temp15 : "-" }}</td>
<td>{{ predTemp.temp16 ? predTemp.temp16 : "-" }}</td>
<td>{{ predTemp.temp17 ? predTemp.temp17 : "-" }}</td>
<td>{{ predTemp.temp18 ? predTemp.temp18 : "-" }}</td>
<td>{{ predTemp.temp19 ? predTemp.temp19 : "-" }}</td>
<td>{{ predTemp.temp20 ? predTemp.temp20 : "-" }}</td>
<td>{{ predTemp.temp21 ? predTemp.temp21 : "-" }}</td>
<td>{{ predTemp.temp22 ? predTemp.temp22 : "-" }}</td>
<td>{{ predTemp.temp23 ? predTemp.temp23 : "-" }}</td>
<td>{{ predTemp.temp24 ? predTemp.temp24 : "-" }}</td>
<td style="background-color: #ffffff">
{{ predTemp.avgTemp ? predTemp.avgTemp : "-" }}
</td>
</tr>
<tr>
<th colspan="15">后一天热量(万吉焦)</th>
</tr>
<tr>
<th>地点</th>
<th colspan="2">00:00-04:00</th>
<th colspan="2">04:00-08:00</th>
<th colspan="2">08:00-12:00</th>
<th colspan="2">12:00-16:00</th>
<th colspan="2">16:00-20:00</th>
<th colspan="2">20:00-24:00</th>
<th colspan="2">小计</th>
</tr>
<tr v-for="item in dataList" :key="item">
<th>{{ item.name }}</th>
<td colspan="2">{{ item.part1 }}</td>
<td colspan="2">{{ item.part2 }}</td>
<td colspan="2">{{ item.part3 }}</td>
<td colspan="2">{{ item.part4 }}</td>
<td colspan="2">{{ item.part5 }}</td>
<td colspan="2">{{ item.part6 }}</td>
<td colspan="2">{{ item.total }}</td>
</tr>
<tr>
<th>时间</th>
<td colspan="10">
{{ dataTime.createBillTime ? dataTime.createBillTime : "-" }}
</td>
<td colspan="2">
{{ dataTime.datePrediction ? dataTime.datePrediction : "-" }}
</td>
<td colspan="2">
{{
dataTime.degreeDatePrediction ? dataTime.degreeDatePrediction : "-"
}}
</td>
</tr>
<tr>
<td colspan="5">制表:</td>
<td colspan="5">确认:</td>
<td colspan="5">领导:</td>
</tr>
</table>
</div>
</template>
<script setup>
......@@ -273,7 +465,14 @@ import zhCn from "element-plus/dist/locale/zh-cn.mjs";
import { ElMessage } from "element-plus";
import { saveAs } from "file-saver";
import XLSX from "xlsx-js-style";
import { postHeatForecast, postPrintHeatForecast } from "../../api/report";
import {
postHeatForecast,
postPrintHeatForecast,
postSaveHeatForecast,
} from "../../api/report";
import print from "vue3-print-nb";
import { htmlPdf } from "../../utils/toPDF";
const loading = ref(false);
const temp = ref([]); //24小时室外预测值
const weather = ref([]); //当日气象信息
const predTemp = ref([]); //24小时室外体感预测值
......@@ -283,96 +482,284 @@ const enertyInfo = reactive({
printTime: null,
queryTime: "2024-1-1 09:00:00",
});
function timeFun() {
var date = new Date();
var year = date.getFullYear();
var dateArr = [
date.getMonth() + 1,
date.getDate(),
date.getHours(),
date.getMinutes(),
date.getSeconds(),
];
var endTimeHour = parseInt(dateArr[2] - 1);
if (endTimeHour < 10) {
endTimeHour = "0" + endTimeHour;
}
if (dateArr[0] < 10) {
dateArr[0] = "0" + dateArr[0];
const printHidden = ref(true);
const vPrint = print;
const printObj = {
id: "printBlock",
popTitle: "明日预测报表",
extraHead: '<meta http-equiv="Content-Language"content="zh-cn"/>',
zIndex: 20002,
openCallback: openCallback,
};
const handleExport = (name) => {
printHidden.value = false;
setTimeout(function () {
var fileName = "明日预测报表";
const fileList = document.getElementsByClassName("contentBlockInn");
htmlPdf(fileName, document.querySelector("#printBlock"), fileList);
ElMessage.success("导出成功!请稍后。。。");
printHidden.value = true;
}, 100);
};
function openCallback() {
postSaveHeatForecastFun();
}
function exportTableToExcel() {
const workbook = XLSX.utils.book_new();
var ws = XLSX.utils.table_to_sheet(document.getElementById("exlBlock"));
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 };
}
if (dateArr[1] < 10) {
dateArr[1] = "0" + dateArr[1];
}
if (dateArr[2] < 10) {
dateArr[2] = "0" + dateArr[2];
}
if (dateArr[3] < 10) {
dateArr[3] = "0" + dateArr[3];
for (const key in ws) {
if (
key === "A1" ||
key === "A2" ||
key === "A2" ||
key === "A3" ||
key === "O2" ||
key === "O3" ||
key === "O4" ||
key === "O5" ||
key === "O6" ||
ws[key].v === "白天" ||
ws[key].v === "01:00" ||
ws[key].v === "02:00" ||
ws[key].v === "03:00" ||
ws[key].v === "04:00" ||
ws[key].v === "05:00" ||
ws[key].v === "06:00" ||
ws[key].v === "07:00" ||
ws[key].v === "08:00" ||
ws[key].v === "09:00" ||
ws[key].v === "10:00" ||
ws[key].v === "11:00" ||
ws[key].v === "12:00" ||
ws[key].v === "13:00" ||
ws[key].v === "14:00" ||
ws[key].v === "15:00" ||
ws[key].v === "16:00" ||
ws[key].v === "17:00" ||
ws[key].v === "18:00" ||
ws[key].v === "19:00" ||
ws[key].v === "20:00" ||
ws[key].v === "21:00" ||
ws[key].v === "22:00" ||
ws[key].v === "23:00" ||
ws[key].v === "24:00" ||
ws[key].v === "室外预测值(℃)" ||
ws[key].v === "室外体感预测值(℃)" ||
ws[key].v === "夜间" ||
ws[key].v === "室外预测值(℃)" ||
ws[key].v === "室外体感预测值(℃)" ||
ws[key].v === "00:00-04:00" ||
ws[key].v === "04:00-08:00" ||
ws[key].v === "08:00-12:00" ||
ws[key].v === "12:00-16:00" ||
ws[key].v === "16:00-20:00" ||
ws[key].v === "20:00-24:00" ||
ws[key].v === "地点" ||
ws[key].v === "后一天热量(万吉焦)" ||
ws[key].v === "小计" ||
ws[key].v === "时间"
) {
ws[key].s = {
alignment: {
horizontal: "center",
vertical: "center",
},
border: {
bottom: {
color: "#000000",
style: "thin",
},
left: {
color: "#000000",
style: "thin",
},
right: {
color: "#000000",
style: "thin",
},
top: {
color: "#000000",
style: "thin",
},
},
fill: {
fgColor: { rgb: "0097d5fd" },
},
font: {
bold: true,
family: 2,
size: 12,
},
};
}
if (dateArr[4] < 10) {
dateArr[4] = "0" + dateArr[4];
}
let endTimes =
year + "-" + dateArr[0] + "-" + dateArr[1] + " " + endTimeHour + ":00:00";
// enertyInfo.printTime =
// year +
// "-" +
// dateArr[0] +
// "-" +
// dateArr[1] +
// " " +
// dateArr[2] +
// ":" +
// dateArr[3] +
// ":" +
// dateArr[4];
enertyInfo.queryTime = endTimes;
ws["!cols"] = [
{ wch: 20 },
{ wch: 25 },
{ wch: 10 },
{ wch: 10 },
{ wch: 10 },
{ wch: 10 },
{ wch: 10 },
{ wch: 10 },
{ wch: 10 },
{ wch: 10 },
{ wch: 10 },
{ wch: 10 },
{ wch: 10 },
{ wch: 10 },
{ wch: 30 },
];
XLSX.utils.sheet_add_aoa(ws, [], {
origin: "A1",
});
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, "明日预测报表.xlsx");
ElMessage.success("导出成功!请稍后。。。");
}
function timeFun() {
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";
}
function postHeatForecastFun() {
if(enertyInfo.queryTime == null) {
if (enertyInfo.queryTime == null) {
ElMessage.error("请选择记录时间");
return false;
}
loading.value = true;
let params = {
QueryTime: enertyInfo.queryTime,
};
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;
});
}
function postPrintHeatForecastFun() {
if(enertyInfo.printTime == null) {
if (enertyInfo.printTime == null) {
ElMessage.error("请选择打印时间");
return false;
}
loading.value = true;
let params = {
QueryTime: enertyInfo.printTime,
};
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;
});
}
function postSaveHeatForecastFun() {
let params = {
Temp: temp.value,
Weather: weather.value,
PredTemp: "",
List: dataList.value,
Time: dataTime.value,
};
postSaveHeatForecast(params).then((res) => {
if (res.success === true) {
ElMessage.success("打印记录保存成功");
} else {
ElMessage.error("打印记录保存失败");
}
});
}
onMounted(() => {
timeFun();
postHeatForecastFun();
// 创建定时任务
let timeOff = true;
setInterval(() => {
const time = new Date();
let minutes = time.getMinutes().toString().padStart(2, "0");
if (minutes == 15) {
if (timeOff) {
timeOff = false;
postHeatForecastFun();
}
} else {
timeOff = true;
}
}, 1000);
});
onUnmounted(() => {});
</script>
......@@ -426,4 +813,20 @@ table.botList td {
text-align: left;
font-weight: bolder;
}
.exlBlock {
display: none;
}
@media print {
.printHidden {
display: none;
}
@page {
size: auto;
margin: 3mm;
}
body,
html {
height: auto !important;
}
}
</style>
\ No newline at end of file
<template>
<div class="contentBlock">
<div class="contentBlockInn">
<div
class="contentBlock"
id="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"
......@@ -13,7 +18,9 @@
<span>{{ enertyInfo.nowTime }} 起始时间</span>
</th>
<th width="25%">
记录时间&nbsp;&nbsp;<el-config-provider :locale="zhCn">
记录时间&nbsp;&nbsp;
<div>
<el-config-provider :locale="zhCn">
<el-date-picker
type="datetime"
value-format="YYYY-MM-DD HH:mm:ss"
......@@ -22,15 +29,18 @@
v-model="enertyInfo.queryTime"
/>
</el-config-provider>
</div>
</th>
<th width="25%"></th>
<th>
<div class="printHidden">
<el-button
type="primary"
style="min-width: 70px"
@click="postHeatAnalysisFun"
>历史查询</el-button
>
</div>
</th>
</tr>
</table>
......@@ -234,6 +244,7 @@
</tr>
</table>
<table
id="conTable"
cellpadding="0"
cellspacing="1"
style="margin-top: 10px; background-color: #99bbe8"
......@@ -311,19 +322,19 @@
</tr>
</template>
</table>
<div>
<div class="printHidden">
<div class="btngrounp">
<el-button
type="primary"
@click="sendClick"
style="margin: 15px 0 0 0"
v-print="printObj"
>打印</el-button
><el-button
>
<!--<el-button
type="primary"
@click="exportTableToExcel"
style="margin: 15px 0 0 10px"
>打印预览</el-button
>
-->
<el-button
type="primary"
@click="exportTableToExcel"
......@@ -334,6 +345,272 @@
</div>
</el-card>
</div>
<div class="exlBlock" id="exlBlock">
<table cellpadding="0" cellspacing="0">
<tr>
<td colspan="15">
{{ enertyInfo.nowTime }} 起始时间
<span
>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;记录时间{{
enertyInfo.queryTime
}}</span
>
</td>
</tr>
<tr>
<td rowspan="8">00:00-24:00数据分析</td>
<td>白天</td>
<td>01:00</td>
<td>02:00</td>
<td>03:00</td>
<td>04:00</td>
<td>05:00</td>
<td>06:00</td>
<td>07:00</td>
<td>08:00</td>
<td>09:00</td>
<td>10:00</td>
<td>11:00</td>
<td>12:00</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>室外预测值(℃)</td>
<td>{{ predictionTemp.temp1 ? predictionTemp.temp1 : "-" }}</td>
<td>{{ predictionTemp.temp2 ? predictionTemp.temp2 : "-" }}</td>
<td>{{ predictionTemp.temp3 ? predictionTemp.temp3 : "-" }}</td>
<td>{{ predictionTemp.temp4 ? predictionTemp.temp4 : "-" }}</td>
<td>{{ predictionTemp.temp5 ? predictionTemp.temp5 : "-" }}</td>
<td>{{ predictionTemp.temp6 ? predictionTemp.temp6 : "-" }}</td>
<td>{{ predictionTemp.temp7 ? predictionTemp.temp7 : "-" }}</td>
<td>{{ predictionTemp.temp8 ? predictionTemp.temp8 : "-" }}</td>
<td>{{ predictionTemp.temp9 ? predictionTemp.temp9 : "-" }}</td>
<td>{{ predictionTemp.temp10 ? predictionTemp.temp10 : "-" }}</td>
<td>{{ predictionTemp.temp11 ? predictionTemp.temp11 : "-" }}</td>
<td>{{ predictionTemp.temp12 ? predictionTemp.temp12 : "-" }}</td>
<td>
测室外平均温度(℃)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{
predictionTemp.avgTemp ? predictionTemp.avgTemp : "-"
}}
</td>
</tr>
<tr>
<td>天津气象局反馈温度(℃)</td>
<td>{{ realTemp.temp1 ? realTemp.temp1 : "-" }}</td>
<td>{{ realTemp.temp2 ? realTemp.temp2 : "-" }}</td>
<td>{{ realTemp.temp3 ? realTemp.temp3 : "-" }}</td>
<td>{{ realTemp.temp4 ? realTemp.temp4 : "-" }}</td>
<td>{{ realTemp.temp5 ? realTemp.temp5 : "-" }}</td>
<td>{{ realTemp.temp6 ? realTemp.temp6 : "-" }}</td>
<td>{{ realTemp.temp7 ? realTemp.temp7 : "-" }}</td>
<td>{{ realTemp.temp8 ? realTemp.temp8 : "-" }}</td>
<td>{{ realTemp.temp9 ? realTemp.temp9 : "-" }}</td>
<td>{{ realTemp.temp10 ? realTemp.temp10 : "-" }}</td>
<td>{{ realTemp.temp11 ? realTemp.temp11 : "-" }}</td>
<td>{{ realTemp.temp12 ? realTemp.temp12 : "-" }}</td>
<td>
天津气象局反馈温度(℃)&nbsp;&nbsp;{{
realTemp.avgTemp ? realTemp.avgTemp : "-"
}}
</td>
</tr>
<tr>
<td>综合气象温度(℃)</td>
<td>
{{ comprehensiveTemp.temp1 ? comprehensiveTemp.temp1 : "-" }}
</td>
<td>
{{ comprehensiveTemp.temp2 ? comprehensiveTemp.temp2 : "-" }}
</td>
<td>
{{ comprehensiveTemp.temp3 ? comprehensiveTemp.temp3 : "-" }}
</td>
<td>
{{ comprehensiveTemp.temp4 ? comprehensiveTemp.temp4 : "-" }}
</td>
<td>
{{ comprehensiveTemp.temp5 ? comprehensiveTemp.temp5 : "-" }}
</td>
<td>
{{ comprehensiveTemp.temp6 ? comprehensiveTemp.temp6 : "-" }}
</td>
<td>
{{ comprehensiveTemp.temp7 ? comprehensiveTemp.temp7 : "-" }}
</td>
<td>
{{ comprehensiveTemp.temp8 ? comprehensiveTemp.temp8 : "-" }}
</td>
<td>
{{ comprehensiveTemp.temp9 ? comprehensiveTemp.temp9 : "-" }}
</td>
<td>
{{ comprehensiveTemp.temp10 ? comprehensiveTemp.temp10 : "-" }}
</td>
<td>
{{ comprehensiveTemp.temp11 ? comprehensiveTemp.temp11 : "-" }}
</td>
<td>
{{ comprehensiveTemp.temp12 ? comprehensiveTemp.temp12 : "-" }}
</td>
<td>
综合气象温度(℃)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{
comprehensiveTemp.avgTemp ? comprehensiveTemp.avgTemp : "-"
}}
</td>
</tr>
<tr>
<th>夜间</th>
<th>13:00</th>
<th>14:00</th>
<th>15:00</th>
<th>16:00</th>
<th>17:00</th>
<th>18:00</th>
<th>19:00</th>
<th>20:00</th>
<th>21:00</th>
<th>22:00</th>
<th>23:00</th>
<th>24:00</th>
</tr>
<tr>
<td>室外预测值(℃)</td>
<td>{{ predictionTemp.temp13 ? predictionTemp.temp13 : "-" }}</td>
<td>{{ predictionTemp.temp14 ? predictionTemp.temp14 : "-" }}</td>
<td>{{ predictionTemp.temp15 ? predictionTemp.temp15 : "-" }}</td>
<td>{{ predictionTemp.temp16 ? predictionTemp.temp16 : "-" }}</td>
<td>{{ predictionTemp.temp17 ? predictionTemp.temp17 : "-" }}</td>
<td>{{ predictionTemp.temp18 ? predictionTemp.temp18 : "-" }}</td>
<td>{{ predictionTemp.temp19 ? predictionTemp.temp19 : "-" }}</td>
<td>{{ predictionTemp.temp20 ? predictionTemp.temp20 : "-" }}</td>
<td>{{ predictionTemp.temp21 ? predictionTemp.temp21 : "-" }}</td>
<td>{{ predictionTemp.temp22 ? predictionTemp.temp22 : "-" }}</td>
<td>{{ predictionTemp.temp23 ? predictionTemp.temp23 : "-" }}</td>
<td>{{ predictionTemp.temp24 ? predictionTemp.temp24 : "-" }}</td>
</tr>
<tr>
<td>天津气象局反馈温度(℃)</td>
<td>{{ realTemp.temp13 ? realTemp.temp13 : "-" }}</td>
<td>{{ realTemp.temp14 ? realTemp.temp14 : "-" }}</td>
<td>{{ realTemp.temp15 ? realTemp.temp15 : "-" }}</td>
<td>{{ realTemp.temp16 ? realTemp.temp16 : "-" }}</td>
<td>{{ realTemp.temp17 ? realTemp.temp17 : "-" }}</td>
<td>{{ realTemp.temp18 ? realTemp.temp18 : "-" }}</td>
<td>{{ realTemp.temp19 ? realTemp.temp19 : "-" }}</td>
<td>{{ realTemp.temp20 ? realTemp.temp20 : "-" }}</td>
<td>{{ realTemp.temp21 ? realTemp.temp21 : "-" }}</td>
<td>{{ realTemp.temp22 ? realTemp.temp22 : "-" }}</td>
<td>{{ realTemp.temp23 ? realTemp.temp23 : "-" }}</td>
<td>{{ realTemp.temp24 ? realTemp.temp24 : "-" }}</td>
</tr>
<tr>
<td>综合气象温度(℃)</td>
<td>
{{ comprehensiveTemp.temp13 ? comprehensiveTemp.temp13 : "-" }}
</td>
<td>
{{ comprehensiveTemp.temp14 ? comprehensiveTemp.temp14 : "-" }}
</td>
<td>
{{ comprehensiveTemp.temp15 ? comprehensiveTemp.temp15 : "-" }}
</td>
<td>
{{ comprehensiveTemp.temp16 ? comprehensiveTemp.temp16 : "-" }}
</td>
<td>
{{ comprehensiveTemp.temp17 ? comprehensiveTemp.temp17 : "-" }}
</td>
<td>
{{ comprehensiveTemp.temp18 ? comprehensiveTemp.temp18 : "-" }}
</td>
<td>
{{ comprehensiveTemp.temp19 ? comprehensiveTemp.temp19 : "-" }}
</td>
<td>
{{ comprehensiveTemp.temp20 ? comprehensiveTemp.temp20 : "-" }}
</td>
<td>
{{ comprehensiveTemp.temp21 ? comprehensiveTemp.temp21 : "-" }}
</td>
<td>
{{ comprehensiveTemp.temp22 ? comprehensiveTemp.temp22 : "-" }}
</td>
<td>
{{ comprehensiveTemp.temp23 ? comprehensiveTemp.temp23 : "-" }}
</td>
<td>
{{ comprehensiveTemp.temp24 ? comprehensiveTemp.temp24 : "-" }}
</td>
</tr>
<tr>
<th rowspan="2">地点</th>
<th colspan="2">小计(万吉焦)</th>
<th colspan="2">00:00-04:00</th>
<th colspan="2">04:00-08:00</th>
<th colspan="2">08:00-12:00</th>
<th colspan="2">12:00-16:00</th>
<th colspan="2">16:00-20:00</th>
<th colspan="2">20:00-24:00</th>
</tr>
<tr>
<th>测算热量</th>
<th>实际热量</th>
<th>测算热量</th>
<th>实际热量</th>
<th>测算热量</th>
<th>实际热量</th>
<th>测算热量</th>
<th>实际热量</th>
<th>测算热量</th>
<th>实际热量</th>
<th>测算热量</th>
<th>实际热量</th>
<th>测算热量</th>
<th>实际热量</th>
</tr>
<tr v-for="(item, key) in analysisSupplys" :key="key">
<th>{{ item.name }}</th>
<td>{{ item.total.measurement }}</td>
<td>{{ item.total.reality }}</td>
<td>{{ item.part1.measurement }}</td>
<td>{{ item.part1.reality }}</td>
<td>{{ item.part2.measurement }}</td>
<td>{{ item.part2.reality }}</td>
<td>{{ item.part3.measurement }}</td>
<td>{{ item.part3.reality }}</td>
<td>{{ item.part4.measurement }}</td>
<td>{{ item.part4.reality }}</td>
<td>{{ item.part5.measurement }}</td>
<td>{{ item.part5.reality }}</td>
<td>{{ item.part6.measurement }}</td>
<td>{{ item.part6.reality }}</td>
</tr>
<tr>
<th>区域</th>
<th colspan="3">能耗项目</th>
<th>测算值</th>
<th>实际值(集团反馈)</th>
<th colspan="4">港益用热量测算与实际热量差额</th>
<th colspan="5">港益用热量测算与实际热量差额百分比</th>
</tr>
<template v-for="item in analysisZones" :key="item.zoneName">
<tr>
<th rowspan="2">{{ item.zoneName }}</th>
<th colspan="3">{{ item.parts[0].partName }}</th>
<td>{{ item.parts[0].measurement }}</td>
<td>{{ item.parts[0].reality }}</td>
<td colspan="4" rowspan="2">{{ item.heatDifference }}</td>
<td colspan="5" rowspan="2">{{ item.heatDifferencePercentage }}</td>
</tr>
<tr>
<th colspan="3">{{ item.parts[1].partName }}</th>
<td>{{ item.parts[1].measurement }}</td>
<td>{{ item.parts[1].reality }}</td>
</tr>
</template>
</table>
</div>
</div>
</template>
<script setup>
......@@ -344,94 +621,259 @@ import { ElMessage } from "element-plus";
import { saveAs } from "file-saver";
import XLSX from "xlsx-js-style";
import { postHeatAnalysis } from "../../api/report";
import print from "vue3-print-nb";
const loading = ref(false);
const predictionTemp = ref([]);
const realTemp = ref([]);
const comprehensiveTemp = ref([]);
const analysisSupplys = ref([]);
const analysisZones = ref([]);
const printHidden = ref(true);
const enertyInfo = reactive({
nowTime: null,
queryTime: null,
});
function timeFun() {
var date = new Date();
var year = date.getFullYear();
var dateArr = [
date.getMonth() + 1,
date.getDate(),
date.getHours(),
date.getMinutes(),
date.getSeconds(),
];
var endTimeHour = parseInt(dateArr[2] - 1);
if (endTimeHour < 10) {
endTimeHour = "0" + endTimeHour;
}
if (dateArr[0] < 10) {
dateArr[0] = "0" + dateArr[0];
const vPrint = print;
const printObj = {
id: "printBlock",
popTitle: "热量析分报表",
extraHead: '<meta http-equiv="Content-Language"content="zh-cn"/>',
zIndex: 20002,
};
let tableData = reactive([]);
function exportTableToExcel() {
const workbook = XLSX.utils.book_new();
var ws = XLSX.utils.table_to_sheet(document.getElementById("exlBlock"));
const range = XLSX.utils.decode_range(ws["!ref"]);
const cellList = Object.keys(ws).filter((item) => item.indexOf("!") < 0);
const border = {
top: {
style: "thin",
},
bottom: {
style: "thin",
},
left: {
style: "thin",
},
right: {
style: "thin",
},
};
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 };
}
if (dateArr[1] < 10) {
dateArr[1] = "0" + dateArr[1];
}
if (dateArr[2] < 10) {
dateArr[2] = "0" + dateArr[2];
}
if (dateArr[3] < 10) {
dateArr[3] = "0" + dateArr[3];
for (const key in ws) {
if (
key === "A1" ||
key === "A2" ||
key === "O2" ||
key === "O3" ||
key === "O4" ||
key === "O5" ||
ws[key].v === "白天" ||
ws[key].v === "01:00" ||
ws[key].v === "02:00" ||
ws[key].v === "03:00" ||
ws[key].v === "04:00" ||
ws[key].v === "05:00" ||
ws[key].v === "06:00" ||
ws[key].v === "07:00" ||
ws[key].v === "08:00" ||
ws[key].v === "09:00" ||
ws[key].v === "10:00" ||
ws[key].v === "11:00" ||
ws[key].v === "12:00" ||
ws[key].v === "13:00" ||
ws[key].v === "14:00" ||
ws[key].v === "15:00" ||
ws[key].v === "16:00" ||
ws[key].v === "17:00" ||
ws[key].v === "18:00" ||
ws[key].v === "19:00" ||
ws[key].v === "20:00" ||
ws[key].v === "21:00" ||
ws[key].v === "22:00" ||
ws[key].v === "23:00" ||
ws[key].v === "24:00" ||
ws[key].v === "室外预测值(℃)" ||
ws[key].v === "天津气象局反馈温度(℃)" ||
ws[key].v === "综合气象温度(℃)" ||
ws[key].v === "夜间" ||
ws[key].v === "室外预测值(℃)" ||
ws[key].v === "天津气象局反馈温度(℃)" ||
ws[key].v === "综合气象温度(℃)" ||
ws[key].v === "00:00-04:00" ||
ws[key].v === "04:00-08:00" ||
ws[key].v === "08:00-12:00" ||
ws[key].v === "12:00-16:00" ||
ws[key].v === "16:00-20:00" ||
ws[key].v === "20:00-24:00" ||
ws[key].v === "地点" ||
ws[key].v === "小计(万吉焦)" ||
ws[key].v === "测算热量" ||
ws[key].v === "实际热量" ||
ws[key].v === "区域" ||
ws[key].v === "能耗项目" ||
ws[key].v === "测算值" ||
ws[key].v === "实际值(集团反馈)" ||
ws[key].v === "港益用热量测算与实际热量差额" ||
ws[key].v === "港益用热量测算与实际热量差额百分比"
) {
ws[key].s = {
alignment: {
horizontal: "center",
vertical: "center",
},
border: {
bottom: {
color: "#000000",
style: "thin",
},
left: {
color: "#000000",
style: "thin",
},
right: {
color: "#000000",
style: "thin",
},
top: {
color: "#000000",
style: "thin",
},
},
fill: {
fgColor: { rgb: "0097d5fd" },
},
font: {
bold: true,
family: 2,
size: 12,
},
};
}
if (dateArr[4] < 10) {
dateArr[4] = "0" + dateArr[4];
}
let endTimes =
year +
"-" +
dateArr[0] +
"-" +
dateArr[1] +
" " +
endTimeHour +
":" +
dateArr[3] +
":" +
dateArr[4];
enertyInfo.nowTime =
year +
"-" +
dateArr[0] +
"-" +
dateArr[1] +
" " +
dateArr[2] +
":" +
dateArr[3] +
":" +
dateArr[4];
enertyInfo.queryTime = endTimes;
ws["!cols"] = [
{ wch: 20 },
{ wch: 25 },
{ wch: 10 },
{ wch: 10 },
{ wch: 10 },
{ wch: 10 },
{ wch: 10 },
{ wch: 10 },
{ wch: 10 },
{ wch: 10 },
{ wch: 10 },
{ wch: 10 },
{ wch: 10 },
{ wch: 10 },
{ wch: 30 },
];
XLSX.utils.sheet_add_aoa(ws, [], {
origin: "A1",
});
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, "热量分析报表.xlsx");
ElMessage.success("导出成功!请稍后。。。");
}
function timeFun() {
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";
}
function postHeatAnalysisFun() {
if (enertyInfo.queryTime == null) {
ElMessage.error("请选择记录时间");
return false;
}
loading.value = true;
let params = {
QueryTime: enertyInfo.queryTime,
};
postHeatAnalysis(params).then((res) => {
if (res.success === true) {
predictionTemp.value = res.data.predictionTemp;
realTemp.value = res.data.realTemp;
comprehensiveTemp.value = res.data.comprehensiveTemp;
analysisSupplys.value = res.data.analysisSupplys;
analysisZones.value = res.data.analysisZones;
res.data.predictionTemp
? (predictionTemp.value = res.data.predictionTemp)
: (predictionTemp.value = {});
res.data.realTemp
? (realTemp.value = res.data.realTemp)
: (realTemp.value = {});
res.data.comprehensiveTemp
? (comprehensiveTemp.value = res.data.comprehensiveTemp)
: (comprehensiveTemp.value = {});
res.data.analysisSupplys
? (analysisSupplys.value = res.data.analysisSupplys)
: (analysisSupplys.value = {});
res.data.analysisZones
? (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;
});
}
function printPage() {
printHidden.value = false;
setTimeout(function () {
let printMe = document.querySelector("#contentBlock");
let printWindow = window.open("", "_blank");
printWindow.document.write(printMe.innerHTML);
printWindow.document.close();
printWindow.focus();
printWindow.print();
printWindow.close();
printHidden.value = true;
}, 100);
}
onMounted(() => {
timeFun();
postHeatAnalysisFun();
// 创建定时任务
let timeOff = true;
setInterval(() => {
const time = new Date();
let minutes = time.getMinutes().toString().padStart(2, "0");
if (minutes == 15) {
if (timeOff) {
timeOff = false;
postHeatAnalysisFun();
}
} else {
timeOff = true;
}
}, 1000);
});
onUnmounted(() => {
});
onUnmounted(() => {});
</script>
<style lang="less" scoped>
.contentBlock {
......@@ -472,4 +914,20 @@ table td {
margin: 0 auto;
text-align: center;
}
.exlBlock {
display: none;
}
@media print {
.printHidden {
display: none;
}
@page {
size: auto;
margin: 3mm;
}
body,
html {
height: auto !important;
}
}
</style>
\ No newline at end of file
<template>
<div class="contentBlock">
<div class="contentBlockInn">
<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"
......@@ -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>
......@@ -55,14 +64,30 @@
<template v-slot:header>
<div>
<div>港益</div>
<span>供水瞬时流量(m³/h)</span>
<span>供水瞬时热量(GJ/H)</span>
</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,113 +143,344 @@
</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>
<div class="btngrounp">
<el-button
type="primary"
@click="sendClick"
v-print="printObj"
style="margin: 15px 0 0 0"
>打印</el-button
><el-button
><!--<el-button
type="primary"
@click="exportTableToExcel"
style="margin: 15px 0 0 10px"
>打印预览</el-button
>
>-->
<el-button
type="primary"
@click="exportTableToExcel"
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>
</div>
<table
cellpadding="0"
cellspacing="3"
class="exlBlock"
id="exlBlock"
style="background-color: #ff0"
>
<tr>
<td colspan="17">
港益热量汇总实时分析&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;当前时间:{{
enertyInfo.nowTime
}}
</td>
</tr>
<tr>
<td>地点</td>
<td>区域换热站计量反馈瞬时流量(m³/h)</td>
<td>区域换热站计量反馈瞬时热量(GJ/H)</td>
<td>港益供水温度(℃)</td>
<td>港益回水温度(℃)</td>
<td>港益供水瞬时流量(m³/h)</td>
<td>港益供水瞬时热量(GJ/H)</td>
<td>预测瞬时热量</td>
<td>当前预测热量累计</td>
<td>当前热量偏差量</td>
<td>滨海供热集团供水温度(℃)</td>
<td>滨海供热集团回水温度(℃)</td>
<td>滨海供热集团供水压力(MP)</td>
<td>滨海供热集团回水压力(MP)</td>
<td>滨海供热集团供水瞬时流量(m³/h)</td>
<td>滨海供热集团供水瞬时热量(GJ/H)</td>
<td>当前实际热量累计</td>
</tr>
<tr v-for="item in tableData" :key="item">
<td>{{ item.pipeName }}</td>
<td>{{ item.firstInstantaneousFlow }}</td>
<td>{{ item.firstInstantaneousHeat }}</td>
<td>{{ item.firstInTemp }}</td>
<td>{{ item.firstOutTemp }}</td>
<td>{{ item.supplyFlow }}</td>
<td>{{ item.supplyHeat }}</td>
<td>{{ item.predictionHeat }}</td>
<td>{{ item.currentPredictionHeat }}</td>
<td>{{ item.currentDifference }}</td>
<td>{{ item.groupFirstSupplyTemp }}</td>
<td>{{ item.groupFirstBackTemp }}</td>
<td>{{ item.groupFirstSupplyPress }}</td>
<td>{{ item.groupFirstBackPress }}</td>
<td>{{ item.groupSupplyFlow }}</td>
<td>{{ item.groupSupplyHeat }}</td>
<td>{{ item.currentRealHeat }}</td>
</tr>
<tr>
<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>
</tr>
<tr>
<td colspan="17">
预测瞬时热量与汇总 瞬时热量 差两(GJ/H)&nbsp;&nbsp;&nbsp;&nbsp;{{
tableDataList.prePlanDiff
}}
</td>
</tr>
<tr>
<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";
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;
const printObj = {
id: "printBlock",
popTitle: "明日预测报表",
extraHead: '<meta http-equiv="Content-Language"content="zh-cn"/>',
zIndex: 20002,
};
function exportTableToExcel() {
const workbook = XLSX.utils.book_new();
var ws = XLSX.utils.table_to_sheet(document.getElementById("exlBlock"));
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);
function postRealAnalysisFun() {
var date = new Date();
var year = date.getFullYear();
var dateArr = [
date.getMonth() + 1,
date.getDate(),
date.getHours(),
date.getMinutes(),
date.getSeconds(),
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 };
}
}
}
for (const key in ws) {
if (
key === "A1" ||
key === "A2" ||
key === "A3" ||
key === "A4" ||
key === "A5" ||
key === "A6" ||
key === "A7" ||
key === "B1" ||
key === "C1" ||
key === "E1" ||
key === "D1" ||
key === "F1" ||
key === "G1" ||
key === "H1" ||
key === "I1" ||
key === "J1" ||
key === "K1" ||
key === "L1" ||
key === "M1" ||
key === "N1" ||
key === "O1" ||
key === "P1" ||
key === "Q1"
) {
ws[key].s = {
alignment: {
horizontal: "center",
vertical: "center",
},
border: {
bottom: {
color: "#000000",
style: "thin",
},
left: {
color: "#000000",
style: "thin",
},
right: {
color: "#000000",
style: "thin",
},
top: {
color: "#000000",
style: "thin",
},
},
fill: {
fgColor: { rgb: "0097d5fd" },
},
font: {
bold: true,
family: 2,
size: 12,
},
};
}
}
ws["!cols"] = [
{ wch: 20 },
{ wch: 10 },
{ wch: 10 },
{ wch: 10 },
{ wch: 10 },
{ wch: 10 },
{ wch: 10 },
{ wch: 10 },
{ wch: 10 },
{ wch: 10 },
{ wch: 10 },
{ wch: 10 },
{ wch: 10 },
{ wch: 10 },
{ wch: 10 },
{ wch: 10 },
{ wch: 20 },
];
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);
XLSX.utils.sheet_add_aoa(ws, [], {
origin: "A1",
});
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, "港益热量汇总实时分析报表.xlsx");
ElMessage.success("导出成功!请稍后。。。");
}
function postRealAnalysisFun() {
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();
});
......@@ -281,4 +529,20 @@ table.bottomTable td {
margin: 0 auto;
text-align: center;
}
.exlBlock {
display: none;
}
@media print {
.printHidden {
display: none;
}
@page {
size: auto;
margin: 3mm;
}
body,
html {
height: auto !important;
}
}
</style>
\ No newline at end of file
<template>
<div class="contentBlock">
<div class="contentBlockInn">
<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>
......@@ -39,7 +44,7 @@
</table>
</td>
<th rowspan="3">
<div>
<div class="printHidden">
<div class="btngrounp">
<el-button
type="primary"
......@@ -48,15 +53,16 @@
>查询</el-button
><el-button
type="primary"
@click="exportTableToExcel"
v-print="printObj"
style="margin: 15px 0 0 10px"
>打印</el-button
><el-button
>
<!--<el-button
type="primary"
@click="exportTableToExcel"
style="margin: 15px 0 0 10px"
>打印预览</el-button
>
>-->
<el-button
type="primary"
@click="exportTableToExcel"
......@@ -84,7 +90,6 @@
v-for="(option, index) in options"
:key="index"
:label="option.value"
:name="option"
>
{{ option.lable }}
</el-checkbox>
......@@ -111,6 +116,52 @@
</el-table>
</el-card>
</div>
<table
class="exlBlock"
id="exlBlock"
cellpadding="0"
cellspacing="1"
style="margin-top: 5px; background-color: #99bbe8"
>
<tr>
<td colspan="2">起始时间:{{ enertyInfo.startTime }}</td>
<td colspan="2">结束时间:{{ enertyInfo.endTime }}</td>
<td colspan="2">
面积:{{ enertyInfo.areaType == 0 ? "计算面积" : "实供建筑面积" }}
</td>
<td colspan="5">
片区:<span v-for="item in areaName" :key="item"
>{{ item }}&nbsp;&nbsp;&nbsp;&nbsp;</span
>
</td>
</tr>
<tr>
<td>序号</td>
<td>片区</td>
<td>换热站名称</td>
<td>面积</td>
<td>热量(GJ)</td>
<td>热耗(GJ/㎡)</td>
<td>热耗(W/㎡)</td>
<td>水量(T)</td>
<td>水耗(KG/㎡)</td>
<td>电量(KWH)</td>
<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>
</tr>
</table>
</div>
</template>
<script setup>
......@@ -122,6 +173,8 @@ import { ElMessage } from "element-plus";
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);
......@@ -133,29 +186,125 @@ const enertyInfo = reactive({
startTime: null,
endTime: null,
});
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;
const areaName = ref([]);
const vPrint = print;
const printObj = {
id: "printBlock",
popTitle: "明日预测报表",
extraHead: '<meta http-equiv="Content-Language"content="zh-cn"/>',
zIndex: 20002,
};
function exportTableToExcel() {
const workbook = XLSX.utils.book_new();
var ws = XLSX.utils.table_to_sheet(document.getElementById("exlBlock"));
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 };
}
}
if (dateArr[0] < 10) {
dateArr[0] = "0" + dateArr[0];
}
if (dateArr[1] < 10) {
dateArr[1] = "0" + dateArr[1];
for (const key in ws) {
if (
key === "A1" ||
key === "A2" ||
key === "B1" ||
key === "C1" ||
key === "D1" ||
key === "E1" ||
key === "F1" ||
key === "G1" ||
ws[key].v === "序号" ||
ws[key].v === "片区" ||
ws[key].v === "换热站名称" ||
ws[key].v === "面积" ||
ws[key].v === "热量(GJ)" ||
ws[key].v === "热耗(GJ/㎡)" ||
ws[key].v === "热耗(W/㎡)" ||
ws[key].v === "水量(T)" ||
ws[key].v === "水耗(KG/㎡)" ||
ws[key].v === "电量(KWH)" ||
ws[key].v === "电量(KWH/㎡)"
) {
ws[key].s = {
alignment: {
horizontal: "center",
vertical: "center",
},
border: {
bottom: {
color: "#000000",
style: "thin",
},
left: {
color: "#000000",
style: "thin",
},
right: {
color: "#000000",
style: "thin",
},
top: {
color: "#000000",
style: "thin",
},
},
fill: {
fgColor: { rgb: "0097d5fd" },
},
font: {
bold: true,
family: 2,
size: 12,
},
};
}
}
enertyInfo.startTime = year + "-" + dateArr[0] + "-" + endTimeDay;
enertyInfo.endTime = year + "-" + dateArr[0] + "-" + dateArr[1];
console.log(enertyInfo);
ws["!cols"] = [{ wch: 5 }];
XLSX.utils.sheet_add_aoa(ws, [], {
origin: "A1",
});
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, "换热站能耗报表.xlsx");
ElMessage.success("导出成功!请稍后。。。");
}
function timeFun() {
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];
}
//根据权限初始化单选列表
......@@ -196,16 +345,31 @@ function initRadioList() {
}
function postTransferEnergyFun() {
areaName.value.length = 0;
enertyInfo.jurisdictionIds.forEach((item) => {
options.forEach((item1) => {
if (item1.value == item) {
areaName.value.push(item1.lable);
}
});
});
if (enertyInfo.startTime == null) {
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;
});
}
......@@ -232,7 +396,7 @@ function postPrintHeatForecastFun() {
onMounted(() => {
timeFun();
initRadioList();
postTransferEnergyFun()
postTransferEnergyFun();
//postHeatForecastFun();
});
onUnmounted(() => {});
......@@ -285,4 +449,20 @@ table.botList td {
text-align: left;
font-weight: bolder;
}
.exlBlock {
display: none;
}
@media print {
.printHidden {
display: none;
}
@page {
size: auto;
margin: 3mm;
}
body,
html {
height: auto !important;
}
}
</style>
\ No newline at end of file
......@@ -210,7 +210,8 @@ import {
getCurrentInstance,
onMounted,
onUpdated,
onBeforeUnmount
onBeforeUnmount,
handleError
} from 'vue';
import { User, Lock } from '@element-plus/icons-vue'
......@@ -290,7 +291,7 @@ function login() {
}
loading.value = true;
userInfo.verificationCode = code.value;
code.value='';
http.post('/api/user/login', userInfo, '正在登录....').then((result) => {
if (!result.success) {
loading.value = false;
......@@ -306,4 +307,11 @@ function login() {
});
}
function handleKeyEvent(event){
if(event.key === 'Enter'){
login();
}
}
window.addEventListener('keydown',handleKeyEvent);
</script>
\ No newline at end of file
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