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

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