From 93c884d59aa9317bb2649f403e2e1a3b2389e3c8 Mon Sep 17 00:00:00 2001 From: guoapeng Date: Sat, 26 Jul 2025 14:19:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=81=9C=E6=AD=A2=E5=8A=A0=E7=83=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/home/index.vue | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/views/home/index.vue b/src/views/home/index.vue index 95189d6..dcedf65 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -2,6 +2,8 @@ import ColorEdit from 'components/color/Edit/index.vue' import AddLiquid from 'components/home/AddLiquid/index.vue' import StartHeat from 'components/home/StartHeat/index.vue' +import { ElMessageBox } from 'element-plus' +import { useHomeStore } from 'stores/homeStore' import { useSystemStore } from 'stores/systemStore' import { watch } from 'vue' @@ -42,6 +44,10 @@ const list = [ ] +const homeStore = useHomeStore() + +let currentCommandId = '' + const chartBox = ref(null) const systemStore = useSystemStore() @@ -55,7 +61,25 @@ const colorVisible = ref(false) const heatVisible = ref(false) const currentHeatModuleCode = ref('MODULE_1') -const startHeat = (moduleCode: 'MODULE_1' | 'MODULE_2') => { +const startHeat = async (moduleCode: 'MODULE_1' | 'MODULE_2') => { + // TODO 停止加热判断条件 + if (false) { + await ElMessageBox.confirm('确定停止加热?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning', + }) + currentCommandId = Date.now().toString() + const params = { + commandId: currentCommandId, + command: 'heater_stop', + params: { + heatModuleCode: moduleCode, + }, + } + await homeStore.sendControl(params) + return + } currentHeatModuleCode.value = moduleCode heatVisible.value = true }