即将接入}
>
diff --git a/frontend/src/features/tickets/TicketDetailPage.tsx b/frontend/src/features/tickets/TicketDetailPage.tsx
index 2dc398c..109bfb6 100644
--- a/frontend/src/features/tickets/TicketDetailPage.tsx
+++ b/frontend/src/features/tickets/TicketDetailPage.tsx
@@ -22,7 +22,7 @@ import type { Ticket, TicketStatus } from './types'
const NEXT_STATUSES: Record = {
pending_info: ['pending', 'closed'],
pending: ['in_progress', 'closed'],
- in_progress: ['pending_confirm', 'resolved', 'closed'],
+ in_progress: ['pending_confirm'],
pending_confirm: ['resolved', 'in_progress', 'closed'],
resolved: ['closed'],
closed: []
@@ -36,10 +36,18 @@ const STATUS_ACTIONS: Partial(null)
const [error, setError] = React.useState('')
const [targetStatus, setTargetStatus] = React.useState(null)
+ const [targetActionLabel, setTargetActionLabel] = React.useState('')
const [transitionDialogOpen, setTransitionDialogOpen] = React.useState(false)
const [transitionError, setTransitionError] = React.useState('')
@@ -51,6 +59,9 @@ export function TicketDetailPage({ ticketId }: { ticketId: number }) {
function openTransition(status: TicketStatus) {
setTargetStatus(status)
+ if (ticket) {
+ setTargetActionLabel(getStatusActionLabel(ticket.status, status))
+ }
setTransitionError('')
setTransitionDialogOpen(true)
}
@@ -107,7 +118,7 @@ export function TicketDetailPage({ ticketId }: { ticketId: number }) {
onClick={() => openTransition(status)}
>
{Icon ? : null}
- {action?.label ?? '调整状态'}
+ {getStatusActionLabel(ticket.status, status)}
)
})}
@@ -132,7 +143,7 @@ export function TicketDetailPage({ ticketId }: { ticketId: number }) {
>
}
>
-
+
{ticket.description}
@@ -142,6 +153,7 @@ export function TicketDetailPage({ ticketId }: { ticketId: number }) {
diff --git a/frontend/src/features/tickets/TicketListPage.tsx b/frontend/src/features/tickets/TicketListPage.tsx
index 3346128..9b8c302 100644
--- a/frontend/src/features/tickets/TicketListPage.tsx
+++ b/frontend/src/features/tickets/TicketListPage.tsx
@@ -198,7 +198,6 @@ export function TicketListPage() {
(window.location.hash = '/tickets/new')}>
diff --git a/frontend/src/features/tickets/TicketMetaPanel.tsx b/frontend/src/features/tickets/TicketMetaPanel.tsx
index 5a8bfe5..a2c2eed 100644
--- a/frontend/src/features/tickets/TicketMetaPanel.tsx
+++ b/frontend/src/features/tickets/TicketMetaPanel.tsx
@@ -2,7 +2,7 @@ import { AppField } from '@/components/app/AppField'
import { AppPriorityBadge } from '@/components/app/AppPriorityBadge'
import { AppStatusBadge } from '@/components/app/AppStatusBadge'
import { Badge } from '@/components/ui/badge'
-import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'
+import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
import { Separator } from '@/components/ui/separator'
import type { Ticket } from './types'
@@ -20,7 +20,6 @@ export function TicketMetaPanel({ ticket }: TicketMetaPanelProps) {
工单属性
- 当前处理状态和关键上下文。
diff --git a/frontend/src/features/tickets/TicketStatusTimeline.tsx b/frontend/src/features/tickets/TicketStatusTimeline.tsx
index fad7337..14d76fb 100644
--- a/frontend/src/features/tickets/TicketStatusTimeline.tsx
+++ b/frontend/src/features/tickets/TicketStatusTimeline.tsx
@@ -13,7 +13,7 @@ const EVENT_LABELS = [
export function TicketStatusTimeline({ ticket }: { ticket: Ticket }) {
return (
-
+
diff --git a/frontend/src/features/tickets/TicketTransitionDialog.tsx b/frontend/src/features/tickets/TicketTransitionDialog.tsx
index 8a71c37..95c2b22 100644
--- a/frontend/src/features/tickets/TicketTransitionDialog.tsx
+++ b/frontend/src/features/tickets/TicketTransitionDialog.tsx
@@ -23,6 +23,7 @@ const STATUS_ACTION_LABELS: Partial> = {
type TicketTransitionDialogProps = {
open: boolean
status: TicketStatus | null
+ actionLabel?: string
onOpenChange: (open: boolean) => void
onSubmit: (status: TicketStatus, remark: string) => Promise
}
@@ -30,12 +31,13 @@ type TicketTransitionDialogProps = {
export function TicketTransitionDialog({
open,
status,
+ actionLabel: customActionLabel,
onOpenChange,
onSubmit
}: TicketTransitionDialogProps) {
const [remark, setRemark] = React.useState('')
const [submitting, setSubmitting] = React.useState(false)
- const actionLabel = status ? STATUS_ACTION_LABELS[status] ?? '调整状态' : '调整状态'
+ const actionLabel = customActionLabel ?? (status ? STATUS_ACTION_LABELS[status] ?? '调整状态' : '调整状态')
React.useEffect(() => {
if (!open) {