|
|
@ -1,5 +1,4 @@ |
|
|
|
<script lang="ts" setup> |
|
|
|
import homeLiquid from 'assets/images/home/home-liquid.svg' |
|
|
|
import Environment from 'components/home/Environment.vue' |
|
|
|
import HomeFormula from 'components/home/HomeFormula.vue' |
|
|
|
import HomeLogLevel from 'components/home/HomeLogLevel.vue' |
|
|
@ -64,85 +63,18 @@ const styles = ref<any>({ |
|
|
|
}) |
|
|
|
|
|
|
|
const computedStyle = () => { |
|
|
|
// console.log('homeStore.h2O2SensorData', homeStore.h2O2SensorData.length) |
|
|
|
if (__DEVICE_TYPE__ === deviceStore.deviceTypeMap.LargeSpaceDM_B) { |
|
|
|
if (homeStore.h2O2SensorData.length === 1) { |
|
|
|
return { |
|
|
|
gridTemplateColumns: 'repeat(1, 1fr)', |
|
|
|
gridTemplateRows: 'repeat(1, 1fr)', |
|
|
|
} |
|
|
|
} |
|
|
|
if (homeStore.h2O2SensorData.length === 2) { |
|
|
|
return { |
|
|
|
gridTemplateColumns: 'repeat(1, 1fr)', |
|
|
|
gridTemplateRows: 'repeat(2, 1fr)', |
|
|
|
} |
|
|
|
} |
|
|
|
if (homeStore.h2O2SensorData.length === 3) { |
|
|
|
return { |
|
|
|
gridTemplateColumns: 'repeat(auto-fit, minmax(250px, 1fr))', |
|
|
|
gridTemplateRows: 'repeat(2, 1fr)', |
|
|
|
justifyContent: 'center', |
|
|
|
} |
|
|
|
} |
|
|
|
if (homeStore.h2O2SensorData.length === 4) { |
|
|
|
return { |
|
|
|
gridTemplateColumns: 'repeat(2, 1fr)', |
|
|
|
gridTemplateRows: 'repeat(2, 1fr)', |
|
|
|
} |
|
|
|
} |
|
|
|
if (homeStore.h2O2SensorData.length === 5) { |
|
|
|
return { |
|
|
|
gridTemplateColumns: 'repeat(3, 1fr)', |
|
|
|
gridTemplateRows: 'repeat(2, 1fr)', |
|
|
|
justifyContent: 'center', |
|
|
|
} |
|
|
|
} |
|
|
|
if (homeStore.h2O2SensorData.length === 6) { |
|
|
|
return { |
|
|
|
gridTemplateColumns: 'repeat(3, 1fr)', |
|
|
|
gridTemplateRows: 'repeat(2, 1fr)', |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
if (homeStore.h2O2SensorData.length === 1) { |
|
|
|
return { |
|
|
|
gridTemplateColumns: 'repeat(1, 1fr)', |
|
|
|
gridTemplateRows: 'repeat(2, 1fr)', |
|
|
|
} |
|
|
|
} |
|
|
|
if (homeStore.h2O2SensorData.length === 2) { |
|
|
|
return { |
|
|
|
gridTemplateColumns: 'repeat(2, 1fr)', |
|
|
|
gridTemplateRows: 'repeat(2, 1fr)', |
|
|
|
} |
|
|
|
} |
|
|
|
if (homeStore.h2O2SensorData.length === 3) { |
|
|
|
return { |
|
|
|
gridTemplateColumns: 'repeat(2, 1fr)', |
|
|
|
gridTemplateRows: 'repeat(2, 1fr)', |
|
|
|
} |
|
|
|
} |
|
|
|
if (homeStore.h2O2SensorData.length === 4) { |
|
|
|
if ( |
|
|
|
deviceType.value === deviceStore.deviceTypeMap.PipeDM |
|
|
|
|| deviceType.value === deviceStore.deviceTypeMap.DrawBarDM |
|
|
|
) { |
|
|
|
return { |
|
|
|
gridTemplateColumns: 'repeat(3, 1fr)', |
|
|
|
gridTemplateRows: 'repeat(2, 1fr)', |
|
|
|
} |
|
|
|
} |
|
|
|
if (homeStore.h2O2SensorData.length === 5) { |
|
|
|
return { |
|
|
|
gridTemplateColumns: 'repeat(3, 1fr)', |
|
|
|
gridTemplateRows: 'repeat(2, 1fr)', |
|
|
|
justifyContent: 'center', |
|
|
|
} |
|
|
|
} |
|
|
|
if (homeStore.h2O2SensorData.length === 6) { |
|
|
|
return { |
|
|
|
gridTemplateColumns: 'repeat(3, 1fr)', |
|
|
|
gridTemplateRows: 'repeat(3, 1fr)', |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
const deviceType = computed(() => { |
|
|
@ -155,43 +87,13 @@ const deviceType = computed(() => { |
|
|
|
<div v-if="route.path === '/home'" class="home-grid-container"> |
|
|
|
<div class="home-left" :style="styles"> |
|
|
|
<el-card |
|
|
|
v-if="deviceType !== deviceStore.deviceTypeMap.LargeSpaceDM_B" |
|
|
|
class="card" |
|
|
|
:class="{ |
|
|
|
'card-center-1': |
|
|
|
deviceType !== deviceStore.deviceTypeMap.LargeSpaceDM_B && homeStore.h2O2SensorData.length === 2, |
|
|
|
'card-center-2': |
|
|
|
deviceType !== deviceStore.deviceTypeMap.LargeSpaceDM_B && homeStore.h2O2SensorData.length === 4, |
|
|
|
}" |
|
|
|
> |
|
|
|
<template #default> |
|
|
|
<!-- <div class="title-line" /> --> |
|
|
|
<div class="card-title-name"> |
|
|
|
<img :src="homeLiquid"> 消毒液 |
|
|
|
</div> |
|
|
|
<div class="card-progress"> |
|
|
|
<div class="card-progress-content"> |
|
|
|
<el-progress :text-inside="true" :stroke-width="35" :percentage="nowLiquidProgress" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="card-num-g"> |
|
|
|
{{ nowLiquid }}(g) |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</el-card> |
|
|
|
<el-card |
|
|
|
v-for="(item, index) in homeStore.h2O2SensorData" |
|
|
|
:key="item.sensorId" |
|
|
|
class="card" |
|
|
|
:class="{ |
|
|
|
'card-center-1': |
|
|
|
index === 0 |
|
|
|
&& deviceType === deviceStore.deviceTypeMap.LargeSpaceDM_B |
|
|
|
&& homeStore.h2O2SensorData.length === 3, |
|
|
|
'card-center-2': |
|
|
|
index === 0 |
|
|
|
&& deviceType === deviceStore.deviceTypeMap.LargeSpaceDM_B |
|
|
|
&& homeStore.h2O2SensorData.length === 5, |
|
|
|
&& (deviceType === deviceStore.deviceTypeMap.PipeDM || deviceType === deviceStore.deviceTypeMap.DrawBarDM), |
|
|
|
}" |
|
|
|
> |
|
|
|
<Environment :env-params="item" /> |
|
|
@ -201,7 +103,22 @@ const deviceType = computed(() => { |
|
|
|
<!-- 正在进行的配方 --> |
|
|
|
<div class="top"> |
|
|
|
<HomeFormula /> |
|
|
|
|
|
|
|
<div v-if="deviceType !== deviceStore.deviceTypeMap.LargeSpaceDM_B" style="margin-top: 20px"> |
|
|
|
<div class="card-progress"> |
|
|
|
<!-- <div class="card-title-name"> --> |
|
|
|
<!-- <img :src="homeLiquid"> --> |
|
|
|
<!-- </div> --> |
|
|
|
<div class="card-progress-content"> |
|
|
|
<el-progress size="small" :text-inside="true" :stroke-width="25" :percentage="nowLiquidProgress" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="card-num-g"> |
|
|
|
消毒液剩余:{{ nowLiquid }}(g) |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="middle"> |
|
|
|
<!-- 选择消毒的等级 --> |
|
|
|
<HomeLogLevel v-if="formulaStore.isDefaultFormula" /> |
|
|
@ -266,26 +183,11 @@ $input-height: 3rem; |
|
|
|
font-size: 20px; |
|
|
|
padding: 1rem; |
|
|
|
} |
|
|
|
|
|
|
|
.card-progress { |
|
|
|
display: flex; |
|
|
|
justify-content: center; |
|
|
|
margin-top: 3rem; |
|
|
|
|
|
|
|
.card-progress-content { |
|
|
|
width: 92%; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.card-num-g { |
|
|
|
margin-top: 3.5vw; |
|
|
|
font-size: 26px; |
|
|
|
font-weight: bold; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.home-right { |
|
|
|
padding: 10px; |
|
|
|
background: linear-gradient(180deg, rgba(147, 203, 255, 1) -190%, #ffffff 24%); |
|
|
|
border-radius: 10px; |
|
|
|
box-shadow: 0 1px 5px 0 rgba(9, 39, 62, 0.15); |
|
|
@ -313,4 +215,26 @@ $input-height: 3rem; |
|
|
|
:deep(.el-card__body) { |
|
|
|
height: 100%; |
|
|
|
} |
|
|
|
|
|
|
|
.card-progress { |
|
|
|
margin-top: 10px; |
|
|
|
padding: 0 10px; |
|
|
|
display: flex; |
|
|
|
justify-content: center; |
|
|
|
align-items: center; |
|
|
|
.card-title-name { |
|
|
|
margin-right: 10px; |
|
|
|
} |
|
|
|
|
|
|
|
.card-progress-content { |
|
|
|
width: 100%; |
|
|
|
} |
|
|
|
} |
|
|
|
.card-num-g { |
|
|
|
text-align: center; |
|
|
|
font-size: 15px; |
|
|
|
color: #3f4349; |
|
|
|
font-weight: bold; |
|
|
|
margin-top: 10px; |
|
|
|
} |
|
|
|
</style> |