新型管道消毒机前端代码
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.

98 lines
2.8 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
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. airCompressorChannel: false,
  15. // 风机开关
  16. draughtFan: false,
  17. // 加热
  18. heatingStrip: false,
  19. sprinklerPump: 0,
  20. chargingPump: 0,
  21. airCompressorObj: {},
  22. airBlowerObj: {},
  23. heatingStripObj: {},
  24. waterImmersionSensor1: false,
  25. waterImmersionSensor2: false,
  26. }
  27. },
  28. // actions
  29. actions: {
  30. updateAirCompressorChannel(airCompressorChannel) {
  31. this.airCompressorChannel = airCompressorChannel
  32. },
  33. updateWaterImmersionSensor1(waterImmersionSensor1) {
  34. this.waterImmersionSensor1 = waterImmersionSensor1
  35. },
  36. updateWaterImmersionSensor2(waterImmersionSensor2) {
  37. this.waterImmersionSensor2 = waterImmersionSensor2
  38. },
  39. updateAirCompressorObj(airCompressorObj) {
  40. // const { io1, io2, currentVal } = airCompressorObj
  41. // if (io1 == 1 && io2 == 1) {
  42. // this.airCompressor = true
  43. // } else {
  44. // this.airCompressor = false
  45. // }
  46. this.airCompressorObj = airCompressorObj
  47. },
  48. updateAirBlowerObj(airBlowerObj) {
  49. // const { io1, io2, currentVal } = airBlowerObj
  50. // if (io1 == 1 && io2 == 1) {
  51. // this.draughtFan = true
  52. // } else {
  53. // this.draughtFan = false
  54. // }
  55. this.airBlowerObj = airBlowerObj
  56. },
  57. updateHeatingStripObj(heatingStripObj) {
  58. // const { io1, io2, currentVal } = heatingStripObj
  59. // if (io1 == 1 && io2 == 1) {
  60. // this.heatingStrip = true
  61. // } else {
  62. // this.heatingStrip = false
  63. // }
  64. this.heatingStripObj = heatingStripObj
  65. },
  66. updateHeatingStrip(heatingStrip) {
  67. this.heatingStrip = heatingStrip
  68. },
  69. updateSprinklerPump(sprinklerPump) {
  70. this.sprinklerPump = sprinklerPump
  71. if (sprinklerPump == 0) {
  72. this.sprayPeristalticPump = false
  73. } else {
  74. this.sprayPeristalticPump = true
  75. }
  76. },
  77. updateChargingPump(chargingPump) {
  78. this.chargingPump = chargingPump
  79. if (chargingPump == 0) {
  80. this.feedingPeristalticPumpStatus = false
  81. } else {
  82. this.feedingPeristalticPumpStatus = true
  83. }
  84. },
  85. updateFeedingPeristalticPumpStatus(status) {
  86. this.feedingPeristalticPumpStatus = status
  87. },
  88. updateSprayPeristalticPump(status) {
  89. this.sprayPeristalticPump = status
  90. },
  91. updateAirCompressor(status) {
  92. this.airCompressor = status
  93. },
  94. updateDraughtFan(status) {
  95. this.draughtFan = status
  96. },
  97. },
  98. })