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'; ...@@ -59,6 +59,7 @@ import { ref, reactive, onMounted, onUnmounted } from 'vue';
import http from '../../api/http'; import http from '../../api/http';
import zhCn from 'element-plus/dist/locale/zh-cn.mjs' import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import store from "../../store/index"; import store from "../../store/index";
import { getFileName } from '../../utils/utils';
//分页设置 //分页设置
const currentPage = ref(1) const currentPage = ref(1)
...@@ -66,6 +67,7 @@ var pageSize = ref(30) ...@@ -66,6 +67,7 @@ var pageSize = ref(30)
const disabled = ref(false) const disabled = ref(false)
const background = ref(false) const background = ref(false)
const total = ref() const total = ref()
const exporter = ref("TransExport")
const options = reactive([]); const options = reactive([]);
const tableData = ref([]); const tableData = ref([]);
const tableHeight = ref(500); const tableHeight = ref(500);
...@@ -118,7 +120,6 @@ function sortMethod({ order, prop }){ ...@@ -118,7 +120,6 @@ function sortMethod({ order, prop }){
} }
AlarmInfo.sort = sortnames; AlarmInfo.sort = sortnames;
} }
console.log(AlarmInfo.sort)
getdata() //调用后端查询接口 getdata() //调用后端查询接口
} }
...@@ -180,10 +181,13 @@ function getdata() { ...@@ -180,10 +181,13 @@ function getdata() {
function getoptions(){ function getoptions(){
if(type.value === "GetPipeAlarmData"){ if(type.value === "GetPipeAlarmData"){
getPipes(); getPipes();
exporter.value = "PipeExport";
}else if(type.value === "GetBoilerAlarmData"){ }else if(type.value === "GetBoilerAlarmData"){
getBoilers(); getBoilers();
exporter.value = "BoilerExport";
}else{ }else{
getSupplys(); getSupplys();
exporter.value = "TransExport";
} }
gettransfer(); gettransfer();
} }
...@@ -224,7 +228,7 @@ function getBoilers(){ ...@@ -224,7 +228,7 @@ function getBoilers(){
//获取总管列表 //获取总管列表
function getPipes(){ function getPipes(){
loading.value = true; loading.value = true;
tableData.value.length = 0; tableData.length = 0;
AlarmInfo.Id.length = 0; AlarmInfo.Id.length = 0;
var result = store.getters.getEnterprise(); var result = store.getters.getEnterprise();
if (result) { if (result) {
...@@ -331,37 +335,41 @@ function setHeaderCellStyle({ row, column, rowIndex, columnIndex }) { ...@@ -331,37 +335,41 @@ function setHeaderCellStyle({ row, column, rowIndex, columnIndex }) {
return css_color; return css_color;
} }
// // 导出表格 按钮点击后触发事件 // 导出表格 按钮点击后触发事件
// async function exportExcel () { async function exportExcel () {
// sessionStorage.setItem("DeviceQueryStart", AlarmInfo.startTime); if(tableData.value !== null){
// sessionStorage.setItem("DeviceQueryEnd", AlarmInfo.endTime); sessionStorage.setItem("DeviceQueryStart", AlarmInfo.startTime);
// AlarmInfo.pageIndex = 0; sessionStorage.setItem("DeviceQueryEnd", AlarmInfo.endTime);
// AlarmInfo.pageCount = 100000; AlarmInfo.pageIndex = 0;
AlarmInfo.pageCount = 100000;
// var fileName = getFileName("报警信息历史数据"); var fileName = getFileName("报警信息历史数据");
// await http.post("/api/transfer/hisExport", AlarmInfo, '正在导出数据....', { responseType: 'blob' }).then((content) => { console.log(AlarmInfo);
// try{ console.log(exporter.value);
// const blob = new Blob([content]); await http.post("/api/alarm/" + exporter.value, AlarmInfo, '正在导出数据....', { responseType: 'blob' }).then((content) => {
// if ('download' in document.createElement('a')) { try{
// // 非IE下载 const blob = new Blob([content]);
// const elink = document.createElement('a'); if ('download' in document.createElement('a')) {
// elink.download = fileName; // 非IE下载
// elink.style.display = 'none'; const elink = document.createElement('a');
// elink.href = URL.createObjectURL(blob); elink.download = fileName;
// document.body.appendChild(elink); elink.style.display = 'none';
// elink.click(); elink.href = URL.createObjectURL(blob);
// URL.revokeObjectURL(elink.href); document.body.appendChild(elink);
// document.body.removeChild(elink); elink.click();
// } else { URL.revokeObjectURL(elink.href);
// // IE10+下载 document.body.removeChild(elink);
// navigator.msSaveBlob(blob, fileName); } else {
// } // IE10+下载
// }catch(error){ navigator.msSaveBlob(blob, fileName);
// console.log(error); }
// } }catch(error){
// }); console.log(error);
// } }
});
}
}
onMounted(() => { onMounted(() => {
setContentHeight(); setContentHeight();
window.addEventListener('resize', setContentHeight); window.addEventListener('resize', setContentHeight);
......
...@@ -219,13 +219,6 @@ ...@@ -219,13 +219,6 @@
} }
} }
//获取用户信息
getuser()
function getuser(){
var user = store.getters.getUserInfo();
console.log(user);
}
//获取总管列表 //获取总管列表
function getPipes(){ function getPipes(){
loading.value = true; loading.value = true;
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
<el-form-item> <el-form-item>
<el-switch <el-switch
v-model="switchV" v-model="switchV"
active-text="表格" active-text="曲线图"
inactive-text="曲线图" inactive-text="表格"
style=" style="
--el-switch-on-color: #13ce66; --el-switch-on-color: #13ce66;
--el-switch-off-color: #6589ff; --el-switch-off-color: #6589ff;
...@@ -124,7 +124,7 @@ ...@@ -124,7 +124,7 @@
</div> </div>
</el-form> </el-form>
</el-card> </el-card>
<div v-show="switchV"> <div v-show="!switchV">
<el-table <el-table
:data="tableData" :data="tableData"
v-loading="tabloading" v-loading="tabloading"
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
<el-table-column prop="uc" :label="enertyTab" /> <el-table-column prop="uc" :label="enertyTab" />
</el-table> </el-table>
</div> </div>
<div v-show="!switchV" id="echartsLayerBlock"> <div v-show="switchV" id="echartsLayerBlock">
<div class="echartsLayer" id="echartsLayer"></div> <div class="echartsLayer" id="echartsLayer"></div>
</div> </div>
</div> </div>
...@@ -170,7 +170,7 @@ import { ...@@ -170,7 +170,7 @@ import {
const options = reactive([]); const options = reactive([]);
const enterpriseId = ref(); const enterpriseId = ref();
const props = { multiple: true, emitPath: false }; const props = { multiple: true, emitPath: false };
const switchV = ref(false); const switchV = ref(true);
const echartF = ref(false); const echartF = ref(false);
const nodata = ref(false); const nodata = ref(false);
const tableData = reactive([]); const tableData = reactive([]);
...@@ -797,6 +797,7 @@ onMounted(() => { ...@@ -797,6 +797,7 @@ onMounted(() => {
setContentHeight(); setContentHeight();
switchV.value = true; switchV.value = true;
sendClick(); sendClick();
changeFun();
window.addEventListener("resize", function () { window.addEventListener("resize", function () {
location.reload(); location.reload();
}); });
......
...@@ -56,63 +56,63 @@ ...@@ -56,63 +56,63 @@
> >
<tr> <tr>
<th>预测室外平均温度(℃)</th> <th>预测室外平均温度(℃)</th>
<td>-1.10</td> <td>{{ predictionTemp.avgTemp ? predictionTemp.avgTemp : "-" }}</td>
</tr> </tr>
<tr> <tr>
<th>天津气象局反馈温度(℃)</th> <th>天津气象局反馈温度(℃)</th>
<td>-1.10</td> <td>{{ realTemp.avgTemp ? realTemp.avgTemp : "-" }}</td>
</tr> </tr>
<tr> <tr>
<th>综合气象温度(℃)</th> <th>综合气象温度(℃)</th>
<td>-1.10</td> <td>{{ comprehensiveTemp.avgTemp ? comprehensiveTemp.avgTemp : "-" }}</td>
</tr> </tr>
</table> </table>
</th> </th>
</tr> </tr>
<tr> <tr>
<td>室外预测值(℃)</td> <td>室外预测值(℃)</td>
<td>01:00</td> <td>{{ predictionTemp.temp1 }}</td>
<td>02:00</td> <td>{{ predictionTemp.temp2 }}</td>
<td>03:00</td> <td>{{ predictionTemp.temp3 }}</td>
<td>04:00</td> <td>{{ predictionTemp.temp4 }}</td>
<td>05:00</td> <td>{{ predictionTemp.temp5 }}</td>
<td>06:00</td> <td>{{ predictionTemp.temp6 }}</td>
<td>07:00</td> <td>{{ predictionTemp.temp7 }}</td>
<td>08:00</td> <td>{{ predictionTemp.temp8 }}</td>
<td>09:00</td> <td>{{ predictionTemp.temp9 }}</td>
<td>10:00</td> <td>{{ predictionTemp.temp10 }}</td>
<td>11:00</td> <td>{{ predictionTemp.temp11 }}</td>
<td>12:00</td> <td>{{ predictionTemp.temp12 }}</td>
</tr> </tr>
<tr> <tr>
<td>天津气象局反馈温度(℃)</td> <td>天津气象局反馈温度(℃)</td>
<td>01:00</td> <td>{{ realTemp.temp1 }}</td>
<td>02:00</td> <td>{{ realTemp.temp2 }}</td>
<td>03:00</td> <td>{{ realTemp.temp3 }}</td>
<td>04:00</td> <td>{{ realTemp.temp4 }}</td>
<td>05:00</td> <td>{{ realTemp.temp5 }}</td>
<td>06:00</td> <td>{{ realTemp.temp6 }}</td>
<td>07:00</td> <td>{{ realTemp.temp7 }}</td>
<td>08:00</td> <td>{{ realTemp.temp8 }}</td>
<td>09:00</td> <td>{{ realTemp.temp9 }}</td>
<td>10:00</td> <td>{{ realTemp.temp10 }}</td>
<td>11:00</td> <td>{{ realTemp.temp11 }}</td>
<td>12:00</td> <td>{{ realTemp.temp12 }}</td>
</tr> </tr>
<tr> <tr>
<td>综合气象温度(℃)</td> <td>综合气象温度(℃)</td>
<td>01:00</td> <td>{{ comprehensiveTemp.temp1 }}</td>
<td>02:00</td> <td>{{ comprehensiveTemp.temp2 }}</td>
<td>03:00</td> <td>{{ comprehensiveTemp.temp3 }}</td>
<td>04:00</td> <td>{{ comprehensiveTemp.temp4 }}</td>
<td>05:00</td> <td>{{ comprehensiveTemp.temp5 }}</td>
<td>06:00</td> <td>{{ comprehensiveTemp.temp6 }}</td>
<td>07:00</td> <td>{{ comprehensiveTemp.temp7 }}</td>
<td>08:00</td> <td>{{ comprehensiveTemp.temp8 }}</td>
<td>09:00</td> <td>{{ comprehensiveTemp.temp9 }}</td>
<td>10:00</td> <td>{{ comprehensiveTemp.temp10 }}</td>
<td>11:00</td> <td>{{ comprehensiveTemp.temp11 }}</td>
<td>12:00</td> <td>{{ comprehensiveTemp.temp12 }}</td>
</tr> </tr>
<tr> <tr>
<th>夜间</th> <th>夜间</th>
...@@ -131,48 +131,48 @@ ...@@ -131,48 +131,48 @@
</tr> </tr>
<tr> <tr>
<td>室外预测值(℃)</td> <td>室外预测值(℃)</td>
<td>01:00</td> <td>{{ predictionTemp.temp13 }}</td>
<td>02:00</td> <td>{{ predictionTemp.temp14 }}</td>
<td>03:00</td> <td>{{ predictionTemp.temp15 }}</td>
<td>04:00</td> <td>{{ predictionTemp.temp16 }}</td>
<td>05:00</td> <td>{{ predictionTemp.temp17 }}</td>
<td>06:00</td> <td>{{ predictionTemp.temp18 }}</td>
<td>07:00</td> <td>{{ predictionTemp.temp19 }}</td>
<td>08:00</td> <td>{{ predictionTemp.temp20 }}</td>
<td>09:00</td> <td>{{ predictionTemp.temp21 }}</td>
<td>10:00</td> <td>{{ predictionTemp.temp22 }}</td>
<td>11:00</td> <td>{{ predictionTemp.temp23 }}</td>
<td>12:00</td> <td>{{ predictionTemp.temp24 }}</td>
</tr> </tr>
<tr> <tr>
<td>天津气象局反馈温度(℃)</td> <td>天津气象局反馈温度(℃)</td>
<td>01:00</td> <td>{{ realTemp.temp13 }}</td>
<td>02:00</td> <td>{{ realTemp.temp14 }}</td>
<td>03:00</td> <td>{{ realTemp.temp15 }}</td>
<td>04:00</td> <td>{{ realTemp.temp16 }}</td>
<td>05:00</td> <td>{{ realTemp.temp17 }}</td>
<td>06:00</td> <td>{{ realTemp.temp18 }}</td>
<td>07:00</td> <td>{{ realTemp.temp19 }}</td>
<td>08:00</td> <td>{{ realTemp.temp20 }}</td>
<td>09:00</td> <td>{{ realTemp.temp21 }}</td>
<td>10:00</td> <td>{{ realTemp.temp22 }}</td>
<td>11:00</td> <td>{{ realTemp.temp23 }}</td>
<td>12:00</td> <td>{{ realTemp.temp24 }}</td>
</tr> </tr>
<tr> <tr>
<td>综合气象温度(℃)</td> <td>综合气象温度(℃)</td>
<td>01:00</td> <td>{{ comprehensiveTemp.temp13 }}</td>
<td>02:00</td> <td>{{ comprehensiveTemp.temp14 }}</td>
<td>03:00</td> <td>{{ comprehensiveTemp.temp15 }}</td>
<td>04:00</td> <td>{{ comprehensiveTemp.temp16 }}</td>
<td>05:00</td> <td>{{ comprehensiveTemp.temp17 }}</td>
<td>06:00</td> <td>{{ comprehensiveTemp.temp18 }}</td>
<td>07:00</td> <td>{{ comprehensiveTemp.temp19 }}</td>
<td>08:00</td> <td>{{ comprehensiveTemp.temp20 }}</td>
<td>09:00</td> <td>{{ comprehensiveTemp.temp21 }}</td>
<td>10:00</td> <td>{{ comprehensiveTemp.temp22 }}</td>
<td>11:00</td> <td>{{ comprehensiveTemp.temp23 }}</td>
<td>12:00</td> <td>{{ comprehensiveTemp.temp24 }}</td>
</tr> </tr>
</table> </table>
<table <table
...@@ -190,10 +190,10 @@ ...@@ -190,10 +190,10 @@
<th colspan="2">16:00-20:00</th> <th colspan="2">16:00-20:00</th>
<th colspan="2">20:00-24:00</th> <th colspan="2">20:00-24:00</th>
</tr> </tr>
<tr> <tr v-for="(item, key) in analysisSupplys" :key="key">
<th>小王庄</th> <th>{{ item.name }}</th>
<td>0.1131</td> <td>{{ item.part1.measurement }}</td>
<td>0.1131</td> <td>{{ item.part1.reality }}</td>
<td>0.1131</td> <td>0.1131</td>
<td>0.1131</td> <td>0.1131</td>
<td>0.1131</td> <td>0.1131</td>
...@@ -207,7 +207,7 @@ ...@@ -207,7 +207,7 @@
<td>0.1131</td> <td>0.1131</td>
<td>0.1131</td> <td>0.1131</td>
</tr> </tr>
<tr> <!-- <tr>
<th>港东</th> <th>港东</th>
<td>0.1131</td> <td>0.1131</td>
<td>0.1131</td> <td>0.1131</td>
...@@ -308,7 +308,7 @@ ...@@ -308,7 +308,7 @@
<td>0.1131</td> <td>0.1131</td>
<td>0.1131</td> <td>0.1131</td>
<td>0.1131</td> <td>0.1131</td>
</tr> </tr> -->
</table> </table>
</el-card> </el-card>
</div> </div>
...@@ -319,6 +319,15 @@ import { ref, reactive, onMounted, onUnmounted } from "vue"; ...@@ -319,6 +319,15 @@ import { ref, reactive, onMounted, onUnmounted } from "vue";
import http from "../../api/http"; import http from "../../api/http";
import zhCn from "element-plus/dist/locale/zh-cn.mjs"; import zhCn from "element-plus/dist/locale/zh-cn.mjs";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
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({ const enertyInfo = reactive({
endTime: null, endTime: null,
}); });
...@@ -361,7 +370,24 @@ function timeFun() { ...@@ -361,7 +370,24 @@ function timeFun() {
enertyInfo.endTime = endTimes; 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(() => { onMounted(() => {
postHeatAnalysisFun();
timeFun(); timeFun();
}); });
onUnmounted(() => { onUnmounted(() => {
...@@ -394,7 +420,7 @@ table { ...@@ -394,7 +420,7 @@ table {
width: 100%; width: 100%;
} }
table th { table th {
background-color: #f5f7fa; background-color: rgb(181, 230, 255);
text-align: center; text-align: center;
padding: 5px 10px; padding: 5px 10px;
} }
......
...@@ -209,6 +209,7 @@ import { ...@@ -209,6 +209,7 @@ import {
} from '@element-plus/icons-vue'; } from '@element-plus/icons-vue';
import DataMenu from '../components/DataMenu.vue'; import DataMenu from '../components/DataMenu.vue';
import EventBus from '../utils/event-bus.js'; import EventBus from '../utils/event-bus.js';
import { ElNotification } from 'element-plus'
//import {RoleEnum} from '../utils/enumData'; //import {RoleEnum} from '../utils/enumData';
...@@ -633,6 +634,87 @@ export default defineComponent({ ...@@ -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> </script>
<style lang="less" scoped> <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