|
|
@ -14,6 +14,7 @@ import { isClose, socket } from 'libs/socket' |
|
|
|
import { cmdNameMap, formatDateTime } from 'libs/utils' |
|
|
|
import { authRoutes } from 'router/routes' |
|
|
|
import { useDebugStore } from 'stores/debugStore' |
|
|
|
import { useHomeStore } from 'stores/homeStore' |
|
|
|
import { useSystemStore } from 'stores/systemStore' |
|
|
|
import { computed, onMounted, onUnmounted, ref, watch } from 'vue' |
|
|
|
import { useRouter } from 'vue-router' |
|
|
@ -21,6 +22,7 @@ import { useRouter } from 'vue-router' |
|
|
|
const { handleLogoClick } = useActivateDebug() |
|
|
|
|
|
|
|
const systemStore = useSystemStore() |
|
|
|
const homeStore = useHomeStore() |
|
|
|
const router = useRouter() |
|
|
|
|
|
|
|
onMounted(async () => { |
|
|
@ -185,6 +187,18 @@ const remoteControlState = computed(() => { |
|
|
|
// charging: true, // 是否正在充电 |
|
|
|
// } |
|
|
|
}) |
|
|
|
|
|
|
|
let currentCommandId = '' |
|
|
|
const putEmpty = async () => { |
|
|
|
currentCommandId = Date.now().toString() |
|
|
|
const params = { |
|
|
|
commandId: currentCommandId, |
|
|
|
command: 'solution_drain_start', |
|
|
|
params: { |
|
|
|
}, |
|
|
|
} |
|
|
|
await homeStore.sendControl(params) |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<template lang="pug"> |
|
|
@ -201,6 +215,7 @@ const remoteControlState = computed(() => { |
|
|
|
@click="router.push(item.path)" |
|
|
|
) |
|
|
|
| {{ item?.meta?.title }} |
|
|
|
ft-button( type="primary" :click-handle="putEmpty" style="width: 80px") 排空 |
|
|
|
div(class="header-right") |
|
|
|
div.power-box(v-if="remoteControlState.connected") |
|
|
|
div.bg-box(:style="`width: ${remoteControlState.batteryLevel}%; background: ${remoteControlState.batteryLevel === 100 ? '#1dbb1d' : remoteControlState.batteryLevel >20 ? '#1989FA' : 'red'} `") |
|
|
|