Browse Source

环控状态

master
xuhuajiao 3 months ago
parent
commit
5dbb6d8f64
  1. 22
      src/views/components/AccessDoor.vue
  2. 17
      src/views/components/WarehouseWarning.vue
  3. 1304
      src/views/environmentalScreen/index copy 2.vue
  4. 787
      src/views/environmentalScreen/index copy.vue
  5. 773
      src/views/environmentalScreen/index-0107-loading.vue
  6. 1149
      src/views/environmentalScreen/index-1216-1.vue
  7. 26
      src/views/environmentalScreen/index.vue

22
src/views/components/AccessDoor.vue

@ -13,12 +13,12 @@
<div>{{ scope.row.time | parseTime }}</div> <div>{{ scope.row.time | parseTime }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="姓名" align="center" :show-overflow-tooltip="true" :width="isScreen ? 100 :''">
<el-table-column label="姓名" align="center" :show-overflow-tooltip="true" :width="isScreen ? 112 :''">
<template slot-scope="scope"> <template slot-scope="scope">
<div>{{ scope.row.name }}</div> <div>{{ scope.row.name }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="minorName" label="说明" align="center" :show-overflow-tooltip="true" :width="isScreen ? 148 :''" />
<el-table-column prop="minorName" label="说明" align="center" :show-overflow-tooltip="true" :width="isScreen ? 136 :''" />
</el-table> </el-table>
</div> </div>
</template> </template>
@ -141,6 +141,24 @@ export default {
} }
}, },
getAccessdoor() { getAccessdoor() {
// this.tableData = [
// {
// 'id': 'eb6b8653',
// 'lscid': 0,
// 'wyid': '',
// 'itemLevels': 1,
// 'siteName': '.',
// 'time': 1765944141000,
// 'isAd': true,
// 'type': 0,
// 'ip': '192.168.99.101:6003',
// 'name': '湿',
// 'minorName': '',
// 'dw': '',
// 'itemClass': 1
// }
// ]
// name 6 7
// page: 0, // page: 0,
FetchInitRealTimeHikDoorLog({ size: this.size }).then((data) => { FetchInitRealTimeHikDoorLog({ size: this.size }).then((data) => {
this.tableData = [] this.tableData = []

17
src/views/components/WarehouseWarning.vue

@ -15,8 +15,13 @@
<!-- <span v-if="scope.row.TS">{{ scope.row.TS | parseTime }}</span> --> <!-- <span v-if="scope.row.TS">{{ scope.row.TS | parseTime }}</span> -->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="name" label="设备" align="center" :show-overflow-tooltip="true" :width="isScreen ? 100 :''" />
<el-table-column prop="value" label="警情" align="center" :show-overflow-tooltip="true" :width="isScreen ? 148 :''" />
<el-table-column prop="siteName" label="设备" align="center" :show-overflow-tooltip="true" :width="isScreen ? 112 :''">
<template slot-scope="scope">
<!-- siteName = "环境监控.空气净化机" -->
<span>{{ getDeviceName(scope.row.siteName) }}</span>
</template>
</el-table-column>
<el-table-column prop="value" label="警情" align="center" :show-overflow-tooltip="true" :width="isScreen ? 136 :''" />
</el-table> </el-table>
</div> </div>
</template> </template>
@ -73,6 +78,11 @@ export default {
this.scrollTimer = null this.scrollTimer = null
}, },
methods: { methods: {
getDeviceName(siteName) {
if (!siteName) return ''
const parts = siteName.split('.')
return parts.length > 1 ? parts[1] : siteName
},
toPage() { toPage() {
this.$router.push({ this.$router.push({
name: 'RunningLog', name: 'RunningLog',
@ -150,7 +160,7 @@ export default {
} }
}, },
getAlarmInfo() { getAlarmInfo() {
// [{"alarmid": "88347b05","lscid": 1,"WYID":"192.168.99.101:5004_1","Itemlevels":7, "siteName": ".", "TS":"2026/1/6 15:08:56", "id":11955, "isAD":1,"type":0,"IP":" 192.168.99.101:5004 ","name":"", "value":"", "dw":"", "ItemClass":3},{"alarmid": "4b232d46","lscid": 1,"WYID":"192.168.99.101:5003_1","Itemlevels":7, "siteName": ".湿", "TS":"2026/1/6 16:13:31", "id":11922, "isAD":1,"type":0,"IP":" 192.168.99.101:5003 ","name":"", "value":"", "dw":"", "ItemClass":1},{"alarmid": "3a309a0a","lscid": 9,"WYID":"192.168.99.101:6003_9","Itemlevels":7, "siteName": ".", "TS":"2026/1/6 16:18:33", "id":12061, "isAD":1,"type":0,"IP":" 192.168.99.101:6003 ","name":"", "value":"OFF", "dw":"", "ItemClass":3},{"alarmid": "63df6a30","lscid": 1,"WYID":"192.168.99.101:5005_1","Itemlevels":7, "siteName": ".湿", "TS":"2026/1/6 16:19:58", "id":11305, "isAD":1,"type":0,"IP":" 192.168.99.101:5005 ","name":"", "value":"", "dw":"", "ItemClass":1}]
// this.tableData = [{"alarmid": "88347b05","lscid": 1,"WYID":"192.168.99.101:5004_1","Itemlevels":7, "siteName": ".", "TS":"2026/1/6 15:08:56", "id":11955, "isAD":1,"type":0,"IP":" 192.168.99.101:5004 ","name":"", "value":"", "dw":"", "ItemClass":3},{"alarmid": "4b232d46","lscid": 1,"WYID":"192.168.99.101:5003_1","Itemlevels":7, "siteName": ".湿", "TS":"2026/1/6 16:13:31", "id":11922, "isAD":1,"type":0,"IP":" 192.168.99.101:5003 ","name":"", "value":"", "dw":"", "ItemClass":1},{"alarmid": "3a309a0a","lscid": 9,"WYID":"192.168.99.101:6003_9","Itemlevels":7, "siteName": ".", "TS":"2026/1/6 16:18:33", "id":12061, "isAD":1,"type":0,"IP":" 192.168.99.101:6003 ","name":"", "value":"OFF", "dw":"", "ItemClass":3},{"alarmid": "63df6a30","lscid": 1,"WYID":"192.168.99.101:5005_1","Itemlevels":7, "siteName": ".湿", "TS":"2026/1/6 16:19:58", "id":11305, "isAD":1,"type":0,"IP":" 192.168.99.101:5005 ","name":"", "value":"", "dw":"", "ItemClass":1}]
// this.tableData = [ // this.tableData = [
// { // {
// 'id': 'eb6b8653', // 'id': 'eb6b8653',
@ -168,6 +178,7 @@ export default {
// 'itemClass': 1 // 'itemClass': 1
// } // }
// ] // ]
// name 6 7
alarmApi.info({ storeroomId: this.storeroomId }).then((data) => { alarmApi.info({ storeroomId: this.storeroomId }).then((data) => {
this.tableData = [] this.tableData = []
if (data && data.length > 0) { if (data && data.length > 0) {

1304
src/views/environmentalScreen/index copy 2.vue
File diff suppressed because it is too large
View File

787
src/views/environmentalScreen/index copy.vue

@ -1,787 +0,0 @@
<template>
<div class="env-container">
<div class="env-top-title" />
<div class="current-date">{{ nowDate }}</div>
<div class="env-main">
<div class="env-main-left">
<div class="env-item container-wrap">
<span class="right-top-line" />
<span class="left-bottom-line" />
<h3>
<svg-icon icon-class="danganjieyue" style="margin-right:10px" />档案借阅
</h3>
<div class="chart-wrapper" style="height: calc(100% - 40px);">
<lend-across :lend-data="lendData" :refreshtime="refreshtime" />
</div>
</div>
<div class="env-item container-wrap" style="height: calc(100% - 170px) !important;">
<span class="right-top-line" />
<span class="left-bottom-line" />
<h3>
<i class="iconfont icon-kongqizhiliangshuju" />档案库空气质量数据
</h3>
<span style="display:block; text-align: center; font-size: 12px; margin-left: 10px; color: #3a99fd;">
{{ currentDeviceName || '' }}
</span>
<ul v-if="newAlarm && newAlarm.length !== 0" class="screen-env-list">
<li v-for="item in newAlarm" :key="item.SUBID">
<svg-icon v-if="item.subName === '温度'" icon-class="temperature" class-name="msg-list-svg" />
<svg-icon v-if="item.subName === '湿度'" icon-class="shidu" class-name="msg-list-svg" />
<svg-icon v-if="item.subName === 'PM2.5浓度'" icon-class="pm25" class-name="msg-list-svg" />
<svg-icon v-if="item.subName === 'PM10浓度'" icon-class="pm10" class-name="msg-list-svg" />
<svg-icon v-if="item.subName === 'TVOC'" icon-class="voc" class-name="msg-list-svg" />
<svg-icon v-if="item.subName === '二氧化碳'" icon-class="co2" class-name="msg-list-svg" />
<svg-icon v-if="item.subName === '甲醛'" icon-class="jiaquan" class-name="msg-list-svg" style="font-size: 64px; margin-left: 10px;" />
<!-- <svg-icon v-if="item.subName === '综合气体'" icon-class="comprehensive-gas" class-name="msg-list-svg" /> -->
<svg-icon v-if="item.subName === '空气质量'" icon-class="kongqi" class-name="msg-list-svg" />
<div class="msg-txt">
<span class="msg-list-num">{{ item.value }}</span>
<p class="msg-list-unit">{{ item.subName }} {{ item.dw }}</p>
</div>
</li>
</ul>
<!-- 空状态提示 -->
<div v-else class="empty-tip" style="display:flex; justify-content: center; height: calc(100% - 80px); color: #909399; align-items: center; font-size: 12px;">
暂无数据
</div>
</div>
</div>
<div class="env-main-middle" :style="{ height: allDisplayConfigData?.length ? 'calc(100vh - 138px)' : 'calc(100vh - 138px)', overflow: 'hidden' }">
<div class="env-3d" :style="{ height: allDisplayConfigData?.length ? 'calc(100% - 80px)' : 'calc(100% + 80px)'}">
<div class="banner-top-name">{{ bannerRoomName }}</div>
<iframe id="myIframe" ref="myIframe" name="iframeMap" class="iframe_box" src="/web3D/index.html" frameborder="0" scrolling="no" />
</div>
<div v-if="newAlarm && newAlarm.length !== 0" class="air-quality" :class="{'air-warn': aqiStatus === '污染'}">
<h3>实时空气质量指数AQI</h3>
<div class="air-params">
<div class="air-left">
<span class="air-title">实时AQI</span>
<div class="air-result"><p>{{ aqiValue }}</p><span>(AQI-US)</span></div>
</div>
<div class="air-right">
<span>空气质量为</span>
<p>{{ aqiStatus }}</p>
</div>
</div>
</div>
<!-- <div v-if="allDisplayConfigData && allDisplayConfigData.length !==0 " class="middle-bottom">
<span class="right-top-line" />
<span class="left-bottom-line" />
<ul class="leakage-list">
<li v-for="item in allDisplayConfigData" :key="item.id" :class="{ 'leakage-warn': item.NetStatus === 0 }">
<p><i class="iconfont icon-weihubaojing" />{{ item.Name }}</p>
<span class="leakage-state-tip" />
</li>
</ul>
</div> -->
<div v-if="validDisplayConfigData.length" class="middle-bottom">
<span class="right-top-line" />
<span class="left-bottom-line" />
<ul
class="leakage-list"
:style="{
height: showScroll ? '147px' : 'auto', // >6
overflow: showScroll ? 'auto' : 'hidden' // >6
}"
>
<li
v-for="item in validDisplayConfigData"
:key="item.id"
:class="{ 'leakage-warn': item.NetStatus === 0 }"
:style="{
width: liWidth,
height: liHeight,
marginRight: '14px',
marginBottom: '14px'
}"
>
<p><i class="iconfont icon-shebei" />{{ item.Name }}</p>
<span class="leakage-state-tip" />
</li>
</ul>
</div>
</div>
<div class="env-main-right">
<!-- 门禁记录 -->
<!-- <security-door :height="'calc(100% - 38px)'" style="margin-bottom: 15px;" /> -->
<AccessDoor :height="'calc(100% - 40px)'" style="margin-bottom: 15px;" />
<!-- 报警记录 -->
<warehouse-warning :height="'calc(100% - 38px)'" />
</div>
</div>
</div>
</template>
<script>
import { getCurrentTime } from '@/utils/index'
import lendAcross from '@/views/components/echarts/lendAcross.vue'
import WarehouseWarning from '@/views/components/WarehouseWarning'
// import SecurityDoor from '@/views/components/SecurityDoor'
import AccessDoor from '@/views/components/AccessDoor'
import displayConfigApi from '@/api/storeManage/displayConfig'
// import thirdApi from '@/api/thirdApi'
import { statisticsCrud } from '@/views/system/archiveStatistics/mixins/statistics'
import alarmApi from '@/api/home/alarm'
// import { allDeviceData, mockIpData } from './index.js'
// // mock
// const mockFetchDataForIP = (params) => {
// return new Promise((resolve) => {
// setTimeout(() => {
// const ip = params.ip
// const result = mockIpData[ip] || { code: 200, message: '', data: [], timestamp: Date.now() }
// resolve(result.data)
// }, 500)
// })
// }
export default {
name: 'EnvironmentalScreen',
components: {
WarehouseWarning,
// SecurityDoor,
AccessDoor,
lendAcross
},
mixins: [statisticsCrud],
data() {
return {
bannerRoomName: '3F 全景图',
nowDate: '',
timer: null,
echartsTimer: null,
roomId: 'D6490DA3D4261E8C26D0E3',
allDisplayConfigData: [],
displayConfigData: [],
url: '',
allDeviceIds: [],
oaoMessage: [],
topDisplayData: {
DAK_DIV_TOP_001: { show: true, curValue: '23.10', unit: '℃', curstatus: 0 },
DAK_DIV_TOP_002: { show: true, curValue: '48.90', unit: '%', curstatus: 0 },
DAK_DIV_TOP_003: { show: true, curValue: '619', unit: 'ppm', curstatus: 0 },
DAK_DIV_TOP_004: { show: true, curValue: '0.21', unit: 'mg/m³', curstatus: 0 },
DAK_DIV_TOP_005: { show: true, curValue: '26.00', unit: 'ug/m³', curstatus: 0 },
DAK_DIV_TOP_006: { show: true, curValue: '38.00', unit: 'ug/m³', curstatus: 0 }
},
refreshtime: 60000,
lendData: [],
typeData: [],
// FullView
newAlarm: [],
aqiValue: 45,
aqiStatus: '健康',
keepIndicators: [
'二氧化碳',
'甲醛',
'综合气体',
'PM2.5浓度',
'PM10浓度',
'温度',
'湿度',
'空气质量'
],
ipToNameMap: {}, // IP
currentDeviceName: '', //
currentIpIndex: 0, // IP
excludeIpList: ['192.168.99.101:6003'], // IP
dataTimer: null, //
iframeWin: null // iframe
}
},
computed: {
// /
validDisplayConfigData() {
return this.allDisplayConfigData.filter(item => item && item.Name)
},
// 3
itemsPerRow() {
const len = this.validDisplayConfigData.length
if (len === 0) return 0
// <=3 3<<=6 3>6 32
return len <= 3 ? len : 3
},
// li
liWidth() {
if (this.itemsPerRow === 0) return '0'
// n = 100%/n - 14px
return `calc(100% / ${this.itemsPerRow} - 14px)`
},
// li
liHeight() {
const len = this.validDisplayConfigData.length
if (len === 0) return '0'
// = (/)
const rows = Math.ceil(len / this.itemsPerRow)
// = 100%/ - 14px
return `calc(100% / ${rows} - 14px)`
},
// >6
showScroll() {
return this.validDisplayConfigData.length > 6
}
},
async created() {
//
this.timer = setInterval(() => {
this.nowDate = getCurrentTime()
}, 1000)
// FullView
window.getIframeLoading = this.getIframeLoading
//
await alarmApi.FetchYpGetSite().then((data) => {
if (data && data.length > 0) {
this.allDisplayConfigData = data
this.handleDeviceIpList()
} else {
this.allDisplayConfigData = []
}
})
// this.allDisplayConfigData = allDeviceData
// this.handleDeviceIpList()
// +
if (this.allDeviceIds.length > 0) {
this.currentDeviceName = this.ipToNameMap[this.allDeviceIds[0]] || ''
await this.getRealTimeData(this.allDeviceIds[0])
//
this.dataTimer = setInterval(async() => {
const currentIp = this.getNextIp()
this.currentDeviceName = this.ipToNameMap[currentIp] || ''
await this.getRealTimeData(currentIp)
}, 10000)
// 10000
console.log(`启动IP轮询,共${this.allDeviceIds.length}个有效IP:`, this.allDeviceIds)
} else {
console.warn('无有效设备IP,停止轮询')
this.newAlarm = []
}
},
mounted() {
this.iframeWin = this.$refs.myIframe?.contentWindow
// if (this.allDeviceIds.length > 0) {
// this.dataTimer = setInterval(async() => {
// const currentIp = this.getNextIp()
// this.currentDeviceName = this.ipToNameMap[currentIp] || ''
// await this.getRealTimeData(currentIp)
// }, 10000)
// console.log(`IP${this.allDeviceIds.length}IP`, this.allDeviceIds)
// }
// echarts
this.echartsTimer = setInterval(() => {
this.lendData = []
this.typeData = []
this.getBorrowerNumSta()
}, this.refreshtime)
},
beforeDestroy() {
//
if (this.timer) clearInterval(this.timer)
if (this.echartsTimer) clearInterval(this.echartsTimer)
if (this.dataTimer) {
clearInterval(this.dataTimer)
console.log('停止IP轮询')
}
},
methods: {
/**
* 处理设备IP列表去重+排除+名称映射
*/
handleDeviceIpList() {
const ipSet = new Set()
this.ipToNameMap = {}
this.allDisplayConfigData.forEach(element => {
const ip = (element.IP || '').trim()
if (ip && !this.excludeIpList.includes(ip)) {
ipSet.add(ip)
this.ipToNameMap[ip] = element.Name || `未知设备(${ip})`
console.log('有效设备IP:', ip, '设备名称:', element.Name)
} else if (this.excludeIpList.includes(ip)) {
console.log('排除指定IP:', ip, '设备名称:', element.Name)
} else if (!ip) {
console.log('过滤空IP:', element.Name)
}
})
this.allDeviceIds = Array.from(ipSet)
},
/**
* 获取下一个轮询IP循环切换
*/
getNextIp() {
if (this.allDeviceIds.length === 0) return ''
//
this.currentIpIndex = this.currentIpIndex % this.allDeviceIds.length
const ip = this.allDeviceIds[this.currentIpIndex]
this.currentIpIndex = (this.currentIpIndex + 1) % this.allDeviceIds.length
console.log(`轮询切换 - 当前IP:${ip},下一个索引:${this.currentIpIndex}`)
return ip
},
/**
* 请求指定IP的实时数据过滤+AQI计算
*/
async getRealTimeData(targetIp) {
if (!targetIp) {
this.newAlarm = []
this.currentDeviceName = ''
return
}
try {
console.log(`开始请求IP【${targetIp}】的实时数据(模拟)`)
//
// const data = await mockFetchDataForIP({ ip: targetIp })
//
const data = await alarmApi.FetchDataForIP({ ip: targetIp })
//
const filteredData = data.filter(item =>
this.keepIndicators.includes(item.subName)
)
if (filteredData.length > 0) {
this.newAlarm = filteredData
console.log(`IP【${targetIp}】(${this.currentDeviceName}) 过滤后的数据:`, filteredData)
this.calcAQI(filteredData)
} else {
this.newAlarm = []
this.aqiValue = 45
this.aqiStatus = '健康'
console.log(`IP【${targetIp}】(${this.currentDeviceName}) 无需要的指标数据`)
}
} catch (error) {
this.newAlarm = []
this.aqiValue = 45
this.aqiStatus = '健康'
this.currentDeviceName = ''
console.error(`IP【${targetIp}】数据请求失败:`, error)
}
},
getIframeLoading(value) {},
//
async changeRoomGetDeivce() {
this.allDeviceIds = []
this.allDisplayConfigData = await displayConfigApi.list({ storeroomId: this.roomId })
this.handleDeviceIpList() // IP
console.log('allDeviceIds2', this.allDeviceIds)
this.displayConfigData = this.allDisplayConfigData.filter((item) => {
return item.isDisplay && item.bindState && item.deviceInfo && (item.divPosition.includes('OAO') || item.divPosition.includes('TOP') || item.divPosition.includes('LS'))
})
console.log('displayConfigData2', this.displayConfigData)
//
if (this.allDeviceIds.length > 0) {
this.currentDeviceName = this.ipToNameMap[this.allDeviceIds[0]] || ''
await this.getRealTimeData(this.allDeviceIds[0])
} else {
this.newAlarm = []
this.currentDeviceName = ''
}
this.handleAQI()
},
/**
* 计算AQI
*/
calcAQI(filteredData) {
const pm25 = parseFloat(filteredData.find(item => item.subName === 'PM2.5浓度')?.value || 0)
const pm10 = parseFloat(filteredData.find(item => item.subName === 'PM10浓度')?.value || 0)
const formaldehyde = parseFloat(filteredData.find(item => item.subName === '甲醛')?.value || 0)
const co2 = parseFloat(filteredData.find(item => item.subName === '二氧化碳')?.value || 0)
let aqi = 0
if (pm25 > 50 || pm10 > 100 || formaldehyde > 30 || co2 > 1000) {
aqi = Math.floor(Math.random() * 50) + 100
this.aqiStatus = '污染'
} else if (pm25 > 25 || pm10 > 50 || formaldehyde > 10 || co2 > 800) {
aqi = Math.floor(Math.random() * 50) + 50
this.aqiStatus = '一般'
} else {
aqi = Math.floor(Math.random() * 50) + 1
this.aqiStatus = '健康'
}
this.aqiValue = aqi
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "~@/assets/styles/lend-manage.scss";
.env-container {
width: 100%;
height: calc(100vh);
background-color: #031435;
.env-top-title {
width: calc(100vw);
height: 130px;
background: url("~@/assets/images/largeScreen/top-title.png") no-repeat 0 -14px;
background-size: contain;
}
.current-date {
position: fixed;
top: 25px;
right: 150px;
font-size: 16px;
color: #3a99fd;
}
.env-main {
display: flex;
justify-content: space-between;
padding: 0 25px;
// margin-top: -12px;
.env-main-left,
.env-main-right {
max-width: 24%;
flex: 1;
height: calc(100vh - 138px);
overflow: hidden;
}
.env-main-middle {
position: relative;
flex: 1;
margin: 0 20px;
height: calc(100vh - 138px);
overflow: hidden;
}
.env-main-left .container-wrap {
min-height: auto;
}
.env-main-right .container-wrap {
height: calc(100% / 2 - 14px);
min-height: auto;
}
.env-item {
margin-bottom: 20px;
text-align: center;
h3 {
position: relative;
display: inline-block;
padding: 10px 70px;
font-size: 16px;
color: #fff;
.iconfont {
margin-right: 10px;
font-size: 14px;
color: #f65163;
}
&::before {
content: "";
position: absolute;
left: 0;
top: 50%;
width: 36px;
height: 12px;
margin-top: -6px;
background: url("~@/assets/images/largeScreen/item-left.png") no-repeat;
background-size: cover;
}
&::after {
content: "";
position: absolute;
top: 50%;
right: 0;
width: 36px;
height: 12px;
margin-top: -6px;
background: url("~@/assets/images/largeScreen/item-right.png") no-repeat;
background-size: cover;
}
}
.msg-list {
flex-wrap: wrap !important;
padding: 0 20px;
li {
margin-bottom: 20px;
display: flex;
align-items: center;
.msg-list-svg {
font-size: 40px;
margin-left: 20px;
}
.msg-txt {
margin-left: 15px;
text-align: left;
.msg-list-num {
font-size: 24px;
color: #fff;
font-weight: 600;
}
.msg-list-unit {
font-size: 14px;
color: #ccc;
margin: 5px 0 0 0;
}
}
}
}
.empty-tip {
font-size: 14px;
color: #999;
padding: 40px 0;
}
}
.screen-env-list {
flex-wrap: wrap;
// justify-content: space-between;
justify-content: flex-start;
height: calc(100% - 54px);
padding: 0 10px;
li {
flex: none;
width: calc(100% / 2 - 22px);
margin: 20px 10px;
height: calc(100% / 4 - 40px);
.msg-list-svg {
font-size: 40px;
margin-left: 20px;
}
&.msg-pm {
.msg-list-svg {
font-size: 46px;
}
}
}
}
.env-3d {
position: relative;
width: 100%;
// height: calc(100% + 80px);
height: calc(100% - 80px);
background: url("~@/assets/images/largeScreen/bg.png") no-repeat center -130px;
overflow: hidden;
margin-top: -80px;
.iframe_box {
width: 100%;
height: 100%;
}
.screen-env-list {
position: absolute;
right: 0;
bottom: 0;
flex-wrap: wrap;
justify-content: space-between;
padding: 0;
width: 165px;
height: 200px;
z-index: 99999;
li {
width: 100%;
margin: 20px 0 0 0;
height: calc(100% / 2 - 20px);
}
}
}
}
}
.banner-top-name{
position: absolute;
left: 0;
top: 80px;
padding: 0 15px;
height: 34px;
line-height: 32px;
font-size: 18px;
color: #fff;
background-color: #113d72;
border: 1px solid #339cff;
border-radius: 4px;
}
.air-quality{
position: absolute;
top: 10px;
right: 20px;
color: #fff;
padding: 20px 20px 10px 20px;
background-image: linear-gradient(to top, rgba(24, 176, 143, .5), rgba(24, 176, 143, 0));
border-radius: 5px;
z-index: 9999;
h3{
padding: 30px 0;
}
.air-params{
display: flex;
justify-content: space-between;
align-items: last baseline;
.air-left{
.air-title{
position: relative;
padding-left: 12px;
font-size: 14px;
&::before{
content: "";
position: absolute;
left: 0;
top: 50%;
width: 6px;
height: 6px;
background-color: #18B08F;
border-radius: 50%;
}
}
.air-result{
display: flex;
justify-content: space-between;
align-items: last baseline;
padding-top: 10px;
p{
font-size: 30px;
font-weight: 600;
padding: 0 6px 0 10px;
}
span{
display: block;
font-size: 12px;
opacity: .6;
}
}
}
.air-right{
text-align: center;
span{
display: block;
font-size: 12px;
}
p{
font-size: 18px;
font-weight: 600;
padding: 10px 30px;
margin-top: 10px;
background-color: rgba(24, 176, 143, .2);
border-radius: 5px;
}
}
}
}
.air-warn{
background-image: linear-gradient(to top, rgba(246, 81, 99, .5), rgba(24, 176, 143, 0));
.air-params{
.air-right{
p{
background-color: rgba(246, 81, 99, .2);
}
}
}
}
.middle-bottom {
width: 100%;
position: relative;
padding: 0 !important;
background-color: #021941;
border: 1px solid #113d72;
color: #339cff;
font-size: 14px;
&::before,
&::after{
content: "";
position: absolute;
width: 17px;
height: 17px;
z-index: 99;
}
&::before{
top: -1px;
left: -1px;
border-top: 1px solid #339CFF;
border-left: 1px solid #339CFF;
}
&::after{
right: -1px;
bottom: -1px;
border-right: 1px solid #339CFF;
border-bottom: 1px solid #339CFF;
}
}
.leakage-list {
display: flex;
justify-content: flex-start;
flex-wrap: wrap;
padding: 14px 0 0 14px;
height: auto;
text-align: left;
&::-webkit-scrollbar {
width: 4px;
height: 4px;
}
&::-webkit-scrollbar-thumb {
background-color: #339cff;
border-radius: 2px;
}
&::-webkit-scrollbar-track {
background-color: #021941;
}
li {
position: relative;
display: flex;
justify-content: space-between;
align-items: center;
// width: calc( 100% / 3 - 14px);
// height: calc(100% / 3 - 14px);
width: auto;
height: auto;
// margin: 0 14px 14px 0;
padding: 0 30px;
border: 1px solid #3581cc;
background-color: #02255f;
border-radius: 2px;
&::before {
content: "";
position: absolute;
top: 4px;
left: 4px;
width: 0;
height: 0;
border-color: transparent #339cff;
border-width: 0 0 6px 6px;
border-style: solid;
}
p {
i {
margin-right: 8px;
font-size: 20px;
}
}
span.leakage-state-tip {
position: relative;
display: block;
width: 6px;
height: 6px;
border-radius: 50%;
background-color: #18b08f;
&::before {
content: "";
position: absolute;
left: 50%;
top: 50%;
width: 14px;
height: 14px;
border-radius: 50%;
box-shadow: inset 0px 0px 10px 1px #18b08f;
transform: translate(-50%, -50%);
}
}
&.leakage-warn {
border-color: #f65164;
box-shadow: inset 0px 0px 15px 1px #f65164;
color: #f65164;
&::before {
border-color: transparent #f65164;
}
span.leakage-state-tip {
background-color: #f65164;
&::before {
box-shadow: inset 0px 0px 10px 1px #f65164;
}
}
}
}
}
</style>

773
src/views/environmentalScreen/index-0107-loading.vue
File diff suppressed because it is too large
View File

1149
src/views/environmentalScreen/index-1216-1.vue
File diff suppressed because it is too large
View File

26
src/views/environmentalScreen/index.vue

@ -101,7 +101,7 @@
return a.Name.length - b.Name.length; // b.Name.length - a.Name.length return a.Name.length - b.Name.length; // b.Name.length - a.Name.length
})" })"
:key="item.id" :key="item.id"
:class="{ 'leakage-warn': item.NetStatus === 0 }"
:class="{ 'leakage-warn': !ypOnlineStatus }"
> >
<p><i class="iconfont icon-shebei" />{{ item.Name }}</p> <p><i class="iconfont icon-shebei" />{{ item.Name }}</p>
<span class="leakage-state-tip" /> <span class="leakage-state-tip" />
@ -180,9 +180,9 @@
</div> </div>
<div class="env-main-right"> <div class="env-main-right">
<!-- 环控实时报警 --> <!-- 环控实时报警 -->
<warehouse-warning is-screen="true" :height="'calc(100% - 38px)'" />
<warehouse-warning :is-screen="true" :height="'calc(100% - 38px)'" />
<!-- 门禁出入记录 --> <!-- 门禁出入记录 -->
<AccessDoor is-screen="true" :height="'calc(100% - 40px)'" size="4" />
<AccessDoor :is-screen="true" :height="'calc(100% - 40px)'" size="4" />
<!-- 当日告警统计 --> <!-- 当日告警统计 -->
<div class="env-item container-wrap"> <div class="env-item container-wrap">
<span class="right-top-line" /> <span class="right-top-line" />
@ -200,6 +200,7 @@
</template> </template>
<script> <script>
import CountTo from 'vue-count-to' import CountTo from 'vue-count-to'
import { getCurrentTime } from '@/utils/index' import { getCurrentTime } from '@/utils/index'
import lendAcross from '@/views/components/echarts/lendAcross.vue' import lendAcross from '@/views/components/echarts/lendAcross.vue'
@ -210,6 +211,7 @@ import { statisticsCrud } from '@/views/system/archiveStatistics/mixins/statisti
import displayConfigApi from '@/api/storeManage/displayConfig' import displayConfigApi from '@/api/storeManage/displayConfig'
import { getDeviceOnoff, getTodayHikAlarmLog } from '@/api/home/device' import { getDeviceOnoff, getTodayHikAlarmLog } from '@/api/home/device'
import alarmApi from '@/api/home/alarm' import alarmApi from '@/api/home/alarm'
import { FetchypNetStatusByIp } from '@/api/storeManage/deviceManage/device'
// import { allDeviceData, mockIpData } from './index.js' // import { allDeviceData, mockIpData } from './index.js'
// const mockFetchDataForIP = (params) => { // const mockFetchDataForIP = (params) => {
@ -323,7 +325,8 @@ export default {
alarmChartData: [], // alarmChartData: [], //
alarmRefreshTimer: null, // alarmRefreshTimer: null, //
deviceConfigTimer: null, deviceConfigTimer: null,
deviceConfigRefreshInterval: 15000 // 15
deviceConfigRefreshInterval: 15000, // 15
ypOnlineStatus: true // - 192.168.99.101:6003线
} }
}, },
computed: { computed: {
@ -390,6 +393,7 @@ export default {
window.getIframeLoading = this.getIframeLoading window.getIframeLoading = this.getIframeLoading
await this.fullDataRefresh() await this.fullDataRefresh()
this.deviceConfigTimer = setInterval(() => { this.deviceConfigTimer = setInterval(() => {
this.fullDataRefresh() this.fullDataRefresh()
@ -425,6 +429,19 @@ export default {
// if (this.alarmRefreshTimer) clearInterval(this.alarmRefreshTimer) // if (this.alarmRefreshTimer) clearInterval(this.alarmRefreshTimer)
}, },
methods: { methods: {
getYPReadStatus() {
const targetIp = '192.168.99.101:6003'
FetchypNetStatusByIp({ ip: targetIp })
.then((data) => {
console.log('data', data)
this.ypOnlineStatus = data !== 0
console.log(`原品环控设备(${targetIp})状态:`, this.ypOnlineStatus ? '在线' : '离线')
})
.catch((error) => {
console.error('获取原品环控设备状态失败:', error)
this.ypOnlineStatus = false
})
},
/** /**
* 全量数据更新设备配置 + 设备实时数据 + 计算逻辑 * 全量数据更新设备配置 + 设备实时数据 + 计算逻辑
*/ */
@ -440,6 +457,7 @@ export default {
// 2. IP // 2. IP
this.handleDeviceIpList() this.handleDeviceIpList()
this.getYPReadStatus()
// 3. IP // 3. IP
if (this.allDeviceIds.length > 0) { if (this.allDeviceIds.length > 0) {

Loading…
Cancel
Save