You've already forked DataMate
refactor(KnowledgeManagement): 调整知识库详情页面文件列表展示逻辑
- 移除未使用的 Tag 组件导入 - 将文件标题列改为文件名列,并调整数据源为 sourceFileId - 修改文件名显示逻辑,统一返回 "文件" 作为默认值 - 移除负责人列的显示 - 更新搜索框占位符文本为 "搜索文件名或内容" - 调整文件名列宽度从 220px 增加到 260px - 优化文件名解析逻辑,根据文件类型返回对应的预览文件名
This commit is contained in:
@@ -8,7 +8,6 @@ import {
|
||||
Empty,
|
||||
Modal,
|
||||
Table,
|
||||
Tag,
|
||||
Tooltip,
|
||||
} from "antd";
|
||||
import { DeleteOutlined, DownloadOutlined, EditOutlined, EyeOutlined, PlusOutlined } from "@ant-design/icons";
|
||||
@@ -148,7 +147,7 @@ const KnowledgeSetDetail = () => {
|
||||
return lastSegment;
|
||||
}
|
||||
}
|
||||
return record.title || "文件";
|
||||
return "文件";
|
||||
};
|
||||
|
||||
const handlePreviewItemFile = async (record: KnowledgeItemView) => {
|
||||
@@ -268,21 +267,21 @@ const KnowledgeSetDetail = () => {
|
||||
|
||||
const itemColumns = [
|
||||
{
|
||||
title: "标题",
|
||||
dataIndex: "title",
|
||||
key: "title",
|
||||
title: "文件名",
|
||||
dataIndex: "sourceFileId",
|
||||
key: "sourceFileId",
|
||||
fixed: "left" as const,
|
||||
width: 220,
|
||||
width: 260,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: "状态",
|
||||
dataIndex: "status",
|
||||
key: "status",
|
||||
width: 120,
|
||||
render: (status: KnowledgeItemView["status"]) => (
|
||||
<Tag color={status?.color}>{status?.label}</Tag>
|
||||
),
|
||||
render: (_: string, record: KnowledgeItemView) => {
|
||||
if (
|
||||
record.contentType === KnowledgeContentType.FILE ||
|
||||
record.sourceType === KnowledgeSourceType.FILE_UPLOAD
|
||||
) {
|
||||
return resolvePreviewFileName(record);
|
||||
}
|
||||
return record.sourceFileId || "-";
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "类型",
|
||||
@@ -293,13 +292,6 @@ const KnowledgeSetDetail = () => {
|
||||
knowledgeContentTypeOptions.find((opt) => opt.value === contentType)?.label ||
|
||||
contentType,
|
||||
},
|
||||
{
|
||||
title: "负责人",
|
||||
dataIndex: "owner",
|
||||
key: "owner",
|
||||
width: 120,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: "来源",
|
||||
dataIndex: "sourceType",
|
||||
@@ -474,7 +466,7 @@ const KnowledgeSetDetail = () => {
|
||||
<SearchControls
|
||||
searchTerm={searchParams.keyword}
|
||||
onSearchChange={handleKeywordChange}
|
||||
searchPlaceholder="搜索标题或内容"
|
||||
searchPlaceholder="搜索文件名或内容"
|
||||
filters={[]}
|
||||
onFiltersChange={handleFiltersChange}
|
||||
onClearFilters={() => setSearchParams({ ...searchParams, filter: { type: [], status: [], tags: [] } })}
|
||||
|
||||
Reference in New Issue
Block a user