Skip to content

Commit a055546

Browse files
authored
update card icon ui (#50)
* feat: update icons in various components and improve styling for better UI consistency
1 parent ba0c690 commit a055546

File tree

9 files changed

+22
-35
lines changed

9 files changed

+22
-35
lines changed

frontend/src/components/CardView.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { ClockCircleOutlined, StarFilled } from "@ant-design/icons";
44
import type { ItemType } from "antd/es/menu/interface";
55
import { formatDateTime } from "@/utils/unit";
66
import ActionDropdown from "./ActionDropdown";
7+
import { Database } from "lucide-react";
78

89
interface BaseCardDataType {
910
id: string | number;
@@ -193,12 +194,9 @@ function CardView<T extends BaseCardDataType>(props: CardViewProps<T>) {
193194
<div className="flex items-center gap-3 min-w-0">
194195
{item?.icon && (
195196
<div
196-
className={`flex-shrink-0 w-12 h-12 ${
197-
item?.iconColor ||
198-
"bg-gradient-to-br from-blue-100 to-blue-200"
199-
} rounded-lg flex items-center justify-center`}
197+
className={`flex-shrink-0 w-12 h-12 bg-gradient-to-br from-sky-300 to-blue-500 text-white rounded-lg flex items-center justify-center`}
200198
>
201-
{item?.icon}
199+
<div className="w-6 h-6 text-gray-50">{item?.icon}</div>
202200
</div>
203201
)}
204202
<div className="flex-1 min-w-0">

frontend/src/components/DetailHeader.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,11 @@ function DetailHeader<T>({
4949
<div className="flex items-start justify-between">
5050
<div className="flex items-start gap-4 flex-1">
5151
<div
52-
className={`w-16 h-16 text-white rounded-lg flex-center shadow-lg ${
53-
data?.iconColor
54-
? data.iconColor
55-
: "bg-gradient-to-br from-blue-100 to-blue-200"
56-
}`}
52+
className={`w-16 h-16 text-white rounded-lg flex-center shadow-lg bg-gradient-to-br from-sky-300 to-blue-500 text-white`}
5753
>
58-
{data?.icon || <Database className="w-8 h-8" />}
54+
{<div className="w-8 h-8 text-gray-50">{data?.icon}</div> || (
55+
<Database className="w-8 h-8 text-white" />
56+
)}
5957
</div>
6058
<div className="flex-1">
6159
<div className="flex items-center gap-3 mb-2">

frontend/src/mock/mock-apis.cjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ const MockAPI = {
129129
// 算子市场
130130
queryOperatorsUsingPost: "/operators/list", // 获取算子列表
131131
queryCategoryTreeUsingGet: "/categories/tree", // 获取算子分类树
132-
queryOperatorByIdUsingGet: "/operators/:operatorId", // 根据ID获取算子详情
132+
queryOperatorByIdUsingGet: "/operators/:id", // 根据ID获取算子详情
133133
createOperatorUsingPost: "/operators/create", // 创建算子
134-
updateOperatorByIdUsingPut: "/operators/:operatorId", // 更新算子
134+
updateOperatorByIdUsingPut: "/operators/:id", // 更新算子
135135
uploadOperatorUsingPost: "/operators/upload", // 上传算子
136136
uploadFileChunkUsingPost: "/operators/upload/chunk", // 上传切片
137137
preUploadOperatorUsingPost: "/operators/upload/pre-upload", // 预上传文件

frontend/src/mock/mock-seed/data-cleansing.cjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,8 @@ module.exports = function (router) {
427427
router.get(API.queryOperatorByIdUsingGet, (req, res) => {
428428
const { id } = req.params;
429429
const operator = operatorList.find((op) => op.id === id);
430-
430+
console.log("获取算子详情:", id, operator);
431+
431432
if (operator) {
432433
// 增加浏览次数模拟
433434
operator.viewCount = (operator.viewCount || 0) + 1;

frontend/src/pages/DataCleansing/cleansing.const.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ import {
1414
PlayCircleOutlined,
1515
CheckCircleOutlined,
1616
AlertOutlined,
17-
DatabaseOutlined,
18-
AppstoreOutlined,
1917
PauseCircleOutlined,
2018
} from "@ant-design/icons";
19+
import { BrushCleaning, Layout } from "lucide-react";
2120

2221
export const templateTypesMap = {
2322
[TemplateType.TEXT]: {
@@ -99,8 +98,7 @@ export const mapTask = (task: CleansingTask) => {
9998
createdAt,
10099
startedAt,
101100
finishedAt,
102-
icon: <DatabaseOutlined style={{ color: "#1677ff" }} />,
103-
iconColor: "bg-blue-100",
101+
icon: <BrushCleaning className="w-full h-full" />,
104102
status,
105103
duration,
106104
before,
@@ -128,8 +126,7 @@ export const mapTemplate = (template: CleansingTemplate) => ({
128126
...template,
129127
createdAt: formatDateTime(template.createdAt),
130128
updatedAt: formatDateTime(template.updatedAt),
131-
icon: <AppstoreOutlined style={{ color: "#1677ff" }} />,
132-
iconColor: "bg-blue-100",
129+
icon: <Layout className="w-full h-full" />,
133130
statistics: [{ label: "算子数量", value: template.instance?.length ?? 0 }],
134131
lastModified: formatDateTime(template.updatedAt),
135132
});

frontend/src/pages/DataManagement/dataset.const.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -205,14 +205,7 @@ export function mapDataset(dataset: AnyObject): Dataset {
205205
size: formatBytes(dataset.totalSize || 0),
206206
createdAt: formatDateTime(dataset.createdAt) || "--",
207207
updatedAt: formatDateTime(dataset?.updatedAt) || "--",
208-
icon: IconComponent ? (
209-
<IconComponent
210-
className="w-5 h-5 text-gray-500"
211-
// style={{ color: iconColor }}
212-
/>
213-
) : (
214-
<Database />
215-
),
208+
icon: IconComponent ? <IconComponent className="w-full h-full" /> : <Database />,
216209
status: datasetStatusMap[dataset.status],
217210
statistics: [
218211
{ label: "文件数", value: dataset.fileCount || 0 },

frontend/src/pages/KnowledgeBase/knowledge-base.const.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export const KBTypeMap = {
6666
export function mapKnowledgeBase(kb: KnowledgeBaseItem): KnowledgeBaseItem {
6767
return {
6868
...kb,
69-
icon: <BookOpenText className="text-gray-400" />,
69+
icon: <BookOpenText className="w-full h-full" />,
7070
description: kb.description,
7171
statistics: [
7272
{
@@ -78,19 +78,19 @@ export function mapKnowledgeBase(kb: KnowledgeBaseItem): KnowledgeBaseItem {
7878
{
7979
label: "文本理解模型",
8080
key: "chatModel",
81-
icon: <BookType className="w-4 h-4 text-green-500" />,
81+
icon: <BookType className="w-4 h-4 text-blue-500" />,
8282
value: kb.chatModel,
8383
},
8484
{
8585
label: "文件数",
8686
key: "fileCount",
87-
icon: <File className="w-4 h-4 text-yellow-500" />,
87+
icon: <File className="w-4 h-4 text-blue-500" />,
8888
value: formatNumber(kb?.fileCount) || 0,
8989
},
9090
{
9191
label: "大小",
9292
key: "size",
93-
icon: <ChartNoAxesColumn className="w-4 h-4 text-red-500" />,
93+
icon: <ChartNoAxesColumn className="w-4 h-4 text-blue-500" />,
9494
value: formatBytes(kb?.size) || "0 MB",
9595
},
9696
],

frontend/src/pages/OperatorMarket/Home/components/Filters.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ const Filters: React.FC<FiltersProps> = ({
140140
className="cursor-pointer hover:text-blue-500"
141141
></Button>
142142
</Tooltip>
143-
<h4>筛选器</h4>
143+
<span>筛选器</span>
144144
</h3>
145145
{hasActiveFilters && (
146146
<span
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { Boxes } from "lucide-react";
1+
import { Code } from "lucide-react";
22
import { OperatorI } from "./operator.model";
33

44
export const mapOperator = (op: OperatorI) => {
55
return {
66
...op,
7-
icon: <Boxes className="w-5 h-5 text-gray-500" />,
7+
icon: <Code className="w-full h-full" />,
88
};
99
};

0 commit comments

Comments
 (0)