import { defineStore } from 'pinia'; import type { PulseAnalysisModel } from '@/request/model'; export const useVisitor = defineStore('visitor', () => { const patientId = ref(); const resultId = ref(); const reportId = ref(); const pulseReport = shallowRef(); const $reset = () => { patientId.value = ''; resultId.value = ''; reportId.value = ''; pulseReport.value = void 0; }; function updatePulseReport(report: PulseAnalysisModel, patient?: string) { if (patientId.value?.toString() !== patient || !pulseReport.value?.results) { if (patient) patientId.value = patient; pulseReport.value = report; } } return { patientId, resultId, reportId, pulseReport, $reset, updatePulseReport }; });