feat(miniprogram): 行动收件箱 — Service + 医生端列表页 + 半屏弹窗
- action-inbox.ts: listActionItems + getActionThread API 调用 - doctor/action-inbox: 待办列表页,Tab 筛选 + 半屏线程弹窗 + 操作按钮 - app.config.ts: 注册 action-inbox 页面到 doctor 子包
This commit is contained in:
60
apps/miniprogram/src/services/action-inbox.ts
Normal file
60
apps/miniprogram/src/services/action-inbox.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
import { api } from './request';
|
||||
|
||||
export interface ActionItem {
|
||||
id: string;
|
||||
action_type: string;
|
||||
priority: string;
|
||||
status: string;
|
||||
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: string;
|
||||
detail?: string;
|
||||
timestamp?: string;
|
||||
link_to?: string;
|
||||
}
|
||||
|
||||
export interface ActionDef {
|
||||
key: string;
|
||||
label: string;
|
||||
variant: string;
|
||||
api_endpoint?: string;
|
||||
}
|
||||
|
||||
export interface ThreadResponse {
|
||||
action_item: ActionItem;
|
||||
thread: ThreadEvent[];
|
||||
available_actions: ActionDef[];
|
||||
}
|
||||
|
||||
interface PaginatedData {
|
||||
data: ActionItem[];
|
||||
total: number;
|
||||
}
|
||||
|
||||
export async function listActionItems(params?: {
|
||||
status?: string;
|
||||
type?: string;
|
||||
page?: number;
|
||||
page_size?: number;
|
||||
}) {
|
||||
return api.get<PaginatedData>(
|
||||
'/health/action-inbox',
|
||||
params as Record<string, string | number | undefined>,
|
||||
);
|
||||
}
|
||||
|
||||
export async function getActionThread(sourceRef: string) {
|
||||
return api.get<ThreadResponse>(
|
||||
`/health/action-inbox/${encodeURIComponent(sourceRef)}/thread`,
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user