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

85 lines
2.3 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
  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. }
  23. },
  24. // actions
  25. actions: {
  26. updateAirCompressorObj(airCompressorObj) {
  27. const { io1, io2, currentVal } = airCompressorObj
  28. if (io1 == 1 && io2 == 1) {
  29. this.airCompressor = true
  30. } else {
  31. this.airCompressor = false
  32. }
  33. this.airCompressorObj = airCompressorObj
  34. },
  35. updateAirBlowerObj(airBlowerObj) {
  36. const { io1, io2, currentVal } = airBlowerObj
  37. if (io1 == 1 && io2 == 1) {
  38. this.draughtFan = true
  39. } else {
  40. this.draughtFan = false
  41. }
  42. this.airBlowerObj = airBlowerObj
  43. },
  44. updateHeatingStripObj(heatingStripObj) {
  45. const { io1, io2, currentVal } = heatingStripObj
  46. if (io1 == 1 && io2 == 1) {
  47. this.heatingStrip = true
  48. } else {
  49. this.heatingStrip = false
  50. }
  51. this.heatingStripObj = heatingStripObj
  52. },
  53. updateHeatingStrip(heatingStrip) {
  54. this.heatingStrip = heatingStrip
  55. },
  56. updateSprinklerPump(sprinklerPump) {
  57. this.sprinklerPump = sprinklerPump
  58. if (sprinklerPump == 0) {
  59. this.sprayPeristalticPump = false
  60. } else {
  61. this.sprayPeristalticPump = true
  62. }
  63. },
  64. updateChargingPump(chargingPump) {
  65. this.chargingPump = chargingPump
  66. if (chargingPump == 0) {
  67. this.feedingPeristalticPumpStatus = false
  68. } else {
  69. this.feedingPeristalticPumpStatus = true
  70. }
  71. },
  72. updateFeedingPeristalticPumpStatus(status) {
  73. this.feedingPeristalticPumpStatus = status
  74. },
  75. updateSprayPeristalticPump(status) {
  76. this.sprayPeristalticPump = status
  77. },
  78. updateAirCompressor(status) {
  79. this.airCompressor = status
  80. },
  81. updateDraughtFan(status) {
  82. this.draughtFan = status
  83. },
  84. },
  85. })