管道式消毒机
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.

78 lines
2.5 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
  1. import { defineStore } from 'pinia'
  2. export const useSealStore = defineStore({
  3. id: 'seal', // id必填,且需要唯一
  4. // state
  5. state: () => {
  6. return {
  7. showPressure: false,
  8. // 0~800kPa
  9. currentAirPressure: 0,
  10. isStartTest: false,
  11. oldAirPressure: null,
  12. airInletProportionalValue: 0,
  13. airOutletProportionalValue: 0,
  14. // 初始化的机器阀门信息
  15. airInletProportionalInitVal: 0,
  16. airOutletProportionalInitVal: 0,
  17. allPressure: [0, 0, 0, 0],
  18. airCompressorValve1: 0,
  19. airCompressorValve2: 0,
  20. airCompressorChannelSelectVal: 1,
  21. AirProportionalValveIsBusy: 1,
  22. }
  23. },
  24. // actions
  25. actions: {
  26. updateShowPressure(showPressure) {
  27. this.showPressure = showPressure
  28. },
  29. updateAirProportionalValveIsBusy(AirProportionalValveIsBusy) {
  30. this.AirProportionalValveIsBusy = AirProportionalValveIsBusy
  31. },
  32. updateAirCompressorChannelSelectVal(airCompressorChannelSelectVal) {
  33. this.airCompressorChannelSelectVal = airCompressorChannelSelectVal
  34. },
  35. updateAirCompressorValve1(airCompressorValve1) {
  36. this.airCompressorValve1 = airCompressorValve1
  37. },
  38. updateAirCompressorValve2(airCompressorValve2) {
  39. this.airCompressorValve2 = airCompressorValve2
  40. },
  41. updateAllPressure(allPressure) {
  42. this.allPressure = allPressure
  43. },
  44. updateAirInletProportionalInitVal(airInletProportionalInitVal) {
  45. this.airInletProportionalInitVal = airInletProportionalInitVal
  46. },
  47. updateAirOutletProportionalInitVal(airOutletProportionalInitVal) {
  48. this.airOutletProportionalInitVal = airOutletProportionalInitVal
  49. },
  50. updateAirInletProportionalValue(airInletProportionalValue) {
  51. this.airInletProportionalValue = airInletProportionalValue
  52. },
  53. updateAirOutletProportionalValue(airOutletProportionalValue) {
  54. this.airOutletProportionalValue = airOutletProportionalValue
  55. },
  56. updateCurrentAirPressure(currentAirPressure) {
  57. this.currentAirPressure = currentAirPressure
  58. },
  59. updateIsStartTest(isStartTest) {
  60. this.isStartTest = isStartTest
  61. },
  62. updateOldAirPressure(oldAirPressure) {
  63. this.oldAirPressure = oldAirPressure
  64. },
  65. },
  66. getters: {
  67. differenceValue(state) {
  68. if (state.isStartTest) {
  69. if (state.oldAirPressure != null && state.currentAirPressure != null) {
  70. return Math.abs(
  71. state.oldAirPressure - state.currentAirPressure,
  72. ).toFixed(1)
  73. }
  74. }
  75. return null
  76. },
  77. },
  78. })