Browse Source

环控数据标签

master
xuhuajiao 2 months ago
parent
commit
4e4be2cd85
  1. 10
      src/api/home/alarm/index.js
  2. 29
      src/assets/icons/svg/jiaquan.svg
  3. 19
      src/assets/icons/svg/kongqi.svg
  4. 2
      src/router/index.js
  5. 2
      src/router/routers.js
  6. 15
      src/views/archivesManage/caseManage/caseList/index.vue
  7. 2
      src/views/components/WarehouseWarning.vue
  8. 2
      src/views/components/echarts/lendAcross.vue
  9. 903
      src/views/environmentalScreen/index-old.vue
  10. 798
      src/views/environmentalScreen/index.js
  11. 927
      src/views/environmentalScreen/index.vue
  12. 424
      src/views/storeManage/warehouse3D/archivesStorage/index-old.vue
  13. 753
      src/views/storeManage/warehouse3D/archivesStorage/index.js
  14. 408
      src/views/storeManage/warehouse3D/archivesStorage/index.vue

10
src/api/home/alarm/index.js

@ -9,6 +9,14 @@ export function info(params) {
})
}
export function FetchYpGetSite(params) {
return request({
url: 'api/alarm/ypGetSite',
params,
method: 'get'
})
}
// getDataForIP
export function FetchDataForIP(params) {
return request({
@ -18,4 +26,4 @@ export function FetchDataForIP(params) {
})
}
export default { info, FetchDataForIP }
export default { info, FetchDataForIP, FetchYpGetSite }

29
src/assets/icons/svg/jiaquan.svg

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 23.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 2111 1095.4" style="enable-background:new 0 0 2111 1095.4;" xml:space="preserve" width="200" height="200">
<style type="text/css">
.st0{fill:url(#路径_993_1_);}
.st1{fill:url(#路径_994_1_);}
</style>
<g id="自定义图标" transform="translate(0 35.4)">
<!-- 渐变1:主图形渐变(对应示例的路径_993_1_) -->
<linearGradient id="路径_993_1_" gradientUnits="userSpaceOnUse" x1="1055.5" y1="1060" x2="1055.5" y2="35" gradientTransform="matrix(1 0 0 1 0 0)">
<stop offset="0" style="stop-color:#C8E4FF"/>
<stop offset="0.632" style="stop-color:#339CFF"/>
<stop offset="1" style="stop-color:#339CFF"/>
</linearGradient>
<!-- 渐变2:细节图形渐变(对应示例的路径_994_1_) -->
<linearGradient id="路径_994_1_" gradientUnits="userSpaceOnUse" x1="1055.5" y1="800" x2="1055.5" y2="100" gradientTransform="matrix(1 0 0 1 0 0)">
<stop offset="0" style="stop-color:#C8E4FF"/>
<stop offset="0.632" style="stop-color:#339CFF"/>
<stop offset="1" style="stop-color:#339CFF"/>
</linearGradient>
<!-- 原有主图形路径(替换为渐变类st0) -->
<path class="st0" d="M309.046245 1024c-91.360595 0-166.859975-75.49938-166.859975-166.859975s75.49938-166.859975 166.859975-166.859975 166.859975 73.913259 166.859976 166.859975-75.49938 166.859975-166.859976 166.859975z m0-275.350682c-59.320942 0-108.807931 49.169765-108.80793 108.807931 0 59.320942 49.169765 108.807931 108.80793 108.807931 59.320942 0 108.807931-49.169765 108.807931-108.807931 0-59.638166-49.486989-108.807931-108.807931-108.807931zM552.674498 333.71995C461.313903 333.71995 385.814523 258.537794 385.814523 166.859975c0-91.360595 75.49938-166.859975 166.859975-166.859975S719.534473 74.230483 719.534473 166.859975c0 92.946716-75.49938 166.859975-166.859975 166.859975z m0-275.350681c-59.320942 0-108.807931 49.169765-108.80793 108.807931 0 59.320942 49.169765 108.807931 108.80793 108.80793 59.320942 0 108.807931-49.169765 108.807931-108.80793 0-59.638166-49.486989-108.807931-108.807931-108.807931z m671.563817 822.245353c-124.669145 0-226.180917-101.511772-226.180917-226.180917s101.511772-226.180917 226.180917-226.180917 226.180917 101.511772 226.180917 226.180917-101.511772 226.180917-226.180917 226.180917z m0-395.895911c-92.946716 0-168.128872 75.49938-168.128873 168.128873 0 92.946716 75.49938 168.128872 168.128873 168.128872 92.946716 0 168.128872-75.49938 168.128872-168.128872 0-92.946716-75.49938-168.128872-168.128872-168.128873zM690.349839 858.726146c-136.406444 0-246.483271-110.076828-246.483271-246.483271s110.076828-246.483271 246.483271-246.483272 246.483271 110.076828 246.483271 246.483272S825.170161 858.726146 690.349839 858.726146z m0-434.914498c-104.366791 0-188.431227 84.064436-188.431227 188.431227s84.064436 188.431227 188.431227 188.431227 188.431227-84.064436 188.431227-188.431227c0.317224-104.366791-85.333333-188.431227-188.431227-188.431227z m0 0"></path>
<!-- 原有细节图形路径(替换为渐变类st1) -->
<path class="st1" d="M572.976853 313.73482L627.53943 294.066914l40.921933 113.249071-54.562577 19.667906L572.976853 313.73482z m331.182156 328.009914l5.710037-57.734821 144.337051 14.275093-5.710038 57.734821-144.33705-14.275093zM398.18627 761.655514l90.408922-52.342007 29.184635 50.121437-90.408922 52.342008-29.184635-50.121438z m0 0"></path>
</g>
</svg>

19
src/assets/icons/svg/kongqi.svg

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 23.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 1024 1024" style="enable-background:new 0 0 1024 1024;" xml:space="preserve" width="256" height="256">
<style type="text/css">
.st0{fill:url(#路径_993_1_);}
</style>
<g id="自定义图标" transform="translate(0 0)">
<!-- 蓝白线性渐变(匹配示例风格) -->
<linearGradient id="路径_993_1_" gradientUnits="userSpaceOnUse" x1="512" y1="980" x2="512" y2="40" gradientTransform="matrix(1 0 0 1 0 0)">
<stop offset="0" style="stop-color:#C8E4FF"/>
<stop offset="0.632" style="stop-color:#339CFF"/>
<stop offset="1" style="stop-color:#339CFF"/>
</linearGradient>
<!-- 原有图形路径(替换为渐变类st0,删除原fill属性) -->
<path class="st0" d="M1015.179008 108.28661c-165.873545 365.536146-292.472798 565.345019-398.447563 628.75435-58.65546 36.129423-121.333426 55.218045-181.232207 55.218046a361.001684 361.001684 0 0 1-245.519176-98.295435c-32.472599 76.427625-55.94941 165.800409-68.01693 272.287129l-0.073136 0.585092-0.073137 0.658229c-6.216601 32.692008-31.741234 56.461365-60.776418 56.461365H54.970113l-1.462729-0.292546c-29.985958-6.362874-53.46277-36.641378-53.46277-69.040841v-1.02391l0.146273-1.023911c12.652612-103.414988 34.301011-196.371459 64.286969-276.382772 12.652612-33.789055 27.938137-64.506379 43.808754-94.346064a410.36881 410.36881 0 0 1-38.177245-128.208256 419.94969 419.94969 0 0 1 9.215197-149.856655 397.423653 397.423653 0 0 1 61.068964-134.936813A360.124046 360.124046 0 0 1 249.878842 66.89136C324.112373 22.497514 457.074501 0.044614 645.181537 0.044614c93.17588 0 201.052194 5.558373 320.776617 16.455709 18.284121 0.292546 36.348832 11.994383 48.635762 31.375551 12.286929 19.454305 12.433202 40.883294 0.585092 60.410736z m-369.558652 22.745446c-216.995947 0-301.395449 27.353045-334.014321 50.317901l-0.365683 0.292546-0.292546 0.219409a263.510751 263.510751 0 0 0-114.60487 158.633034 266.65562 266.65562 0 0 0-3.218005 117.603465 546.622079 546.622079 0 0 1 159.803217-125.575342c65.018334-33.203964 139.76382-55.071772 222.042364-64.872061a62.677967 62.677967 0 0 1 10.312245-0.877638c29.108321 0 51.561221 22.526037 57.119593 57.485276a58.43605 58.43605 0 0 1-8.922651 42.931116 67.066156 67.066156 0 0 1-44.759528 29.035184l-0.511955 0.146273h-0.511955c-145.468466 15.139252-255.612011 76.647035-333.941185 183.060619 46.880486 51.268675 111.89882 82.424817 180.720251 82.424817 42.711706 0 84.618912-12.06752 121.114017-34.886103l0.21941-0.219409 0.292546-0.146273c51.488085-29.32773 147.296878-138.227954 312.365922-488.112892-85.935368-7.459921-161.339083-7.459921-222.846866-7.459922z" p-id="4562"></path>
</g>
</svg>

2
src/router/index.js

@ -9,7 +9,7 @@ import { filterAsyncRouter } from '@/store/modules/permission'
NProgress.configure({ showSpinner: false })// NProgress Configuration
const whiteList = ['/login', '/environmentalScreen']// no redirect whitelist
const whiteList = ['/login', '/envScreen']// no redirect whitelist
router.beforeEach((to, from, next) => {
if (to.meta.title) {

2
src/router/routers.js

@ -59,7 +59,7 @@ export const constantRouterMap = [
]
},
{
path: '/environmentalScreen',
path: '/envScreen',
component: (resolve) => require(['@/views/environmentalScreen/index'], resolve),
hidden: true
}

15
src/views/archivesManage/caseManage/caseList/index.vue

@ -285,13 +285,24 @@ export default {
{
lsfFileVar: {
varname: 'barcode', //
varvalue: '编号:' + item.barcode
// varvalue: '' + item.barcode
// varvalue: '\r\n10000001'
varvalue: '15字第000000001号'
}
},
{
lsfFileVar: {
varname: 'title',
varvalue: '姓名:' + item.title
// varvalue: '' + item.title
// varvalue: '\r\n'
varvalue: '李军'
}
},
{
lsfFileVar: {
varname: 'nativePlace',
// varvalue: '\r\n'
varvalue: '湖北武汉'
}
}
]

2
src/views/components/WarehouseWarning.vue

@ -142,6 +142,8 @@ export default {
alarmApi.info({ storeroomId: this.storeroomId }).then((data) => {
if (data && data.length > 0) {
this.tableData.splice(0, data.length, ...data)
} else {
this.tableData = []
}
})
}

2
src/views/components/echarts/lendAcross.vue

@ -117,7 +117,7 @@ export default {
{
name: '数量',
type: 'bar',
barWidth: 30, //
barWidth: 12, //
barGap: 25,
showBackground: true,
backgroundStyle: {

903
src/views/environmentalScreen/index-old.vue

@ -0,0 +1,903 @@
<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><i class="iconfont icon-kongqizhiliangshuju" />档案库空气质量数据</h3>
<!-- <ul class="screen-env-list">
<li v-show="(bannerIndex === 0 || bannerIndex === 1 || bannerIndex === 2 || bannerIndex === 3) && topDisplayData.DAK_DIV_TOP_003.show" :class="{ 'li-warn': topDisplayData.DAK_DIV_TOP_003.curstatus > 0 }">
<svg-icon icon-class="co2" class-name="msg-list-svg" />
<div class="msg-txt">
<span class="msg-list-num">{{ topDisplayData.DAK_DIV_TOP_003.curValue }}</span>
<p class="msg-list-unit">CO2 {{ topDisplayData.DAK_DIV_TOP_003.unit }}</p>
</div>
</li>
<li v-show="(bannerIndex === 0 || bannerIndex === 1 || bannerIndex === 2 || bannerIndex === 3) && topDisplayData.DAK_DIV_TOP_004.show" :class="{ 'li-warn': topDisplayData.DAK_DIV_TOP_004.curstatus > 0 }">
<svg-icon icon-class="voc" class-name="msg-list-svg" />
<div class="msg-txt">
<span class="msg-list-num">{{ topDisplayData.DAK_DIV_TOP_004.curValue }}</span>
<p class="msg-list-unit">TVOC {{ topDisplayData.DAK_DIV_TOP_004.unit }}</p>
</div>
</li>
<li v-show="(bannerIndex === 0 || bannerIndex === 1 || bannerIndex === 2 || bannerIndex === 3) && topDisplayData.DAK_DIV_TOP_005.show" :class="{ 'li-warn': topDisplayData.DAK_DIV_TOP_005.curstatus > 0 }" class="msg-pm">
<svg-icon icon-class="pm25" class-name="msg-list-svg" />
<div class="msg-txt">
<span class="msg-list-num">{{ topDisplayData.DAK_DIV_TOP_005.curValue }}</span>
<p class="msg-list-unit">PM2.5 {{ topDisplayData.DAK_DIV_TOP_005.unit }}</p>
</div>
</li>
<li v-show="(bannerIndex === 0 || bannerIndex === 1 || bannerIndex === 2 || bannerIndex === 3) && topDisplayData.DAK_DIV_TOP_006.show" :class="{ 'li-warn': topDisplayData.DAK_DIV_TOP_006.curstatus > 0 }" class="msg-pm">
<svg-icon icon-class="pm10" class-name="msg-list-svg" />
<div class="msg-txt">
<span class="msg-list-num">{{ topDisplayData.DAK_DIV_TOP_006.curValue }}</span>
<p class="msg-list-unit">PM10 {{ topDisplayData.DAK_DIV_TOP_006.unit }}</p>
</div>
</li>
</ul> -->
</div>
<!-- <div class="env-item container-wrap">
<span class="right-top-line" />
<span class="left-bottom-line" />
<h3><i class="iconfont icon-loushuijiance" />漏水检测</h3>
<div class="leakage-detection">
<div class="state-list">
<span>正常</span>
<span>报警</span>
</div>
<ul class="leakage-list">
<li :class="{ 'leakage-warn': waterLeakage.waterLeakageStatus1 }">
<p><i class="iconfont icon-weihubaojing" />维护报警</p>
<span class="leakage-state-tip" />
</li>
<li :class="{ 'leakage-warn': waterLeakage.waterLeakageStatus2 }">
<p><i class="iconfont icon-loushuibaojing" />漏水报警</p>
<span class="leakage-state-tip" />
</li>
<li :class="{ 'leakage-warn': waterLeakage.waterLeakageStatus3 }">
<p><i class="iconfont icon-ganyingxianduanlie" />感应线断裂</p>
<span class="leakage-state-tip" />
</li>
<li :class="{ 'leakage-warn': waterLeakage.waterLeakageStatus4 }">
<p><i class="iconfont icon-loushuiweizhi" />漏水位置</p>
<span>{{ waterLeakage.waterLeakageText4 }}</span>
</li>
</ul>
</div>
</div> -->
<!-- 门禁记录 -->
<security-door :height="'calc(100% - 38px)'" />
</div>
<div class="env-main-middle">
<div class="env-3d">
<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" />
<!-- <ul class="screen-env-list">
<li v-show="(bannerIndex === 0 || bannerIndex === 1 ) && topDisplayData.DAK_DIV_TOP_001.show" :class="{ 'li-warn': topDisplayData.DAK_DIV_TOP_001.curstatus > 0 }">
<svg-icon icon-class="temperature" class-name="msg-list-svg" />
<div class="msg-txt">
<span class="msg-list-num">{{ topDisplayData.DAK_DIV_TOP_001.curValue }}</span>
<p class="msg-list-unit">温度 {{ topDisplayData.DAK_DIV_TOP_001.unit }}</p>
</div>
</li>
<li v-show="(bannerIndex === 0 || bannerIndex === 1 )&& topDisplayData.DAK_DIV_TOP_002.show" :class="{ 'li-warn': topDisplayData.DAK_DIV_TOP_002.curstatus > 0 }">
<svg-icon icon-class="shidu" class-name="msg-list-svg" />
<div class="msg-txt">
<span class="msg-list-num">{{ topDisplayData.DAK_DIV_TOP_002.curValue }}</span>
<p class="msg-list-unit">湿度 {{ topDisplayData.DAK_DIV_TOP_002.unit }}</p>
</div>
</li>
<li v-show="bannerIndex === 2 && topOAODisplayData.ZLS_MO_OAO_001.show" :class="{ 'li-warn': topOAODisplayData.ZLS_MO_OAO_001.alarmState }">
<svg-icon icon-class="temperature" class-name="msg-list-svg" />
<div class="msg-txt">
<span class="msg-list-num">{{ topOAODisplayData.ZLS_MO_OAO_001.wendu }}</span>
<p class="msg-list-unit">温度</p>
</div>
</li>
<li v-show="bannerIndex === 2 && topOAODisplayData.ZLS_MO_OAO_001.show" :class="{ 'li-warn': topOAODisplayData.ZLS_MO_OAO_001.alarmState }">
<svg-icon icon-class="shidu" class-name="msg-list-svg" />
<div class="msg-txt">
<span class="msg-list-num">{{ topOAODisplayData.ZLS_MO_OAO_001.sidu }}</span>
<p class="msg-list-unit">湿度</p>
</div>
</li>
<li v-show="bannerIndex === 3 && topOAODisplayData.YLS_MO_OAO_001.show" :class="{ 'li-warn': topOAODisplayData.YLS_MO_OAO_001.alarmState }">
<svg-icon icon-class="temperature" class-name="msg-list-svg" />
<div class="msg-txt">
<span class="msg-list-num">{{ topOAODisplayData.YLS_MO_OAO_001.wendu }}</span>
<p class="msg-list-unit">温度</p>
</div>
</li>
<li v-show="bannerIndex === 3 && topOAODisplayData.YLS_MO_OAO_001.show" :class="{ 'li-warn': topOAODisplayData.YLS_MO_OAO_001.alarmState }">
<svg-icon icon-class="shidu" class-name="msg-list-svg" />
<div class="msg-txt">
<span class="msg-list-num">{{ topOAODisplayData.YLS_MO_OAO_001.sidu }}</span>
<p class="msg-list-unit">湿度</p>
</div>
</li>
</ul> -->
</div>
</div>
<div class="env-main-right">
<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>
<!-- 报警记录 -->
<warehouse-warning :height="'calc(100% - 38px)'" />
</div>
</div>
</div>
</template>
<script>
import { getCurrentTime } from '@/utils/index'
// import typePie from '@/views/components/echarts/typePie.vue'
import lendAcross from '@/views/components/echarts/lendAcross.vue'
// import Video from '@/views/storeManage/warehouse3D/module/video'
import WarehouseWarning from '@/views/components/WarehouseWarning'
import SecurityDoor from '@/views/components/SecurityDoor'
import displayConfigApi from '@/api/storeManage/displayConfig'
import thirdApi from '@/api/thirdApi'
import { statisticsCrud } from '@/views/system/archiveStatistics/mixins/statistics'
// import NumFlip from './module/numFlip.vue'
// import CountTo from 'vue-count-to'
// import { getDayYearBorrowNum } from '@/api/archivesManage/lendManage'
// import { getDeviceList } from '@/api/storeManage/deviceManage/device'
// import { getOnlineDevice } from '@/api/home/device'
// import { FetchGetArchivesNum, FetchInitArchivesTypeNum } from '@/api/archivesManage/statistics'
export default {
name: 'EnvironmentalScreen',
components: {
WarehouseWarning,
SecurityDoor,
// Video,
lendAcross
},
mixins: [statisticsCrud],
data() {
return {
bannerRoomName: '3F 全景图',
nowDate: '',
timer: null,
className: ['readRoomContainer', 'collateRoomContainer'],
roomId: 'D6490DA3D4261E8C26D0E3',
allDisplayConfigData: [],
displayConfigData: [],
url: '',
allDeviceIds: [],
oaoMessage: [],
topOAODisplayData: {
ZLS_MO_OAO_001: {
show: false,
wendu: '',
sidu: '',
alarmState: 0
},
YLS_MO_OAO_001: {
show: false,
wendu: '',
sidu: '',
alarmState: 0
}
},
topDisplayData: {
DAK_DIV_TOP_001: {
show: false,
curValue: '',
unit: '',
curstatus: 0
},
DAK_DIV_TOP_002: {
show: false,
curValue: '',
unit: '',
curstatus: 0
},
DAK_DIV_TOP_003: {
show: false,
curValue: '',
unit: '',
curstatus: 0
},
DAK_DIV_TOP_004: {
show: false,
curValue: '',
unit: '',
curstatus: 0
},
DAK_DIV_TOP_005: {
show: false,
curValue: '',
unit: '',
curstatus: 0
},
DAK_DIV_TOP_006: {
show: false,
curValue: '',
unit: '',
curstatus: 0
}
},
waterLeakage: {
waterLeakageStatus1: false,
waterLeakageStatus2: false,
waterLeakageStatus3: false,
waterLeakageStatus4: false,
waterLeakageText4: ''
},
// daylend: 'daylend',
// daylendnum: 0,
// dayreturn: 'dayreturn',
// dayreturnnum: 0,
// monlend: 'monlend',
// monlendnum: 0,
// monreturn: 'monreturn',
// monreturnnum: 0,
// totalNum: 0,
// filesNum: 0,
// archivesNum: 0,
// allDevNum: 0,
// lineDevNum: 0,
// offDevNum: 0,
echartsTimer: null,
refreshtime: 60000
}
},
async created() {
this.timer = setInterval(() => {
this.nowDate = getCurrentTime()
}, 1000)
window.getIframeLoading = this.getIframeLoading // vuewindow
this.allDisplayConfigData = await displayConfigApi.list({ storeroomId: this.roomId })
this.allDisplayConfigData.forEach(element => {
if (element.isDisplay && element.bindState && element.deviceInfo && (element.divPosition.includes('OAO') || element.divPosition.includes('TOP') || element.divPosition.includes('LS'))) {
this.allDeviceIds.push(element.deviceInfo.deviceId)
if (!this.url) {
this.url = 'http://' + element.deviceInfo.deviceIp + ':' + element.deviceInfo.devicePort
}
}
})
console.log('allDeviceIds', 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('displayConfigData', this.displayConfigData)
await this.getRealTimeData()
// this.getDayYearBorrowNum()
// this.handleLeftTableNum()
},
mounted() {
const _this = this
// this.iframeWin = this.$refs.myIframe.contentWindow
// inframe
// document.getElementById('myIframe').onload = function() {
// _this.deviceState()
// }
window.addEventListener('message', this.handleMessageDevice)
//
this.dataTimer = setInterval(async() => {
// _this.getDayYearBorrowNum()
// _this.handleLeftTableNum()
// await _this.getRealTimeData()
// _this.handleAQI()
}, 1000 * 30)
//
this.echartsTimer = setInterval(() => {
_this.lendData = []
_this.typeData = []
_this.getBorrowerNumSta()
_this.getArchivesTypeStatistics()
}, this.refreshtime)
},
beforeDestroy() {
if (this.timer) {
clearInterval(this.timer)
}
if (this.dataTimer) {
clearInterval(this.dataTimer)
}
},
methods: {
async changeRoomGetDeivce() {
this.allDeviceIds = []
this.allDisplayConfigData = await displayConfigApi.list({ storeroomId: this.roomId })
console.log('allDisplayConfigData2', this.allDisplayConfigData)
this.allDisplayConfigData.forEach(element => {
if (element.isDisplay && element.bindState && element.deviceInfo && (element.divPosition.includes('OAO') || element.divPosition.includes('TOP') || element.divPosition.includes('LS'))) {
this.allDeviceIds.push(element.deviceInfo.deviceId)
if (!this.url) {
this.url = 'http://' + element.deviceInfo.deviceIp + ':' + element.deviceInfo.devicePort
}
}
})
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)
await this.getRealTimeData()
this.handleAQI()
},
//
getIframeLoading(value) {
// console.log(`iframe${value}`)
if (value === 'false') {
this.allDisplayConfigData.forEach(element => {
if ((!element.isDisplay || !element.bindState) && element.divPosition.includes('OAO')) {
this.handleHide(element.divPosition)
}
})
// this.handleAlarm('DAK_MO_OAO_003')
this.deviceState()
this.handleAQI()
}
},
// data / iframe
deviceState(e) {
// this.iframeWin.postMessage({
// data: this.oaoMessage
// }, '*')
},
// /
handleMessageDevice(event) {
// const _this = this
// if (event.data && event.data.data) {
// const data = event.data.data
//
// if (data.includes('CAM')) {
// _this.$nextTick(() => {
// this.$refs.camera.openVideoVisible = true
// //
// this.$refs.camera.videoSrc = 'https://qiniu.aiyxlib.com/1606275873000.mp4'
// this.$refs.camera.videoTitle = data
// })
// }
// }
},
// 湿
handleAQI() {
this.oaoMessage.forEach(element => {
window.frames['iframeMap'].setAlertValue(element.id, element.wendu, element.sidu)
})
},
// 湿
handleAlarm(deviceId) {
window.frames['iframeMap'].Myalert(deviceId, true)
},
//
handleHide(deviceId) {
// true false
window.frames['iframeMap'].setYangGanCanshow(deviceId, false)
},
//
rowBgColor({ row, rowIndex }) {
if (rowIndex % 2 === 1) {
return 'light-blue'
} else {
return ''
}
},
getRealTimeData() {
if (this.allDeviceIds.length > 0) {
thirdApi.getRealTimeData({ ids: this.allDeviceIds, url: this.url }).then((data) => {
this.oaoMessage.splice(0, this.oaoMessage.length)
this.displayConfigData.forEach(element => {
if (element.divPosition.includes('TOP') && element.deviceSpecParams[0]) {
// div
const result = data.find((item) => {
return item.property_id === element.deviceSpecParams[0].paramId && item.device_id === element.deviceInfo.deviceId
})
if (result) {
this.$set(this.topDisplayData, element.divPosition, {
show: true,
curValue: result.curvalue,
unit: result.unit,
curstatus: result.curstatus
})
} else {
this.$set(this.topDisplayData, element.divPosition, {
show: false
})
}
} else if (element.divPosition.includes('OAO')) {
// 3D
const wenduParamId = element.deviceSpecParams.find((item) => { return item.paramName === '温度' })?.paramId
const siduParamId = element.deviceSpecParams.find((item) => { return item.paramName === '湿度' })?.paramId
let wendu = {}
let sidu = {}
if (wenduParamId) {
wendu = data.find((item) => {
return item.property_id === wenduParamId && item.device_id === element.deviceInfo.deviceId
})
}
if (siduParamId) {
sidu = data.find((item) => {
return item.property_id === siduParamId && item.device_id === element.deviceInfo.deviceId
})
}
// console.log(wendu?.curstatus, sidu?.curstatus)
this.oaoMessage.push({
id: element.divPosition,
wendu: (wendu?.curvalue) ? (Math.round(wendu?.curvalue)) : '-',
sidu: (sidu?.curvalue) ? (Math.round(sidu?.curvalue)) : '-',
alarmState: (wendu && wendu.curstatus > 0) || (sidu && sidu.curstatus > 0)
})
this.$set(this.topOAODisplayData, element.divPosition, {
show: true,
wendu: (wendu?.curvalue) ? (Math.round(wendu?.curvalue)) : '-',
sidu: (sidu?.curvalue) ? (Math.round(sidu?.curvalue)) : '-',
alarmState: (wendu && wendu.curstatus > 0) || (sidu && sidu.curstatus > 0)
})
} else {
// LS
const waterLeakageParamId1 = element.deviceSpecParams.find((item) => { return item.paramName === '维护报警' })?.paramId
const waterLeakageParamId2 = element.deviceSpecParams.find((item) => { return item.paramName === '漏水报警' })?.paramId
const waterLeakageParamId3 = element.deviceSpecParams.find((item) => { return item.paramName === '感应线断裂' })?.paramId
const waterLeakage4 = element.deviceSpecParams.find((item) => { return item.paramName === '漏水位置' })
if (waterLeakage4) {
this.waterLeakage.waterLeakageText4 = waterLeakage4.unit
}
const waterLeakageParamId4 = waterLeakage4?.paramId
if (waterLeakageParamId1) {
this.waterLeakage.waterLeakageStatus1 = data.find((item) => {
return item.property_id === waterLeakageParamId1 && item.device_id === element.deviceInfo.deviceId
})?.curstatus > 0
}
if (waterLeakageParamId2) {
this.$set(this.waterLeakage, 'waterLeakageStatus2', data.find((item) => {
return item.property_id === waterLeakageParamId2 && item.device_id === element.deviceInfo.deviceId
})?.curstatus > 0)
}
if (waterLeakageParamId3) {
this.$set(this.waterLeakage, 'waterLeakageStatus3', data.find((item) => {
return item.property_id === waterLeakageParamId3 && item.device_id === element.deviceInfo.deviceId
})?.curstatus > 0)
}
if (waterLeakageParamId4) {
const waterLeakageValue4 = data.find((item) => {
return item.property_id === waterLeakageParamId4 && item.device_id === element.deviceInfo.deviceId
})
this.$set(this.waterLeakage, 'waterLeakageStatus4', waterLeakageValue4?.curstatus > 0)
this.waterLeakage.waterLeakageText4 = waterLeakageValue4?.curvalue ? waterLeakageValue4?.curvalue + ' ' + this.waterLeakage.waterLeakageText4 : ''
}
}
})
})
}
}
// getDayYearBorrowNum() {
// getDayYearBorrowNum({ ids: this.allDeviceIds, url: this.url }).then((data) => {
// if (data) {
// this.daylendnum = data.dayBorrow
// this.dayreturnnum = data.dayReturn
// this.monlendnum = data.monthBorrow
// this.monreturnnum = data.monthReturn
// }
// })
// }
// table
// handleLeftTableNum() {
// //
// FetchGetArchivesNum().then(data => {
// this.totalNum = data
// })
// // ,
// FetchInitArchivesTypeNum().then(data => {
// this.filesNum = data.filesNum
// this.archivesNum = data.archivesNum
// })
// // ,线,线
// this.handleTotalDeviceNum()
// },
// ,线,线
// handleTotalDeviceNum() {
// Promise.all([getDeviceList({ page: 0, size: 10 }), getOnlineDevice()]).then((result) => {
// this.allDevNum = result[0].totalElements
// this.lineDevNum = result[1]
// this.offDevNum = this.allDevNum - this.lineDevNum
// })
// }
}
}
</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 {
flex: 1;
margin: 0 20px;
height: calc(100vh - 138px);
overflow: hidden;
}
.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;
}
}
}
.screen-env-list {
flex-wrap: wrap;
justify-content: space-between;
height: calc(100% - 38px);
padding: 0 44px 0 4px;
li {
flex: none;
width: calc(100% / 2 - 44px);
margin: 20px 0 20px 40px;
height: calc(100% / 2 - 40px);
.msg-list-svg {
font-size: 40px;
margin-left: 20px;
}
&.msg-pm {
.msg-list-svg {
font-size: 46px;
}
}
}
}
.leakage-detection {
padding: 0 44px;
font-size: 14px;
color: #339cff;
height: calc(100% - 38px);
.leakage-list {
height: calc(100% - 26px);
text-align: left;
li {
position: relative;
display: flex;
justify-content: space-between;
align-items: center;
height: calc(100% / 4 - 14px);
margin-bottom: 14px;
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;
}
}
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;
}
}
}
}
}
}
.state-list {
display: flex;
justify-content: flex-end;
margin-bottom: 10px;
font-size: 14px;
color: #339cff;
span {
position: relative;
display: block;
padding-left: 16px;
margin-left: 30px;
&::before {
content: "";
position: absolute;
left: 0;
top: 50%;
width: 10px;
height: 10px;
border-radius: 50%;
margin-top: -5px;
background-color: #18b08f;
}
&:last-child::before {
background-color: #f65164;
}
}
}
.device-container {
position: relative;
.state-list {
position: absolute;
right: 40px;
top: 12px;
}
.env-device-list {
display: flex;
height: calc(100% - 38px);
justify-content: space-between;
padding: 0 0 20px 20px;
li {
width: calc(100% / 6 - 20px);
margin-right: 20px;
.env-device-img {
display: flex;
align-items: center;
justify-content: center;
height: calc(100% - 40px);
border: 1px solid #3581cc;
margin-bottom: 10px;
img {
display: block;
// height: 100%;
// object-fit: contain;
}
}
.env-device-text {
position: relative;
display: flex;
justify-content: center;
align-items: center;
height: 36px;
line-height: 36px;
font-size: 14px;
color: #339cff;
border: 1px solid #3581cc;
background-color: #02255f;
border-radius: 36px;
span {
position: relative;
// position: absolute;
// right: 8px;
// top: 50%;
// margin-top: -3px;
display: block;
width: 6px;
height: 6px;
margin-left: 14px;
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%);
}
}
}
&.device-warn {
.env-device-text {
span {
background-color: #f65164;
&::before {
box-shadow: inset 0px 0px 10px 1px #f65164;
}
}
}
}
}
}
}
.env-3d {
position: relative;
width: 100%;
height: calc(100% + 80px);
// margin-bottom: 20px;
background: url("~@/assets/images/largeScreen/bg.png") no-repeat center -130px;
// background-size: 100% 100%;
overflow: hidden;
margin-top: -80px;
.iframe_box {
width: 100%;
height: 100%;
// margin-left: -80px;
}
.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);
}
}
}
}
}
.middle-bottom {
display: flex;
color: #339cff;
font-size: 14px;
justify-content: space-between;
height: calc(100% / 4);
.middle-bottom-l {
display: flex;
justify-content: space-between;
width: 60%;
height: calc(100% - 22px) !important;
ul {
width: 59%;
padding: 25px 20px;
display: flex;
flex-direction: column;
justify-content: space-between;
li {
height: calc(100% / 3 - 14px);
background: linear-gradient(
360deg,
rgba(51, 156, 255, 0.24) 0%,
rgba(56, 158, 225, 0) 70%,
rgba(56, 158, 225, 0) 100%
);
display: flex;
align-items: center;
justify-content: space-between;
.row-item {
display: flex;
align-items: center;
.svg-box {
margin-right: 10px;
.card-panel-icon {
font-size: 24px;
}
}
}
.row-num {
font-size: 18px;
color: #fff;
margin-right: 10px;
}
// padding: 10px 0;
}
}
}
.middle-bottom-r {
width: 38%;
height: calc(100% - 22px) !important;
ul {
width: 100%;
height: 100%;
padding: 20px;
display: flex;
flex-direction: column;
justify-content: space-between;
li {
height: 20%;
display: flex;
align-items: center;
justify-content: space-between;
// padding: 10px 0;
}
}
}
}
.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;
}
</style>

