Browse Source

测试

master
maochaoying 2 years ago
parent
commit
ede6fa043d
  1. 8
      .env
  2. 8
      src/components/Test.vue
  3. 8
      src/mock/command.js
  4. 8
      src/store/modules/setting.js
  5. 4
      src/store/modules/websocket.js

8
.env

@ -1,5 +1,5 @@
# VITE_BASE_WS1_URL=ws://192.168.8.10:19001/
# VITE_BASE_WS2_URL=ws://192.168.8.10:19002/
VITE_BASE_WS1_URL=ws://192.168.8.10:19001/
VITE_BASE_WS2_URL=ws://192.168.8.10:19002/
VITE_BASE_WS1_URL=ws://127.0.0.1:19001/
VITE_BASE_WS2_URL=ws://127.0.0.1:19002/
# VITE_BASE_WS1_URL=ws://127.0.0.1:19001/
# VITE_BASE_WS2_URL=ws://127.0.0.1:19002/

8
src/components/Test.vue

@ -17,7 +17,7 @@
<div class="btn_wrap"> <div class="btn_wrap">
<div <div
:class=" :class="
settingStore.addLiquidConfigVal > 0
settingStore.chargingPumpRPM > 0
? 'open success style-btn' ? 'open success style-btn'
: 'open style-btn' : 'open style-btn'
" "
@ -27,7 +27,7 @@
</div> </div>
<div <div
:class=" :class="
settingStore.addLiquidConfigVal < 0
settingStore.chargingPumpRPM < 0
? 'open success style-btn' ? 'open success style-btn'
: 'open style-btn' : 'open style-btn'
" "
@ -61,7 +61,7 @@
<div class="btn_wrap"> <div class="btn_wrap">
<div <div
:class=" :class="
settingStore.sprayLiquidConfigVal > 0
settingStore.sprinklerPumpRPM > 0
? 'open success style-btn' ? 'open success style-btn'
: 'open style-btn' : 'open style-btn'
" "
@ -71,7 +71,7 @@
</div> </div>
<div <div
:class=" :class="
settingStore.sprayLiquidConfigVal < 0
settingStore.sprinklerPumpRPM < 0
? 'open success style-btn' ? 'open success style-btn'
: 'open style-btn' : 'open style-btn'
" "

8
src/mock/command.js

@ -142,8 +142,8 @@ export const addLiquidCtrlJSON = (num, speed, power) => {
export const test_replenishingFluidsPumpCtrJSON = (ctrl, speed) => { export const test_replenishingFluidsPumpCtrJSON = (ctrl, speed) => {
return { return {
command: 'test_replenishingFluidsPumpCtr',
messageId: 'test_replenishingFluidsPumpCtr',
command: 'test_replenishingFluidsPumpCtrl',
messageId: 'test_replenishingFluidsPumpCtrl',
ctrl, ctrl,
speed, speed,
} }
@ -151,8 +151,8 @@ export const test_replenishingFluidsPumpCtrJSON = (ctrl, speed) => {
export const sprayLiquidPump_open_for_testJSON = (ctrl, speed) => { export const sprayLiquidPump_open_for_testJSON = (ctrl, speed) => {
return { return {
command: 'sprayLiquidPump_open_for_test',
messageId: 'sprayLiquidPump_open_for_test',
command: 'test_sprayLiquidPumpCtrl',
messageId: 'test_sprayLiquidPumpCtrl',
ctrl, ctrl,
speed, speed,
} }

8
src/store/modules/setting.js

@ -28,10 +28,18 @@ export const useSettingStore = defineStore({
// 所有setting的对象数据 // 所有setting的对象数据
allSettingList: [], allSettingList: [],
deviceIp: '127.0.0.1', deviceIp: '127.0.0.1',
chargingPumpRPM: 0,
sprinklerPumpRPM: 0,
} }
}, },
// actions // actions
actions: { actions: {
updateChargingPumpRPM(chargingPumpRPM) {
this.chargingPumpRPM = chargingPumpRPM
},
updateSprinklerPumpRPM(sprinklerPumpRPM) {
this.sprinklerPumpRPM = sprinklerPumpRPM
},
updateStopedHumi(stoped_humi) { updateStopedHumi(stoped_humi) {
this.stoped_humi = stoped_humi this.stoped_humi = stoped_humi
}, },

4
src/store/modules/websocket.js

@ -75,12 +75,16 @@ export const useWebSocketStore = defineStore({
chargingPump, chargingPump,
waterImmersionSensor1, waterImmersionSensor1,
waterImmersionSensor2, waterImmersionSensor2,
chargingPumpRPM,
sprinklerPumpRPM,
} = sensor_data } = sensor_data
if ([1, 2, 3, 4].includes(disinfectionWorkState)) { if ([1, 2, 3, 4].includes(disinfectionWorkState)) {
operatorStore.updateShowStartReady(false) operatorStore.updateShowStartReady(false)
} else { } else {
operatorStore.updateStopReady(false) operatorStore.updateStopReady(false)
} }
settingStore.updateChargingPumpRPM(chargingPumpRPM)
settingStore.updateSprinklerPumpRPM(sprinklerPumpRPM)
operatorStore.updateDrainingWorkState(drainingWorkState) operatorStore.updateDrainingWorkState(drainingWorkState)
operatorStore.updateReplenishingFluidsWorkState( operatorStore.updateReplenishingFluidsWorkState(
replenishingFluidsWorkState, replenishingFluidsWorkState,

Loading…
Cancel
Save