Browse Source

test

master
maochaoying 2 years ago
parent
commit
2dce3ff05b
  1. 7
      src/components/LiquidHandle.vue
  2. 1
      src/components/Operator.vue
  3. 4
      src/components/Progress.vue
  4. 5
      src/mock/command.js
  5. 2
      src/pages/Home.vue
  6. 10
      src/store/modules/test.js
  7. 4
      src/store/modules/websocket.js

7
src/components/LiquidHandle.vue

@ -105,7 +105,12 @@ const isPopLiquidStatus = ref(false)
const startAdd = () => {
if (!isAddLiquidStatus.value) {
isAddLiquidStatus.value = true
webSocketStore.sendCommandMsg(startReplenishingFluidsJSON)
console.log(
startReplenishingFluidsJSON(parseInt(addLiquidVal.value.slice(0, -2))),
)
webSocketStore.sendCommandMsg(
startReplenishingFluidsJSON(parseInt(addLiquidVal.value.slice(0, -2))),
)
}
}

1
src/components/Operator.vue

@ -117,7 +117,6 @@ const logVal = ref(1)
const roomSize = ref(0)
watch(() => {
console.log(props.input)
roomSize.value = props.input.match(/\d+/g)
})

4
src/components/Progress.vue

@ -4,14 +4,14 @@
<div class="left_progress">
<div class="left_time_tag">剩余时间</div>
<p class="time">{{ operatorStore.estimatedRemainingTimeS }} S</p>
<div class="progress_bg">
<!-- <div class="progress_bg">
<div
class="pro"
:style="{
'--width': '325px',
}"
></div>
</div>
</div> -->
</div>
<div class="right_btns">
<div

5
src/mock/command.js

@ -99,9 +99,12 @@ export const someAirSwitchJSON = (num, flag) => {
}
}
export const startReplenishingFluidsJSON = {
export const startReplenishingFluidsJSON = stopAt => {
return {
command: 'startReplenishingFluids',
messageId: 'startReplenishingFluids',
stopAt,
}
}
export const stopReplenishingFluidsJSON = {

2
src/pages/Home.vue

@ -235,7 +235,7 @@ const changeShowOperator = flag => {
showOpertor.value = flag
}
const input = ref('')
const input = ref('0')
const onChange = a => {
input.value = a
}

10
src/store/modules/test.js

@ -55,9 +55,19 @@ export const useTestStore = defineStore({
},
updateSprinklerPump(sprinklerPump) {
this.sprinklerPump = sprinklerPump
if (sprinklerPump == 0) {
this.sprayPeristalticPump = false
} else {
this.sprayPeristalticPump = true
}
},
updateChargingPump(chargingPump) {
this.chargingPump = chargingPump
if (chargingPump == 0) {
this.feedingPeristalticPumpStatus = false
} else {
this.feedingPeristalticPumpStatus = true
}
},
updateFeedingPeristalticPumpStatus(status) {
this.feedingPeristalticPumpStatus = status

4
src/store/modules/websocket.js

@ -29,7 +29,7 @@ export const useWebSocketStore = defineStore({
const operatorStore = useOperatorStore()
init.connect()
init.ws.onmessage = function (ev) {
console.log(JSON.parse(ev.data))
// console.log(JSON.parse(ev.data))
const { ackcode, messageId } = JSON.parse(ev.data)
if (ackcode == 0) {
@ -129,7 +129,7 @@ export const useWebSocketStore = defineStore({
const testStore = useTestStore()
const settingStore = useSettingStore()
init.ws.onmessage = function (ev) {
console.log(JSON.parse(ev.data))
// console.log(JSON.parse(ev.data))
const { command } = JSON.parse(ev.data)
switch (command) {
case 'RealtimeSensorDataReport':

Loading…
Cancel
Save