798
src/views/environmentalScreen/index.js

@ -0,0 +1,798 @@
export const allDeviceData = [{
'id': 1,
'ParentID': 0,
'SubClass': 0,
'IP': '',
'Name': '环境监控',
'NetStatus': 1,
'SUBTYPE': '1'
}, {
'id': 11303,
'ParentID': 1,
'SubClass': 0,
'IP': '192.168.99.101:5005',
'Name': '温湿度',
'NetStatus': 1,
'SUBTYPE': '17'
}, {
'id': 11355,
'ParentID': 1,
'SubClass': 0,
'IP': '192.168.99.102:5003:3',
'Name': '环境监测3_3',
'NetStatus': 1,
'SUBTYPE': '25'
}, {
'id': 11379,
'ParentID': 1,
'SubClass': 0,
'IP': '192.168.99.102:5004:2',
'Name': '环境监测2_2',
'NetStatus': 1,
'SUBTYPE': '25'
}, {
'id': 11403,
'ParentID': 1,
'SubClass': 0,
'IP': '192.168.99.102:5005',
'Name': '环境监测1',
'NetStatus': 1,
'SUBTYPE': '25'
}, {
'id': 11440,
'ParentID': 1,
'SubClass': 0,
'IP': '192.168.99.101:5004',
'Name': '壁挂升降空气净化机',
'NetStatus': 1,
'SUBTYPE': '11'
}, {
'id': 11486,
'ParentID': 1,
'SubClass': 0,
'IP': '192.168.99.101:5003',
'Name': '恒湿净化一体机',
'NetStatus': 1,
'SUBTYPE': '11'
}, {
'id': 11519,
'ParentID': 1,
'SubClass': 0,
'IP': '',
'Name': '空调红外控制',
'NetStatus': 1,
'SUBTYPE': '1'
}, {
'id': 11520,
'ParentID': 1,
'SubClass': 0,
'IP': '192.168.99.101:6003',
'Name': '开关量',
'NetStatus': 1,
'SUBTYPE': '11'
}]
export const mockIpData = {
// 温湿度
'192.168.99.101:5005': {
'code': 200,
'message': '操作成功',
'data': [
{
'IP': '192.168.99.101:5005',
'subName': '湿度',
'WYID': '192.168.99.101:5005_1',
'value': '51.20',
'dw': '%',
'SUBID': 1,
'TIME': '2025-12-11 13:22:31'
},
{
'IP': '192.168.99.101:5005',
'subName': '温度',
'WYID': '192.168.99.101:5005_2',
'value': '17.80',
'dw': '℃',
'SUBID': 2,
'TIME': '2025-12-11 13:22:31'
}
// {
// 'IP': '192.168.99.101:5003',
// 'subName': '二氧化碳',
// 'WYID': '192.168.99.101:5003_1',
// 'value': '593.00',
// 'dw': 'ppm',
// 'SUBID': 1,
// 'TIME': '2025-12-11 13:25:09'
// },
// {
// 'IP': '192.168.99.101:5003',
// 'subName': '甲醛',
// 'WYID': '192.168.99.101:5003_2',
// 'value': '20.00',
// 'dw': 'mg/m3',
// 'SUBID': 2,
// 'TIME': '2025-12-11 13:25:09'
// },
// {
// 'IP': '192.168.99.101:5003',
// 'subName': '综合气体',
// 'WYID': '192.168.99.101:5003_3',
// 'value': '140.00',
// 'dw': 'ppm',
// 'SUBID': 3,
// 'TIME': '2025-12-11 13:25:09'
// },
// {
// 'IP': '192.168.99.101:5003',
// 'subName': 'PM2.5浓度',
// 'WYID': '192.168.99.101:5003_4',
// 'value': '82.00',
// 'dw': 'ppm',
// 'SUBID': 4,
// 'TIME': '2025-12-11 13:25:09'
// },
// {
// 'IP': '192.168.99.101:5003',
// 'subName': 'PM10浓度',
// 'WYID': '192.168.99.101:5003_5',
// 'value': '101.00',
// 'dw': 'ppm',
// 'SUBID': 5,
// 'TIME': '2025-12-11 13:25:09'
// }
],
'timestamp': 1765430551410
},
// 环境检测3_3
'192.168.99.102:5003:3': {
'code': 200,
'message': '操作成功',
'data': [
{
'IP': '192.168.99.102:5003:3',
'subName': 'PM2.5浓度',
'WYID': '192.168.99.102:5003:3_1',
'value': '48.00',
'dw': 'μg/m3',
'SUBID': 1,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': 'PM10浓度',
'WYID': '192.168.99.102:5003:3_2',
'value': '61.00',
'dw': 'μg/m3',
'SUBID': 2,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': '湿度',
'WYID': '192.168.99.102:5003:3_3',
'value': '47.40',
'dw': '%',
'SUBID': 3,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': '温度',
'WYID': '192.168.99.102:5003:3_4',
'value': '20.20',
'dw': '℃',
'SUBID': 4,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': '大气压力',
'WYID': '192.168.99.102:5003:3_5',
'value': '0.00',
'dw': 'kPa',
'SUBID': 5,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': '光照度',
'WYID': '192.168.99.102:5003:3_6',
'value': '0.00',
'dw': 'Lux',
'SUBID': 6,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': 'TVOC',
'WYID': '192.168.99.102:5003:3_7',
'value': '45.00',
'dw': 'Lux',
'SUBID': 7,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': '二氧化碳',
'WYID': '192.168.99.102:5003:3_8',
'value': '986.00',
'dw': 'ppm',
'SUBID': 8,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': '甲醛',
'WYID': '192.168.99.102:5003:3_9',
'value': '0.50',
'dw': 'ppm',
'SUBID': 9,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': '臭氧',
'WYID': '192.168.99.102:5003:3_10',
'value': '0.00',
'dw': 'ppm',
'SUBID': 10,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': '氧气',
'WYID': '192.168.99.102:5003:3_11',
'value': '0.00',
'dw': '%VOL',
'SUBID': 11,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': '硫化氢',
'WYID': '192.168.99.102:5003:3_12',
'value': '0.00',
'dw': 'ppm',
'SUBID': 12,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': '甲烷',
'WYID': '192.168.99.102:5003:3_13',
'value': '0.00',
'dw': '%LEL',
'SUBID': 13,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': '一氧化碳',
'WYID': '192.168.99.102:5003:3_14',
'value': '0.00',
'dw': 'ppm',
'SUBID': 14,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': '二氧化氮',
'WYID': '192.168.99.102:5003:3_15',
'value': '0.00',
'dw': 'ppm',
'SUBID': 15,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': '二氧化硫',
'WYID': '192.168.99.102:5003:3_16',
'value': '0.00',
'dw': 'ppm',
'SUBID': 16,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': '氢气',
'WYID': '192.168.99.102:5003:3_17',
'value': '0.00',
'dw': 'ppm',
'SUBID': 17,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': '氨气',
'WYID': '192.168.99.102:5003:3_18',
'value': '0.00',
'dw': 'ppm',
'SUBID': 18,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': '噪声',
'WYID': '192.168.99.102:5003:3_19',
'value': '0.00',
'dw': 'dB',
'SUBID': 19,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': '异味',
'WYID': '192.168.99.102:5003:3_20',
'value': '0.00',
'dw': 'ppm',
'SUBID': 20,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': 'TSP',
'WYID': '192.168.99.102:5003:3_21',
'value': '73.00',
'dw': '',
'SUBID': 21,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': '烟雾',
'WYID': '192.168.99.102:5003:3_22',
'value': '0.00',
'dw': '',
'SUBID': 22,
'TIME': '2025-12-11 13:23:11'
}
],
'timestamp': 1765430591361
},
// 壁挂升降空气净化机
'192.168.99.101:5004': {
'code': 200,
'message': '操作成功',
'data': [
{
'IP': '192.168.99.101:5004',
'subName': '运行模式',
'WYID': '192.168.99.101:5004_1',
'value': '自动',
'dw': '',
'SUBID': 1,
'TIME': '2025-12-11 13:24:08'
},
{
'IP': '192.168.99.101:5004',
'subName': '风机风速',
'WYID': '192.168.99.101:5004_2',
'value': '低速',
'dw': '',
'SUBID': 2,
'TIME': '2025-12-11 13:24:08'
},
{
'IP': '192.168.99.101:5004',
'subName': 'CO2浓度',
'WYID': '192.168.99.101:5004_3',
'value': '621.00',
'dw': 'ppm',
'SUBID': 3,
'TIME': '2025-12-11 13:24:08'
},
{
'IP': '192.168.99.101:5004',
'subName': '甲醛',
'WYID': '192.168.99.101:5004_4',
'value': '20.00',
'dw': 'ug/m3',
'SUBID': 4,
'TIME': '2025-12-11 13:24:08'
},
{
'IP': '192.168.99.101:5004',
'subName': 'TVOC',
'WYID': '192.168.99.101:5004_5',
'value': '130.00',
'dw': 'ug/m3',
'SUBID': 5,
'TIME': '2025-12-11 13:24:08'
},
{
'IP': '192.168.99.101:5004',
'subName': 'PM2.5浓度',
'WYID': '192.168.99.101:5004_6',
'value': '93.00',
'dw': 'ug/m3',
'SUBID': 6,
'TIME': '2025-12-11 13:24:08'
},
{
'IP': '192.168.99.101:5004',
'subName': 'PM10浓度',
'WYID': '192.168.99.101:5004_7',
'value': '109.00',
'dw': 'ug/m3',
'SUBID': 7,
'TIME': '2025-12-11 13:24:08'
},
{
'IP': '192.168.99.101:5004',
'subName': '温度',
'WYID': '192.168.99.101:5004_8',
'value': '20.00',
'dw': '℃',
'SUBID': 8,
'TIME': '2025-12-11 13:24:08'
},
{
'IP': '192.168.99.101:5004',
'subName': '湿度',
'WYID': '192.168.99.101:5004_9',
'value': '51.00',
'dw': '%',
'SUBID': 9,
'TIME': '2025-12-11 13:24:08'
},
{
'IP': '192.168.99.101:5004',
'subName': '空气质量等级',
'WYID': '192.168.99.101:5004_10',
'value': '轻度',
'dw': '',
'SUBID': 10,
'TIME': '2025-12-11 13:24:08'
},
{
'IP': '192.168.99.101:5004',
'subName': '开关机状态',
'WYID': '192.168.99.101:5004_11',
'value': '停止',
'dw': '',
'SUBID': 11,
'TIME': '2025-12-11 13:24:08'
}
],
'timestamp': 1765430648253
},
// 恒湿净化一体机
'192.168.99.101:5003': {
'code': 200,
'message': '操作成功',
'data': [
{
'IP': '192.168.99.101:5003',
'subName': '二氧化碳',
'WYID': '192.168.99.101:5003_1',
'value': '593.00',
'dw': 'ppm',
'SUBID': 1,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '甲醛',
'WYID': '192.168.99.101:5003_2',
'value': '20.00',
'dw': 'mg/m3',
'SUBID': 2,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '综合气体',
'WYID': '192.168.99.101:5003_3',
'value': '140.00',
'dw': 'ppm',
'SUBID': 3,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': 'PM2.5浓度',
'WYID': '192.168.99.101:5003_4',
'value': '82.00',
'dw': 'ppm',
'SUBID': 4,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': 'PM10浓度',
'WYID': '192.168.99.101:5003_5',
'value': '101.00',
'dw': 'ppm',
'SUBID': 5,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '温度',
'WYID': '192.168.99.101:5003_6',
'value': '20.00',
'dw': '℃',
'SUBID': 6,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '湿度',
'WYID': '192.168.99.101:5003_7',
'value': '59.00',
'dw': '%',
'SUBID': 7,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '化霜温度',
'WYID': '192.168.99.101:5003_8',
'value': '11.00',
'dw': '℃',
'SUBID': 8,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '空气质量',
'WYID': '192.168.99.101:5003_9',
'value': '良',
'dw': '',
'SUBID': 9,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '开关机状态',
'WYID': '192.168.99.101:5003_10',
'value': '开启',
'dw': '',
'SUBID': 10,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '除湿状态',
'WYID': '192.168.99.101:5003_11',
'value': '停止',
'dw': '',
'SUBID': 11,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '加湿状态',
'WYID': '192.168.99.101:5003_12',
'value': '停止',
'dw': '',
'SUBID': 12,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '净化状态',
'WYID': '192.168.99.101:5003_13',
'value': '停止',
'dw': '',
'SUBID': 13,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '排水状态',
'WYID': '192.168.99.101:5003_14',
'value': '停止',
'dw': '',
'SUBID': 14,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '恒湿状态',
'WYID': '192.168.99.101:5003_15',
'value': '停止',
'dw': '',
'SUBID': 15,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '化霜状态',
'WYID': '192.168.99.101:5003_16',
'value': '停止',
'dw': '',
'SUBID': 16,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '水满状态',
'WYID': '192.168.99.101:5003_17',
'value': '停止',
'dw': '',
'SUBID': 17,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '水满信号',
'WYID': '192.168.99.101:5003_18',
'value': '无效',
'dw': '',
'SUBID': 18,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '缺水信号',
'WYID': '192.168.99.101:5003_19',
'value': '无效',
'dw': '',
'SUBID': 19,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '风机输出状态',
'WYID': '192.168.99.101:5003_20',
'value': '关',
'dw': '',
'SUBID': 20,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '除湿风机状态',
'WYID': '192.168.99.101:5003_21',
'value': '关',
'dw': '',
'SUBID': 21,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '加湿风机状态',
'WYID': '192.168.99.101:5003_22',
'value': '关',
'dw': '',
'SUBID': 22,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '净化风机状态',
'WYID': '192.168.99.101:5003_23',
'value': '关',
'dw': '',
'SUBID': 23,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '除湿输出状态',
'WYID': '192.168.99.101:5003_24',
'value': '关',
'dw': '',
'SUBID': 24,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '净化输出状态',
'WYID': '192.168.99.101:5003_25',
'value': '关',
'dw': '',
'SUBID': 25,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '加湿输出状态',
'WYID': '192.168.99.101:5003_26',
'value': '关',
'dw': '',
'SUBID': 26,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '排水状态',
'WYID': '192.168.99.101:5003_27',
'value': '关',
'dw': '',
'SUBID': 27,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '运行状态',
'WYID': '192.168.99.101:5003_28',
'value': '无状态',
'dw': '',
'SUBID': 28,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '故障状态',
'WYID': '192.168.99.101:5003_29',
'value': '正常',
'dw': '',
'SUBID': 29,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '湿度上限',
'WYID': '192.168.99.101:5003_30',
'value': '55.00',
'dw': '%',
'SUBID': 30,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '湿度下限',
'WYID': '192.168.99.101:5003_31',
'value': '50.00',
'dw': '%',
'SUBID': 31,
'TIME': '2025-12-11 13:25:09'
}
],
'timestamp': 1765430709089
},
// 补充其他IP的模拟数据(如环境监测2_2、环境监测1)
'192.168.99.102:5004:2': {
code: 200,
message: '操作成功',
data: [
{
'IP': '192.168.99.102:5004:2',
'subName': '温度',
'WYID': '192.168.99.102:5004:2_1',
'value': '19.50',
'dw': '℃',
'SUBID': 1,
'TIME': '2025-12-11 13:26:00'
},
{
'IP': '192.168.99.102:5004:2',
'subName': '湿度',
'WYID': '192.168.99.102:5004:2_2',
'value': '48.20',
'dw': '%',
'SUBID': 2,
'TIME': '2025-12-11 13:26:00'
}
],
timestamp: 1765430760000
},
'192.168.99.102:5005': {
code: 200,
message: '操作成功',
data: [
{
'IP': '192.168.99.102:5005',
'subName': '温度',
'WYID': '192.168.99.102:5005_1',
'value': '21.00',
'dw': '℃',
'SUBID': 1,
'TIME': '2025-12-11 13:27:00'
},
{
'IP': '192.168.99.102:5005',
'subName': '湿度',
'WYID': '192.168.99.102:5005_2',
'value': '46.80',
'dw': '%',
'SUBID': 2,
'TIME': '2025-12-11 13:27:00'
}
],
timestamp: 1765430820000
}
}

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

