feat(knowledge): 添加知识库标签统计功能

- 在 KnowledgeItemApplicationService 中注入 TagMapper 并调用统计方法
- 新增 countKnowledgeSetTags 方法用于计算知识库中的标签总数
- 在 KnowledgeManagementStatisticsResponse 中添加 totalTags 字段
- 在前端 KnowledgeManagementPage 中显示标签总数统计信息
- 更新统计卡片布局从 3 列改为 4 列以适应新增统计项
- 在知识管理模型中添加 totalTags 类型定义
This commit is contained in:
2026-02-01 18:46:31 +08:00
parent 7043a26ab3
commit d135a7f336
6 changed files with 28 additions and 1 deletions

View File

@@ -40,6 +40,10 @@ const DEFAULT_STATISTICS: StatisticsItem[] = [
title: "文件总数",
value: 0,
},
{
title: "标签总数",
value: 0,
},
{
title: "总大小",
value: "0 B",
@@ -113,6 +117,10 @@ export default function KnowledgeManagementPage() {
title: "文件总数",
value: stats?.totalFiles ?? 0,
},
{
title: "标签总数",
value: stats?.totalTags ?? 0,
},
{
title: "总大小",
value: formatBytes(stats?.totalSize ?? 0),
@@ -276,7 +284,7 @@ export default function KnowledgeManagementPage() {
<div className="grid grid-cols-1 gap-4">
<Card>
<div className="grid grid-cols-3">
<div className="grid grid-cols-4">
{statisticsData.map((item) => (
<Statistic
title={item.title}

View File

@@ -82,6 +82,7 @@ export interface KnowledgeManagementStatistics {
totalKnowledgeSets: number;
totalFiles: number;
totalSize: number;
totalTags: number;
}
export interface KnowledgeItemSearchResult {