A8000
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.

36 lines
1.1 KiB

8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
  1. import { defineStore } from 'pinia'
  2. import { ref } from 'vue'
  3. import type { TestTubeRack } from '../../types/Index'
  4. export const useTestTubeStore = defineStore(
  5. 'testTube',
  6. () => {
  7. const tubeRack = ref<TestTubeRack>({} as TestTubeRack)
  8. const bloodTypes = ref<{ key: string; name: string }[]>([])
  9. // const projectSettings = ref<Record<string, string>>({})
  10. const setTubeRack = (rack: TestTubeRack) => {
  11. tubeRack.value = rack
  12. }
  13. const setBloodTypes = (types: { key: string; name: string }[]) => {
  14. bloodTypes.value = types
  15. }
  16. // 设置指定试管架的项目设置
  17. // const setProjectSetting = (uuid: string, setting: string) => {
  18. // projectSettings.value[uuid] = setting
  19. // }
  20. // 获取指定试管架的项目设置,默认返回 '自动'
  21. // const getProjectSetting = (uuid: string): string => {
  22. // return projectSettings.value[uuid] || '自动'
  23. // }
  24. // const bloodTypes = ref([])
  25. return {
  26. tubeRack,
  27. setTubeRack,
  28. bloodTypes,
  29. setBloodTypes,
  30. }
  31. },
  32. {
  33. persist: true,
  34. },
  35. )