424
src/views/storeManage/warehouse3D/archivesStorage/index-old.vue

@ -0,0 +1,424 @@
<template>
<div class="warehouse">
<!-- <h1>全景图</h1> -->
<div class="warehouse-left">
<div class="left-3d">
<iframe id="myIframe" ref="myIframe" name="iframeMap" class="iframe_box" src="/web3D/index.html" frameborder="0" scrolling="no" />
<ul class="msg-list">
<!-- :class="{ 'li-warn': newAlarm.DAK_DIV_TOP_001.curstatus > 0 }" -->
<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" />
<div class="msg-txt">
<span class="msg-list-num">{{ item.value }}</span>
<p class="msg-list-unit">{{ item.subName }} {{ item.dw }}</p>
</div>
</li>
<!-- <li v-show="newAlarm.DAK_DIV_TOP_002.show" :class="{ 'li-warn': newAlarm.DAK_DIV_TOP_002.curstatus > 0 }">
<svg-icon icon-class="shidu" class-name="msg-list-svg" />
<div class="msg-txt">
<span class="msg-list-num">{{ newAlarm.DAK_DIV_TOP_002.curValue }}</span>
<p class="msg-list-unit">湿度 {{ newAlarm.DAK_DIV_TOP_002.unit }}</p>
</div>
</li> -->
<!-- <li v-show="topDisplayData.DAK_DIV_TOP_001.show" :class="{ 'li-warn': topDisplayData.DAK_DIV_TOP_001.curstatus > 0 }">
<svg-icon icon-class="temperature" class-name="msg-list-svg" />
<div class="msg-txt">
<span class="msg-list-num">{{ topDisplayData.DAK_DIV_TOP_001.curValue }}</span>
<p class="msg-list-unit">温度 {{ topDisplayData.DAK_DIV_TOP_001.unit }}</p>
</div>
</li>
<li v-show="topDisplayData.DAK_DIV_TOP_002.show" :class="{ 'li-warn': topDisplayData.DAK_DIV_TOP_002.curstatus > 0 }">
<svg-icon icon-class="shidu" class-name="msg-list-svg" />
<div class="msg-txt">
<span class="msg-list-num">{{ topDisplayData.DAK_DIV_TOP_002.curValue }}</span>
<p class="msg-list-unit">湿度 {{ topDisplayData.DAK_DIV_TOP_002.unit }}</p>
</div>
</li>
<li v-show="topDisplayData.DAK_DIV_TOP_003.show" :class="{ 'li-warn': topDisplayData.DAK_DIV_TOP_003.curstatus > 0 }">
<svg-icon icon-class="co2" class-name="msg-list-svg" />
<div class="msg-txt">
<span class="msg-list-num">{{ topDisplayData.DAK_DIV_TOP_003.curValue }}</span>
<p class="msg-list-unit">CO2 {{ topDisplayData.DAK_DIV_TOP_003.unit }}</p>
</div>
</li>
<li v-show="topDisplayData.DAK_DIV_TOP_004.show" :class="{ 'li-warn': topDisplayData.DAK_DIV_TOP_004.curstatus > 0 }">
<svg-icon icon-class="voc" class-name="msg-list-svg" />
<div class="msg-txt">
<span class="msg-list-num">{{ topDisplayData.DAK_DIV_TOP_004.curValue }}</span>
<p class="msg-list-unit">TVOC {{ topDisplayData.DAK_DIV_TOP_004.unit }}</p>
</div>
</li>
<li v-show="topDisplayData.DAK_DIV_TOP_005.show" :class="{ 'li-warn': topDisplayData.DAK_DIV_TOP_005.curstatus > 0 }" class="msg-pm">
<svg-icon icon-class="pm25" class-name="msg-list-svg" />
<div class="msg-txt">
<span class="msg-list-num">{{ topDisplayData.DAK_DIV_TOP_005.curValue }}</span>
<p class="msg-list-unit">PM2.5 {{ topDisplayData.DAK_DIV_TOP_005.unit }}</p>
</div>
</li>
<li v-show="topDisplayData.DAK_DIV_TOP_006.show" :class="{ 'li-warn': topDisplayData.DAK_DIV_TOP_006.curstatus > 0 }" class="msg-pm">
<svg-icon icon-class="pm10" class-name="msg-list-svg" />
<div class="msg-txt">
<span class="msg-list-num">{{ topDisplayData.DAK_DIV_TOP_006.curValue }}</span>
<p class="msg-list-unit">PM10 {{ topDisplayData.DAK_DIV_TOP_006.unit }}</p>
</div>
</li> -->
</ul>
<!-- air-warn -->
<div class="air-quality">
<h3>实时空气质量指数AQI</h3>
<div class="air-params">
<div class="air-left">
<span class="air-title">实时AQI</span>
<div class="air-result"><p>45</p><span>(AQI-US)</span></div>
</div>
<div class="air-right">
<span>空气质量为</span>
<p>健康</p>
</div>
</div>
</div>
</div>
</div>
<div class="warehouse-right">
<!-- 报警记录 -->
<warehouse-warning :height="'calc(100% - 40px)'" :storeroom-id="roomId" />
<!-- 门禁记录 -->
<AccessDoor :height="'calc(100% - 40px)'" />
</div>
<hkVideo ref="camera" :dialog-open.sync="open" />
</div>
</template>
<script>
import WarehouseWarning from '@/views/components/WarehouseWarning'
import AccessDoor from '@/views/components/AccessDoor'
import displayConfigApi from '@/api/storeManage/displayConfig'
// import thirdApi from '@/api/thirdApi'
import alarmApi from '@/api/home/alarm'
import hkVideo from '../module/hkVideo.vue'
export default {
name: 'FullView',
components: { WarehouseWarning, AccessDoor, hkVideo },
data() {
return {
roomId: '01A1DC2123C2B75E1A579D',
allDisplayConfigData: [],
displayConfigData: [],
url: '',
allDeviceIds: [],
oaoMessage: [],
timer: '',
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
}
},
open: false,
newAlarm: []
}
},
async created() {
window.getIframeLoading = this.getIframeLoading // vuewindow
this.allDisplayConfigData = await displayConfigApi.list({ storeroomId: this.roomId })
this.allDisplayConfigData.forEach(element => {
// if (element.isDisplay && element.bindState && element.deviceInfo && (element.divPosition.includes('OAO') || element.divPosition.includes('TOP'))) {
// this.allDeviceIds.push(element.deviceInfo.deviceId)
// if (!this.url) {
// this.url = 'http://' + element.deviceInfo.deviceIp + ':' + element.deviceInfo.devicePort
// }
// }
console.log('element.deviceInfo', element.deviceInfo)
this.allDeviceIds.push(element.deviceInfo.deviceIp)
if (!this.url) {
this.url = 'http://' + element.deviceInfo.deviceIp + ':' + element.deviceInfo.devicePort
}
})
this.displayConfigData = this.allDisplayConfigData.filter((item) => { return item.isDisplay && item.bindState && item.deviceInfo && (item.divPosition.includes('OAO') || item.divPosition.includes('TOP')) })
console.log('this.displayConfigData', this.displayConfigData)
await this.getRealTimeData()
},
mounted() {
const _this = this
_this.iframeWin = this.$refs.myIframe.contentWindow
// inframe
document.getElementById('myIframe').onload = function() {
_this.deviceState()
}
// window.addEventListener('message', this.handleMessageDevice)
window.addEventListener('message', this.handleMessageEvent)
//
this.timer = setInterval(async() => {
await _this.getRealTimeData()
_this.handleAQI()
}, 10000)
},
beforeDestroy() {
if (this.timer) {
clearInterval(this.timer)
}
window.removeEventListener('message', this.handleMessageEvent)
},
methods: {
handleMessageEvent(event) {
if (event.data) {
switch (event.data.type) {
case 'autoRotationStatus':
{
const newValue = event.data.value
this.$emit('update:isGetRotate', newValue)
console.log('Received auto rotation status:', newValue)
}
break
case 'cameraClick':
{
const deviceData = event.data.data
console.log('cameraClick', deviceData)
//
if (deviceData.toLowerCase().includes('cam')) {
this.open = true
this.$nextTick(() => {
this.$refs.camera.getVideoUrl(this.roomId, deviceData)
})
}
}
break
case 'archCabinetsClick':
{
const data = event.data.data
console.log('archCabinetsClick', data)
console.log(data.split('-')[1])
if (data.includes('cabinet')) {
this.deviceId = data.split('-')[1]
this.$router.push('/storeManage/deseCabinet')
localStorage.setItem('cabinetNum', this.deviceId)
}
}
break
default:
console.log('errorwww:', event.data)
}
}
},
//
getIframeLoading(value) {
// console.log(`iframe${value}`)
if (value === 'false') {
this.allDisplayConfigData.forEach(element => {
if ((!element.isDisplay || !element.bindState) && element.divPosition.includes('OAO')) {
this.handleHide(element.divPosition)
}
})
// this.handleAlarm('DAK_MO_OAO_003')
this.deviceState()
this.handleAQI()
// window.frames['iframeMap'].setAlertValue('DAK_MO_OAO_003', 20, 60)
}
},
// data / iframe
deviceState(e) {
this.iframeWin.postMessage({
data: this.oaoMessage
}, '*')
},
// 湿
handleAQI() {
this.oaoMessage.forEach(element => {
window.frames['iframeMap'].setAlertValue(element.id, element.wendu, element.sidu)
})
},
// 湿
handleAlarm(deviceId) {
// true false
window.frames['iframeMap'].Myalert(deviceId, true)
},
//
handleHide(deviceId) {
// true false
window.frames['iframeMap'].setYangGanCanshow(deviceId, true)
},
//
rowBgColor({ row, rowIndex }) {
if (rowIndex % 2 === 1) {
return 'light-blue'
} else {
return ''
}
},
getRealTimeData() {
if (this.allDeviceIds.length > 0) {
// 192.1.8.228 this.allDeviceIds[0]
alarmApi.FetchDataForIP({ ip: '192.1.8.156:1000' }).then((data) => {
this.newAlarm = data
this.oaoMessage.splice(0, this.oaoMessage.length)
this.displayConfigData.forEach(element => {
if (element.divPosition.includes('TOP') && element.deviceSpecParams[0]) {
// div
const result = data.find((item) => {
return item.property_id === element.deviceSpecParams[0].paramId && item.device_id === element.deviceInfo.deviceId
})
console.log(result)
// this.$set(this.topDisplayData, element.divPosition, {
// show: true,
// curValue: result.curvalue,
// unit: result.unit,
// curstatus: result.curstatus
// })
} else {
// 3D
const wenduParamId = element.deviceSpecParams.find((item) => { return item.paramName === '温度' })?.paramId
const siduParamId = element.deviceSpecParams.find((item) => { return item.paramName === '湿度' })?.paramId
let wendu = {}
let sidu = {}
if (wenduParamId) {
wendu = data.find((item) => {
return item.property_id === wenduParamId && item.device_id === element.deviceInfo.deviceId
})
}
if (siduParamId) {
sidu = data.find((item) => {
return item.property_id === siduParamId && item.device_id === element.deviceInfo.deviceId
})
}
this.oaoMessage.push({
id: element.divPosition,
wendu: (wendu?.curvalue) ? (Math.round(wendu?.curvalue)) : '-',
sidu: (sidu?.curvalue) ? (Math.round(sidu?.curvalue)) : '-',
alarmState: (wendu && wendu.curstatus > 0) || (sidu && sidu.curstatus > 0)
})
}
})
})
}
}
}
}
</script>
<style lang="scss" scoped>
@import "~@/assets/styles/lend-manage.scss";
.warehouse-left {
position: relative;
}
.container-wrap {
min-height: auto;
height: calc(100% / 2 - 10px);
overflow: hidden;
}
.container-wrap {
margin-bottom: 20px;
}
.air-quality{
position: absolute;
bottom: 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;
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);
}
}
}
}
</style>

