diff --git a/apps/web/src/app/app-shell.tsx b/apps/web/src/app/app-shell.tsx index af1a7ad..efd9743 100644 --- a/apps/web/src/app/app-shell.tsx +++ b/apps/web/src/app/app-shell.tsx @@ -8,12 +8,13 @@ */ import { useState } from 'react'; import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; -import type { Session, TaskCard, TaskDetail } from '@contracts'; +import type { Session, TaskCard, TaskDetail, WorkOrderReply } from '@contracts'; import { listApprovalsForMeRoute, listMessagesRoute, listTasksRoute, logoutRoute, + replyWorkOrderRoute, sessionRoute, taskDetailRoute, } from '@contracts'; @@ -25,6 +26,7 @@ import { ReportDesk } from '@features/desk-report'; import { Ico } from '@web-shared/Ico.tsx'; import { call } from '@web-shared/typed-fetch.ts'; import { useChatWidth } from '@web-shared/useChatWidth.ts'; +import { EmptyState } from '@web-shared/desk/module-kit.tsx'; import { SURFACE_META, canSeeSurface } from '@web-shared/gov/surfaces.ts'; import { queryKeys } from './query.ts'; @@ -91,6 +93,17 @@ export function AppShell() { const me = session.data?.staff.name ?? '—'; + /** + * 工单回传 —— 视图区与对话区同一条口。 + * 回传后按键失效、画面由服务端重投影:前端不自行推演卡与工单的状态(§9.2)。 + */ + const replyOrder = useMutation({ + mutationFn: (reply: WorkOrderReply) => call(replyWorkOrderRoute, { body: { reply } }), + onSuccess: () => { + void queryClient.invalidateQueries({ queryKey: ['desk'] }); + }, + }); + return (
@@ -186,29 +199,72 @@ export function AppShell() { onPick={setTaskId} onCollapse={() => setCollapsed(true)} /> + {/* + 手上没任务时,三栏也得**站得住**:中栏与对话区各给自己的空态。 + 少一栏会让整个工位看着像坏了 —— 空态是常态,不是缺页。 + */} {detail.data !== undefined ? ( - + replyOrder.mutate(reply)} + /> ) : (
-
- - {tasks.isLoading ? '载入中…' : '还没有落到你工位的任务'} -
+ {tasks.isLoading ? ( +
+ + 载入中… +
+ ) : ( + + )}
)} - {detail.data !== undefined && ( - - )} - {detail.data !== undefined && ( -
- -
- )} + +
+ {detail.data !== undefined ? ( + undefined} /> + ) : ( +
+
+ + + + 任务助理 + Agent + 开一单即可对话 +
+
+ +
+
+
+