diff --git a/src/components/LiquidHandle.vue b/src/components/LiquidHandle.vue index ea05e54..3b7a1d8 100644 --- a/src/components/LiquidHandle.vue +++ b/src/components/LiquidHandle.vue @@ -79,10 +79,10 @@ @@ -151,7 +151,8 @@ @@ -187,15 +188,24 @@ const props = defineProps({ }, }) -const addLiquidVal = ref(2000) +const addLiquidVal = ref('2000') const tipModalVisible = ref(false) const webSocketStore = useWebSocketStore() const isPopLiquidStatus = ref(false) +const formatter = value => { + if (parseInt(value) > 5000) { + return '5000' + } + if (parseInt(value) <= 0) { + return '0' + } + return value.replace(/^0+/gi, '') +} + const startAdd = () => { if (!(operatorStore.replenishingFluidsWorkState == 1)) { - console.log(startReplenishingFluidsJSON(parseInt(addLiquidVal.value))) webSocketStore.sendCommandMsg( startReplenishingFluidsJSON(parseInt(addLiquidVal.value)), ) @@ -227,6 +237,22 @@ const hideTabLiquid = () => { const deviceStore = useDeviceStore() const { disinfectantCapacity } = storeToRefs(deviceStore) + +const isFirstClick = ref(true) + +const handleInput = value => { + if (isFirstClick.value) { + setTimeout(() => { + addLiquidVal.value = value + '' + }) + isFirstClick.value = false + } +} + +const handleClickInput = () => { + isFirstClick.value = true + numberKeyboardShow.value = true +}