feat(web): 行动收件箱前端 — API + Drawer + 列表页 + 路由

- actionInbox.ts: API 调用层,list + getThread
- ActionThreadDrawer: 上下文线程抽屉,时间线 + 操作按钮
- ActionInbox: 列表页,Tabs 筛选 + 分页 + 点击打开 Drawer
- App.tsx: 注册 /health/action-inbox 路由
This commit is contained in:
iven
2026-05-01 16:36:24 +08:00
parent 758bc210e1
commit 81dd3d2bda
4 changed files with 466 additions and 0 deletions

View File

@@ -0,0 +1,66 @@
import client from '../client';
import type { PaginatedResponse } from '../types';
export type ActionType = 'ai_suggestion' | 'alert' | 'followup' | 'data_anomaly';
export type ActionPriority = 'urgent' | 'high' | 'medium' | 'low';
export type ActionStatus = 'pending' | 'in_progress' | 'completed' | 'dismissed';
export interface ActionItem {
id: string;
action_type: ActionType;
priority: ActionPriority;
status: ActionStatus;
title: string;
summary: string;
patient_id: string;
patient_name: string;
source_ref: string;
created_at: string;
updated_at: string;
}
export interface ThreadEvent {
step: string;
label: string;
status: ActionStatus;
detail?: string;
timestamp?: string;
operator?: string;
link_to?: string;
}
export interface ActionDefinition {
key: string;
label: string;
variant: 'primary' | 'danger' | 'default';
api_endpoint?: string;
}
export interface ThreadResponse {
action_item: ActionItem;
thread: ThreadEvent[];
available_actions: ActionDefinition[];
}
export const actionInboxApi = {
list: async (params?: {
status?: string;
type?: string;
page?: number;
page_size?: number;
}) => {
const { data } = await client.get<{
success: boolean;
data: PaginatedResponse<ActionItem>;
}>('/health/action-inbox', { params });
return data.data;
},
getThread: async (sourceRef: string) => {
const { data } = await client.get<{
success: boolean;
data: ThreadResponse;
}>(`/health/action-inbox/${encodeURIComponent(sourceRef)}/thread`);
return data.data;
},
};