From 3ef9cc2ebeaffc525568df70252204585d796a5b Mon Sep 17 00:00:00 2001 From: Clas Wen Date: Thu, 25 Sep 2025 19:37:34 +0800 Subject: [PATCH] Make RepairAdmin page responsive with mobile card layout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add responsive container layout with mobile-first approach - Implement mobile card component for better touch interaction - Switch between table (desktop) and cards (mobile) at sm breakpoint - Make header section responsive with stacked layout on mobile - Enhance drawer with full-screen mobile support - Add mobile-optimized filter controls - Improve touch targets and spacing for mobile devices - Fix global CSS button border issue for card styling 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- src/pages/repair/RepairAdmin.tsx | 168 ++++++++++++++++++++++++------- src/styles/global.css | 1 - 2 files changed, 129 insertions(+), 40 deletions(-) diff --git a/src/pages/repair/RepairAdmin.tsx b/src/pages/repair/RepairAdmin.tsx index b8f9d00..7b5c30e 100644 --- a/src/pages/repair/RepairAdmin.tsx +++ b/src/pages/repair/RepairAdmin.tsx @@ -140,15 +140,15 @@ function TicketDetailDrawer(props: { return ( - -

维修详情

- {isLoading} + +

维修详情

+ {isLoading && {isLoading}}
- + { event => ( -
+
{ availableActions?.map((action) => { return ( @@ -171,8 +171,8 @@ function TicketDetailDrawer(props: { } - - @@ -336,6 +336,52 @@ export default function App() { onOpen() } + const MobileEventCard = ({ event }: { event: PublicEvent }) => ( + + ) + const renderCell = useCallback((event: PublicEvent, columnKey: string | number) => { const cellValue = event[columnKey] @@ -389,45 +435,89 @@ export default function App() { } }, []) return ( -
-
-
维修管理
+
+
+
维修管理
{ userInfo?.roles?.find(v => v.toLowerCase() == "repair admin") - ? + ?
: <> }
- - setPage(page)} - /> - - )} - > - - {column => {column.label}}>} - - }> - {item => ( - - {columnKey => {renderCell(item, columnKey)}} - + {/* Mobile Cards Layout */} +
+ {/* Filter Section for Mobile */} +
+ 筛选状态: + +
+ + {isLoading + ? ( +
+ +
+ ) + : ( +
+ {items.map(event => ( + + ))} + {items.length === 0 && ( +
+ 暂无维修记录 +
+ )} +
+ )} + + {/* Mobile Pagination */} +
+ setPage(page)} + /> +
+
+ + {/* Desktop Table Layout */} +
+
+ setPage(page)} + /> + )} - -
+ > + + {column => {column.label}
}>} + + }> + {item => ( + + {columnKey => {renderCell(item, columnKey)}} + + )} + + +