|
|
@ -27,20 +27,12 @@ const curStateRemainTime = ref(homeStore.curStateRemainTime) |
|
|
|
const disinfectFormulaVisible = ref(false) |
|
|
|
const isDeviceIdle = ref(homeStore.isDeviceIdle) |
|
|
|
const loading = ref(false) |
|
|
|
const h2O2SensorData = ref(homeStore.h2O2SensorData) |
|
|
|
|
|
|
|
watchEffect(() => { |
|
|
|
formulaInfo.value = formulaStore.currentSelectedFormulaInfo |
|
|
|
disinfectionState.value = homeStore.disinfectionState |
|
|
|
curStateRemainTime.value = homeStore.curStateRemainTime |
|
|
|
isDeviceIdle.value = homeStore.isDeviceIdle |
|
|
|
h2O2SensorData.value = homeStore.h2O2SensorData.map((item, index) => { |
|
|
|
return { |
|
|
|
...item, |
|
|
|
title: index === 0 ? '仓内' : `探头${index}`, |
|
|
|
chartId: index === 0 ? 'inside' : `env${index}`, |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
const onDisinfectConfig = () => { |
|
|
@ -72,7 +64,7 @@ const onSave = () => { |
|
|
|
} |
|
|
|
|
|
|
|
const goHome = () => { |
|
|
|
router.back() |
|
|
|
router.push('/home') |
|
|
|
} |
|
|
|
const onClose = () => { |
|
|
|
disinfectFormulaVisible.value = false |
|
|
@ -85,15 +77,17 @@ const operationState = computed(() => { |
|
|
|
|
|
|
|
let poll = null |
|
|
|
|
|
|
|
const getData = async () => { |
|
|
|
const getData = async (type?: string) => { |
|
|
|
const data = await syncSendCmd({ |
|
|
|
className: 'H2O2SensorMgr', |
|
|
|
fnName: 'getH2O2SensorList', |
|
|
|
}) |
|
|
|
chartList.value = data.rely |
|
|
|
for (let i = 0; i < chartList.value.length; i++) { |
|
|
|
const item: any = chartList.value[i] |
|
|
|
const list = await syncSendCmd({ |
|
|
|
|
|
|
|
const list = data.rely |
|
|
|
!type && (chartList.value = list.map(item => ({ ...item, data: [] }))) |
|
|
|
for (let i = 0; i < list.length; i++) { |
|
|
|
const item: any = list[i] |
|
|
|
const res = await syncSendCmd({ |
|
|
|
className: 'H2O2SensorMgr', |
|
|
|
fnName: 'getDisinfectionH2O2DataRecordList', |
|
|
|
params: { |
|
|
@ -102,18 +96,23 @@ const getData = async () => { |
|
|
|
interval: 30, |
|
|
|
}, |
|
|
|
}) |
|
|
|
chartList.value[i].data = list.rely |
|
|
|
item.data = res.rely |
|
|
|
} |
|
|
|
chartList.value = list |
|
|
|
console.log(chartList.value) |
|
|
|
} |
|
|
|
|
|
|
|
const chartLoading = ref(false) |
|
|
|
onMounted(async () => { |
|
|
|
chartLoading.value = true |
|
|
|
await getData() |
|
|
|
chartLoading.value = false |
|
|
|
poll = setInterval(() => { |
|
|
|
if (operationState.value) { |
|
|
|
clearInterval(poll) |
|
|
|
return |
|
|
|
} |
|
|
|
getData() |
|
|
|
getData('interval') |
|
|
|
}, 1000 * 30) |
|
|
|
}) |
|
|
|
|
|
|
@ -145,7 +144,11 @@ onUnmounted(() => { |
|
|
|
</bt-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="line-chart-content" :style="{ 'grid-template-columns': `repeat(${chartList.length},1fr)` }"> |
|
|
|
<div |
|
|
|
v-loading="chartLoading" |
|
|
|
class="line-chart-content" |
|
|
|
:style="{ 'grid-template-columns': `repeat(${chartList.length},1fr)` }" |
|
|
|
> |
|
|
|
<div v-for="(item, index) in chartList" :key="index"> |
|
|
|
<LineChart :env-data="item" /> |
|
|
|
</div> |
|
|
|