Commit f6a5e883 authored by 王亚晖's avatar 王亚晖
parents 68aa4f39 2fc187b3
import http from './http'
//热量分析报表
export const postHeatAnalysis = params => {
return http.post(`/api/analysis/report/HeatAnalysis`, params).then(res => res).catch(function (error) {
console.log(error);
})
}
......@@ -59,6 +59,7 @@ import { ref, reactive, onMounted, onUnmounted } from 'vue';
import http from '../../api/http';
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import store from "../../store/index";
import { getFileName } from '../../utils/utils';
//分页设置
const currentPage = ref(1)
......@@ -66,6 +67,7 @@ var pageSize = ref(30)
const disabled = ref(false)
const background = ref(false)
const total = ref()
const exporter = ref("TransExport")
const options = reactive([]);
const tableData = ref([]);
const tableHeight = ref(500);
......@@ -118,7 +120,6 @@ function sortMethod({ order, prop }){
}
AlarmInfo.sort = sortnames;
}
console.log(AlarmInfo.sort)
getdata() //调用后端查询接口
}
......@@ -180,10 +181,13 @@ function getdata() {
function getoptions(){
if(type.value === "GetPipeAlarmData"){
getPipes();
exporter.value = "PipeExport";
}else if(type.value === "GetBoilerAlarmData"){
getBoilers();
exporter.value = "BoilerExport";
}else{
getSupplys();
exporter.value = "TransExport";
}
gettransfer();
}
......@@ -224,7 +228,7 @@ function getBoilers(){
//获取总管列表
function getPipes(){
loading.value = true;
tableData.value.length = 0;
tableData.length = 0;
AlarmInfo.Id.length = 0;
var result = store.getters.getEnterprise();
if (result) {
......@@ -331,37 +335,41 @@ function setHeaderCellStyle({ row, column, rowIndex, columnIndex }) {
return css_color;
}
// // 导出表格 按钮点击后触发事件
// async function exportExcel () {
// sessionStorage.setItem("DeviceQueryStart", AlarmInfo.startTime);
// sessionStorage.setItem("DeviceQueryEnd", AlarmInfo.endTime);
// AlarmInfo.pageIndex = 0;
// AlarmInfo.pageCount = 100000;
// 导出表格 按钮点击后触发事件
async function exportExcel () {
if(tableData.value !== null){
sessionStorage.setItem("DeviceQueryStart", AlarmInfo.startTime);
sessionStorage.setItem("DeviceQueryEnd", AlarmInfo.endTime);
AlarmInfo.pageIndex = 0;
AlarmInfo.pageCount = 100000;
// var fileName = getFileName("报警信息历史数据");
var fileName = getFileName("报警信息历史数据");
// await http.post("/api/transfer/hisExport", AlarmInfo, '正在导出数据....', { responseType: 'blob' }).then((content) => {
// try{
// const blob = new Blob([content]);
// if ('download' in document.createElement('a')) {
// // 非IE下载
// const elink = document.createElement('a');
// elink.download = fileName;
// elink.style.display = 'none';
// elink.href = URL.createObjectURL(blob);
// document.body.appendChild(elink);
// elink.click();
// URL.revokeObjectURL(elink.href);
// document.body.removeChild(elink);
// } else {
// // IE10+下载
// navigator.msSaveBlob(blob, fileName);
// }
// }catch(error){
// console.log(error);
// }
// });
// }
console.log(AlarmInfo);
console.log(exporter.value);
await http.post("/api/alarm/" + exporter.value, AlarmInfo, '正在导出数据....', { responseType: 'blob' }).then((content) => {
try{
const blob = new Blob([content]);
if ('download' in document.createElement('a')) {
// 非IE下载
const elink = document.createElement('a');
elink.download = fileName;
elink.style.display = 'none';
elink.href = URL.createObjectURL(blob);
document.body.appendChild(elink);
elink.click();
URL.revokeObjectURL(elink.href);
document.body.removeChild(elink);
} else {
// IE10+下载
navigator.msSaveBlob(blob, fileName);
}
}catch(error){
console.log(error);
}
});
}
}
onMounted(() => {
setContentHeight();
window.addEventListener('resize', setContentHeight);
......
......@@ -218,13 +218,6 @@
})
}
}
//获取用户信息
getuser()
function getuser(){
var user = store.getters.getUserInfo();
console.log(user);
}
//获取总管列表
function getPipes(){
......
......@@ -101,7 +101,7 @@
</el-form-item>
<div style="position: absolute; top: 25px; right: 2%">
<el-button type="primary" @click="sendClick">查询</el-button
><el-button type="primary" @click="exportTableToExcel"
><el-button type="primary" @click="exportTableToExcelAll"
>导出表格</el-button
>
</div>
......@@ -241,6 +241,14 @@
<div style="position: relative">
<img src="/imgs/energyConsumptionPage/title_bg.png" />
<div class="cardListTit">热单耗排行</div>
<div
class="downExl"
@click="
exportTableToExcelFun(1, topHeatUCList.value, '热单耗(W/㎡)')
"
>
导出表格
</div>
</div>
<div>
<table class="cardTable" style="width: 100%">
......@@ -263,6 +271,14 @@
<div style="position: relative">
<img src="/imgs/energyConsumptionPage/title_bg.png" />
<div class="cardListTit">度日数热耗排行</div>
<div
class="downExl"
@click="
exportTableToExcelFun(2, topDayHeatUC.value, '热耗(W/(㎡×℃))')
"
>
导出表格
</div>
</div>
<div>
<table class="cardTable" style="width: 100%">
......@@ -285,6 +301,14 @@
<div style="position: relative">
<img src="/imgs/energyConsumptionPage/title_bg.png" />
<div class="cardListTit">水单耗排行</div>
<div
class="downExl"
@click="
exportTableToExcelFun(3, topWaterUC.value, '水单耗(Kg/㎡)')
"
>
导出表格
</div>
</div>
<div>
<table class="cardTable" style="width: 100%">
......@@ -307,6 +331,14 @@
<div style="position: relative">
<img src="/imgs/energyConsumptionPage/title_bg.png" />
<div class="cardListTit">电单耗排行</div>
<div
class="downExl"
@click="
exportTableToExcelFun(4, topElecUC.value, '电单耗(Kwh/㎡)')
"
>
导出表格
</div>
</div>
<div>
<table class="cardTable" style="width: 100%">
......@@ -329,6 +361,12 @@
<div style="position: relative">
<img src="/imgs/energyConsumptionPage/title_bg.png" />
<div class="cardListTit">一网回温排行</div>
<div
class="downExl"
@click="exportTableToExcelFun(5, topFirsHW.value, '一网回温(℃)')"
>
导出表格
</div>
</div>
<div>
<table class="cardTable" style="width: 100%">
......@@ -338,7 +376,7 @@
<th>机组名称</th>
<th>一网回温(℃)</th>
</tr>
<tr v-for="item in topElecUC.value" :key="item.rankingIndex">
<tr v-for="item in topFirsHW.value" :key="item.rankingIndex">
<td>{{ item.rankingIndex }}</td>
<td>{{ item.supplyName }}</td>
<td>{{ item.transferName }}</td>
......@@ -351,6 +389,14 @@
<div style="position: relative">
<img src="/imgs/energyConsumptionPage/title_bg.png" />
<div class="cardListTit">一网万平米流量排行</div>
<div
class="downExl"
@click="
exportTableToExcelFun(6, topFirsFlow.value, '流量(t/h/万㎡)')
"
>
导出表格
</div>
</div>
<div>
<table class="cardTable" style="width: 100%">
......@@ -373,6 +419,12 @@
<div style="position: relative">
<img src="/imgs/energyConsumptionPage/title_bg.png" />
<div class="cardListTit">热效率排行</div>
<div
class="downExl"
@click="exportTableToExcelFun(7, topBHXL.value, '热效率')"
>
导出表格
</div>
</div>
<div>
<table class="cardTable" style="width: 100%">
......@@ -382,7 +434,7 @@
<th>机组名称</th>
<th>热效率</th>
</tr>
<tr v-for="item in topFirsFlow.value" :key="item.rankingIndex">
<tr v-for="item in topBHXL.value" :key="item.rankingIndex">
<td>{{ item.rankingIndex }}</td>
<td>{{ item.supplyName }}</td>
<td>{{ item.transferName }}</td>
......@@ -395,6 +447,12 @@
<div style="position: relative">
<img src="/imgs/energyConsumptionPage/title_bg.png" />
<div class="cardListTit">板换效率趋势一排行</div>
<div
class="downExl"
@click="exportTableToExcelFun(8, topBHXLXJ1.value, '板换效率(%)')"
>
导出表格
</div>
</div>
<div>
<table class="cardTable" style="width: 100%">
......@@ -417,6 +475,14 @@
<div style="position: relative">
<img src="/imgs/energyConsumptionPage/title_bg.png" />
<div class="cardListTit">二网均温排行</div>
<div
class="downExl"
@click="
exportTableToExcelFun(9, topSecondTempAvg.value, '二网均温(℃)')
"
>
导出表格
</div>
</div>
<div>
<table class="cardTable" style="width: 100%">
......@@ -442,6 +508,14 @@
<div style="position: relative">
<img src="/imgs/energyConsumptionPage/title_bg.png" />
<div class="cardListTit">二网温差排行</div>
<div
class="downExl"
@click="
exportTableToExcelFun(10, topSecondTempAvg.value, '二网温差(℃)')
"
>
导出表格
</div>
</div>
<div>
<table class="cardTable" style="width: 100%">
......@@ -467,6 +541,18 @@
<div style="position: relative">
<img src="/imgs/energyConsumptionPage/title_bg.png" />
<div class="cardListTit">二网瞬时流量排行</div>
<div
class="downExl"
@click="
exportTableToExcelFun(
11,
topSecondTempAvg.value,
'二网瞬时(t/h)'
)
"
>
导出表格
</div>
</div>
<div>
<table class="cardTable" style="width: 100%">
......@@ -492,6 +578,18 @@
<div style="position: relative">
<img src="/imgs/energyConsumptionPage/title_bg.png" />
<div class="cardListTit">二网万平米流量排行</div>
<div
class="downExl"
@click="
exportTableToExcelFun(
12,
topSecondTempAvg.value,
'流量(t/h/万㎡)'
)
"
>
导出表格
</div>
</div>
<div>
<table class="cardTable" style="width: 100%">
......@@ -523,6 +621,8 @@ import * as echarts from "echarts";
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 {
postOverview,
postTopHeatUC,
......@@ -613,6 +713,167 @@ const rules = {
startTime: [{ required: true, message: "请选择开始时间", trigger: "blur" }],
endTime: [{ required: true, message: "请选择结束时间", trigger: "blur" }],
};
function exportTableToExcelFun(n, dataList, company) {
let title = ["排名", "供热站名称", "机组名称", company];
let space = ["A1", "B1", "C1", "D1"];
let data = reactive([]);
dataList.forEach((element) => {
data.push({
rankingIndex: element.rankingIndex,
supplyName: element.supplyName,
transferName: element.transferName,
uc: element.uc.toFixed(2),
});
});
switch (n) {
case 1:
exportTableToExcel(title, space, "热单耗排行", data);
break;
case 2:
exportTableToExcel(title, space, "度日数热耗排行", data);
break;
case 3:
exportTableToExcel(title, space, "水单耗排行", data);
break;
case 4:
exportTableToExcel(title, space, "电单耗排行", data);
break;
case 5:
exportTableToExcel(title, space, "一网回温排行", data);
break;
case 6:
exportTableToExcel(title, space, "一网万平米流量排行", data);
break;
case 7:
exportTableToExcel(title, space, "热效率排行", data);
break;
case 8:
exportTableToExcel(title, space, "板换效率趋势一排行", data);
break;
case 9:
exportTableToExcel(title, space, "二网均温排行", data);
break;
case 10:
exportTableToExcel(title, space, "二网温差排行", data);
break;
case 11:
exportTableToExcel(title, space, "二网瞬时流量排行", data);
break;
case 12:
exportTableToExcel(title, space, "二网万平米流量排行", data);
break;
}
}
function exportTableToExcel(title, space, sheetTit, data) {
const worksheet = XLSX.utils.json_to_sheet(data);
const workbook = XLSX.utils.book_new();
XLSX.utils.sheet_add_aoa(worksheet, [title], {
origin: "A1",
});
worksheet["!cols"] = [{ wch: 5 }, { wch: 20 }, { wch: 20 }, { wch: 20 }];
space.forEach((element) => {
worksheet[element].s = {
fill: {
fgColor: { rgb: "0097d5fd" },
},
};
});
XLSX.utils.book_append_sheet(workbook, worksheet, sheetTit);
const excelBuffer = XLSX.write(workbook, { bookType: "xlsx", type: "array" });
const dataBlob = new Blob([excelBuffer], {
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8",
});
const downloadUrl = URL.createObjectURL(dataBlob);
saveAs(dataBlob, sheetTit + ".xlsx");
ElMessage.success("导出成功!请稍后。。。");
}
function exportTableToExcelAll() {
let worksheet = ref();
let workbook = ref();
let excelBuffer = ref();
let dataBlob = ref();
let data = [
topHeatUCList.value,
topDayHeatUC.value,
topWaterUC.value,
topElecUC.value,
topFirsHW.value,
topFirsFlow.value,
topBHXL.value,
topBHXLXJ1.value,
topSecondTempAvg.value,
topSecondTempAvg.value,
topSecondTempAvg.value,
topSecondTempAvg.value,
];
let title = [
"热单耗(W/㎡)",
"热耗(W/(㎡×℃",
"水单耗(Kg/㎡)",
"电单耗(Kwh/㎡)",
"一网回温(℃)",
"流量(t/h/万㎡)",
"热效率",
"板换效率(%)",
"二网均温(℃)",
"二网温差(℃)",
];
let space = ["A1", "B1", "C1", "D1", "E1"];
let sheetTit = [
"热单耗排行",
"度日数热耗排行",
"水单耗排行",
"电单耗排行",
"一网回温排行",
"一网万平米流量排行",
"热效率排行",
"板换效率趋势一排行",
"二网均温排行",
"二网温差排行",
"二网瞬时流量排行",
"二网万平米流量排行",
];
workbook = XLSX.utils.book_new();
for (var i = 0; i < 12; i++) {
worksheet = XLSX.utils.json_to_sheet(data[i]);
XLSX.utils.sheet_add_aoa(
worksheet,
[["排名", "机组ID", "供热站名称", "机组名称", title[i]]],
{
origin: "A1",
}
);
worksheet["!cols"] = [
{ wch: 5 },
{ wch: 20 },
{ wch: 20 },
{ wch: 20 },
{ wch: 20 },
];
worksheet["!cols"][1] = { hidden: true };
space.forEach((element) => {
worksheet[element].s = {
fill: {
fgColor: { rgb: "0097d5fd" },
},
};
});
XLSX.utils.book_append_sheet(workbook, worksheet, sheetTit[i]);
}
excelBuffer = XLSX.write(workbook, { bookType: "xlsx", type: "array" });
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() {
var date = new Date();
......@@ -1001,6 +1262,14 @@ td {
letter-spacing: 3px;
font-weight: bolder;
}
.downExl {
position: absolute;
top: 5px;
right: 10px;
color: #3e79ed;
font-weight: bolder;
cursor: pointer;
}
.cardTable {
border: none;
border-spacing: 0;
......
......@@ -16,8 +16,8 @@
<el-form-item>
<el-switch
v-model="switchV"
active-text="表格"
inactive-text="曲线图"
active-text="曲线图"
inactive-text="表格"
style="
--el-switch-on-color: #13ce66;
--el-switch-off-color: #6589ff;
......@@ -124,7 +124,7 @@
</div>
</el-form>
</el-card>
<div v-show="switchV">
<div v-show="!switchV">
<el-table
:data="tableData"
v-loading="tabloading"
......@@ -141,7 +141,7 @@
<el-table-column prop="uc" :label="enertyTab" />
</el-table>
</div>
<div v-show="!switchV" id="echartsLayerBlock">
<div v-show="switchV" id="echartsLayerBlock">
<div class="echartsLayer" id="echartsLayer"></div>
</div>
</div>
......@@ -170,7 +170,7 @@ import {
const options = reactive([]);
const enterpriseId = ref();
const props = { multiple: true, emitPath: false };
const switchV = ref(false);
const switchV = ref(true);
const echartF = ref(false);
const nodata = ref(false);
const tableData = reactive([]);
......@@ -797,6 +797,7 @@ onMounted(() => {
setContentHeight();
switchV.value = true;
sendClick();
changeFun();
window.addEventListener("resize", function () {
location.reload();
});
......
......@@ -56,63 +56,63 @@
>
<tr>
<th>预测室外平均温度(℃)</th>
<td>-1.10</td>
<td>{{ predictionTemp.avgTemp ? predictionTemp.avgTemp : "-" }}</td>
</tr>
<tr>
<th>天津气象局反馈温度(℃)</th>
<td>-1.10</td>
<td>{{ realTemp.avgTemp ? realTemp.avgTemp : "-" }}</td>
</tr>
<tr>
<th>综合气象温度(℃)</th>
<td>-1.10</td>
<td>{{ comprehensiveTemp.avgTemp ? comprehensiveTemp.avgTemp : "-" }}</td>
</tr>
</table>
</th>
</tr>
<tr>
<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>{{ predictionTemp.temp1 }}</td>
<td>{{ predictionTemp.temp2 }}</td>
<td>{{ predictionTemp.temp3 }}</td>
<td>{{ predictionTemp.temp4 }}</td>
<td>{{ predictionTemp.temp5 }}</td>
<td>{{ predictionTemp.temp6 }}</td>
<td>{{ predictionTemp.temp7 }}</td>
<td>{{ predictionTemp.temp8 }}</td>
<td>{{ predictionTemp.temp9 }}</td>
<td>{{ predictionTemp.temp10 }}</td>
<td>{{ predictionTemp.temp11 }}</td>
<td>{{ predictionTemp.temp12 }}</td>
</tr>
<tr>
<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>{{ realTemp.temp1 }}</td>
<td>{{ realTemp.temp2 }}</td>
<td>{{ realTemp.temp3 }}</td>
<td>{{ realTemp.temp4 }}</td>
<td>{{ realTemp.temp5 }}</td>
<td>{{ realTemp.temp6 }}</td>
<td>{{ realTemp.temp7 }}</td>
<td>{{ realTemp.temp8 }}</td>
<td>{{ realTemp.temp9 }}</td>
<td>{{ realTemp.temp10 }}</td>
<td>{{ realTemp.temp11 }}</td>
<td>{{ realTemp.temp12 }}</td>
</tr>
<tr>
<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>{{ comprehensiveTemp.temp1 }}</td>
<td>{{ comprehensiveTemp.temp2 }}</td>
<td>{{ comprehensiveTemp.temp3 }}</td>
<td>{{ comprehensiveTemp.temp4 }}</td>
<td>{{ comprehensiveTemp.temp5 }}</td>
<td>{{ comprehensiveTemp.temp6 }}</td>
<td>{{ comprehensiveTemp.temp7 }}</td>
<td>{{ comprehensiveTemp.temp8 }}</td>
<td>{{ comprehensiveTemp.temp9 }}</td>
<td>{{ comprehensiveTemp.temp10 }}</td>
<td>{{ comprehensiveTemp.temp11 }}</td>
<td>{{ comprehensiveTemp.temp12 }}</td>
</tr>
<tr>
<th>夜间</th>
......@@ -131,48 +131,48 @@
</tr>
<tr>
<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>{{ predictionTemp.temp13 }}</td>
<td>{{ predictionTemp.temp14 }}</td>
<td>{{ predictionTemp.temp15 }}</td>
<td>{{ predictionTemp.temp16 }}</td>
<td>{{ predictionTemp.temp17 }}</td>
<td>{{ predictionTemp.temp18 }}</td>
<td>{{ predictionTemp.temp19 }}</td>
<td>{{ predictionTemp.temp20 }}</td>
<td>{{ predictionTemp.temp21 }}</td>
<td>{{ predictionTemp.temp22 }}</td>
<td>{{ predictionTemp.temp23 }}</td>
<td>{{ predictionTemp.temp24 }}</td>
</tr>
<tr>
<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>{{ realTemp.temp13 }}</td>
<td>{{ realTemp.temp14 }}</td>
<td>{{ realTemp.temp15 }}</td>
<td>{{ realTemp.temp16 }}</td>
<td>{{ realTemp.temp17 }}</td>
<td>{{ realTemp.temp18 }}</td>
<td>{{ realTemp.temp19 }}</td>
<td>{{ realTemp.temp20 }}</td>
<td>{{ realTemp.temp21 }}</td>
<td>{{ realTemp.temp22 }}</td>
<td>{{ realTemp.temp23 }}</td>
<td>{{ realTemp.temp24 }}</td>
</tr>
<tr>
<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>{{ comprehensiveTemp.temp13 }}</td>
<td>{{ comprehensiveTemp.temp14 }}</td>
<td>{{ comprehensiveTemp.temp15 }}</td>
<td>{{ comprehensiveTemp.temp16 }}</td>
<td>{{ comprehensiveTemp.temp17 }}</td>
<td>{{ comprehensiveTemp.temp18 }}</td>
<td>{{ comprehensiveTemp.temp19 }}</td>
<td>{{ comprehensiveTemp.temp20 }}</td>
<td>{{ comprehensiveTemp.temp21 }}</td>
<td>{{ comprehensiveTemp.temp22 }}</td>
<td>{{ comprehensiveTemp.temp23 }}</td>
<td>{{ comprehensiveTemp.temp24 }}</td>
</tr>
</table>
<table
......@@ -190,10 +190,10 @@
<th colspan="2">16:00-20:00</th>
<th colspan="2">20:00-24:00</th>
</tr>
<tr>
<th>小王庄</th>
<td>0.1131</td>
<td>0.1131</td>
<tr v-for="(item, key) in analysisSupplys" :key="key">
<th>{{ item.name }}</th>
<td>{{ item.part1.measurement }}</td>
<td>{{ item.part1.reality }}</td>
<td>0.1131</td>
<td>0.1131</td>
<td>0.1131</td>
......@@ -207,7 +207,7 @@
<td>0.1131</td>
<td>0.1131</td>
</tr>
<tr>
<!-- <tr>
<th>港东</th>
<td>0.1131</td>
<td>0.1131</td>
......@@ -308,7 +308,7 @@
<td>0.1131</td>
<td>0.1131</td>
<td>0.1131</td>
</tr>
</tr> -->
</table>
</el-card>
</div>
......@@ -319,6 +319,15 @@ import { ref, reactive, onMounted, onUnmounted } 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 {
postHeatAnalysis,
} from "../../api/report";
const predictionTemp = ref([]);
const realTemp = ref([]);
const comprehensiveTemp = ref([]);
const analysisSupplys = ref([]);
const enertyInfo = reactive({
endTime: null,
});
......@@ -361,7 +370,24 @@ function timeFun() {
enertyInfo.endTime = endTimes;
}
function postHeatAnalysisFun() {
let params = {
"QueryTime":"2024-1-1 09:00:00"
}
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;
} else {
ElMessage.error(res.message);
}
});
}
onMounted(() => {
postHeatAnalysisFun();
timeFun();
});
onUnmounted(() => {
......@@ -394,7 +420,7 @@ table {
width: 100%;
}
table th {
background-color: #f5f7fa;
background-color: rgb(181, 230, 255);
text-align: center;
padding: 5px 10px;
}
......
......@@ -209,6 +209,7 @@ import {
} from '@element-plus/icons-vue';
import DataMenu from '../components/DataMenu.vue';
import EventBus from '../utils/event-bus.js';
import { ElNotification } from 'element-plus'
//import {RoleEnum} from '../utils/enumData';
......@@ -633,6 +634,87 @@ export default defineComponent({
},
});
//报警弹窗
const enterpriseId = ref();
const userId = ref();
const roleId = ref();
const title = ref();
const msg = ref();
const id = ref();
const counttitle = ref();
const countmsg = ref();
const countid = ref();
const route = useRoute();
//获取用户信息
getuser()
function getuser(){
var user = store.getters.getUserInfo();
if(user){
enterpriseId.value = user.enterpriseId;
userId.value = user.userId;
roleId.value = user.roleId;
}
}
const AlarmInfo = reactive({
"enterpriseId": enterpriseId.value,
"UserId": userId.value,
"RoleId": roleId.value
});
function alarm(){
http.post("/api/alarm/GetAlarmMsg", AlarmInfo).then((result) => {
if(title.value !== result.data[0].title || msg.value !== result.data[0].msg){
title.value = result.data[0].title;
msg.value = result.data[0].msg;
id.value = result.data[0].id;
ElNotification({
title: title.value,
message: msg.value,
position: 'bottom-right',
type: 'warning',
duration: 0,
// onClick() {
// console.log(111111)
// const routePath = '/Home/Video'; // 要导航到的路由路径
// const routeQuery = { id: id.value }; // 如果需要,可以传递参数
// // 序列化查询参数
// const queryString = new URLSearchParams(routeQuery).toString();
// // 打开新窗口并导航到指定路由
// window.open(
// `${routePath}?${queryString}`,
// '_blank',
// 'toolbar=yes,location=yes,status=yes,menubar=yes,width=600,height=400,scrollbars=yes'
// );
// },
})
}
});
}
const router = useRouter()
function countalarm(){
http.post("/api/alarm/GetAlarmMsg", AlarmInfo).then((result) => {
if(counttitle.value !== result.data[1].title || countmsg.value !== result.data[1].msg){
counttitle.value = result.data[1].title;
countmsg.value = result.data[1].msg;
countid.value = result.data[1].id;
ElNotification({
title: counttitle.value,
message: countmsg.value,
position: 'bottom-right',
type: 'warning',
duration: 0,
// onClick() {
// router.push({ path: '/GisHome'})
// },
})
}
});
}
setInterval(() => {
alarm();
countalarm();
}, 6 * 1000); // 每分钟执行一次
</script>
<style lang="less" scoped>
......
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