753
src/views/storeManage/warehouse3D/archivesStorage/index.js

@ -0,0 +1,753 @@
export const allDeviceData = [{
'id': 1,
'ParentID': 0,
'SubClass': 0,
'IP': '',
'Name': '环境监控',
'NetStatus': 1,
'SUBTYPE': '1'
}, {
'id': 11303,
'ParentID': 1,
'SubClass': 0,
'IP': '192.168.99.101:5005',
'Name': '温湿度',
'NetStatus': 1,
'SUBTYPE': '17'
}, {
'id': 11355,
'ParentID': 1,
'SubClass': 0,
'IP': '192.168.99.102:5003:3',
'Name': '环境监测3_3',
'NetStatus': 1,
'SUBTYPE': '25'
}, {
'id': 11379,
'ParentID': 1,
'SubClass': 0,
'IP': '192.168.99.102:5004:2',
'Name': '环境监测2_2',
'NetStatus': 1,
'SUBTYPE': '25'
}, {
'id': 11403,
'ParentID': 1,
'SubClass': 0,
'IP': '192.168.99.102:5005',
'Name': '环境监测1',
'NetStatus': 1,
'SUBTYPE': '25'
}, {
'id': 11440,
'ParentID': 1,
'SubClass': 0,
'IP': '192.168.99.101:5004',
'Name': '壁挂升降空气净化机',
'NetStatus': 1,
'SUBTYPE': '11'
}, {
'id': 11486,
'ParentID': 1,
'SubClass': 0,
'IP': '192.168.99.101:5003',
'Name': '恒湿净化一体机',
'NetStatus': 1,
'SUBTYPE': '11'
}, {
'id': 11519,
'ParentID': 1,
'SubClass': 0,
'IP': '',
'Name': '空调红外控制',
'NetStatus': 1,
'SUBTYPE': '1'
}, {
'id': 11520,
'ParentID': 1,
'SubClass': 0,
'IP': '192.168.99.101:6003',
'Name': '开关量',
'NetStatus': 1,
'SUBTYPE': '11'
}]
export const mockIpData = {
// 温湿度
'192.168.99.101:5005': {
'code': 200,
'message': '操作成功',
'data': [
{
'IP': '192.168.99.101:5005',
'subName': '湿度',
'WYID': '192.168.99.101:5005_1',
'value': '51.20',
'dw': '%',
'SUBID': 1,
'TIME': '2025-12-11 13:22:31'
},
{
'IP': '192.168.99.101:5005',
'subName': '温度',
'WYID': '192.168.99.101:5005_2',
'value': '17.80',
'dw': '℃',
'SUBID': 2,
'TIME': '2025-12-11 13:22:31'
}
],
'timestamp': 1765430551410
},
// 环境检测3_3
'192.168.99.102:5003:3': {
'code': 200,
'message': '操作成功',
'data': [
{
'IP': '192.168.99.102:5003:3',
'subName': 'PM2.5浓度',
'WYID': '192.168.99.102:5003:3_1',
'value': '48.00',
'dw': 'μg/m3',
'SUBID': 1,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': 'PM10浓度',
'WYID': '192.168.99.102:5003:3_2',
'value': '61.00',
'dw': 'μg/m3',
'SUBID': 2,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': '湿度',
'WYID': '192.168.99.102:5003:3_3',
'value': '47.40',
'dw': '%',
'SUBID': 3,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': '温度',
'WYID': '192.168.99.102:5003:3_4',
'value': '20.20',
'dw': '℃',
'SUBID': 4,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': '大气压力',
'WYID': '192.168.99.102:5003:3_5',
'value': '0.00',
'dw': 'kPa',
'SUBID': 5,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': '光照度',
'WYID': '192.168.99.102:5003:3_6',
'value': '0.00',
'dw': 'Lux',
'SUBID': 6,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': 'TVOC',
'WYID': '192.168.99.102:5003:3_7',
'value': '45.00',
'dw': 'Lux',
'SUBID': 7,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': '二氧化碳',
'WYID': '192.168.99.102:5003:3_8',
'value': '986.00',
'dw': 'ppm',
'SUBID': 8,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': '甲醛',
'WYID': '192.168.99.102:5003:3_9',
'value': '0.50',
'dw': 'ppm',
'SUBID': 9,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': '臭氧',
'WYID': '192.168.99.102:5003:3_10',
'value': '0.00',
'dw': 'ppm',
'SUBID': 10,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': '氧气',
'WYID': '192.168.99.102:5003:3_11',
'value': '0.00',
'dw': '%VOL',
'SUBID': 11,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': '硫化氢',
'WYID': '192.168.99.102:5003:3_12',
'value': '0.00',
'dw': 'ppm',
'SUBID': 12,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': '甲烷',
'WYID': '192.168.99.102:5003:3_13',
'value': '0.00',
'dw': '%LEL',
'SUBID': 13,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': '一氧化碳',
'WYID': '192.168.99.102:5003:3_14',
'value': '0.00',
'dw': 'ppm',
'SUBID': 14,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': '二氧化氮',
'WYID': '192.168.99.102:5003:3_15',
'value': '0.00',
'dw': 'ppm',
'SUBID': 15,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': '二氧化硫',
'WYID': '192.168.99.102:5003:3_16',
'value': '0.00',
'dw': 'ppm',
'SUBID': 16,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': '氢气',
'WYID': '192.168.99.102:5003:3_17',
'value': '0.00',
'dw': 'ppm',
'SUBID': 17,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': '氨气',
'WYID': '192.168.99.102:5003:3_18',
'value': '0.00',
'dw': 'ppm',
'SUBID': 18,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': '噪声',
'WYID': '192.168.99.102:5003:3_19',
'value': '0.00',
'dw': 'dB',
'SUBID': 19,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': '异味',
'WYID': '192.168.99.102:5003:3_20',
'value': '0.00',
'dw': 'ppm',
'SUBID': 20,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': 'TSP',
'WYID': '192.168.99.102:5003:3_21',
'value': '73.00',
'dw': '',
'SUBID': 21,
'TIME': '2025-12-11 13:23:11'
},
{
'IP': '192.168.99.102:5003:3',
'subName': '烟雾',
'WYID': '192.168.99.102:5003:3_22',
'value': '0.00',
'dw': '',
'SUBID': 22,
'TIME': '2025-12-11 13:23:11'
}
],
'timestamp': 1765430591361
},
// 壁挂升降空气净化机
'192.168.99.101:5004': {
'code': 200,
'message': '操作成功',
'data': [
{
'IP': '192.168.99.101:5004',
'subName': '运行模式',
'WYID': '192.168.99.101:5004_1',
'value': '自动',
'dw': '',
'SUBID': 1,
'TIME': '2025-12-11 13:24:08'
},
{
'IP': '192.168.99.101:5004',
'subName': '风机风速',
'WYID': '192.168.99.101:5004_2',
'value': '低速',
'dw': '',
'SUBID': 2,
'TIME': '2025-12-11 13:24:08'
},
{
'IP': '192.168.99.101:5004',
'subName': 'CO2浓度',
'WYID': '192.168.99.101:5004_3',
'value': '621.00',
'dw': 'ppm',
'SUBID': 3,
'TIME': '2025-12-11 13:24:08'
},
{
'IP': '192.168.99.101:5004',
'subName': '甲醛',
'WYID': '192.168.99.101:5004_4',
'value': '20.00',
'dw': 'ug/m3',
'SUBID': 4,
'TIME': '2025-12-11 13:24:08'
},
{
'IP': '192.168.99.101:5004',
'subName': 'TVOC',
'WYID': '192.168.99.101:5004_5',
'value': '130.00',
'dw': 'ug/m3',
'SUBID': 5,
'TIME': '2025-12-11 13:24:08'
},
{
'IP': '192.168.99.101:5004',
'subName': 'PM2.5浓度',
'WYID': '192.168.99.101:5004_6',
'value': '93.00',
'dw': 'ug/m3',
'SUBID': 6,
'TIME': '2025-12-11 13:24:08'
},
{
'IP': '192.168.99.101:5004',
'subName': 'PM10浓度',
'WYID': '192.168.99.101:5004_7',
'value': '109.00',
'dw': 'ug/m3',
'SUBID': 7,
'TIME': '2025-12-11 13:24:08'
},
{
'IP': '192.168.99.101:5004',
'subName': '温度',
'WYID': '192.168.99.101:5004_8',
'value': '20.00',
'dw': '℃',
'SUBID': 8,
'TIME': '2025-12-11 13:24:08'
},
{
'IP': '192.168.99.101:5004',
'subName': '湿度',
'WYID': '192.168.99.101:5004_9',
'value': '51.00',
'dw': '%',
'SUBID': 9,
'TIME': '2025-12-11 13:24:08'
},
{
'IP': '192.168.99.101:5004',
'subName': '空气质量等级',
'WYID': '192.168.99.101:5004_10',
'value': '轻度',
'dw': '',
'SUBID': 10,
'TIME': '2025-12-11 13:24:08'
},
{
'IP': '192.168.99.101:5004',
'subName': '开关机状态',
'WYID': '192.168.99.101:5004_11',
'value': '停止',
'dw': '',
'SUBID': 11,
'TIME': '2025-12-11 13:24:08'
}
],
'timestamp': 1765430648253
},
// 恒湿净化一体机
'192.168.99.101:5003': {
'code': 200,
'message': '操作成功',
'data': [
{
'IP': '192.168.99.101:5003',
'subName': '二氧化碳',
'WYID': '192.168.99.101:5003_1',
'value': '593.00',
'dw': 'ppm',
'SUBID': 1,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '甲醛',
'WYID': '192.168.99.101:5003_2',
'value': '20.00',
'dw': 'mg/m3',
'SUBID': 2,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '综合气体',
'WYID': '192.168.99.101:5003_3',
'value': '140.00',
'dw': 'ppm',
'SUBID': 3,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': 'PM2.5浓度',
'WYID': '192.168.99.101:5003_4',
'value': '82.00',
'dw': 'ppm',
'SUBID': 4,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': 'PM10浓度',
'WYID': '192.168.99.101:5003_5',
'value': '101.00',
'dw': 'ppm',
'SUBID': 5,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '温度',
'WYID': '192.168.99.101:5003_6',
'value': '20.00',
'dw': '℃',
'SUBID': 6,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '湿度',
'WYID': '192.168.99.101:5003_7',
'value': '59.00',
'dw': '%',
'SUBID': 7,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '化霜温度',
'WYID': '192.168.99.101:5003_8',
'value': '11.00',
'dw': '℃',
'SUBID': 8,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '空气质量',
'WYID': '192.168.99.101:5003_9',
'value': '良',
'dw': '',
'SUBID': 9,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '开关机状态',
'WYID': '192.168.99.101:5003_10',
'value': '开启',
'dw': '',
'SUBID': 10,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '除湿状态',
'WYID': '192.168.99.101:5003_11',
'value': '停止',
'dw': '',
'SUBID': 11,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '加湿状态',
'WYID': '192.168.99.101:5003_12',
'value': '停止',
'dw': '',
'SUBID': 12,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '净化状态',
'WYID': '192.168.99.101:5003_13',
'value': '停止',
'dw': '',
'SUBID': 13,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '排水状态',
'WYID': '192.168.99.101:5003_14',
'value': '停止',
'dw': '',
'SUBID': 14,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '恒湿状态',
'WYID': '192.168.99.101:5003_15',
'value': '停止',
'dw': '',
'SUBID': 15,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '化霜状态',
'WYID': '192.168.99.101:5003_16',
'value': '停止',
'dw': '',
'SUBID': 16,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '水满状态',
'WYID': '192.168.99.101:5003_17',
'value': '停止',
'dw': '',
'SUBID': 17,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '水满信号',
'WYID': '192.168.99.101:5003_18',
'value': '无效',
'dw': '',
'SUBID': 18,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '缺水信号',
'WYID': '192.168.99.101:5003_19',
'value': '无效',
'dw': '',
'SUBID': 19,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '风机输出状态',
'WYID': '192.168.99.101:5003_20',
'value': '关',
'dw': '',
'SUBID': 20,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '除湿风机状态',
'WYID': '192.168.99.101:5003_21',
'value': '关',
'dw': '',
'SUBID': 21,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '加湿风机状态',
'WYID': '192.168.99.101:5003_22',
'value': '关',
'dw': '',
'SUBID': 22,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '净化风机状态',
'WYID': '192.168.99.101:5003_23',
'value': '关',
'dw': '',
'SUBID': 23,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '除湿输出状态',
'WYID': '192.168.99.101:5003_24',
'value': '关',
'dw': '',
'SUBID': 24,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '净化输出状态',
'WYID': '192.168.99.101:5003_25',
'value': '关',
'dw': '',
'SUBID': 25,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '加湿输出状态',
'WYID': '192.168.99.101:5003_26',
'value': '关',
'dw': '',
'SUBID': 26,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '排水状态',
'WYID': '192.168.99.101:5003_27',
'value': '关',
'dw': '',
'SUBID': 27,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '运行状态',
'WYID': '192.168.99.101:5003_28',
'value': '无状态',
'dw': '',
'SUBID': 28,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '故障状态',
'WYID': '192.168.99.101:5003_29',
'value': '正常',
'dw': '',
'SUBID': 29,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '湿度上限',
'WYID': '192.168.99.101:5003_30',
'value': '55.00',
'dw': '%',
'SUBID': 30,
'TIME': '2025-12-11 13:25:09'
},
{
'IP': '192.168.99.101:5003',
'subName': '湿度下限',
'WYID': '192.168.99.101:5003_31',
'value': '50.00',
'dw': '%',
'SUBID': 31,
'TIME': '2025-12-11 13:25:09'
}
],
'timestamp': 1765430709089
},
// 补充其他IP的模拟数据(如环境监测2_2、环境监测1)
'192.168.99.102:5004:2': {
code: 200,
message: '操作成功',
data: [
{
'IP': '192.168.99.102:5004:2',
'subName': '温度',
'WYID': '192.168.99.102:5004:2_1',
'value': '19.50',
'dw': '℃',
'SUBID': 1,
'TIME': '2025-12-11 13:26:00'
},
{
'IP': '192.168.99.102:5004:2',
'subName': '湿度',
'WYID': '192.168.99.102:5004:2_2',
'value': '48.20',
'dw': '%',
'SUBID': 2,
'TIME': '2025-12-11 13:26:00'
}
],
timestamp: 1765430760000
},
'192.168.99.102:5005': {
code: 200,
message: '操作成功',
data: [
{
'IP': '192.168.99.102:5005',
'subName': '温度',
'WYID': '192.168.99.102:5005_1',
'value': '21.00',
'dw': '℃',
'SUBID': 1,
'TIME': '2025-12-11 13:27:00'
},
{
'IP': '192.168.99.102:5005',
'subName': '湿度',
'WYID': '192.168.99.102:5005_2',
'value': '46.80',
'dw': '%',
'SUBID': 2,
'TIME': '2025-12-11 13:27:00'
}
],
timestamp: 1765430820000
}
}

