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

70 lines
2.2 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. }
  21. },
  22. // actions
  23. actions: {
  24. updateAirCompressorChannelSelectVal(airCompressorChannelSelectVal) {
  25. this.airCompressorChannelSelectVal = airCompressorChannelSelectVal
  26. },
  27. updateAirCompressorValve1(airCompressorValve1) {
  28. this.airCompressorValve1 = airCompressorValve1
  29. },
  30. updateAirCompressorValve2(airCompressorValve2) {
  31. this.airCompressorValve2 = airCompressorValve2
  32. },
  33. updateAllPressure(allPressure) {
  34. this.allPressure = allPressure
  35. },
  36. updateAirInletProportionalInitVal(airInletProportionalInitVal) {
  37. this.airInletProportionalInitVal = airInletProportionalInitVal
  38. },
  39. updateAirOutletProportionalInitVal(airOutletProportionalInitVal) {
  40. this.airOutletProportionalInitVal = airOutletProportionalInitVal
  41. },
  42. updateAirInletProportionalValue(airInletProportionalValue) {
  43. this.airInletProportionalValue = airInletProportionalValue
  44. },
  45. updateAirOutletProportionalValue(airOutletProportionalValue) {
  46. this.airOutletProportionalValue = airOutletProportionalValue
  47. },
  48. updateCurrentAirPressure(currentAirPressure) {
  49. this.currentAirPressure = currentAirPressure
  50. },
  51. updateIsStartTest(isStartTest) {
  52. this.isStartTest = isStartTest
  53. },
  54. updateOldAirPressure(oldAirPressure) {
  55. this.oldAirPressure = oldAirPressure
  56. },
  57. },
  58. getters: {
  59. differenceValue(state) {
  60. if (state.isStartTest) {
  61. if (state.oldAirPressure != null && state.currentAirPressure != null) {
  62. return Math.abs(
  63. state.oldAirPressure - state.currentAirPressure,
  64. ).toFixed(1)
  65. }
  66. }
  67. return null
  68. },
  69. },
  70. })