feat(health): Web 管理端设备数据集成补全 — Phase 2
- 新增告警三页面(仪表盘/列表/规则)+ 设备管理菜单种子数据
- 新增设备管理后端 API(GET /devices + DELETE /devices/{id})
- 新增设备数据查看组件 DeviceReadingsTab(原始数据 + 小时聚合)
- 新增设备管理页面 DeviceManage(列表/筛选/解绑)
- 患者详情页新增设备数据 Tab
This commit is contained in:
32
apps/web/src/api/health/devices.ts
Normal file
32
apps/web/src/api/health/devices.ts
Normal 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),
|
||||
};
|
||||
Reference in New Issue
Block a user