Commit a561cf35 authored by moonby's avatar moonby

240703

parent 0239b038
......@@ -81,7 +81,9 @@ const props = defineProps(['dataRows',
'tableHeight',
'alarm',
'isLoading',
'parentMethod']);
'parentMethod',
'offlineTime'
]);
const emit = defineEmits(['sort','child-event']);
const classObject = 'fixedColumn'
const tableRef = ref(null);
......
......@@ -292,16 +292,16 @@ function getSupplys() {
if (element.enterpriseId === "9bca54bc-8f27-4849-8d7d-50c5099e1949") {
element.serviceCenterList.forEach(service => {
service.supplyList.forEach(supply => {
if (supply.boilerList.length > 0) {
// if (supply.boilerList.length > 0) {
selectList.supplyList.push({ label: supply.supplyName, value: supply.supplyId })
}
// }
})
})
} else {
element.supplyList.forEach(supply => {
if (supply.boilerList.length > 0) {
// if (supply.boilerList.length > 0) {
selectList.supplyList.push({ label: supply.supplyName, value: supply.supplyId })
}
// }
})
}
return;
......@@ -316,6 +316,10 @@ function getSupplys() {
}
function getDropdown() {
selectList.dropdownList.length = 0;
selectList.waterList.length=0;
selectList.gasList.length=0;
selectList.heatList.length=0;
selectList.elecList.length=0;
var result = store.getters.getEnterprise();
if (result) {
result.forEach(element => {
......@@ -589,40 +593,51 @@ async function getForms() {
// })
console.log(cardForms);
// console.log(selectList);
// for (var i = 0; i < cardForms.forms.length; i++) {
// cardForms.tableData[i] = [];
// }
await http.post('/api/device/Real', { enterpriseId: enterpriseId.value, deviceType: 5 }).then((result) => {
//根据返回结果,构建数据表cardForms.tableData和警告表
//处理:将字段与form对比,放取出对应的name和value,存入正确的tableData
findBoilderTableData(result.data, selectList.waterList[showDropdown.value].deviceId);
if(selectList.waterList.length>0){
findBoilderTableData(result.data, selectList.waterList[showDropdown.value].deviceId);
}
// findBoilderTableData(result.data, selectList.waterList[showDropdown.value].deviceId);
})
await http.post('/api/device/Real', { enterpriseId: enterpriseId.value, deviceType: 6 }).then((result) => {
//根据返回结果,构建数据表cardForms.tableData和警告表
//处理:将字段与form对比,放取出对应的name和value,存入正确的tableData
findBoilderTableData(result.data, selectList.heatList[showDropdown.value].deviceId);
if(selectList.heatList.length > 0){
findBoilderTableData(result.data, selectList.heatList[showDropdown.value].deviceId);
}
// findBoilderTableData(result.data, selectList.heatList[showDropdown.value].deviceId);
})
await http.post('/api/device/Real', { enterpriseId: enterpriseId.value, deviceType: 7 }).then((result) => {
//根据返回结果,构建数据表cardForms.tableData和警告表
//处理:将字段与form对比,放取出对应的name和value,存入正确的tableData
findBoilderTableData(result.data, selectList.elecList[showDropdown.value].deviceId);
if(selectList.elecList.length>0){
findBoilderTableData(result.data, selectList.elecList[showDropdown.value].deviceId);
}
})
await http.post('/api/device/Real', { enterpriseId: enterpriseId.value, deviceType: 4 }).then((result) => {
//根据返回结果,构建数据表cardForms.tableData和警告表
//处理:将字段与form对比,放取出对应的name和value,存入正确的tableData
findBoilderTableData(result.data, selectList.gasList[showDropdown.value].deviceId);
if(selectList.gasList.length>0){
findBoilderTableData(result.data, selectList.gasList[showDropdown.value].deviceId);
}
})
console.log(cardForms)
// console.log(cardForms)
}
function findBoilderTableData(dataSource, Id) {
//找到id相同的,解析并存入数据表
var data = dataSource.realData;
console.log(dataSource)
// console.log(dataSource)
// for (var i = 0; i < data.length; i++) {
// // console.log(data[i]['id'])
// // console.log(Id)
......@@ -702,10 +717,10 @@ function setCellStyle({ row, column, rowIndex, columnIndex }) {
if (alarmElement.enName.toUpperCase() === element.enName.toUpperCase()) {
//报警
if (alarmElement.topMost || alarmElement.downMost) {
console.log("!!!1")
// console.log("!!!1")
css_color['color'] = '#ff0000';
} else {
console.log("!!!2")
// console.log("!!!2")
css_color['color'] = '#ff8040';
}
}
......
......@@ -4,6 +4,7 @@
<el-card class="card-contianer">
<div class="div-header">
<template v-for="item in arrPercent" :key="item.text">
<el-tooltip effect="dark" :content="item.tips" placement="top-start"></el-tooltip>
<div class=" div-percent" :style="{backgroundImage: `url(${item.back})`}">
<el-progress :style="{color: item.color}" define-back-color="blue" width="60" type="circle" :percentage="item.data" :color="item.color">
<template #default="{ percentage }">
......@@ -39,30 +40,17 @@
</el-card>
<div class="search-box" v-show="searchBoxShow">
<div style="width: 400px; float:left">
<label>供热站:</label>
<el-select
v-model="showSupply"
placeholder="请选择"
collapse-tags
style="width: 240px"
multiple
@change="supplyChange"
@remove-tag='removeTag'
>
<el-option label='全选' value='全选' @click.native='selectAll'></el-option>
<el-option
v-for="item in supplyOptions.items"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<label>离线时间(分):</label>
<el-input style="width: 80px;" v-model="offlineTime" type="number" min="30" max="300"> </el-input>
</div>
<div style="float:left">
<label>刷新间隔(秒):</label>
<el-input style="width: 80px;" v-model="refreshTime" type="number" min="30" max="300"> </el-input>
</div>
<div style=" position: absolute; right: 120px; bottom: 10px;">
<el-button type="primary" plain @click="saveInfo">
<i class="el-icon-search" />保存
</el-button>
<el-button type="primary" plain @click="getFilterData">
<i class="el-icon-search" />查询
</el-button>
......@@ -196,10 +184,12 @@
const searchBoxShow = ref(false) //显示搜索框
const autoRefresh = ref(false)//自动刷新
const refreshTime = ref(60)//自动刷新间隔
const offlineTime = ref(30)
const titleData = ref([]);//自定义标题
const autoColBoxShow = ref(false);//显示自定义列
const title = ref('实时换热站自定义列');
const cfgType = ref(0);//自定义窗口类型:0实时数据,1曲线,2实时状态
const onChangeDialog = (val) => {
// console.log('onclick',val);
......@@ -220,7 +210,8 @@
text: "换热站上传率",
back: '/imgs/realPage/trans/1.png',
color: "rgb(176 63 63)",
forColor:"rgb(250 97 97)"
forColor:"rgb(250 97 97)",
tips:""
}, {
data: 0,
color: 'red',
......@@ -228,7 +219,8 @@
text:'换热站自控率',
back: '/imgs/realPage/trans/2.png',
color: "rgb(72 88 180)",
forColor:"rgb(97 119 250)"
forColor:"rgb(97 119 250)",
tips:""
}, {
data: 0,
color: 'red',
......@@ -236,7 +228,8 @@
text:'变频器投入率',
back: '/imgs/realPage/trans/3.png',
color: "rgb(163 68 174)",
forColor:"rgb(235 100 251)"
forColor:"rgb(235 100 251)",
tips:""
}, {
data: 0,
color: 'red',
......@@ -244,7 +237,8 @@
back: '/imgs/realPage/trans/4.png',
text:'热数据正常比',
color: "rgb(186 99 68)",
forColor:"rgb(250 137 97)"
forColor:"rgb(250 137 97)",
tips:""
},
{
data: 0,
......@@ -253,7 +247,8 @@
back: '/imgs/realPage/trans/5.png',
text:'水数据正常比',
color: "rgb(0 137 177)",
forColor:"rgb(98 176 240)"
forColor:"rgb(98 176 240)",
tips:""
},
{
data: 0,
......@@ -262,7 +257,8 @@
back: '/imgs/realPage/trans/6.png',
text:"电数据正常比",
color: "rgb(145 164 14)",
forColor:"rgb(203 230 18)"
forColor:"rgb(203 230 18)",
tips:""
},
{
data: 0,
......@@ -271,7 +267,8 @@
back: '/imgs/realPage/trans/7.png',
text:'平均阀门开度',
color: "rgb(51 145 72)",
forColor:"rgb(68 194 97)"
forColor:"rgb(68 194 97)",
tips:""
},
{
data: 0,
......@@ -280,7 +277,8 @@
back: '/imgs/realPage/trans/8.png',
text:'变频平均频率',
color: "rgb(134 12 204)",
forColor:"rgb(162 0 255)"
forColor:"rgb(162 0 255)",
tips:""
}));
......@@ -288,6 +286,7 @@
setContentHeight();
window.addEventListener('resize', setContentHeight);
getDataTables();
loadInfo()
})
onUnmounted(()=>{
window.removeEventListener('resize', setContentHeight);
......@@ -562,6 +561,19 @@
getFilterData();
}
}, refreshTime.value*1000); // 每分钟执行一次
function saveInfo(){
localStorage.setItem('offlineTime',offlineTime.value);
searchBoxShow.value = false;
}
function loadInfo(){
var offtime=localStorage.getItem('offlineTime');
if(offtime){
offlineTime.value=offtime;
}
}
// 分页大小改变时触发
const handleSizeChange = (val) => {
......@@ -574,4 +586,15 @@
Page.page = val;
getFilterData();
};
//判断是否离线,传入采集时间、离线时间
function onlineStatus(gatherTime,offlineTime){
//获取当前时间
var currentDate=new Date();
var hour=currentDate.getHours();
var min=currentDate.getMinutes();
//开始判定时间
}
</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