|
|
@ -14,28 +14,34 @@ |
|
|
|
<p class="title">设置加液</p> |
|
|
|
</div> |
|
|
|
<div |
|
|
|
:class="isAddLiquidStatus ? 'btn mr active' : 'btn mr '" |
|
|
|
:class=" |
|
|
|
operatorStore.replenishingFluidsWorkState |
|
|
|
? 'btn mr active' |
|
|
|
: 'btn mr ' |
|
|
|
" |
|
|
|
v-if="tabType == 1" |
|
|
|
@click="stopAdd" |
|
|
|
> |
|
|
|
停止加液 |
|
|
|
</div> |
|
|
|
<div |
|
|
|
:class="isAddLiquidStatus ? 'btn' : 'btn active'" |
|
|
|
:class=" |
|
|
|
operatorStore.replenishingFluidsWorkState ? 'btn' : 'btn active' |
|
|
|
" |
|
|
|
v-if="tabType == 1" |
|
|
|
@click="startAdd" |
|
|
|
> |
|
|
|
开始加液 |
|
|
|
</div> |
|
|
|
<div |
|
|
|
:class="isPopLiquidStatus ? 'btn mr active' : 'btn mr '" |
|
|
|
:class="operatorStore.drainingWorkState ? 'btn mr active' : 'btn mr '" |
|
|
|
v-if="tabType == 2" |
|
|
|
@click="stopPop" |
|
|
|
> |
|
|
|
停止排液 |
|
|
|
</div> |
|
|
|
<div |
|
|
|
:class="isPopLiquidStatus ? 'btn' : 'btn active'" |
|
|
|
:class="operatorStore.drainingWorkState ? 'btn' : 'btn active'" |
|
|
|
v-if="tabType == 2" |
|
|
|
@click="startTabLiquid" |
|
|
|
> |
|
|
@ -92,15 +98,13 @@ |
|
|
|
<div |
|
|
|
class="liquid_column" |
|
|
|
:style="{ |
|
|
|
'--height': `${(disinfectantCapacity / 500) * 427}px`, |
|
|
|
'--height': `${(disinfectantCapacity / 5000) * 427}px`, |
|
|
|
}" |
|
|
|
></div> |
|
|
|
</div> |
|
|
|
<LiquidModal |
|
|
|
v-if="tabType == 2 && tipModalVisible" |
|
|
|
:hideTabLiquid="hideTabLiquid" |
|
|
|
:startPopFlag="startPopFlag" |
|
|
|
:isPopLiquidStatus="isPopLiquidStatus" |
|
|
|
/> |
|
|
|
<van-number-keyboard |
|
|
|
v-model="addLiquidVal" |
|
|
@ -135,12 +139,10 @@ const addLiquidVal = ref(1) |
|
|
|
const tipModalVisible = ref(false) |
|
|
|
const webSocketStore = useWebSocketStore() |
|
|
|
|
|
|
|
const isAddLiquidStatus = ref(false) |
|
|
|
const isPopLiquidStatus = ref(false) |
|
|
|
|
|
|
|
const startAdd = () => { |
|
|
|
if (!isAddLiquidStatus.value) { |
|
|
|
isAddLiquidStatus.value = true |
|
|
|
if (!operatorStore.replenishingFluidsWorkState) { |
|
|
|
console.log(startReplenishingFluidsJSON(parseInt(addLiquidVal.value))) |
|
|
|
webSocketStore.sendCommandMsg( |
|
|
|
startReplenishingFluidsJSON(parseInt(addLiquidVal.value)), |
|
|
@ -149,40 +151,23 @@ const startAdd = () => { |
|
|
|
} |
|
|
|
|
|
|
|
const stopAdd = () => { |
|
|
|
if (isAddLiquidStatus.value) { |
|
|
|
isAddLiquidStatus.value = false |
|
|
|
if (operatorStore.replenishingFluidsWorkState) { |
|
|
|
webSocketStore.sendCommandMsg(stopReplenishingFluidsJSON) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const stopPop = () => { |
|
|
|
if (isPopLiquidStatus.value) { |
|
|
|
if (operatorStore.drainingWorkState) { |
|
|
|
webSocketStore.sendCommandMsg(stopDrainingJSON) |
|
|
|
isPopLiquidStatus.value = false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const startPopFlag = () => { |
|
|
|
isPopLiquidStatus.value = true |
|
|
|
} |
|
|
|
|
|
|
|
const startTabLiquid = () => { |
|
|
|
if (!isPopLiquidStatus.value) { |
|
|
|
if (!operatorStore.drainingWorkState) { |
|
|
|
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' |
|
|
|
} |
|
|
|
return '0/g' |
|
|
|
} |
|
|
|
|
|
|
|
const hideTabLiquid = () => { |
|
|
|
tipModalVisible.value = false |
|
|
|
} |
|
|
|