Commit a561cf35 authored by moonby's avatar moonby

240703

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