Browse Source

feat: 停止加热

master
guoapeng 1 week ago
parent
commit
93c884d59a
  1. 26
      src/views/home/index.vue

26
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
}

Loading…
Cancel
Save