修改动态血氧功能

This commit is contained in:
lxd 2025-07-24 14:20:20 +08:00
parent a72825258a
commit 5d1d8e7fd3
7 changed files with 1694 additions and 2 deletions

47
src/api/spo2data/index.ts Normal file
View File

@ -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 })
},
}

View File

@ -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
}
})
}
}

View File

@ -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

File diff suppressed because it is too large Load Diff

View File

@ -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: []
}

View File

@ -1,6 +1,8 @@
import type { App } from 'vue'
import { Icon } from './Icon'
import SpO2AnalysisDialog from './SpO2AnalysisDialog'
export const setupGlobCom = (app: App<Element>): void => {
app.component('Icon', Icon)
app.component('SpO2AnalysisDialog', SpO2AnalysisDialog)
}

View File

@ -283,6 +283,13 @@
@confirm="handlePatientConfirm"
@cancel="handlePatientCancel"
/>
<!-- 血氧分析弹窗 -->
<SpO2AnalysisDialog
v-model="analysisDialogVisible"
:patient-data="currentPatient"
@save="handleAnalysisSave"
/>
</template>
<script setup lang="ts">
@ -304,6 +311,10 @@ const queryFormRef = ref()
const patientSelectRef = ref()
const Profilevo = ref<any>({})
//
const analysisDialogVisible = ref(false)
const currentPatient = ref<any>({})
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
@ -398,8 +409,15 @@ const cancelWearTimeChange = (row: any) => {
//
const handleAnalysis = (row: any) => {
// TODO:
ElMessage.info('分析功能待实现')
currentPatient.value = row
analysisDialogVisible.value = true
}
//
const handleAnalysisSave = (data: any) => {
console.log('保存分析结果:', data)
ElMessage.success('分析结果已保存')
getList() //
}
//
const handleView = (row: any) => {