import { defineStore } from 'pinia' import { ref } from 'vue' import type { TestTubeRack } from '../../types/Index' export const useTestTubeStore = defineStore( 'testTube', () => { const tubeRack = ref({} as TestTubeRack) const bloodTypes = ref<{ key: string; name: string }[]>([]) // const projectSettings = ref>({}) const setTubeRack = (rack: TestTubeRack) => { tubeRack.value = rack } const setBloodTypes = (types: { key: string; name: string }[]) => { bloodTypes.value = types } // 设置指定试管架的项目设置 // const setProjectSetting = (uuid: string, setting: string) => { // projectSettings.value[uuid] = setting // } // 获取指定试管架的项目设置,默认返回 '自动' // const getProjectSetting = (uuid: string): string => { // return projectSettings.value[uuid] || '自动' // } // const bloodTypes = ref([]) return { tubeRack, setTubeRack, bloodTypes, setBloodTypes, } }, { persist: true, }, )