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);
......
......@@ -219,13 +219,6 @@
}
}
//获取用户信息
getuser()
function getuser(){
var user = store.getters.getUserInfo();
console.log(user);
}
//获取总管列表
function getPipes(){
loading.value = true;
......
......@@ -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