408
src/views/storeManage/warehouse3D/archivesStorage/index.vue

@ -1,89 +1,43 @@
<template>
<div class="warehouse">
<!-- <h1>全景图</h1> -->
<div class="warehouse-left">
<div class="left-3d">
<iframe id="myIframe" ref="myIframe" name="iframeMap" class="iframe_box" src="/web3D/index.html" frameborder="0" scrolling="no" />
<ul class="msg-list">
<!-- :class="{ 'li-warn': newAlarm.DAK_DIV_TOP_001.curstatus > 0 }" -->
<ul v-if="newAlarm && newAlarm.length !== 0" class="msg-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="width: 2em; margin-left: 20px;" />
<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>
<!-- <li v-show="newAlarm.DAK_DIV_TOP_002.show" :class="{ 'li-warn': newAlarm.DAK_DIV_TOP_002.curstatus > 0 }">
<svg-icon icon-class="shidu" class-name="msg-list-svg" />
<div class="msg-txt">
<span class="msg-list-num">{{ newAlarm.DAK_DIV_TOP_002.curValue }}</span>
<p class="msg-list-unit">湿度 {{ newAlarm.DAK_DIV_TOP_002.unit }}</p>
</div>
</li> -->
<!-- <li v-show="topDisplayData.DAK_DIV_TOP_001.show" :class="{ 'li-warn': topDisplayData.DAK_DIV_TOP_001.curstatus > 0 }">
<svg-icon icon-class="temperature" class-name="msg-list-svg" />
<div class="msg-txt">
<span class="msg-list-num">{{ topDisplayData.DAK_DIV_TOP_001.curValue }}</span>
<p class="msg-list-unit">温度 {{ topDisplayData.DAK_DIV_TOP_001.unit }}</p>
</div>
</li>
<li v-show="topDisplayData.DAK_DIV_TOP_002.show" :class="{ 'li-warn': topDisplayData.DAK_DIV_TOP_002.curstatus > 0 }">
<svg-icon icon-class="shidu" class-name="msg-list-svg" />
<div class="msg-txt">
<span class="msg-list-num">{{ topDisplayData.DAK_DIV_TOP_002.curValue }}</span>
<p class="msg-list-unit">湿度 {{ topDisplayData.DAK_DIV_TOP_002.unit }}</p>
</div>
</li>
<li v-show="topDisplayData.DAK_DIV_TOP_003.show" :class="{ 'li-warn': topDisplayData.DAK_DIV_TOP_003.curstatus > 0 }">
<svg-icon icon-class="co2" class-name="msg-list-svg" />
<div class="msg-txt">
<span class="msg-list-num">{{ topDisplayData.DAK_DIV_TOP_003.curValue }}</span>
<p class="msg-list-unit">CO2 {{ topDisplayData.DAK_DIV_TOP_003.unit }}</p>
</div>
</li>
<li v-show="topDisplayData.DAK_DIV_TOP_004.show" :class="{ 'li-warn': topDisplayData.DAK_DIV_TOP_004.curstatus > 0 }">
<svg-icon icon-class="voc" class-name="msg-list-svg" />
<div class="msg-txt">
<span class="msg-list-num">{{ topDisplayData.DAK_DIV_TOP_004.curValue }}</span>
<p class="msg-list-unit">TVOC {{ topDisplayData.DAK_DIV_TOP_004.unit }}</p>
</div>
</li>
<li v-show="topDisplayData.DAK_DIV_TOP_005.show" :class="{ 'li-warn': topDisplayData.DAK_DIV_TOP_005.curstatus > 0 }" class="msg-pm">
<svg-icon icon-class="pm25" class-name="msg-list-svg" />
<div class="msg-txt">
<span class="msg-list-num">{{ topDisplayData.DAK_DIV_TOP_005.curValue }}</span>
<p class="msg-list-unit">PM2.5 {{ topDisplayData.DAK_DIV_TOP_005.unit }}</p>
</div>
</li>
<li v-show="topDisplayData.DAK_DIV_TOP_006.show" :class="{ 'li-warn': topDisplayData.DAK_DIV_TOP_006.curstatus > 0 }" class="msg-pm">
<svg-icon icon-class="pm10" class-name="msg-list-svg" />
<div class="msg-txt">
<span class="msg-list-num">{{ topDisplayData.DAK_DIV_TOP_006.curValue }}</span>
<p class="msg-list-unit">PM10 {{ topDisplayData.DAK_DIV_TOP_006.unit }}</p>
</div>
</li> -->
</ul>
<!-- air-warn -->
<div class="air-quality">
<!-- <div 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>45</p><span>(AQI-US)</span></div>
<div class="air-result"><p>{{ aqiValue }}</p><span>(AQI-US)</span></div>
</div>
<div class="air-right">
<span>空气质量为</span>
<p>健康</p>
<p>{{ aqiStatus }}</p>
</div>
</div>
</div>
</div> -->
</div>
</div>
<div class="warehouse-right">
<!-- 报警记录 -->
<warehouse-warning :height="'calc(100% - 40px)'" :storeroom-id="roomId" />
<!-- 门禁记录 -->
<AccessDoor :height="'calc(100% - 40px)'" />
</div>
<hkVideo ref="camera" :dialog-open.sync="open" />
@ -93,10 +47,19 @@
<script>
import WarehouseWarning from '@/views/components/WarehouseWarning'
import AccessDoor from '@/views/components/AccessDoor'
import displayConfigApi from '@/api/storeManage/displayConfig'
// import thirdApi from '@/api/thirdApi'
import alarmApi from '@/api/home/alarm'
import hkVideo from '../module/hkVideo.vue'
import alarmApi from '@/api/home/alarm'
// import { allDeviceData, mockIpData } from './index.js'
// 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: 'FullView',
@ -106,96 +69,122 @@ export default {
roomId: '01A1DC2123C2B75E1A579D',
allDisplayConfigData: [],
displayConfigData: [],
url: '',
allDeviceIds: [],
currentIpIndex: 0,
excludeIpList: [
'192.168.99.101:6003'
],
oaoMessage: [],
timer: '',
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
}
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 }
},
open: false,
newAlarm: []
newAlarm: [],
aqiValue: 45,
aqiStatus: '健康',
keepIndicators: [
'二氧化碳',
'甲醛',
'综合气体',
'PM2.5浓度',
'PM10浓度',
'温度',
'湿度',
'空气质量'
],
// IP
ipToNameMap: {},
//
currentDeviceName: ''
}
},
async created() {
window.getIframeLoading = this.getIframeLoading // vuewindow
this.allDisplayConfigData = await displayConfigApi.list({ storeroomId: this.roomId })
this.allDisplayConfigData.forEach(element => {
// if (element.isDisplay && element.bindState && element.deviceInfo && (element.divPosition.includes('OAO') || element.divPosition.includes('TOP'))) {
// this.allDeviceIds.push(element.deviceInfo.deviceId)
// if (!this.url) {
// this.url = 'http://' + element.deviceInfo.deviceIp + ':' + element.deviceInfo.devicePort
// }
// }
console.log('element.deviceInfo', element.deviceInfo)
this.allDeviceIds.push(element.deviceInfo.deviceIp)
if (!this.url) {
this.url = 'http://' + element.deviceInfo.deviceIp + ':' + element.deviceInfo.devicePort
window.getIframeLoading = this.getIframeLoading
//
// this.allDisplayConfigData = allDeviceData
//
await alarmApi.FetchYpGetSite().then((data) => {
if (data && data.length > 0) {
this.allDisplayConfigData = data
// IP
this.handleDeviceIpList()
} else {
this.allDisplayConfigData = []
}
})
this.displayConfigData = this.allDisplayConfigData.filter((item) => { return item.isDisplay && item.bindState && item.deviceInfo && (item.divPosition.includes('OAO') || item.divPosition.includes('TOP')) })
console.log('this.displayConfigData', this.displayConfigData)
await this.getRealTimeData()
if (this.allDeviceIds.length > 0) {
//
this.currentDeviceName = this.ipToNameMap[this.allDeviceIds[0]] || ''
await this.getRealTimeData(this.allDeviceIds[0])
console.log('初始加载IP数据:', this.allDeviceIds[0])
} else {
console.warn('无有效设备IP,停止轮询')
this.newAlarm = []
}
},
mounted() {
const _this = this
_this.iframeWin = this.$refs.myIframe.contentWindow
// inframe
document.getElementById('myIframe').onload = function() {
_this.deviceState()
}
// window.addEventListener('message', this.handleMessageDevice)
window.addEventListener('message', this.handleMessageEvent)
//
this.timer = setInterval(async() => {
await _this.getRealTimeData()
_this.handleAQI()
}, 10000)
if (this.allDeviceIds.length > 0) {
this.timer = 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)
}
},
beforeDestroy() {
if (this.timer) {
clearInterval(this.timer)
console.log('停止IP轮询')
}
window.removeEventListener('message', this.handleMessageEvent)
},
methods: {
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 ''
const ip = this.allDeviceIds[this.currentIpIndex]
this.currentIpIndex = (this.currentIpIndex + 1) % this.allDeviceIds.length
console.log(`轮询切换 - 当前IP:${ip},下一个索引:${this.currentIpIndex}`)
return ip
},
/**
* 处理iframe消息事件
*/
handleMessageEvent(event) {
if (event.data) {
switch (event.data.type) {
@ -210,7 +199,6 @@ export default {
{
const deviceData = event.data.data
console.log('cameraClick', deviceData)
//
if (deviceData.toLowerCase().includes('cam')) {
this.open = true
this.$nextTick(() => {
@ -232,101 +220,88 @@ export default {
}
break
default:
console.log('errorwww:', event.data)
console.log('未知消息类型:', event.data)
}
}
},
//
getIframeLoading(value) {
// console.log(`iframe${value}`)
if (value === 'false') {
this.allDisplayConfigData.forEach(element => {
if ((!element.isDisplay || !element.bindState) && element.divPosition.includes('OAO')) {
this.handleHide(element.divPosition)
}
})
// this.handleAlarm('DAK_MO_OAO_003')
this.deviceState()
this.handleAQI()
// window.frames['iframeMap'].setAlertValue('DAK_MO_OAO_003', 20, 60)
/**
* 请求指定IP的实时数据过滤+设备名称关联
*/
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)
}
},
// data / iframe
deviceState(e) {
this.iframeWin.postMessage({
data: this.oaoMessage
}, '*')
/**
* 计算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
},
// 湿
getIframeLoading(value) {},
deviceState(e) {
this.iframeWin.postMessage({ data: this.oaoMessage }, '*')
},
handleAQI() {
this.oaoMessage.forEach(element => {
window.frames['iframeMap'].setAlertValue(element.id, element.wendu, element.sidu)
})
},
// 湿
handleAlarm(deviceId) {
// true false
window.frames['iframeMap'].Myalert(deviceId, true)
},
//
handleHide(deviceId) {
// true false
window.frames['iframeMap'].setYangGanCanshow(deviceId, true)
},
//
rowBgColor({ row, rowIndex }) {
if (rowIndex % 2 === 1) {
return 'light-blue'
} else {
return ''
}
},
getRealTimeData() {
if (this.allDeviceIds.length > 0) {
// 192.1.8.228 this.allDeviceIds[0]
alarmApi.FetchDataForIP({ ip: '192.1.8.156:1000' }).then((data) => {
this.newAlarm = data
this.oaoMessage.splice(0, this.oaoMessage.length)
this.displayConfigData.forEach(element => {
if (element.divPosition.includes('TOP') && element.deviceSpecParams[0]) {
// div
const result = data.find((item) => {
return item.property_id === element.deviceSpecParams[0].paramId && item.device_id === element.deviceInfo.deviceId
})
console.log(result)
// this.$set(this.topDisplayData, element.divPosition, {
// show: true,
// curValue: result.curvalue,
// unit: result.unit,
// curstatus: result.curstatus
// })
} else {
// 3D
const wenduParamId = element.deviceSpecParams.find((item) => { return item.paramName === '温度' })?.paramId
const siduParamId = element.deviceSpecParams.find((item) => { return item.paramName === '湿度' })?.paramId
let wendu = {}
let sidu = {}
if (wenduParamId) {
wendu = data.find((item) => {
return item.property_id === wenduParamId && item.device_id === element.deviceInfo.deviceId
})
}
if (siduParamId) {
sidu = data.find((item) => {
return item.property_id === siduParamId && item.device_id === element.deviceInfo.deviceId
})
}
this.oaoMessage.push({
id: element.divPosition,
wendu: (wendu?.curvalue) ? (Math.round(wendu?.curvalue)) : '-',
sidu: (sidu?.curvalue) ? (Math.round(sidu?.curvalue)) : '-',
alarmState: (wendu && wendu.curstatus > 0) || (sidu && sidu.curstatus > 0)
})
}
})
})
}
}
}
}
@ -341,11 +316,23 @@ export default {
min-height: auto;
height: calc(100% / 2 - 10px);
overflow: hidden;
}
.container-wrap {
margin-bottom: 20px;
}
//
.device-name-title {
position: absolute;
top: 0;
left: 0;
color: #fff;
font-size: 18px;
font-weight: 600;
background: rgba(0, 0, 0, 0.3);
padding: 8px 16px;
border-radius: 4px;
z-index: 10;
}
.air-quality{
position: absolute;
bottom: 10px;
@ -421,4 +408,11 @@ export default {
}
}
}
.msg-list{
// top: 40px;
flex-wrap: wrap !important;
li{
margin-bottom: 20px;
}
}
</style>
Loading…
Cancel
Save