diff --git a/src/api/spo2data/index.ts b/src/api/spo2data/index.ts new file mode 100644 index 0000000..e8bc4dd --- /dev/null +++ b/src/api/spo2data/index.ts @@ -0,0 +1,47 @@ +import request from '@/config/axios' + +// 血氧数据 VO +export interface Spo2dataVO { + id: number // 主键ID,自增 + regid: string // 注册ID + examid: string // 检查ID + spo2value: number // 血氧饱和度(%) + weartime: Date // 佩戴时间 + measuretime: Date // 测量时间 + createtime: Date // 创建时间 + updatetime: Date // 更新时间 + pulsevalue: string // 脉率(bpm) +} + +// 血氧数据 API +export const Spo2dataApi = { + // 查询血氧数据分页 + getSpo2dataPage: async (params: any) => { + return await request.get({ url: `/system/spo2data/page`, params }) + }, + + // 查询血氧数据详情 + getSpo2data: async (id: number) => { + return await request.get({ url: `/system/spo2data/get?id=` + id }) + }, + + // 新增血氧数据 + createSpo2data: async (data: Spo2dataVO) => { + return await request.post({ url: `/system/spo2data/create`, data }) + }, + + // 修改血氧数据 + updateSpo2data: async (data: Spo2dataVO) => { + return await request.put({ url: `/system/spo2data/update`, data }) + }, + + // 删除血氧数据 + deleteSpo2data: async (id: number) => { + return await request.delete({ url: `/system/spo2data/delete?id=` + id }) + }, + + // 导出血氧数据 Excel + exportSpo2data: async (params) => { + return await request.download({ url: `/system/spo2data/export-excel`, params }) + }, +} \ No newline at end of file diff --git a/src/api/spo2info/index.ts b/src/api/spo2info/index.ts index f6ccb8f..bf23655 100644 --- a/src/api/spo2info/index.ts +++ b/src/api/spo2info/index.ts @@ -75,5 +75,17 @@ export const Spo2infoApi = { url: `/system/spo2info/update-wearstarttime`, data }) + }, + + // 获取血氧信息统计数据 + getSpO2Analysis: async (regid: string, examid: string, weartime: string) => { + return await request.get({ + url: `/system/spo2info/analysis`, + params: { + regid, + examid, + weartime + } + }) } } diff --git a/src/components/SpO2AnalysisDialog/index.ts b/src/components/SpO2AnalysisDialog/index.ts new file mode 100644 index 0000000..ca209ac --- /dev/null +++ b/src/components/SpO2AnalysisDialog/index.ts @@ -0,0 +1,23 @@ +import SpO2AnalysisDialog from './index.vue' +import type { + PatientInfo, + SpO2Stats, + DataStats, + DiagnosisForm, + SaveData, + SpO2AnalysisDialogProps, + SpO2AnalysisDialogEmits +} from './types' + +export { + SpO2AnalysisDialog, + type PatientInfo, + type SpO2Stats, + type DataStats, + type DiagnosisForm, + type SaveData, + type SpO2AnalysisDialogProps, + type SpO2AnalysisDialogEmits +} + +export default SpO2AnalysisDialog diff --git a/src/components/SpO2AnalysisDialog/index.vue b/src/components/SpO2AnalysisDialog/index.vue new file mode 100644 index 0000000..b5cbd78 --- /dev/null +++ b/src/components/SpO2AnalysisDialog/index.vue @@ -0,0 +1,1526 @@ + + + + + diff --git a/src/components/SpO2AnalysisDialog/types.ts b/src/components/SpO2AnalysisDialog/types.ts new file mode 100644 index 0000000..462077f --- /dev/null +++ b/src/components/SpO2AnalysisDialog/types.ts @@ -0,0 +1,64 @@ +// 患者信息接口 +export interface PatientInfo { + id?: string + name?: string + gender?: string + age?: number + examid?: string + weartime?: string | Date + devicename?: string + deviceid?: string +} + +// 血氧统计数据接口 +export interface SpO2Stats { + averageSpO2?: number + minSpO2?: number + maxSpO2?: number + lowOxygenTime?: number + oxygenDesaturationEvents?: number + averageDesaturationDuration?: number +} + +// 数据统计接口 +export interface DataStats { + totalDuration?: number + dataPoints?: number + sampleRate?: number + quality?: 'excellent' | 'good' | 'fair' | 'poor' + dataCompleteness?: number + signalQuality?: number +} + +// 诊断结论接口 +export interface DiagnosisForm { + conclusion: string +} + +// 保存数据接口 +export interface SaveData { + patientId: string + diagnosis: DiagnosisForm + stats: { + spo2: SpO2Stats + data: DataStats + } + timestamp: Date +} + +// 组件Props接口 +export interface SpO2AnalysisDialogProps { + modelValue: boolean + patientData?: PatientInfo + analysisData?: { + spo2Stats?: SpO2Stats + dataStats?: DataStats + } +} + +// 组件Emits接口 +export interface SpO2AnalysisDialogEmits { + 'update:modelValue': [value: boolean] + save: [data: SaveData] + close: [] +} diff --git a/src/components/index.ts b/src/components/index.ts index 4d030c3..01c70a8 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -1,6 +1,8 @@ import type { App } from 'vue' import { Icon } from './Icon' +import SpO2AnalysisDialog from './SpO2AnalysisDialog' export const setupGlobCom = (app: App): void => { app.component('Icon', Icon) + app.component('SpO2AnalysisDialog', SpO2AnalysisDialog) } diff --git a/src/views/analysis/SpO₂.vue b/src/views/analysis/SpO₂.vue index 1306cdb..0a2c0fb 100644 --- a/src/views/analysis/SpO₂.vue +++ b/src/views/analysis/SpO₂.vue @@ -283,6 +283,13 @@ @confirm="handlePatientConfirm" @cancel="handlePatientCancel" /> + + +