|
|
@ -2,12 +2,12 @@ |
|
|
|
import { syncSendCmd } from 'apis/system' |
|
|
|
import homeFinish from 'assets/images/home/home-finish.svg' |
|
|
|
import homeSettingSvg from 'assets/images/home/home-setting.svg' |
|
|
|
import Config from 'components/home/config.vue' |
|
|
|
import RunFormulaConfig from 'components/formula/RunFormulaConfig.vue' |
|
|
|
import HomeFormula from 'components/home/HomeFormula.vue' |
|
|
|
import LineChart from 'components/home/LineChart.vue' |
|
|
|
import { stopTimer } from 'libs/countdownTimer' |
|
|
|
import { deviceStateMap } from 'libs/utils' |
|
|
|
import { cloneDeep } from 'lodash' |
|
|
|
import { FtMessage } from 'libs/message' |
|
|
|
import { compareJSON, deviceStateMap } from 'libs/utils' |
|
|
|
import { computed, onMounted, onUnmounted, provide, ref, watchEffect } from 'vue' |
|
|
|
import { useRouter } from 'vue-router' |
|
|
|
|
|
|
@ -56,11 +56,24 @@ const onFinishDisinfect = async () => { |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
const onSave = () => { |
|
|
|
const formData = configRef.value?.getFormData() |
|
|
|
formulaStore.updateSelectedFormula(cloneDeep(formData)) |
|
|
|
onClose() |
|
|
|
const chartRef = ref() |
|
|
|
const onSave = async () => { |
|
|
|
const formData = await chartRef.value?.saveFormData() |
|
|
|
if (!formData) { |
|
|
|
return |
|
|
|
} |
|
|
|
// 消毒中更新实时配置 |
|
|
|
const res = await formulaStore.getRealtimeConfig() |
|
|
|
const diff = compareJSON(res.rely, formData) |
|
|
|
const diffKeys = Object.keys(diff) |
|
|
|
if (diffKeys.length) { |
|
|
|
await Promise.all( |
|
|
|
diffKeys.map(async (key) => { |
|
|
|
await formulaStore.setRealtimeConfig(key, diff[key].newVal) |
|
|
|
}), |
|
|
|
) |
|
|
|
FtMessage.success('修改成功') |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const goHome = () => { |
|
|
@ -127,22 +140,6 @@ onUnmounted(() => { |
|
|
|
<div v-if="formulaInfo && formulaInfo.name" class="line-chart-formula"> |
|
|
|
<HomeFormula style="background: #e0f0ff" /> |
|
|
|
</div> |
|
|
|
<div class="line-chart-set"> |
|
|
|
<bt-button |
|
|
|
v-if="!isDeviceIdle" |
|
|
|
button-text="运行参数" |
|
|
|
text-size="24px" |
|
|
|
border-radius="5px" |
|
|
|
height="3.5rem" |
|
|
|
text-color="#1989fa" |
|
|
|
padding="0.8vw" |
|
|
|
@click="onDisinfectConfig" |
|
|
|
> |
|
|
|
<template #icon> |
|
|
|
<img :src="homeSettingSvg" width="15" alt=""> |
|
|
|
</template> |
|
|
|
</bt-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div |
|
|
|
v-loading="chartLoading" |
|
|
@ -175,9 +172,9 @@ onUnmounted(() => { |
|
|
|
bg-color="#FF6767" |
|
|
|
text-color="#FFFFFF" |
|
|
|
width="15vw" |
|
|
|
height="7vh" |
|
|
|
height="3.5rem" |
|
|
|
text-size="24px" |
|
|
|
border-radius="12px" |
|
|
|
border-radius="5px" |
|
|
|
@click="onFinishDisinfect" |
|
|
|
> |
|
|
|
<template #icon> |
|
|
@ -185,20 +182,32 @@ onUnmounted(() => { |
|
|
|
</template> |
|
|
|
</bt-button> |
|
|
|
<bt-button |
|
|
|
v-if="!isDeviceIdle" |
|
|
|
button-text="运行参数" |
|
|
|
text-size="24px" |
|
|
|
border-radius="5px" |
|
|
|
height="3.5rem" |
|
|
|
text-color="#1989fa" |
|
|
|
padding="0.8vw" |
|
|
|
@click="onDisinfectConfig" |
|
|
|
> |
|
|
|
<template #icon> |
|
|
|
<img :src="homeSettingSvg" width="15" alt=""> |
|
|
|
</template> |
|
|
|
</bt-button> |
|
|
|
<bt-button |
|
|
|
button-text="返回" |
|
|
|
width="10vw" |
|
|
|
height="7vh" |
|
|
|
text-color="#1989fa" |
|
|
|
text-size="24px" |
|
|
|
border-radius="12px" |
|
|
|
border-radius="5px" |
|
|
|
@click="goHome" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<ft-dialog v-model="disinfectFormulaVisible" title="运行参数" width="80vw" :ok-handle="onSave" @cancel="onClose"> |
|
|
|
<div> |
|
|
|
<Config ref="configRef" /> |
|
|
|
</div> |
|
|
|
<RunFormulaConfig ref="chartRef" /> |
|
|
|
</ft-dialog> |
|
|
|
</main> |
|
|
|
</template> |
|
|
|