|
|
@ -11,7 +11,7 @@ |
|
|
|
placeholder="设置加液蠕动泵转速" |
|
|
|
/> |
|
|
|
</p> |
|
|
|
<div class="btn">设置</div> |
|
|
|
<div class="btn" @click="setAddliquidVal">设置</div> |
|
|
|
</div> |
|
|
|
<div class="row_wrap"> |
|
|
|
<p class="title">喷液蠕动泵</p> |
|
|
@ -24,17 +24,42 @@ |
|
|
|
placeholder="设置喷液蠕动泵转速" |
|
|
|
/> |
|
|
|
</p> |
|
|
|
<div class="btn">设置</div> |
|
|
|
<div class="btn" @click="setSprayLiquidVal">设置</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup> |
|
|
|
import { ref } from 'vue' |
|
|
|
const addLiquidVal = ref(0) |
|
|
|
const sprayLiquidVal = ref(0) |
|
|
|
import { showSuccessToast, showFailToast } from 'vant' |
|
|
|
import { useSettingStore } from '@/store' |
|
|
|
const settingStore = useSettingStore() |
|
|
|
const addLiquidVal = ref(settingStore.addLiquidConfigVal) |
|
|
|
const sprayLiquidVal = ref(settingStore.sprayLiquidConfigVal) |
|
|
|
|
|
|
|
const formatter = value => value + '/g' |
|
|
|
const formatter = value => { |
|
|
|
if (value != 0) { |
|
|
|
var newVal = value.replace(/\b(0+)/gi, '') |
|
|
|
return newVal + '/g' |
|
|
|
} |
|
|
|
return '0/g' |
|
|
|
} |
|
|
|
|
|
|
|
const setAddliquidVal = () => { |
|
|
|
const val = parseInt( |
|
|
|
addLiquidVal.value.substring(0, addLiquidVal.value.length - 2), |
|
|
|
) |
|
|
|
settingStore.changeAddLiquidConfigVal(val) |
|
|
|
showSuccessToast('设置成功') |
|
|
|
} |
|
|
|
|
|
|
|
const setSprayLiquidVal = () => { |
|
|
|
const val = parseInt( |
|
|
|
sprayLiquidVal.value.substring(0, sprayLiquidVal.value.length - 2), |
|
|
|
) |
|
|
|
settingStore.changeSprayLiquidConfigVal(val) |
|
|
|
showSuccessToast('设置成功') |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|