Browse Source

清除

master
maochaoying 2 years ago
parent
commit
f56e73ca9c
  1. 38
      src/components/LiquidHandle.vue
  2. 8
      src/components/Operator.vue

38
src/components/LiquidHandle.vue

@ -79,10 +79,10 @@
<van-field
type="number"
v-model="addLiquidVal"
:clickable="true"
:maxlength="4"
:maxlength="6"
readonly
@click.stop="numberKeyboardShow = true"
:formatter="formatter"
@click.stop="handleClickInput"
class="add_liquid_input"
/>
</div>
@ -151,7 +151,8 @@
<van-number-keyboard
v-model="addLiquidVal"
:show="numberKeyboardShow"
:maxlength="4"
@input="handleInput"
:maxlength="6"
@blur="numberKeyboardShow = false"
/>
</div>
@ -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
}
</script>
<style lang="scss" scoped>

8
src/components/Operator.vue

@ -698,7 +698,13 @@ onUnmounted(() => {
}
.time {
text-align: center;
padding: 10px;
padding: 2px 10px;
font-family: Source Han Sans CN;
font-size: 28px;
font-weight: bold;
line-height: normal;
letter-spacing: 0.1em;
color: #000;
}
.tube {
width: 292px;

Loading…
Cancel
Save