You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
93 lines
2.6 KiB
93 lines
2.6 KiB
import { defineStore } from 'pinia'
|
|
export const useTestStore = defineStore({
|
|
id: 'test', // id必填,且需要唯一
|
|
// state
|
|
state: () => {
|
|
return {
|
|
// 加液蠕动泵开关
|
|
feedingPeristalticPumpStatus: false,
|
|
// 喷液蠕动泵开关
|
|
sprayPeristalticPump: false,
|
|
// 空压机开关
|
|
airCompressor: false,
|
|
// 风机开关
|
|
draughtFan: false,
|
|
// 加热
|
|
heatingStrip: false,
|
|
sprinklerPump: 0,
|
|
chargingPump: 0,
|
|
airCompressorObj: {},
|
|
airBlowerObj: {},
|
|
heatingStripObj: {},
|
|
waterImmersionSensor1: false,
|
|
waterImmersionSensor2: false,
|
|
}
|
|
},
|
|
// actions
|
|
actions: {
|
|
updateWaterImmersionSensor1(waterImmersionSensor1) {
|
|
this.waterImmersionSensor1 = waterImmersionSensor1
|
|
},
|
|
updateWaterImmersionSensor2(waterImmersionSensor2) {
|
|
this.waterImmersionSensor2 = waterImmersionSensor2
|
|
},
|
|
updateAirCompressorObj(airCompressorObj) {
|
|
// const { io1, io2, currentVal } = airCompressorObj
|
|
// if (io1 == 1 && io2 == 1) {
|
|
// this.airCompressor = true
|
|
// } else {
|
|
// this.airCompressor = false
|
|
// }
|
|
this.airCompressorObj = airCompressorObj
|
|
},
|
|
updateAirBlowerObj(airBlowerObj) {
|
|
// const { io1, io2, currentVal } = airBlowerObj
|
|
// if (io1 == 1 && io2 == 1) {
|
|
// this.draughtFan = true
|
|
// } else {
|
|
// this.draughtFan = false
|
|
// }
|
|
this.airBlowerObj = airBlowerObj
|
|
},
|
|
updateHeatingStripObj(heatingStripObj) {
|
|
// const { io1, io2, currentVal } = heatingStripObj
|
|
// if (io1 == 1 && io2 == 1) {
|
|
// this.heatingStrip = true
|
|
// } else {
|
|
// this.heatingStrip = false
|
|
// }
|
|
this.heatingStripObj = heatingStripObj
|
|
},
|
|
updateHeatingStrip(heatingStrip) {
|
|
this.heatingStrip = heatingStrip
|
|
},
|
|
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
|
|
},
|
|
updateSprayPeristalticPump(status) {
|
|
this.sprayPeristalticPump = status
|
|
},
|
|
updateAirCompressor(status) {
|
|
this.airCompressor = status
|
|
},
|
|
updateDraughtFan(status) {
|
|
this.draughtFan = status
|
|
},
|
|
},
|
|
})
|