feat(health): Web 管理端设备数据集成补全 — Phase 2
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled

- 新增告警三页面(仪表盘/列表/规则)+ 设备管理菜单种子数据
- 新增设备管理后端 API(GET /devices + DELETE /devices/{id})
- 新增设备数据查看组件 DeviceReadingsTab(原始数据 + 小时聚合)
- 新增设备管理页面 DeviceManage(列表/筛选/解绑)
- 患者详情页新增设备数据 Tab
This commit is contained in:
iven
2026-04-29 06:28:30 +08:00
parent f6ccb8a35c
commit cac61637ce
14 changed files with 784 additions and 1 deletions

View File

@@ -0,0 +1,32 @@
import client from '../client';
import type { PaginatedResponse } from '../types';
// --- Types ---
export interface DeviceItem {
id: string;
patient_id: string;
device_id: string;
device_model: string;
device_type: string;
bound_at: string;
last_sync_at: string;
version: number;
}
// --- API ---
export const deviceApi = {
listDevices: (params?: {
patient_id?: string;
device_type?: string;
page?: number;
page_size?: number;
}) =>
client
.get('/health/devices', { params })
.then((r) => r.data.data as PaginatedResponse<DeviceItem>),
unbindDevice: (id: string, version: number) =>
client
.delete(`/health/devices/${id}`, { data: { version } })
.then((r) => r.data.data as DeviceItem),
};