feat: adopt solution and close ticket

This commit is contained in:
hailin
2026-07-03 16:36:46 +08:00
parent 40ab7ca548
commit 6132d383ae
7 changed files with 325 additions and 10 deletions

View File

@@ -66,11 +66,15 @@ export function TicketDetailPage({ ticketId }: { ticketId: number }) {
const [transitionError, setTransitionError] = React.useState('')
React.useEffect(() => {
refreshTicket()
refreshEvents()
}, [ticketId])
function refreshTicket() {
getTicket(ticketId)
.then(setTicket)
.catch((reason: unknown) => setError(reason instanceof Error ? reason.message : '加载失败'))
refreshEvents()
}, [ticketId])
}
function refreshEvents() {
listTicketEvents(ticketId).then(setEvents).catch(() => setEvents([]))
@@ -189,7 +193,13 @@ export function TicketDetailPage({ ticketId }: { ticketId: number }) {
side={
<>
<TicketMetaPanel ticket={ticket} />
<SolutionLinkPanel ticketId={ticket.id} />
<SolutionLinkPanel
ticketId={ticket.id}
onTicketChanged={() => {
refreshTicket()
refreshEvents()
}}
/>
<AppSection title="AI 支持分析" action={<Badge variant="ai">后续接入</Badge>}>
<div className="grid gap-3">
<div className="flex items-center gap-2 text-sm font-medium text-foreground">