Browse Source

fix: 设备类型控制

master
guoapeng 2 weeks ago
parent
commit
eb1a9e4200
  1. 6
      src/components/home/HomeSetting.vue
  2. 8
      src/layouts/default.vue
  3. 13
      src/views/home/index.vue

6
src/components/home/HomeSetting.vue

@ -238,12 +238,16 @@ const settingWidth = computed(() => {
}
return '7.5rem'
})
const deviceType = computed(() => {
return __DEVICE_TYPE__
})
</script>
<template>
<div class="home-start-opt">
<div class="home-opt-flex">
<div v-if="__DEVICE_TYPE__ === deviceStore.deviceTypeMap.PipeDM">
<div v-if="deviceType === deviceStore.deviceTypeMap.PipeDM">
<BtButton
button-text="压力控制"
text-size="1.3rem"

8
src/layouts/default.vue

@ -6,7 +6,7 @@ import NetReconnection from 'components/system/NetReconnection.vue'
import { formatDateTime, openFullscreen } from 'libs/utils'
import { authRoutes } from 'router/routes'
import { useDeviceStore } from 'stores/deviceStore'
import { onMounted, onUnmounted, ref, watch, watchEffect } from 'vue'
import { computed, onMounted, onUnmounted, ref, watch, watchEffect } from 'vue'
import { useI18n } from 'vue-i18n'
import { useRouter } from 'vue-router'
@ -165,6 +165,10 @@ const statusMap = {
name: '设备告警信息',
},
}
const deviceType = computed(() => {
return __DEVICE_TYPE__
})
</script>
<template>
@ -203,7 +207,7 @@ const statusMap = {
</div>
</div>
<div class="user">
<span v-if="__DEVICE_TYPE__ === deviceStore.deviceTypeMap.LargeSpaceDM_B">
<span v-if="deviceType === deviceStore.deviceTypeMap.LargeSpaceDM_B">
<img v-if="websocketConnected" width="20" :src="WifiConnSvg" alt="">
<img v-else :src="WifiUnconnSvg" width="20" alt="">
</span>

13
src/views/home/index.vue

@ -145,6 +145,9 @@ const computedStyle = () => {
}
}
}
const deviceType = computed(() => {
return __DEVICE_TYPE__
})
</script>
<template>
@ -152,13 +155,13 @@ const computedStyle = () => {
<div v-if="route.path === '/home'" class="home-grid-container">
<div class="home-left" :style="styles">
<el-card
v-if="__DEVICE_TYPE__ !== deviceStore.deviceTypeMap.LargeSpaceDM_B"
v-if="deviceType !== deviceStore.deviceTypeMap.LargeSpaceDM_B"
class="card"
:class="{
'card-center-1':
__DEVICE_TYPE__ !== deviceStore.deviceTypeMap.LargeSpaceDM_B && homeStore.h2O2SensorData.length === 2,
deviceType !== deviceStore.deviceTypeMap.LargeSpaceDM_B && homeStore.h2O2SensorData.length === 2,
'card-center-2':
__DEVICE_TYPE__ !== deviceStore.deviceTypeMap.LargeSpaceDM_B && homeStore.h2O2SensorData.length === 4,
deviceType !== deviceStore.deviceTypeMap.LargeSpaceDM_B && homeStore.h2O2SensorData.length === 4,
}"
>
<template #default>
@ -183,11 +186,11 @@ const computedStyle = () => {
:class="{
'card-center-1':
index === 0
&& __DEVICE_TYPE__ === deviceStore.deviceTypeMap.LargeSpaceDM_B
&& deviceType === deviceStore.deviceTypeMap.LargeSpaceDM_B
&& homeStore.h2O2SensorData.length === 3,
'card-center-2':
index === 0
&& __DEVICE_TYPE__ !== deviceStore.deviceTypeMap.LargeSpaceDM_B
&& deviceType !== deviceStore.deviceTypeMap.LargeSpaceDM_B
&& homeStore.h2O2SensorData.length === 5,
}"
>

Loading…
Cancel
Save