From 697e946cdfef53d64f35c235ee20cba3213b58cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AC=94=E8=AE=B0=E6=9C=AC=E9=87=8C=E7=9A=84=E6=B0=B8?= =?UTF-8?q?=E5=B9=B3?= Date: Mon, 14 Jul 2025 11:17:19 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9C=AC=E6=AC=A1=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=86=85=E5=AE=B9=E5=A6=82=E4=B8=8B=20?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nkebao/src/pages/content/Content.tsx | 268 +++++++++++++-------------- 1 file changed, 128 insertions(+), 140 deletions(-) diff --git a/nkebao/src/pages/content/Content.tsx b/nkebao/src/pages/content/Content.tsx index 1c7d6a6b..eef1c55f 100644 --- a/nkebao/src/pages/content/Content.tsx +++ b/nkebao/src/pages/content/Content.tsx @@ -9,6 +9,9 @@ import { Badge } from '@/components/ui/badge'; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '@/components/ui/dropdown-menu'; import { useToast } from '@/components/ui/toast'; import { get, del } from '@/api/request'; +import Layout from '@/components/Layout'; +import UnifiedHeader from '@/components/UnifiedHeader'; +import BottomNav from '@/components/BottomNav'; interface ApiResponse { code: number; @@ -187,164 +190,149 @@ export default function Content() { ); return ( -
-
-
-
- -

内容库

+ + +
+
+ + setSearchQuery(e.target.value)} + onKeyDown={(e) => e.key === 'Enter' && handleSearch()} + className="pl-9" + />
-
-
-
- -
-
-
- - setSearchQuery(e.target.value)} - onKeyDown={(e) => e.key === 'Enter' && handleSearch()} - className="pl-9" - /> +
+ + + 全部 + 微信好友 + 聊天群 + + +
+ + } + > +
+
+ {loading ? ( +
+
- - -
- - - - 全部 - 微信好友 - 聊天群 - - - -
- {loading ? ( -
- + ) : filteredLibraries.length === 0 ? ( +
+
+

暂无数据

+
- ) : filteredLibraries.length === 0 ? ( -
-
-

暂无数据

- -
-
- ) : ( - filteredLibraries.map((library) => ( - -
-
-
-

{library.name}

- - {library.isEnabled === 1 ? '已启用' : '未启用'} - -
-
-
- 来源: - {library.sourceType === 1 && library.sourceFriends?.length > 0 ? ( +
+ ) : ( + filteredLibraries.map((library) => ( + +
+
+
+

{library.name}

+ + {library.isEnabled === 1 ? '已启用' : '未启用'} + +
+
+
+ 来源: + {library.sourceType === 1 && library.sourceFriends?.length > 0 ? ( +
+ {(library.friendsData || []).slice(0, 3).map((friend) => ( + {friend.nickname + ))} + {library.sourceFriends.length > 3 && ( + + +{library.sourceFriends.length - 3} + + )} +
+ ) : library.sourceType === 2 && library.sourceGroups?.length > 0 ? ( +
- {(library.friendsData || []).slice(0, 3).map((friend) => ( + {(library.groupsData || []).slice(0, 3).map((group) => ( {friend.nickname ))} - {library.sourceFriends.length > 3 && ( + {library.sourceGroups.length > 3 && ( - +{library.sourceFriends.length - 3} + +{library.sourceGroups.length - 3} )}
- ) : library.sourceType === 2 && library.sourceGroups?.length > 0 ? ( -
-
- {(library.groupsData || []).slice(0, 3).map((group) => ( - {group.name - ))} - {library.sourceGroups.length > 3 && ( - - +{library.sourceGroups.length - 3} - - )} -
-
- ) : ( -
- )} -
-
创建人:{library.creator}
-
内容数量:{library.itemCount}
-
更新时间:{new Date(library.updateTime).toLocaleString('zh-CN', { - year: 'numeric', - month: '2-digit', - day: '2-digit', - hour: '2-digit', - minute: '2-digit' - })}
+
+ ) : ( +
+ )}
+
创建人:{library.creator}
+
内容数量:{library.itemCount}
+
更新时间:{new Date(library.updateTime).toLocaleString('zh-CN', { + year: 'numeric', + month: '2-digit', + day: '2-digit', + hour: '2-digit', + minute: '2-digit' + })}
- - - - - - handleEdit(library.id)}> - - 编辑 - - handleDelete(library.id)}> - - 删除 - - handleViewMaterials(library.id)}> - - 查看素材 - - -
-
- )) - )} -
+ + + + + + handleEdit(library.id)}> + + 编辑 + + handleDelete(library.id)}> + + 删除 + + handleViewMaterials(library.id)}> + + 查看素材 + + + +
+ + )) + )}
-
-
-
+
+ ); } \ No newline at end of file