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.

214 lines
4.7 KiB

3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
  1. import { defineStore } from 'pinia'
  2. export const useSystemStore = defineStore('system', {
  3. state: (): System.SystemStore => ({
  4. systemStatus: {
  5. virtual: false,
  6. initComplete: false,
  7. selfTest: true,
  8. emergencyStop: false,
  9. door: {
  10. status: false,
  11. },
  12. gantryArm: {
  13. idle: true,
  14. },
  15. solutionArea: {
  16. idle: true,
  17. shaking: false,
  18. trayStatus: 0,
  19. solutionContainer: [
  20. {
  21. id: 1,
  22. type: 'solution',
  23. empty: false,
  24. full: false,
  25. },
  26. {
  27. id: 2,
  28. type: 'solution',
  29. empty: false,
  30. full: false,
  31. },
  32. {
  33. id: 3,
  34. type: 'solution',
  35. empty: false,
  36. full: false,
  37. },
  38. {
  39. id: 4,
  40. type: 'solution',
  41. empty: false,
  42. full: false,
  43. },
  44. {
  45. id: 5,
  46. type: 'solution',
  47. empty: false,
  48. full: false,
  49. },
  50. {
  51. id: 6,
  52. type: 'solution',
  53. empty: false,
  54. full: false,
  55. },
  56. {
  57. id: 7,
  58. type: 'solution',
  59. empty: false,
  60. full: false,
  61. },
  62. {
  63. id: 8,
  64. type: 'solution',
  65. empty: false,
  66. full: false,
  67. },
  68. {
  69. id: 9,
  70. type: 'neutralization',
  71. empty: false,
  72. full: false,
  73. },
  74. ],
  75. pumping: false,
  76. },
  77. heatModule: [
  78. {
  79. moduleCode: 'heat_module_01',
  80. trayStatus: 1,
  81. heating: false,
  82. capExist: false,
  83. temperature: 0,
  84. targetTemperature: 0,
  85. },
  86. {
  87. moduleCode: 'heat_module_02',
  88. trayStatus: 1,
  89. heating: false,
  90. capExist: false,
  91. temperature: 100,
  92. targetTemperature: 0,
  93. },
  94. {
  95. moduleCode: 'heat_module_03',
  96. trayStatus: 2,
  97. heating: true,
  98. capExist: false,
  99. temperature: 130,
  100. targetTemperature: 0,
  101. },
  102. {
  103. moduleCode: 'heat_module_04',
  104. trayStatus: 2,
  105. heating: false,
  106. capExist: false,
  107. temperature: 0,
  108. targetTemperature: 0,
  109. },
  110. {
  111. moduleCode: 'heat_module_05',
  112. trayStatus: 1,
  113. heating: false,
  114. capExist: false,
  115. temperature: 0,
  116. targetTemperature: 0,
  117. },
  118. {
  119. moduleCode: 'heat_module_06',
  120. trayStatus: 0,
  121. heating: false,
  122. capExist: false,
  123. temperature: 0,
  124. targetTemperature: 0,
  125. },
  126. ],
  127. tray: [
  128. {
  129. uuid: '',
  130. heatModuleId: 'heat_module_01',
  131. inSolutionArea: false,
  132. inHeatModule: true,
  133. tubes: [
  134. {
  135. addSolution: true,
  136. exists: true,
  137. },
  138. ],
  139. crafts: {
  140. state: 'READY',
  141. },
  142. },
  143. {
  144. uuid: '',
  145. heatModuleId: 'heat_module_02',
  146. inSolutionArea: false,
  147. inHeatModule: true,
  148. tubes: [
  149. {
  150. addSolution: true,
  151. exists: true,
  152. },
  153. ],
  154. crafts: {
  155. state: 'RUNNING',
  156. craft: {
  157. id: 1,
  158. name: '菱锌矿硫酸溶解法',
  159. steps: '',
  160. },
  161. },
  162. },
  163. {
  164. uuid: '',
  165. heatModuleId: 'heat_module_03',
  166. inSolutionArea: false,
  167. inHeatModule: true,
  168. tubes: [
  169. {
  170. addSolution: true,
  171. exists: true,
  172. },
  173. ],
  174. crafts: {
  175. state: 'ERROR',
  176. },
  177. },
  178. ],
  179. },
  180. systemUser: {
  181. username: '',
  182. },
  183. loginForm: {
  184. username: import.meta.env.FT_NODE_ENV !== 'prod' ? 'admin' : '',
  185. password: import.meta.env.FT_NODE_ENV !== 'prod' ? '123456' : '',
  186. },
  187. menuExpand: true,
  188. isDebug: import.meta.env.FT_NODE_ENV !== 'prod',
  189. streamVisible: false,
  190. systemList: [],
  191. }),
  192. actions: {
  193. updateDebug() {
  194. this.isDebug = !this.isDebug
  195. },
  196. updateSystemStatus(data: System.SystemStatus) {
  197. this.systemStatus = data
  198. },
  199. updateStreamVisible(bool: boolean) {
  200. this.streamVisible = bool
  201. },
  202. updateMenuExpand() {
  203. this.menuExpand = !this.menuExpand
  204. },
  205. updateSystemUser(data: System.SystemUser) {
  206. this.systemUser = data
  207. },
  208. pushSystemList(text: any) {
  209. this.systemList.push(text)
  210. },
  211. },
  212. persist: false,
  213. })