From 08311a50d4bd414682e3ee2c94df2ca69bc1eb5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=B1=BC=E5=BC=80=E5=8F=91?= Date: Sat, 16 May 2026 10:04:48 +0800 Subject: [PATCH] =?UTF-8?q?feat(MyWorks):=20=E8=8D=89=E7=A8=BF=E7=AE=B1?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BF=BB=E9=A1=B5=EF=BC=88=E6=AF=8F=E9=A1=B5?= =?UTF-8?q?=208=20=E6=9D=A1=EF=BC=8C=E5=A4=8D=E7=94=A8=E6=88=90=E7=89=87?= =?UTF-8?q?=E5=88=86=E9=A1=B5=E7=BB=84=E4=BB=B6=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/pages/ContentManagement/MyWorks.tsx | 62 ++++++++++++------- 1 file changed, 39 insertions(+), 23 deletions(-) diff --git a/tauri-app/src/pages/ContentManagement/MyWorks.tsx b/tauri-app/src/pages/ContentManagement/MyWorks.tsx index f94d5f3..c505ec6 100644 --- a/tauri-app/src/pages/ContentManagement/MyWorks.tsx +++ b/tauri-app/src/pages/ContentManagement/MyWorks.tsx @@ -374,6 +374,9 @@ export default function MyWorks() { const totalPages = Math.ceil(products.length / PAGE_SIZE); const paginatedProducts = products.slice((currentPage - 1) * PAGE_SIZE, currentPage * PAGE_SIZE); + const totalDraftPages = Math.ceil(drafts.length / PAGE_SIZE); + const paginatedDrafts = drafts.slice((currentPage - 1) * PAGE_SIZE, currentPage * PAGE_SIZE); + return (
{/* 页面标题和 Tab 区域 */} @@ -425,31 +428,44 @@ export default function MyWorks() { )} {activeTab === 'drafts' && ( -
- {drafts.length > 0 ? ( -
- {drafts.map(draft => ( - handleEditDraft(e, draft)} - onSave={saveDraftTitle} - onChange={setEditDraftTitle} - onDelete={e => openDeleteDraftModal(e, draft)} - /> - ))} -
- ) : ( -
-
-

暂无草稿

-

开始创作后会保存草稿在这里

+ <> +
+ {paginatedDrafts.length > 0 ? ( +
+ {paginatedDrafts.map(draft => ( + handleEditDraft(e, draft)} + onSave={saveDraftTitle} + onChange={setEditDraftTitle} + onDelete={e => openDeleteDraftModal(e, draft)} + /> + ))} +
+ ) : ( +
+
+

暂无草稿

+

开始创作后会保存草稿在这里

+
+ )} +
+ {totalDraftPages > 1 && ( +
+
+ + {Array.from({ length: totalDraftPages }, (_, i) => i + 1).map(page => ( + + ))} + +
)} -
+ )} )}