diff --git a/src/components/LiquidHandle.vue b/src/components/LiquidHandle.vue index 6b1fa0a..cfe18b2 100644 --- a/src/components/LiquidHandle.vue +++ b/src/components/LiquidHandle.vue @@ -12,13 +12,25 @@ />

设置加液

-
暂停加液
-
开始加液
+
+ 暂停加液 +
+
+ 开始加液 +
开始排液
-
+
import LiquidModal from './dialogs/LiquidModal.vue' -import { useDeviceStore } from '@/store' +import { useDeviceStore, useWebSocketStore } from '@/store' import { ref } from 'vue' import { storeToRefs } from 'pinia' +import { + startReplenishingFluidsJSON, + stopReplenishingFluidsJSON, +} from '@/mock/command' + const props = defineProps({ tabType: { type: Number, }, }) + const addLiquidVal = ref(0) const tipModalVisible = ref(false) +const webSocketStore = useWebSocketStore() + +const isAddLiquidStatus = ref(false) + +const startAdd = () => { + isAddLiquidStatus.value = true + webSocketStore.sendCommandMsg(startReplenishingFluidsJSON) +} + +const stopAdd = () => { + isAddLiquidStatus.value = false + webSocketStore.sendCommandMsg(stopReplenishingFluidsJSON) +} const startTabLiquid = () => { tipModalVisible.value = true } const formatter = value => { + if (value > 500) { + return '500/g' + } if (value != 0) { var newVal = value.replace(/\b(0+)/gi, '') return newVal + '/g' diff --git a/src/components/dialogs/LiquidModal.vue b/src/components/dialogs/LiquidModal.vue index 3c53006..1d0c904 100644 --- a/src/components/dialogs/LiquidModal.vue +++ b/src/components/dialogs/LiquidModal.vue @@ -33,6 +33,11 @@