大空间消毒机
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

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. import { defineStore } from 'pinia'
  2. export const useTestStore = defineStore({
  3. id: 'test', // id必填,且需要唯一
  4. // state
  5. state: () => {
  6. return {
  7. // 加液蠕动泵开关
  8. feedingPeristalticPumpStatus: false,
  9. // 喷液蠕动泵开关
  10. sprayPeristalticPump: false,
  11. // 空压机开关
  12. airCompressor: false,
  13. // 风机开关
  14. draughtFan: false,
  15. // 加热
  16. heatingStrip: false,
  17. sprinklerPump: 0,
  18. chargingPump: 0,
  19. airCompressorObj: {},
  20. airBlowerObj: {},
  21. heatingStripObj: {},
  22. waterImmersionSensor1: false,
  23. waterImmersionSensor2: false,
  24. }
  25. },
  26. // actions
  27. actions: {
  28. updateWaterImmersionSensor1(waterImmersionSensor1) {
  29. this.waterImmersionSensor1 = waterImmersionSensor1
  30. },
  31. updateWaterImmersionSensor2(waterImmersionSensor2) {
  32. this.waterImmersionSensor2 = waterImmersionSensor2
  33. },
  34. updateAirCompressorObj(airCompressorObj) {
  35. const { io1, io2, currentVal } = airCompressorObj
  36. if (io1 == 1 && io2 == 1) {
  37. this.airCompressor = true
  38. } else {
  39. this.airCompressor = false
  40. }
  41. this.airCompressorObj = airCompressorObj
  42. },
  43. updateAirBlowerObj(airBlowerObj) {
  44. const { io1, io2, currentVal } = airBlowerObj
  45. if (io1 == 1 && io2 == 1) {
  46. this.draughtFan = true
  47. } else {
  48. this.draughtFan = false
  49. }
  50. this.airBlowerObj = airBlowerObj
  51. },
  52. updateHeatingStripObj(heatingStripObj) {
  53. const { io1, io2, currentVal } = heatingStripObj
  54. if (io1 == 1 && io2 == 1) {
  55. this.heatingStrip = true
  56. } else {
  57. this.heatingStrip = false
  58. }
  59. this.heatingStripObj = heatingStripObj
  60. },
  61. updateHeatingStrip(heatingStrip) {
  62. this.heatingStrip = heatingStrip
  63. },
  64. updateSprinklerPump(sprinklerPump) {
  65. this.sprinklerPump = sprinklerPump
  66. if (sprinklerPump == 0) {
  67. this.sprayPeristalticPump = false
  68. } else {
  69. this.sprayPeristalticPump = true
  70. }
  71. },
  72. updateChargingPump(chargingPump) {
  73. this.chargingPump = chargingPump
  74. if (chargingPump == 0) {
  75. this.feedingPeristalticPumpStatus = false
  76. } else {
  77. this.feedingPeristalticPumpStatus = true
  78. }
  79. },
  80. updateFeedingPeristalticPumpStatus(status) {
  81. this.feedingPeristalticPumpStatus = status
  82. },
  83. updateSprayPeristalticPump(status) {
  84. this.sprayPeristalticPump = status
  85. },
  86. updateAirCompressor(status) {
  87. this.airCompressor = status
  88. },
  89. updateDraughtFan(status) {
  90. this.draughtFan = status
  91. },
  92. },
  93. })