From 2de36c3da6b2ab79306a72efd5713f332bda585c Mon Sep 17 00:00:00 2001 From: hailin Date: Thu, 2 Jul 2026 15:28:19 +0800 Subject: [PATCH] refactor: align select composition with shadcn --- .../design-system/DesignSystemPreview.tsx | 10 ++++--- .../features/solutions/SolutionCreatePage.tsx | 8 +++-- .../features/solutions/SolutionListPage.tsx | 10 ++++--- .../src/features/tickets/TicketComments.tsx | 8 +++-- .../src/features/tickets/TicketCreatePage.tsx | 12 ++++---- .../src/features/tickets/TicketFilterBar.tsx | 30 +++++++++++-------- 6 files changed, 46 insertions(+), 32 deletions(-) diff --git a/frontend/src/features/design-system/DesignSystemPreview.tsx b/frontend/src/features/design-system/DesignSystemPreview.tsx index fb3d94e..160e2cb 100644 --- a/frontend/src/features/design-system/DesignSystemPreview.tsx +++ b/frontend/src/features/design-system/DesignSystemPreview.tsx @@ -10,7 +10,7 @@ import { Badge } from '@/components/ui/badge' import { Button } from '@/components/ui/button' import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' import { Input } from '@/components/ui/input' -import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select' +import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select' type PreviewRow = { id: number @@ -75,9 +75,11 @@ export function DesignSystemPreview() { - 全部状态 - 待处理 - 处理中 + + 全部状态 + 待处理 + 处理中 + diff --git a/frontend/src/features/solutions/SolutionCreatePage.tsx b/frontend/src/features/solutions/SolutionCreatePage.tsx index 09cb77a..c546863 100644 --- a/frontend/src/features/solutions/SolutionCreatePage.tsx +++ b/frontend/src/features/solutions/SolutionCreatePage.tsx @@ -7,7 +7,7 @@ import { AppSection } from '@/components/app/AppSection' import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert' import { Button } from '@/components/ui/button' import { Input } from '@/components/ui/input' -import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select' +import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select' import { Textarea } from '@/components/ui/textarea' import { getTicket } from '@/features/tickets/api' @@ -114,8 +114,10 @@ export function SolutionCreatePage() { - 草稿 - 发布 + + 草稿 + 发布 + diff --git a/frontend/src/features/solutions/SolutionListPage.tsx b/frontend/src/features/solutions/SolutionListPage.tsx index 212deba..dcc824b 100644 --- a/frontend/src/features/solutions/SolutionListPage.tsx +++ b/frontend/src/features/solutions/SolutionListPage.tsx @@ -9,7 +9,7 @@ import { Badge } from '@/components/ui/badge' import { Card, CardContent } from '@/components/ui/card' import { Button } from '@/components/ui/button' import { Input } from '@/components/ui/input' -import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select' +import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select' import { formatDateTime } from '@/lib/format' import { listSolutions } from './api' @@ -117,9 +117,11 @@ export function SolutionListPage() { - 全部状态 - 已发布 - 草稿 + + 全部状态 + 已发布 + 草稿 + diff --git a/frontend/src/features/tickets/TicketComments.tsx b/frontend/src/features/tickets/TicketComments.tsx index 41661ec..296def9 100644 --- a/frontend/src/features/tickets/TicketComments.tsx +++ b/frontend/src/features/tickets/TicketComments.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import { AppSection } from '@/components/app/AppSection' import { Button } from '@/components/ui/button' -import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select' +import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select' import { Textarea } from '@/components/ui/textarea' import { addTicketComment } from './api' @@ -37,8 +37,10 @@ export function TicketComments({ ticketId, onCommentAdded }: TicketCommentsProps - 内部备注 - 用户可见回复 + + 内部备注 + 用户可见回复 +