Browse Source

fix: 增加无线传感器增加序号

master
guoapeng 2 weeks ago
parent
commit
08d7d4d766
  1. 9
      src/components/home/Environment.vue
  2. 8
      src/stores/homeStore.ts

9
src/components/home/Environment.vue

@ -44,9 +44,9 @@ const imgs: Record<string, any> = {
} }
const titles: Record<string, any> = { const titles: Record<string, any> = {
Internal: '仓内传感器',
WiredExtSensor: '外接传感器',
WirelessExtSensor: '无线传感器',
Internal: '仓内',
WiredExtSensor: '外接',
WirelessExtSensor: '无线',
} }
/** /**
* @hook 生命周期钩子 - 组件挂载完成时执行 * @hook 生命周期钩子 - 组件挂载完成时执行
@ -61,7 +61,8 @@ onMounted(() => {
<div class="box"> <div class="box">
<div class="title"> <div class="title">
<div style="width: 100%; display: flex; align-items: center"> <div style="width: 100%; display: flex; align-items: center">
<img :src="imgs[envParams.type] || homeInside" alt="" style="margin-right: 10px"> {{ titles[envParams.type] }}
<img :src="imgs[envParams.type] || homeInside" alt="" style="margin-right: 10px"> {{ titles[envParams.type]
}}{{ envParams.sensorId }}
</div> </div>
<el-tag v-if="!envParams.online" type="danger"> <el-tag v-if="!envParams.online" type="danger">

8
src/stores/homeStore.ts

@ -27,6 +27,7 @@ const h2O2Data: Home.DisplayrelyMgrParams[] = [deviceTypeMap.PipeDM, deviceTypeM
{ {
type: 'WirelessExtSensor', type: 'WirelessExtSensor',
online: false, online: false,
sensorId: 1,
temp: -1, temp: -1,
rh: -1, rh: -1,
rs: -1, rs: -1,
@ -35,6 +36,7 @@ const h2O2Data: Home.DisplayrelyMgrParams[] = [deviceTypeMap.PipeDM, deviceTypeM
{ {
type: 'WirelessExtSensor', type: 'WirelessExtSensor',
online: false, online: false,
sensorId: 2,
temp: -1, temp: -1,
rh: -1, rh: -1,
rs: -1, rs: -1,
@ -43,6 +45,7 @@ const h2O2Data: Home.DisplayrelyMgrParams[] = [deviceTypeMap.PipeDM, deviceTypeM
{ {
type: 'WirelessExtSensor', type: 'WirelessExtSensor',
online: false, online: false,
sensorId: 3,
temp: -1, temp: -1,
rh: -1, rh: -1,
rs: -1, rs: -1,
@ -61,6 +64,7 @@ const h2O2Data: Home.DisplayrelyMgrParams[] = [deviceTypeMap.PipeDM, deviceTypeM
{ {
type: 'WiredExtSensor', type: 'WiredExtSensor',
online: false, online: false,
sensorId: 1,
temp: -1, temp: -1,
rh: -1, rh: -1,
rs: -1, rs: -1,
@ -69,6 +73,7 @@ const h2O2Data: Home.DisplayrelyMgrParams[] = [deviceTypeMap.PipeDM, deviceTypeM
{ {
type: 'WiredExtSensor', type: 'WiredExtSensor',
online: false, online: false,
sensorId: 2,
temp: -1, temp: -1,
rh: -1, rh: -1,
rs: -1, rs: -1,
@ -78,6 +83,7 @@ const h2O2Data: Home.DisplayrelyMgrParams[] = [deviceTypeMap.PipeDM, deviceTypeM
type: 'WirelessExtSensor', type: 'WirelessExtSensor',
online: false, online: false,
temp: -1, temp: -1,
sensorId: 1,
rh: -1, rh: -1,
rs: -1, rs: -1,
h2o2: -1, h2o2: -1,
@ -85,6 +91,7 @@ const h2O2Data: Home.DisplayrelyMgrParams[] = [deviceTypeMap.PipeDM, deviceTypeM
{ {
type: 'WirelessExtSensor', type: 'WirelessExtSensor',
online: false, online: false,
sensorId: 2,
temp: -1, temp: -1,
rh: -1, rh: -1,
rs: -1, rs: -1,
@ -93,6 +100,7 @@ const h2O2Data: Home.DisplayrelyMgrParams[] = [deviceTypeMap.PipeDM, deviceTypeM
{ {
type: 'WirelessExtSensor', type: 'WirelessExtSensor',
online: false, online: false,
sensorId: 3,
temp: -1, temp: -1,
rh: -1, rh: -1,
rs: -1, rs: -1,

Loading…
Cancel
Save