首页:布局调整

温度管理:加变量筛选
This commit is contained in:
fengrong 2024-11-20 15:45:12 +08:00
parent 8528da0bdd
commit 14d5db21d6
4 changed files with 252 additions and 35 deletions

View File

@ -1,20 +1,36 @@
<template> <template>
<div class="default-main" ref="HomeHight"> <div class="default-main" ref="HomeHight">
<el-row style="margin: 0px;"> <el-row style="margin: 0px;">
<el-col :md="24" :lg="16" class="col-center" style="padding-right: 10px;"> <el-col :md="24" :lg="24" class="col-center" style="padding-right: 10px;">
<div class="grid-content ep-bg-purple-light"> <div class="grid-content ep-bg-purple-light">
<!--风机矩阵--> <!--风机矩阵-->
<div class="matrix panelBg"> <div class="matrix panelBg">
<el-text class="mx-1 homelabel">风机矩阵</el-text> <div class="homeHeader">
<div class="cardLabel">风机矩阵</div>
<div class="realAlert"
ref="scrollRef"
@mouseover.native="clearScroll"
@mouseleave.native="createScroll">
<p v-for="(item,index) in tableData"
:key="index"
@click="open(item)" >
<span>{{item.deviceCode}}</span>
<span>{{item.eventText}}</span>
<span>{{item.eventTimeFormate}}</span>
</p>
<!-- <span v-if="tableData.length==0">暂无告警</span>-->
</div>
</div>
<el-scrollbar> <el-scrollbar>
<WindContent :parentData="FanList" @StatusListData="StatusListData"></WindContent> <WindContent :parentData="FanList" @StatusListData="StatusListData"></WindContent>
</el-scrollbar> </el-scrollbar>
</div> </div>
</div> </div>
</el-col> </el-col>
<el-col :md="24" :lg="8" style="padding: 0px"> <!-- <el-col :md="24" :lg="8" style="padding: 0px">
<div class="grid-content ep-bg-purple cardContentRight"> <div class="grid-content ep-bg-purple cardContentRight">
<!--实时告警--> &lt;!&ndash;实时告警&ndash;&gt;
<div class="realPart panelBg" style="margin-bottom: 0"> <div class="realPart panelBg" style="margin-bottom: 0">
<el-text class="mx-1 homelabel">实时告警</el-text> <el-text class="mx-1 homelabel">实时告警</el-text>
<div class="realAlert" <div class="realAlert"
@ -34,7 +50,7 @@
</div> </div>
</div> </div>
</div> </div>
</el-col> </el-col>-->
</el-row> </el-row>
</div> </div>
</template> </template>
@ -322,10 +338,14 @@ const clearScroll = () => {
const createScroll = () => { const createScroll = () => {
clearScroll() clearScroll()
timer =setInterval(() => { timer =setInterval(() => {
scrollRef.value.scrollTop += 1 scrollRef.value.scrollLeft += 1;
if (scrollRef.value.clientHeight + scrollRef.value.scrollTop == scrollRef.value.scrollHeight) { if (scrollRef.value.clientWidth + scrollRef.value.scrollLeft == scrollRef.value.scrollWidth) {
scrollRef.value.scrollTop = 0 scrollRef.value.scrollLeft = 0
} }
//scrollRef.value.scrollTop += 1
/* if (scrollRef.value.clientHeight + scrollRef.value.scrollTop == scrollRef.value.scrollHeight) {
scrollRef.value.scrollTop = 0
}*/
}, 30); }, 30);
} }
@ -356,7 +376,7 @@ const sizeChange = () => {
if (!rect) return if (!rect) return
computedHeight.powerHeight = rect.height - 630 + 'px' computedHeight.powerHeight = rect.height - 630 + 'px'
computedHeight.alarmHeight = rect.height - 5 + 'px' computedHeight.alarmHeight = rect.height - 5 + 'px'
computedHeight.centerHeight = rect.height - 5 + 'px' computedHeight.centerHeight = rect.height - 0 + 'px'
if (window.screen.width < 1360) { if (window.screen.width < 1360) {
computedHeight.alarmHeight = '300px' computedHeight.alarmHeight = '300px'
computedHeight.powerHeight = '200px' computedHeight.powerHeight = '200px'
@ -394,7 +414,7 @@ onUnmounted(() => {
<style scoped lang="scss"> <style scoped lang="scss">
$marginNum: 10px; $marginNum: 10px;
$labelHeight: 38px; $labelHeight: 30px;
@mixin cardDefaultStyle { @mixin cardDefaultStyle {
margin-top: $marginNum; margin-top: $marginNum;
margin-bottom: $marginNum; margin-bottom: $marginNum;
@ -404,13 +424,13 @@ $labelHeight: 38px;
} }
@mixin cardlabel { @mixin cardlabel {
.cardLabel { .cardLabel {
width: 100%; width: 200px;
height: $labelHeight; height: $labelHeight;
font-size: 18px; font-size: 18px;
font-weight: 600; font-weight: 600;
color: #4e5969; color: #4e5969;
line-height: 38px; line-height: 30px;
padding-left: 10px; /* padding-left: 10px;*/
} }
} }
.default-main { .default-main {
@ -438,7 +458,7 @@ $labelHeight: 38px;
letter-spacing: 0; letter-spacing: 0;
line-height: 18px; line-height: 18px;
font-weight: 600; font-weight: 600;
margin-bottom: 20px; margin-bottom: 10px;
display: block; display: block;
} }
.grid-content { .grid-content {
@ -447,9 +467,9 @@ $labelHeight: 38px;
height: 100%; height: 100%;
.panelBg { .panelBg {
background-color: #ffffff; background-color: #ffffff;
padding: 20px; padding: 10px;
border-radius: 5px; border-radius: 5px;
margin-bottom: 20px; margin-bottom: 10px;
} }
.overview { .overview {
/* @include cardDefaultStyle; /* @include cardDefaultStyle;
@ -526,6 +546,7 @@ $labelHeight: 38px;
} }
} }
.matrix { .matrix {
@include cardlabel;
background: url('/@/assets/dashboard/bg1.png') no-repeat #ffffff; background: url('/@/assets/dashboard/bg1.png') no-repeat #ffffff;
background-size: 100% 100%; background-size: 100% 100%;
/* min-height: 900px;*/ /* min-height: 900px;*/
@ -535,6 +556,19 @@ $labelHeight: 38px;
.el-scrollbar { .el-scrollbar {
height: calc(100% - 20px); height: calc(100% - 20px);
} }
.homeHeader{
display: flex;
}
.realAlert{
overflow: hidden;
white-space: nowrap;
cursor: pointer;
line-height: 30px;
p{
padding-right: 30px;
display: inline-block;
}
}
} }
.summarize { .summarize {
padding: 10px; padding: 10px;

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="FanList-content"> <div class="FanList-content">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :xs="24" :sm="12" :md="12" :lg="8" v-for="(item, index) in props.parentData" style="margin-bottom: 10px"> <el-col :xs="24" :sm="12" :md="12" :lg="4" v-for="(item, index) in props.parentData" style="margin-bottom: 5px">
<div class="grid-content ep-bg-purple" @dblclick="handleDoubleClick(item)"> <div class="grid-content ep-bg-purple" @dblclick="handleDoubleClick(item)">
<div class="FanList-panel" :class="item.standard == true ? 'wind-mark' : 'wind-default'"> <div class="FanList-panel" :class="item.standard == true ? 'wind-mark' : 'wind-default'">
<div class="fanlist-top"> <div class="fanlist-top">
@ -293,7 +293,7 @@ const handleDoubleClick = (row) => {
} }
} }
.fanlist-text { .fanlist-text {
margin-top: 20px; margin-top: 15px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.content-number { .content-number {
@ -309,6 +309,7 @@ const handleDoubleClick = (row) => {
display: flex; display: flex;
justify-content: end; justify-content: end;
height: 24px; height: 24px;
margin-top: -7px;
.tag-panel { .tag-panel {
border-radius: 0 0 8px 0; border-radius: 0 0 8px 0;
line-height: 20px; line-height: 20px;
@ -329,4 +330,14 @@ const handleDoubleClick = (row) => {
} }
} }
} }
@media screen and (max-width: 1280px) {
.FanList-content {
.FanList-panel {
.fanlist-text {
margin-top: 10px !important;
}
}
}
}
</style> </style>

View File

@ -87,7 +87,7 @@
<div class="realConter"> <div class="realConter">
<div class="header"> <div class="header">
<el-button type="primary" :icon="Crop" class="defaultBtn" @click="openMeasure">测点选择</el-button> <el-button type="primary" :icon="Crop" class="defaultBtn" @click="openMeasure">测点选择</el-button>
<el-button style="color: rgb(0, 100, 170);;" :icon="Download" class="defaultBtn" @click="downFun(tableColumn,tableData)">数据导出</el-button> <el-button style="color: rgb(0, 100, 170);" :icon="Download" class="defaultBtn" @click="downFun(tableColumn,tableData)">数据导出</el-button>
<div class="selectPart"> <div class="selectPart">
<span>自动更新</span> <span>自动更新</span>
<el-switch <el-switch

View File

@ -1,5 +1,58 @@
<template> <template>
<div class="temperature"> <div class="temperature">
<el-dialog v-model="visible" title="选择变量" width="700" :before-close="handleClose">
<div class="dialogContent">
<div class="PitchPart">
<el-row :gutter="20">
<div class="Pitchitem" v-for="item in subSystemDataList">
<el-checkbox-group v-model="checkList">
<el-checkbox v-model:value=item.measPointCode v-model:label=item.measPointName />
</el-checkbox-group>
</div>
</el-row>
</div>
</div>
<!-- <el-row :gutter="20">
<el-col :span="12">
<div class="transferLeft">
<el-main class="mainPart">
<el-table class="tablePart"
ref="RealtableRef"
:data="modalTbleData"
@selectionChange="selectTable"
:row-key="getRowKey">
&lt;!&ndash; <el-table-column type="selection" width="55" :reserve-selection="true"/>&ndash;&gt;
<el-table-column type="selection" width="55"/>
<el-table-column prop="porder" label="序号" width="60" />
<el-table-column prop="attributeCode" sortable label="名称" />
<el-table-column prop="attributeName" sortable label="描述" />
</el-table>
<div class="mainFooter" style="display: flex; justify-content: left">
<el-pagination
v-model:current-page="currentPage"
v-model:page-size="currentPageSize"
:total="pageTotal"
:page-sizes="pagePagination"
background
:pager-count="7"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
layout="prev, pager, next, jumper,sizes,total"
></el-pagination>
</div>
</el-main>
</div>
</el-col>
</el-row>-->
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="sureBtn">保存</el-button>
<el-button @click="visible = false">取消</el-button>
</div>
</template>
</el-dialog>
<el-container class="containerPart"> <el-container class="containerPart">
<el-aside class="defaultAside"> <el-aside class="defaultAside">
<el-main class="treeMain"> <el-main class="treeMain">
@ -15,6 +68,7 @@
</el-main> </el-main>
</el-aside> </el-aside>
<el-container class="defaultMainContainer"> <el-container class="defaultMainContainer">
<el-button style="color: rgb(0, 100, 170);" class="defaultBtn" @click="openMeasure">选择变量</el-button>
<div class="temperature-chart" ref="temperatureChartRef"></div> <div class="temperature-chart" ref="temperatureChartRef"></div>
</el-container> </el-container>
</el-container> </el-container>
@ -26,7 +80,8 @@ import {nextTick, onActivated, onMounted, onUnmounted, reactive, ref} from 'vue'
import {equipList,getTemperatureLimitByDeviceId,getsnapshotData} from "/@/api/backend/temperature/request.ts"; import {equipList,getTemperatureLimitByDeviceId,getsnapshotData} from "/@/api/backend/temperature/request.ts";
import * as echarts from "echarts"; import * as echarts from "echarts";
import {useEventListener } from '@vueuse/core' import {useEventListener } from '@vueuse/core'
import {dayjs} from "element-plus"; import { ElMessage} from "element-plus";
import {getModelAttributeList} from "/@/api/backend/realData/request";
const defaultProps = { const defaultProps = {
children: 'children', children: 'children',
label: 'name' label: 'name'
@ -50,14 +105,14 @@ const deviceQuery = (data: any) => {
nextTick(() => { nextTick(() => {
deviceId.value=res.data[0]?.id deviceId.value=res.data[0]?.id
equipTreeRef.value?.setCurrentKey(deviceData.value[0].children[0].id!, true) equipTreeRef.value?.setCurrentKey(deviceData.value[0].children[0].id!, true)
getChartData({id:deviceId.value}) getChartData({deviceId:deviceId.value,attributes:[]})
}) })
}) })
} }
const handleNodeClick = (data: any) => { const handleNodeClick = (data: any) => {
deviceId.value=data.id deviceId.value=data.id
state.charts.temperatureChart.clear() state.charts.temperatureChart.clear()
getChartData({id:deviceId.value}) getChartData({id:deviceId.value,attributes:[]})
} }
const state: { const state: {
@ -86,7 +141,7 @@ const inittemperatureChar = () => {
const option = { const option = {
grid: { grid: {
show:true, show:true,
top: 50, top: 0,
right: 23, right: 23,
bottom: 10, bottom: 10,
left: 25, left: 25,
@ -94,12 +149,6 @@ const inittemperatureChar = () => {
borderColor:'transparent', borderColor:'transparent',
backgroundColor:'rgba(254,55,49,0.20)' backgroundColor:'rgba(254,55,49,0.20)'
}, },
// tooltip: {
// trigger: 'axis',
// axisPointer: {
// type: 'shadow',
// },
// },
xAxis: { xAxis: {
type: 'value', type: 'value',
interval: 10, interval: 10,
@ -147,7 +196,7 @@ const inittemperatureChar = () => {
color: '#4E5969', color: '#4E5969',
}, },
}, },
axisTick: { show: true }, axisTick: { show: false },
splitLine: { splitLine: {
interval: 50, interval: 50,
lineStyle: { lineStyle: {
@ -230,9 +279,86 @@ const inittemperatureChar = () => {
temperatureChart.setOption(option) temperatureChart.setOption(option)
state.charts.temperatureChart = temperatureChart state.charts.temperatureChart = temperatureChart
} }
const attributesCode:any[]=[]
const currentPage = ref(1)
const currentPageSize = ref(20)
const pageTotal = ref(0)
const pagePagination = ref([20, 50, 100])
const modalTbleData=ref<any[]>([])
const visible = ref(false)
const checkList=ref([])
const selectcheck=ref([])
const openMeasure=() =>{
visible.value=true
variableList()
}
const subSystemDataList=ref([])
const variableList = () =>{
const data={
deviceId:deviceId.value,
attributes:[]
}
getTemperatureLimitByDeviceId(data).then((res) => {
if (res.code=='200') {
subSystemDataList.value=res.data.map((item) => {
return {
measPointName:item.measPointName,
measPointCode: item.measPointCode
}
})
// selectcheck.value=res.data.map((item) => {
// return item.measPointCode
// })
}
})
}
const queryListData = reactive({
pageSize: 20,
pageNum: 1,
iotModelId: '',
attributeType: '138'
})
const modelAttributeList=(data: any) =>{
getModelAttributeList(data).then((res) => {
if (res.code == 200) {
modalTbleData.value = res.rows
pageTotal.value = res.total;
} else {
ElMessage.error({
message: res.msg,
type: 'error',
})
}
})
}
const handleSizeChange = (val: number) => {
queryListData.pageSize = val
modelAttributeList(queryListData)
}
const handleCurrentChange = (val: number) => {
queryListData.pageNum = val
modelAttributeList(queryListData)
}
const handleClose = (done: () => void) => {
visible.value = false
}
const sureBtn = () => {
visible.value = false
selectcheck.value=checkList.value
getChartData({deviceId:deviceId.value,attributes:selectcheck.value})
}
let attributesCode:any[]=[]
const getChartData = (data: any) => { const getChartData = (data: any) => {
console.log(JSON.stringify(data)) //console.log(JSON.stringify(data))
getTemperatureLimitByDeviceId(data).then((res) => { getTemperatureLimitByDeviceId(data).then((res) => {
if (res.code=='200') { if (res.code=='200') {
temperatureData.name=[] temperatureData.name=[]
@ -241,6 +367,7 @@ const getChartData = (data: any) => {
temperatureData.limit1Low=[] temperatureData.limit1Low=[]
temperatureData.limit2High=[] temperatureData.limit2High=[]
temperatureData.limit2Low=[] temperatureData.limit2Low=[]
attributesCode=[]
res.data.forEach((item,index) => { res.data.forEach((item,index) => {
temperatureData.name.push(item.measPointName) temperatureData.name.push(item.measPointName)
attributesCode.push(item.measPointCode) attributesCode.push(item.measPointCode)
@ -253,7 +380,13 @@ const getChartData = (data: any) => {
temperatureData.limit2Low.push(item.limit2Low) temperatureData.limit2Low.push(item.limit2Low)
} }
}) })
getTemperaData([{deviceId:data.id,attributes:attributesCode}]) //console.log(JSON.stringify({deviceId:data.id,attributes:attributesCode}))
if(!data.attributes.length){
getTemperaData([{deviceId:data.deviceId,attributes:attributesCode}])
}else{
getTemperaData([{deviceId:data.deviceId,attributes:data.attributes}])
}
} }
}) })
} }
@ -308,7 +441,12 @@ let autoUpdateTimer: any = null
const autoUpdate = () => { const autoUpdate = () => {
if (!autoUpdateTimer) { if (!autoUpdateTimer) {
autoUpdateTimer = setInterval(() => { autoUpdateTimer = setInterval(() => {
getChartData({id:deviceId.value}) if(!selectcheck.value.length){
getChartData({deviceId:deviceId.value,attributes:[]})
}else{
getChartData({deviceId:deviceId.value,attributes:selectcheck.value})
}
}, 2000) }, 2000)
} }
} }
@ -339,9 +477,37 @@ onUnmounted(() => {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
$paginationHeight: 32px;
.temperature{ .temperature{
width: 100%; width: 100%;
height: 100%; height: 100%;
.el-dialog{
.dialogContent {
max-height: 500px;
overflow-y: auto;
overflow-x: hidden;
.PitchPart {
.Pitchitem {
line-height: 30px;
display: flex;
justify-content: space-between;
margin-left: 15px;
width: 320px;
}
}
}
.mainPart{
height: 500px;
overflow: hidden;
.tablePart{
height: calc(100% - $paginationHeight);
}
.mainFooter{
margin-top: 10px;
}
}
}
.containerPart { .containerPart {
height: 100%; height: 100%;
.defaultAside { .defaultAside {
@ -352,9 +518,15 @@ onUnmounted(() => {
.defaultMainContainer{ .defaultMainContainer{
width: calc(100% - 260px); width: calc(100% - 260px);
height: 100%; height: 100%;
.el-button{
height: 40px;
margin: 20px 0 20px 20px;
width: 100px;
}
flex-direction: column;
.temperature-chart{ .temperature-chart{
width: 100%; width: 100%;
height: calc(100% - 50px); height: calc(100% - 70px);
} }
} }
} }