|
@ -1,5 +1,4 @@ |
|
|
<script lang="ts" setup> |
|
|
<script lang="ts" setup> |
|
|
import { sendCmd } from '@/apis/system' |
|
|
|
|
|
import { useFormulaStore } from '@/stores/formulaStore' |
|
|
import { useFormulaStore } from '@/stores/formulaStore' |
|
|
import homeChart from 'assets/images/home/home-chart.svg' |
|
|
import homeChart from 'assets/images/home/home-chart.svg' |
|
|
import homeFinish from 'assets/images/home/home-finish.svg' |
|
|
import homeFinish from 'assets/images/home/home-finish.svg' |
|
@ -16,12 +15,12 @@ import { useRoute, useRouter } from 'vue-router' |
|
|
|
|
|
|
|
|
const router = useRouter() |
|
|
const router = useRouter() |
|
|
const route = useRoute() |
|
|
const route = useRoute() |
|
|
const formulaStore = useFormulaStore() |
|
|
|
|
|
const homeStore = useHomeStore() |
|
|
const homeStore = useHomeStore() |
|
|
const environmentParams = ref<Home.DisplayrelyMgrParams>(homeStore.$state.h2O2SensorData[0]) |
|
|
|
|
|
const probe1Params = ref<Home.DisplayrelyMgrParams>(homeStore.$state.h2O2SensorData[1]) |
|
|
|
|
|
const probe2Params = ref<Home.DisplayrelyMgrParams>(homeStore.$state.h2O2SensorData[2]) |
|
|
|
|
|
const liquidInfo = ref<Home.LiquidData>(homeStore.$state.liquidData) |
|
|
|
|
|
|
|
|
const formulaStore = useFormulaStore() |
|
|
|
|
|
const environmentParams = ref<Home.DisplayrelyMgrParams>(homeStore.h2O2SensorData[0]) |
|
|
|
|
|
const probe1Params = ref<Home.DisplayrelyMgrParams>(homeStore.h2O2SensorData[1]) |
|
|
|
|
|
const probe2Params = ref<Home.DisplayrelyMgrParams>(homeStore.h2O2SensorData[2]) |
|
|
|
|
|
const liquidInfo = ref<Home.LiquidData>(homeStore.liquidData) |
|
|
const deviceState = ref(1) |
|
|
const deviceState = ref(1) |
|
|
const isModalOpen = ref(false) |
|
|
const isModalOpen = ref(false) |
|
|
const formulaInfo = ref() |
|
|
const formulaInfo = ref() |
|
@ -38,13 +37,10 @@ const options = ref([{ |
|
|
const selectedValue = ref() |
|
|
const selectedValue = ref() |
|
|
|
|
|
|
|
|
onMounted(() => { |
|
|
onMounted(() => { |
|
|
formulaInfo.value = formulaStore.currentSelectedFormulaInfo |
|
|
|
|
|
setInterval(() => { |
|
|
|
|
|
initData() |
|
|
|
|
|
}, 1000) |
|
|
|
|
|
|
|
|
formulaInfo.value = formulaStore.currentSelectedFormulaInfo || formulaStore.initFormulaInfo |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
watch(() => homeStore.$state.h2O2SensorData, (newVal) => { |
|
|
|
|
|
|
|
|
watch(() => homeStore.h2O2SensorData, (newVal) => { |
|
|
if (newVal && newVal.length) { |
|
|
if (newVal && newVal.length) { |
|
|
environmentParams.value = newVal[0] |
|
|
environmentParams.value = newVal[0] |
|
|
} |
|
|
} |
|
@ -54,29 +50,6 @@ watch(() => formulaStore.currentSelectedFormulaInfo, (newVal) => { |
|
|
formulaInfo.value = newVal |
|
|
formulaInfo.value = newVal |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
const initData = async () => { |
|
|
|
|
|
const envParams = { |
|
|
|
|
|
fnName: 'readH2O2SensorData', |
|
|
|
|
|
className: 'FrontEndRealtimeDisplayContentMgr', |
|
|
|
|
|
params: {}, |
|
|
|
|
|
} |
|
|
|
|
|
const resData = await sendCmd(envParams) |
|
|
|
|
|
if (resData.rely && resData.rely.val.length) { |
|
|
|
|
|
homeStore.updateHomeData(resData.rely.val) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const liquidParams = { |
|
|
|
|
|
fnName: 'getState', |
|
|
|
|
|
className: 'AddLiquidService', |
|
|
|
|
|
params: {}, |
|
|
|
|
|
} |
|
|
|
|
|
const liquidData = await sendCmd(liquidParams) |
|
|
|
|
|
if (liquidData.rely) { |
|
|
|
|
|
homeStore.updateHomeLiquid(liquidData.rely) |
|
|
|
|
|
liquidInfo.value = liquidData.rely |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 开始消毒 |
|
|
// 开始消毒 |
|
|
const onStartDisinfect = () => { |
|
|
const onStartDisinfect = () => { |
|
|
const isStart = homeStore.startDisinfect() |
|
|
const isStart = homeStore.startDisinfect() |
|
@ -118,7 +91,7 @@ const onShowChart = () => { |
|
|
|
|
|
|
|
|
<template> |
|
|
<template> |
|
|
<div class="home"> |
|
|
<div class="home"> |
|
|
<div v-if="route.path === '/home'" class="home-grid-container"> |
|
|
|
|
|
|
|
|
<div v-if="route.path === '/home'" class="home-grid-container"> |
|
|
<div class="home-grid-item merged-cell"> |
|
|
<div class="home-grid-item merged-cell"> |
|
|
<div class="home-left"> |
|
|
<div class="home-left"> |
|
|
<div class="item1"> |
|
|
<div class="item1"> |
|
@ -131,7 +104,9 @@ const onShowChart = () => { |
|
|
<el-progress :text-inside="true" :stroke-width="26" :percentage="liquidInfo.nowLiquid" /> |
|
|
<el-progress :text-inside="true" :stroke-width="26" :percentage="liquidInfo.nowLiquid" /> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="item1-num-g">{{ liquidInfo.nowLiquid }}(g)</div> |
|
|
|
|
|
|
|
|
<div class="item1-num-g"> |
|
|
|
|
|
{{ liquidInfo.nowLiquid }}(g) |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="item2"> |
|
|
<div class="item2"> |
|
|
<div class="title" /> |
|
|
<div class="title" /> |
|
@ -157,9 +132,9 @@ const onShowChart = () => { |
|
|
<div>{{ formulaInfo.name }}</div> |
|
|
<div>{{ formulaInfo.name }}</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="title-spend"> |
|
|
|
|
|
|
|
|
<div v-if="formulaInfo && formulaInfo.injection_pump_speed" class="title-spend"> |
|
|
<span>速率</span> |
|
|
<span>速率</span> |
|
|
<span style="color: #31CB7A">50</span>g/分钟 |
|
|
|
|
|
|
|
|
<span style="color: #31CB7A">{{ formulaInfo.injection_pump_speed }}</span>g/分钟 |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="home-right-level"> |
|
|
<div class="home-right-level"> |
|
@ -197,25 +172,35 @@ const onShowChart = () => { |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="home-remain-time"> |
|
|
<div class="home-remain-time"> |
|
|
<div class="home-remaini-label">预计剩余时间: </div> |
|
|
|
|
|
<div class="home-remaini-value">10:00:20</div> |
|
|
|
|
|
|
|
|
<div class="home-remaini-label"> |
|
|
|
|
|
预计剩余时间: |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="home-remaini-value"> |
|
|
|
|
|
10:00:20 |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="home-start-opt"> |
|
|
<div class="home-start-opt"> |
|
|
<div class="home-opt-flex"> |
|
|
<div class="home-opt-flex"> |
|
|
<FtButton size="large" @click="onShowChart"> |
|
|
<FtButton size="large" @click="onShowChart"> |
|
|
<div class="home-chart"> |
|
|
<div class="home-chart"> |
|
|
<div><img :src="homeChart" style="width: 20px"></div> |
|
|
<div><img :src="homeChart" style="width: 20px"></div> |
|
|
<div class="home-chart-text">图表数据</div> |
|
|
|
|
|
|
|
|
<div class="home-chart-text"> |
|
|
|
|
|
图表数据 |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</FtButton> |
|
|
</FtButton> |
|
|
<FtButton @click="onDisinfectConfig"> |
|
|
<FtButton @click="onDisinfectConfig"> |
|
|
<div v-if="deviceState === 1" class="home-chart"> |
|
|
<div v-if="deviceState === 1" class="home-chart"> |
|
|
<div><img :src="homeSetting" style="width: 20px"></div> |
|
|
<div><img :src="homeSetting" style="width: 20px"></div> |
|
|
<div class="home-chart-text">消毒设置</div> |
|
|
|
|
|
|
|
|
<div class="home-chart-text"> |
|
|
|
|
|
消毒设置 |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div v-else class="home-chart"> |
|
|
<div v-else class="home-chart"> |
|
|
<div><img :src="homeRunSvg" style="width: 20px"></div> |
|
|
<div><img :src="homeRunSvg" style="width: 20px"></div> |
|
|
<div class="home-chart-text">运行参数</div> |
|
|
|
|
|
|
|
|
<div class="home-chart-text"> |
|
|
|
|
|
运行参数 |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</FtButton> |
|
|
</FtButton> |
|
|
</div> |
|
|
</div> |
|
|