You've already forked DataMate
Merge branch 'ModelEngine-Group:main' into develop_label_tool
This commit is contained in:
@@ -168,12 +168,12 @@ function CardView<T extends BaseCardDataType>(props: CardViewProps<T>) {
|
||||
const ops = (item) =>
|
||||
typeof operations === "function" ? operations(item) : operations;
|
||||
return (
|
||||
<div className="flex-1 flex flex-col overflow-auto">
|
||||
<div className="overflow-auto grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 gap-4">
|
||||
<div className="flex-overflow-hidden">
|
||||
<div className="flex-overflow-auto grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 gap-4">
|
||||
{data.map((item) => (
|
||||
<div
|
||||
key={item.id}
|
||||
className="border border-gray-100 rounded-lg p-4 bg-white hover:shadow-lg transition-shadow duration-200"
|
||||
className="border-card p-4 bg-white hover:shadow-lg transition-shadow duration-200"
|
||||
>
|
||||
<div className="flex flex-col space-y-4 h-full">
|
||||
{/* Header */}
|
||||
|
||||
@@ -48,7 +48,7 @@ function DetailHeader<T>({
|
||||
<div className="flex items-start justify-between">
|
||||
<div className="flex items-start gap-4 flex-1">
|
||||
<div
|
||||
className={`w-16 h-16 text-white rounded-xl flex items-center justify-center shadow-lg ${
|
||||
className={`w-16 h-16 text-white rounded-lg flex-center shadow-lg ${
|
||||
data?.iconColor
|
||||
? data.iconColor
|
||||
: "bg-gradient-to-br from-blue-100 to-blue-200"
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
import { Button } from "antd";
|
||||
|
||||
const DevelopmentInProgress = ({ showHome = true }) => {
|
||||
const DevelopmentInProgress = ({ showHome = true, showTime = "" }) => {
|
||||
return (
|
||||
<div className="mt-40 flex flex-col items-center justify-center">
|
||||
<div className="hero-icon">🚧</div>
|
||||
<h1 className="text-2xl font-bold">功能开发中</h1>
|
||||
<p className="mt-4">
|
||||
为了给您带来更好的体验,我们计划<b>2025.10.30</b>
|
||||
开放此功能
|
||||
</p>
|
||||
{showTime && (
|
||||
<p className="mt-4">
|
||||
为了给您带来更好的体验,我们计划<b>{showTime}</b>
|
||||
开放此功能
|
||||
</p>
|
||||
)}
|
||||
{showHome && (
|
||||
<Button
|
||||
type="primary"
|
||||
|
||||
@@ -32,7 +32,7 @@ const RadioCard: React.FC<RadioCardProps> = ({
|
||||
{options.map((option) => (
|
||||
<div
|
||||
key={option.value}
|
||||
className="border border-gray-200 rounded-lg hover:shadow-lg p-4 text-center"
|
||||
className="border-card hover:shadow-lg p-4 text-center"
|
||||
style={{
|
||||
borderColor: value === option.value ? "#1677ff" : undefined,
|
||||
background: value === option.value ? "#e6f7ff" : undefined,
|
||||
|
||||
@@ -30,7 +30,7 @@ function CustomTag({
|
||||
return (
|
||||
<div
|
||||
key={tag.id}
|
||||
className="flex items-center justify-between px-4 py-2 border border-gray-100 rounded-md hover:bg-gray-50"
|
||||
className="flex items-center justify-between px-4 py-2 border-card hover:bg-gray-50"
|
||||
>
|
||||
{editingTag?.id === tag.id ? (
|
||||
<div className="flex gap-2 flex-1">
|
||||
@@ -92,17 +92,6 @@ function CustomTag({
|
||||
);
|
||||
}
|
||||
|
||||
export const mockPreparedTags = [
|
||||
{ id: "1", name: "重要" },
|
||||
{ id: "2", name: "待处理" },
|
||||
{ id: "3", name: "已完成" },
|
||||
{ id: "4", name: "审核中" },
|
||||
{ id: "5", name: "高优先级" },
|
||||
{ id: "6", name: "低优先级" },
|
||||
{ id: "7", name: "客户A" },
|
||||
{ id: "8", name: "客户B" },
|
||||
];
|
||||
|
||||
const TagManager: React.FC = ({
|
||||
onFetch,
|
||||
onCreate,
|
||||
@@ -112,7 +101,7 @@ const TagManager: React.FC = ({
|
||||
onFetch: () => Promise<any>;
|
||||
onCreate: (tag: Pick<TagItem, "name">) => Promise<{ ok: boolean }>;
|
||||
onDelete: (tagId: number) => Promise<{ ok: boolean }>;
|
||||
onUpdate: (oldTagId: number, newTag: string) => Promise<{ ok: boolean }>;
|
||||
onUpdate: (tag: TagItem) => Promise<{ ok: boolean }>;
|
||||
}) => {
|
||||
const [showTagManager, setShowTagManager] = useState(false);
|
||||
const { message } = App.useApp();
|
||||
@@ -121,9 +110,6 @@ const TagManager: React.FC = ({
|
||||
const [editingTag, setEditingTag] = useState<string | null>(null);
|
||||
const [editingTagValue, setEditingTagValue] = useState("");
|
||||
|
||||
// 预置标签
|
||||
const [preparedTags, setPreparedTags] = useState(mockPreparedTags);
|
||||
|
||||
// 获取标签列表
|
||||
const fetchTags = async () => {
|
||||
if (!onFetch) return;
|
||||
@@ -161,7 +147,7 @@ const TagManager: React.FC = ({
|
||||
|
||||
const updateTag = async (oldTag: TagItem, newTag: string) => {
|
||||
try {
|
||||
await onUpdate?.(oldTag.id, { ...oldTag, name: newTag });
|
||||
await onUpdate?.({ ...oldTag, name: newTag });
|
||||
fetchTags();
|
||||
message.success("标签更新成功");
|
||||
} catch (error) {
|
||||
@@ -213,55 +199,48 @@ const TagManager: React.FC = ({
|
||||
title="标签管理"
|
||||
width={500}
|
||||
>
|
||||
<div className="space-y-4">
|
||||
<div className="space-y-4 flex-overflow">
|
||||
{/* Add New Tag */}
|
||||
<div className="space-y-2">
|
||||
<div className="flex gap-2">
|
||||
<Input
|
||||
placeholder="输入标签名称..."
|
||||
value={newTag}
|
||||
allowClear
|
||||
onChange={(e) => setNewTag(e.target.value)}
|
||||
onKeyPress={(e) => {
|
||||
if (e.key === "Enter") {
|
||||
addTag(e.target.value);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={handleCreateNewTag}
|
||||
disabled={!newTag.trim()}
|
||||
icon={<PlusOutlined />}
|
||||
>
|
||||
添加
|
||||
</Button>
|
||||
<div className="flex gap-2">
|
||||
<Input
|
||||
placeholder="输入标签名称..."
|
||||
value={newTag}
|
||||
allowClear
|
||||
onChange={(e) => setNewTag(e.target.value)}
|
||||
onKeyPress={(e) => {
|
||||
if (e.key === "Enter") {
|
||||
addTag(e.target.value);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={handleCreateNewTag}
|
||||
disabled={!newTag.trim()}
|
||||
icon={<PlusOutlined />}
|
||||
>
|
||||
添加
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div className="flex-overflow">
|
||||
<div className="overflow-auto grid grid-cols-2 gap-2">
|
||||
{tags.map((tag) => (
|
||||
<CustomTag
|
||||
isEditable
|
||||
key={tag.id}
|
||||
tag={tag}
|
||||
editingTag={editingTag}
|
||||
editingTagValue={editingTagValue}
|
||||
setEditingTag={setEditingTag}
|
||||
setEditingTagValue={setEditingTagValue}
|
||||
handleEditTag={handleEditTag}
|
||||
handleCancelEdit={handleCancelEdit}
|
||||
handleDeleteTag={handleDeleteTag}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2 className="font-large font-bold w-full">预置标签</h2>
|
||||
<div className="grid grid-cols-2 gap-2">
|
||||
{preparedTags.length > 0 &&
|
||||
preparedTags.map((tag) => <CustomTag key={tag.id} tag={tag} />)}
|
||||
</div>
|
||||
|
||||
<h2 className="font-large font-bold w-full">自定义标签</h2>
|
||||
<div className="grid grid-cols-2 gap-2 mt-4">
|
||||
{tags.map((tag) => (
|
||||
<CustomTag
|
||||
isEditable
|
||||
key={tag.id}
|
||||
tag={tag}
|
||||
editingTag={editingTag}
|
||||
editingTagValue={editingTagValue}
|
||||
setEditingTag={setEditingTag}
|
||||
setEditingTagValue={setEditingTagValue}
|
||||
handleEditTag={handleEditTag}
|
||||
handleCancelEdit={handleCancelEdit}
|
||||
handleDeleteTag={handleDeleteTag}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</Drawer>
|
||||
</>
|
||||
|
||||
@@ -89,7 +89,7 @@ export default function TaskPopover() {
|
||||
{tasks.map((task) => (
|
||||
<div
|
||||
key={task.id}
|
||||
className="p-3 border border-gray-100 rounded-lg hover:bg-gray-50"
|
||||
className="p-3 border-card hover:bg-gray-50"
|
||||
>
|
||||
<div className="space-y-2">
|
||||
<div className="flex items-center justify-between">
|
||||
|
||||
@@ -43,3 +43,27 @@
|
||||
visibility: visible;
|
||||
transform: translateX(0);
|
||||
}
|
||||
|
||||
@layer components {
|
||||
.flex-center {
|
||||
@apply flex items-center justify-center;
|
||||
}
|
||||
.flex-overflow-auto {
|
||||
@apply flex-1 flex flex-col overflow-auto h-full;
|
||||
}
|
||||
.flex-overflow-hidden {
|
||||
@apply flex flex-col h-full overflow-hidden;
|
||||
}
|
||||
.border-card {
|
||||
@apply border border-[#f0f0f0] rounded-lg bg-white;
|
||||
}
|
||||
.border {
|
||||
@apply border border-gray-100;
|
||||
}
|
||||
.border-bottom {
|
||||
@apply border-b border-gray-100;
|
||||
}
|
||||
.border-top {
|
||||
@apply border-t border-gray-100;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -429,7 +429,7 @@ export default function ImageAnnotationWorkspace({
|
||||
}`}
|
||||
onClick={() => setSelectedImageIndex(index)}
|
||||
>
|
||||
<div className="w-8 h-8 bg-gray-200 rounded flex items-center justify-center text-sm font-medium mr-3">
|
||||
<div className="w-8 h-8 bg-gray-200 rounded flex-center text-sm font-medium mr-3">
|
||||
{index + 1}
|
||||
</div>
|
||||
<img
|
||||
@@ -462,7 +462,7 @@ export default function ImageAnnotationWorkspace({
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex-1 border rounded-lg overflow-hidden bg-gray-100 relative">
|
||||
<div className="flex-1 border-card overflow-hidden bg-gray-100 relative">
|
||||
<canvas
|
||||
ref={canvasRef}
|
||||
width={800}
|
||||
|
||||
@@ -123,7 +123,7 @@ export default function AnnotationTaskCreate() {
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="h-full flex flex-col overflow-auto">
|
||||
<div className="flex-overflow-auto">
|
||||
{/* Header */}
|
||||
<div className="flex items-center mb-2">
|
||||
<Link to="/data/annotation">
|
||||
@@ -134,7 +134,7 @@ export default function AnnotationTaskCreate() {
|
||||
<h1 className="text-xl font-bold bg-clip-text">创建标注任务</h1>
|
||||
</div>
|
||||
|
||||
<div className="h-full flex-1 overflow-y-auto flex flex-col bg-white rounded-lg shadow-sm">
|
||||
<div className="flex-overflow-auto bg-white rounded-lg shadow-sm">
|
||||
<div className="flex-1 overflow-y-auto p-6">
|
||||
<Form
|
||||
form={form}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import { queryDatasetsUsingGet } from "@/pages/DataManagement/dataset.api";
|
||||
import { datasetTypeMap } from "@/pages/DataManagement/dataset.const";
|
||||
import {
|
||||
datasetTypeMap,
|
||||
mapDataset,
|
||||
} from "@/pages/DataManagement/dataset.const";
|
||||
import { Button, Form, Input, Modal, Select } from "antd";
|
||||
import TextArea from "antd/es/input/TextArea";
|
||||
import { Database } from "lucide-react";
|
||||
@@ -26,7 +29,7 @@ export default function CreateAnnotationTask({
|
||||
page: 0,
|
||||
size: 1000,
|
||||
});
|
||||
setDatasets(data.content || []);
|
||||
setDatasets(data.content.map(mapDataset) || []);
|
||||
};
|
||||
fetchDatasets();
|
||||
}, [open]);
|
||||
@@ -74,22 +77,20 @@ export default function CreateAnnotationTask({
|
||||
>
|
||||
<Select
|
||||
placeholder="请选择数据集"
|
||||
options={datasets.map((dataset) => ({
|
||||
label: (
|
||||
<div className="flex items-center justify-between gap-3 py-2">
|
||||
<div className="flex items-center font-sm text-gray-900">
|
||||
<span>
|
||||
{dataset.icon || <Database className="w-4 h-4 mr-2" />}
|
||||
</span>
|
||||
<span>{dataset.name}</span>
|
||||
options={datasets.map((dataset) => {
|
||||
return {
|
||||
label: (
|
||||
<div className="flex items-center justify-between gap-3 py-2">
|
||||
<div className="flex items-center font-sm text-gray-900">
|
||||
<span className="mr-2">{dataset.icon}</span>
|
||||
<span>{dataset.name}</span>
|
||||
</div>
|
||||
<div className="text-xs text-gray-500">{dataset.size}</div>
|
||||
</div>
|
||||
<div className="text-xs text-gray-500">
|
||||
{datasetTypeMap[dataset?.datasetType]?.label}
|
||||
</div>
|
||||
</div>
|
||||
),
|
||||
value: dataset.id,
|
||||
}))}
|
||||
),
|
||||
value: dataset.id,
|
||||
};
|
||||
})}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
|
||||
@@ -19,8 +19,10 @@ import {
|
||||
import { mapAnnotationTask } from "../annotation.const";
|
||||
import CreateAnnotationTask from "../Create/components/CreateAnnptationTaskDialog";
|
||||
import { ColumnType } from "antd/es/table";
|
||||
import DevelopmentInProgress from "@/components/DevelopmentInProgress";
|
||||
|
||||
export default function DataAnnotation() {
|
||||
return <DevelopmentInProgress showTime="2025.10.30" />;
|
||||
const navigate = useNavigate();
|
||||
const [viewMode, setViewMode] = useState<"list" | "card">("list");
|
||||
const [showCreateDialog, setShowCreateDialog] = useState(false);
|
||||
|
||||
@@ -2,7 +2,7 @@ import { get, post, put, del, download } from "@/utils/request";
|
||||
|
||||
// 标注任务管理相关接口
|
||||
export function queryAnnotationTasksUsingGet(params?: any) {
|
||||
return get("/api/project/mappings/list", params);
|
||||
return get("/project/mappings/list", params);
|
||||
}
|
||||
|
||||
export function createAnnotationTaskUsingPost(data: any) {
|
||||
|
||||
@@ -101,9 +101,9 @@ export default function CleansingTaskCreate() {
|
||||
</div>
|
||||
</div>
|
||||
{/* Step Content */}
|
||||
<div className="h-full mb-4 flex flex-col overflow-auto flex-1 bg-white rounded shadow-sm">
|
||||
<div className="flex-overflow-auto bg-white border-card">
|
||||
<div className="flex-1 overflow-auto m-6">{renderStepContent()}</div>
|
||||
<div className="flex justify-end p-6 gap-3 border-t border-gray-200">
|
||||
<div className="flex justify-end p-6 gap-3 border-top">
|
||||
<Button onClick={() => navigate("/data/cleansing")}>取消</Button>
|
||||
{currentStep > 1 && <Button onClick={handlePrev}>上一步</Button>}
|
||||
{currentStep === 2 ? (
|
||||
|
||||
@@ -90,9 +90,9 @@ export default function CleansingTemplateCreate() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="h-full mb-4 flex flex-col overflow-auto flex-1 bg-white rounded shadow-sm">
|
||||
<div className="flex-overflow-auto border-card">
|
||||
<div className="flex-1 overflow-auto m-6">{renderStepContent()}</div>
|
||||
<div className="flex justify-end p-6 gap-3 border-t border-gray-200">
|
||||
<div className="flex justify-end p-6 gap-3 border-top">
|
||||
<Button onClick={() => navigate("/data/cleansing")}>取消</Button>
|
||||
{currentStep > 1 && <Button onClick={handlePrev}>上一步</Button>}
|
||||
{currentStep === 2 ? (
|
||||
|
||||
@@ -3,6 +3,7 @@ import { queryDatasetsUsingGet } from "@/pages/DataManagement/dataset.api";
|
||||
import {
|
||||
datasetTypeMap,
|
||||
datasetTypes,
|
||||
mapDataset,
|
||||
} from "@/pages/DataManagement/dataset.const";
|
||||
import {
|
||||
Dataset,
|
||||
@@ -34,7 +35,7 @@ export default function CreateTaskStepOne({
|
||||
|
||||
const fetchDatasets = async () => {
|
||||
const { data } = await queryDatasetsUsingGet({ page: 0, size: 1000 });
|
||||
setDatasets(data.content || []);
|
||||
setDatasets(data.content.map(mapDataset) || []);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
@@ -76,22 +77,20 @@ export default function CreateTaskStepOne({
|
||||
<Form.Item label="源数据集" name="srcDatasetId" required>
|
||||
<Select
|
||||
placeholder="请选择源数据集"
|
||||
options={datasets.map((dataset) => ({
|
||||
label: (
|
||||
<div className="flex items-center justify-between gap-3 py-2">
|
||||
<div className="flex items-center font-sm text-gray-900">
|
||||
<span>
|
||||
{dataset.icon || <Database className="w-4 h-4 mr-2" />}
|
||||
</span>
|
||||
<span>{dataset.name}</span>
|
||||
options={datasets.map((dataset) => {
|
||||
return {
|
||||
label: (
|
||||
<div className="flex items-center justify-between gap-3 py-2">
|
||||
<div className="flex items-center font-sm text-gray-900">
|
||||
<span className="mr-2">{dataset.icon}</span>
|
||||
<span>{dataset.name}</span>
|
||||
</div>
|
||||
<div className="text-xs text-gray-500">{dataset.size}</div>
|
||||
</div>
|
||||
<div className="text-xs text-gray-500">
|
||||
{datasetTypeMap[dataset?.datasetType]?.label}
|
||||
</div>
|
||||
</div>
|
||||
),
|
||||
value: dataset.id,
|
||||
}))}
|
||||
),
|
||||
value: dataset.id,
|
||||
};
|
||||
})}
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item label="目标数据集名称" name="destDatasetName" required>
|
||||
|
||||
@@ -105,7 +105,7 @@ const OperatorFlow: React.FC<OperatorFlowProps> = ({
|
||||
</div>
|
||||
{/* 编排区域 */}
|
||||
<div
|
||||
className="flex-1 overflow-auto p-4 flex flex-col gap-2"
|
||||
className="flex-overflow-auto p-4 gap-2"
|
||||
onDragOver={(e) => e.preventDefault()}
|
||||
onDragLeave={handleContainerDragLeave}
|
||||
onDrop={handleDropToContainer}
|
||||
|
||||
@@ -56,7 +56,7 @@ export default function ProcessFlowDiagram() {
|
||||
];
|
||||
|
||||
return (
|
||||
<div className="rounded-xl border border-gray-200 p-6 bg-white">
|
||||
<div className="border-card p-6">
|
||||
<div className="w-full flex items-center justify-center">
|
||||
<div className="w-full flex items-center space-x-12">
|
||||
{flowSteps.map((step, index) => {
|
||||
|
||||
@@ -16,7 +16,11 @@ export interface CleansingTask {
|
||||
color: string;
|
||||
};
|
||||
startedAt: string;
|
||||
progress: number;
|
||||
progress: {
|
||||
finishedFileNum: number;
|
||||
process: 100,
|
||||
totalFileNum: number;
|
||||
};
|
||||
operators: OperatorI[];
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
|
||||
@@ -59,7 +59,7 @@ const defaultTemplates = [
|
||||
];
|
||||
|
||||
export default function CollectionTaskCreate() {
|
||||
return <DevelopmentInProgress />;
|
||||
return <DevelopmentInProgress showTime="2025.10.30" />;
|
||||
|
||||
const navigate = useNavigate();
|
||||
const [form] = Form.useForm();
|
||||
|
||||
@@ -10,7 +10,7 @@ export default function DataCollection() {
|
||||
const navigate = useNavigate();
|
||||
const [activeTab, setActiveTab] = useState("task-management");
|
||||
|
||||
return <DevelopmentInProgress />;
|
||||
return <DevelopmentInProgress showTime="2025.10.30" />;
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
||||
@@ -180,9 +180,7 @@ export default function DataEvaluationPage() {
|
||||
setTasks(tasks.filter((task) => task.id !== taskId));
|
||||
};
|
||||
|
||||
return (
|
||||
<DevelopmentInProgress />
|
||||
);
|
||||
return <DevelopmentInProgress showTime="2025.11.30" />;
|
||||
// 主列表界面
|
||||
return (
|
||||
<div>
|
||||
|
||||
@@ -56,7 +56,7 @@ export default function DatasetCreate() {
|
||||
</div>
|
||||
|
||||
{/* form */}
|
||||
<div className="h-full flex flex-col flex-1 overflow-auto bg-white border-gray-200 rounded shadow-sm">
|
||||
<div className="flex-overflow-auto border-card">
|
||||
<div className="flex-1 p-6 overflow-auto">
|
||||
<Form
|
||||
form={form}
|
||||
@@ -67,7 +67,7 @@ export default function DatasetCreate() {
|
||||
<BasicInformation data={newDataset} setData={setNewDataset} />
|
||||
</Form>
|
||||
</div>
|
||||
<div className="flex gap-2 justify-end p-6 border-t border-gray-200">
|
||||
<div className="flex gap-2 justify-end p-6 border-top">
|
||||
<Button onClick={() => navigate("/data/management")}>取消</Button>
|
||||
<Button type="primary" onClick={handleSubmit}>
|
||||
确定
|
||||
|
||||
@@ -2,7 +2,6 @@ import RadioCard from "@/components/RadioCard";
|
||||
import { Input, Select, Form } from "antd";
|
||||
import { datasetTypes } from "../../dataset.const";
|
||||
import { useEffect, useState } from "react";
|
||||
import { mockPreparedTags } from "@/components/TagManagement";
|
||||
import { queryDatasetTagsUsingGet } from "../../dataset.api";
|
||||
|
||||
export default function BasicInformation({
|
||||
@@ -26,26 +25,11 @@ export default function BasicInformation({
|
||||
const fetchTags = async () => {
|
||||
try {
|
||||
const { data } = await queryDatasetTagsUsingGet();
|
||||
const preparedTags = mockPreparedTags.map((tag) => ({
|
||||
label: tag.name,
|
||||
value: tag.name,
|
||||
}));
|
||||
const customTags = data.map((tag) => ({
|
||||
label: tag.name,
|
||||
value: tag.name,
|
||||
}));
|
||||
setTagOptions([
|
||||
{
|
||||
label: <span>预置标签</span>,
|
||||
title: "prepared",
|
||||
options: preparedTags,
|
||||
},
|
||||
{
|
||||
label: <span>自定义标签</span>,
|
||||
title: "custom",
|
||||
options: customTags,
|
||||
},
|
||||
]);
|
||||
setTagOptions(customTags);
|
||||
} catch (error) {
|
||||
console.error("Error fetching tags: ", error);
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ export default function DatasetDetail() {
|
||||
{
|
||||
icon: <Clock className="text-blue-400 w-4 h-4" />,
|
||||
key: "time",
|
||||
value: dataset?.createdAt,
|
||||
value: dataset?.updatedAt,
|
||||
},
|
||||
];
|
||||
|
||||
@@ -200,7 +200,7 @@ export default function DatasetDetail() {
|
||||
},
|
||||
}}
|
||||
/>
|
||||
<div className="h-full flex flex-col flex-1 overflow-auto p-6 pt-2 bg-white rounded-md shadow">
|
||||
<div className="flex-overflow-auto p-6 pt-2 bg-white rounded-md shadow">
|
||||
<Tabs activeKey={activeTab} items={tabList} onChange={setActiveTab} />
|
||||
<div className="h-full overflow-auto">
|
||||
{activeTab === "overview" && (
|
||||
|
||||
@@ -20,8 +20,8 @@ import {
|
||||
deleteDatasetByIdUsingDelete,
|
||||
createDatasetTagUsingPost,
|
||||
queryDatasetTagsUsingGet,
|
||||
updateDatasetTagByIdUsingPut,
|
||||
deleteDatasetTagByIdUsingDelete,
|
||||
deleteDatasetTagUsingDelete,
|
||||
updateDatasetTagUsingPut,
|
||||
} from "../dataset.api";
|
||||
import { formatBytes } from "@/utils/unit";
|
||||
import EditDataset from "../Create/EditDataset";
|
||||
@@ -295,8 +295,8 @@ export default function DatasetManagementPage() {
|
||||
{/* tasks */}
|
||||
<TagManager
|
||||
onCreate={createDatasetTagUsingPost}
|
||||
onDelete={deleteDatasetTagByIdUsingDelete}
|
||||
onUpdate={updateDatasetTagByIdUsingPut}
|
||||
onDelete={(ids: string) => deleteDatasetTagUsingDelete({ ids })}
|
||||
onUpdate={updateDatasetTagUsingPut}
|
||||
onFetch={queryDatasetTagsUsingGet}
|
||||
/>
|
||||
<Link to="/data/management/create">
|
||||
|
||||
@@ -97,13 +97,13 @@ export function createDatasetTagUsingPost(data: any) {
|
||||
}
|
||||
|
||||
// 更新数据集标签
|
||||
export function updateDatasetTagByIdUsingPut(id: string | number, data: any) {
|
||||
return put(`/api/data-management/tags/${id}`, data);
|
||||
export function updateDatasetTagUsingPut(data: any) {
|
||||
return put(`/api/data-management/tags`, data);
|
||||
}
|
||||
|
||||
// 删除数据集标签
|
||||
export function deleteDatasetTagByIdUsingDelete(id: string | number) {
|
||||
return del(`/api/data-management/tags/${id}`);
|
||||
export function deleteDatasetTagUsingDelete(data: any) {
|
||||
return del(`/api/data-management/tags`, data);
|
||||
}
|
||||
|
||||
// 数据集质量检查
|
||||
|
||||
@@ -23,6 +23,8 @@ import {
|
||||
Music,
|
||||
Videotape,
|
||||
Database,
|
||||
Image,
|
||||
ScanText,
|
||||
} from "lucide-react";
|
||||
|
||||
export const datasetTypeMap: Record<
|
||||
@@ -41,8 +43,8 @@ export const datasetTypeMap: Record<
|
||||
value: DatasetType.TEXT,
|
||||
label: "文本",
|
||||
order: 1,
|
||||
icon: FileText,
|
||||
iconColor: "#3b82f6",
|
||||
icon: ScanText,
|
||||
iconColor: "blue",
|
||||
children: [
|
||||
DatasetSubType.TEXT_DOCUMENT,
|
||||
DatasetSubType.TEXT_WEB,
|
||||
@@ -54,8 +56,8 @@ export const datasetTypeMap: Record<
|
||||
value: DatasetType.IMAGE,
|
||||
label: "图像",
|
||||
order: 2,
|
||||
icon: FileImage,
|
||||
iconColor: "#3b82f6",
|
||||
icon: Image,
|
||||
iconColor: "green",
|
||||
children: [DatasetSubType.IMAGE_IMAGE, DatasetSubType.IMAGE_CAPTION],
|
||||
description: "用于处理和分析图像数据的数据集",
|
||||
},
|
||||
@@ -64,7 +66,7 @@ export const datasetTypeMap: Record<
|
||||
label: "音频",
|
||||
order: 3,
|
||||
icon: Music,
|
||||
iconColor: "#3b82f6",
|
||||
iconColor: "orange",
|
||||
children: [DatasetSubType.AUDIO_AUDIO, DatasetSubType.AUDIO_JSONL],
|
||||
description: "用于处理和分析音频数据的数据集",
|
||||
},
|
||||
@@ -73,7 +75,7 @@ export const datasetTypeMap: Record<
|
||||
label: "视频",
|
||||
order: 3,
|
||||
icon: Video,
|
||||
iconColor: "#3b82f6",
|
||||
iconColor: "purple",
|
||||
children: [DatasetSubType.VIDEO_VIDEO, DatasetSubType.VIDEO_JSONL],
|
||||
description: "用于处理和分析视频数据的数据集",
|
||||
},
|
||||
@@ -193,14 +195,22 @@ export const dataSourceMap: Record<string, { label: string; value: string }> = {
|
||||
export const dataSourceOptions = Object.values(dataSourceMap);
|
||||
|
||||
export function mapDataset(dataset: Dataset) {
|
||||
const IconComponent = datasetTypeMap[dataset?.datasetType]?.icon || null;
|
||||
const { icon: IconComponent, iconColor } =
|
||||
datasetTypeMap[dataset?.datasetType] || {};
|
||||
return {
|
||||
...dataset,
|
||||
type: datasetTypeMap[dataset.datasetType]?.label || "未知",
|
||||
size: formatBytes(dataset.totalSize || 0),
|
||||
createdAt: formatDateTime(dataset.createdAt) || "--",
|
||||
updatedAt: formatDateTime(dataset?.updatedAt) || "--",
|
||||
icon: IconComponent ? <IconComponent className="w-4 h-4" /> : <Database />,
|
||||
icon: IconComponent ? (
|
||||
<IconComponent
|
||||
className="w-5 h-5 text-gray-500"
|
||||
// style={{ color: iconColor }}
|
||||
/>
|
||||
) : (
|
||||
<Database />
|
||||
),
|
||||
status: datasetStatusMap[dataset.status],
|
||||
statistics: [
|
||||
{ label: "文件数", value: dataset.fileCount || 0 },
|
||||
|
||||
@@ -37,7 +37,7 @@ const { TextArea } = Input;
|
||||
const { Option } = Select;
|
||||
|
||||
const KnowledgeBaseCreatePage: React.FC = () => {
|
||||
return <DevelopmentInProgress />;
|
||||
return <DevelopmentInProgress showTime="2025.10.30" />;
|
||||
const navigate = useNavigate();
|
||||
const [form] = Form.useForm();
|
||||
const [knowledgeBases, setKnowledgeBases] =
|
||||
|
||||
@@ -11,22 +11,12 @@ import {
|
||||
FileText,
|
||||
Download,
|
||||
} from "lucide-react";
|
||||
import {
|
||||
Card,
|
||||
Button,
|
||||
Badge,
|
||||
Input,
|
||||
Tabs,
|
||||
Modal,
|
||||
Breadcrumb,
|
||||
Tag,
|
||||
} from "antd";
|
||||
import {
|
||||
mockChunks,
|
||||
mockQAPairs,
|
||||
sliceOperators,
|
||||
} from "@/mock/knowledgeBase";
|
||||
import type { KnowledgeBase, KBFile } from "@/pages/KnowledgeGeneration/knowledge-base.model";
|
||||
import { Card, Button, Badge, Input, Tabs, Modal, Breadcrumb, Tag } from "antd";
|
||||
import { mockChunks, mockQAPairs, sliceOperators } from "@/mock/knowledgeBase";
|
||||
import type {
|
||||
KnowledgeBase,
|
||||
KBFile,
|
||||
} from "@/pages/KnowledgeGeneration/knowledge-base.model";
|
||||
import { Link, useNavigate } from "react-router";
|
||||
import DetailHeader from "@/components/DetailHeader";
|
||||
import DevelopmentInProgress from "@/components/DevelopmentInProgress";
|
||||
@@ -59,7 +49,7 @@ const getStatusColor = (status: string) => {
|
||||
};
|
||||
|
||||
const KnowledgeBaseFileDetail: React.FC = () => {
|
||||
return <DevelopmentInProgress />;
|
||||
return <DevelopmentInProgress showTime="2025.10.30" />;
|
||||
const navigate = useNavigate();
|
||||
// 假设通过 props 或路由参数获取 selectedFile/selectedKB
|
||||
const [selectedFile] = useState<KBFile>(
|
||||
|
||||
@@ -20,7 +20,7 @@ import CardView from "@/components/CardView";
|
||||
import DevelopmentInProgress from "@/components/DevelopmentInProgress";
|
||||
|
||||
export default function KnowledgeGenerationPage() {
|
||||
return <DevelopmentInProgress />;
|
||||
return <DevelopmentInProgress showTime="2025.10.30" />;
|
||||
const navigate = useNavigate();
|
||||
const [knowledgeBases, setKnowledgeBases] =
|
||||
useState<KnowledgeBase[]>(mockKnowledgeBases);
|
||||
|
||||
@@ -9,9 +9,9 @@ const MainLayout = () => {
|
||||
{/* Sidebar */}
|
||||
<Sidebar />
|
||||
{/* Main Content */}
|
||||
<div className="flex-1 flex flex-col overflow-auto p-6">
|
||||
<div className="flex-overflow-auto p-6">
|
||||
{/* Content Area */}
|
||||
<div className="flex-1 flex flex-col overflow-auto">
|
||||
<div className="flex-overflow-auto">
|
||||
<Outlet />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { memo, useEffect, useState } from "react";
|
||||
import { memo, useEffect, useState } from "react";
|
||||
import { Button, Menu, Popover } from "antd";
|
||||
import {
|
||||
CloseOutlined,
|
||||
@@ -105,7 +105,6 @@ const AsiderAndHeaderLayout = () => {
|
||||
defaultOpenKeys={["synthesis"]}
|
||||
onClick={({ key }) => {
|
||||
setActiveItem(key);
|
||||
console.log(`/data/${key}`);
|
||||
navigate(`/data/${key}`);
|
||||
}}
|
||||
/>
|
||||
@@ -169,10 +168,7 @@ const AsiderAndHeaderLayout = () => {
|
||||
<div
|
||||
className="fixed inset-0 z-40"
|
||||
onClick={() => {
|
||||
console.log("clicked outside");
|
||||
|
||||
setTaskCenterVisible(false);
|
||||
toggleShowTaskPopover(false);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -123,7 +123,7 @@ export default function OperatorPluginCreate() {
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="h-full flex flex-col overflow-auto bg-gray-50">
|
||||
<div className="flex-overflow-auto bg-gray-50">
|
||||
{/* Header */}
|
||||
<div className="flex justify-between items-center">
|
||||
<div className="flex items-center gap-4">
|
||||
@@ -167,8 +167,8 @@ export default function OperatorPluginCreate() {
|
||||
</div>
|
||||
|
||||
{/* Content */}
|
||||
<div className="h-full flex flex-col flex-1 overflow-y-auto p-6 mt-4 bg-white rounded-md shadow">
|
||||
<div className="h-full w-full flex flex-col flex-1 overflow-y-auto">
|
||||
<div className="flex-overflow-auto p-6 mt-4 bg-white border-card">
|
||||
<div className="flex-overflow-auto">
|
||||
{uploadStep === "upload" && (
|
||||
<UploadStep onUpload={handleFileUpload} isUploading={isUploading} />
|
||||
)}
|
||||
|
||||
@@ -115,9 +115,9 @@ export default function OperatorMarketPage() {
|
||||
</div> */}
|
||||
</div>
|
||||
{/* Main Content */}
|
||||
<div className="flex flex-1 overflow-auto h-full bg-white rounded-lg">
|
||||
<div className="flex-overflow-auto flex-row border-card">
|
||||
<div
|
||||
className={`border-r border-gray-200 transition-all duration-300 ${
|
||||
className={`border-r border-gray-100 transition-all duration-300 ${
|
||||
showFilters
|
||||
? "translate-x-0 w-56"
|
||||
: "-translate-x-full w-0 opacity-0"
|
||||
@@ -130,7 +130,7 @@ export default function OperatorMarketPage() {
|
||||
setSelectedFilters={setSelectedFilters}
|
||||
/>
|
||||
</div>
|
||||
<div className="flex-1 bg-yellow flex flex-col px-4 my-4">
|
||||
<div className="flex-overflow-auto p-6 ">
|
||||
<div className="flex w-full items-top gap-4 border-b border-gray-200 mb-4">
|
||||
{!showFilters && (
|
||||
<Button
|
||||
@@ -139,9 +139,8 @@ export default function OperatorMarketPage() {
|
||||
onClick={() => setShowFilters(true)}
|
||||
/>
|
||||
)}
|
||||
<div className="flex-1">
|
||||
<div className="flex-1 mb-4">
|
||||
<SearchControls
|
||||
className="mb-4"
|
||||
searchTerm={searchParams.keyword}
|
||||
onSearchChange={(keyword) =>
|
||||
setSearchParams({ ...searchParams, keyword })
|
||||
|
||||
@@ -129,7 +129,7 @@ const Filters: React.FC<FiltersProps> = ({
|
||||
);
|
||||
|
||||
return (
|
||||
<div className="p-4 space-y-4 h-full overflow-y-auto">
|
||||
<div className="p-6 space-y-4 h-full overflow-y-auto">
|
||||
{/* Filter Header */}
|
||||
<div className="flex items-center justify-between">
|
||||
<h3 className="text-sm font-medium text-gray-900 flex items-center gap-2">
|
||||
@@ -142,7 +142,7 @@ const Filters: React.FC<FiltersProps> = ({
|
||||
className="cursor-pointer hover:text-blue-500"
|
||||
></Button>
|
||||
</Tooltip>
|
||||
筛选器
|
||||
<h4>筛选器</h4>
|
||||
</h3>
|
||||
{hasActiveFilters && (
|
||||
<span
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Button, Avatar, List, Tag, Badge } from "antd";
|
||||
import { Button, List, Tag, Badge } from "antd";
|
||||
import { DeleteOutlined, EditOutlined, StarFilled } from "@ant-design/icons";
|
||||
import { Brain, Code, Cpu, Package, Zap, Settings, X } from "lucide-react";
|
||||
import { Zap, Settings, X } from "lucide-react";
|
||||
import { useState } from "react";
|
||||
import { useNavigate } from "react-router";
|
||||
import { Operator } from "../../operator.model";
|
||||
@@ -49,20 +49,10 @@ export function ListView({ operators, pagination }) {
|
||||
statusConfig[status as keyof typeof statusConfig] || statusConfig.active
|
||||
);
|
||||
};
|
||||
const getTypeIcon = (type: string) => {
|
||||
const iconMap = {
|
||||
preprocessing: Code,
|
||||
training: Brain,
|
||||
inference: Cpu,
|
||||
postprocessing: Package,
|
||||
};
|
||||
const IconComponent = iconMap[type as keyof typeof iconMap] || Code;
|
||||
return <IconComponent className="w-4 h-4" />;
|
||||
};
|
||||
|
||||
return (
|
||||
<List
|
||||
className="p-4 overflow-auto mx-4"
|
||||
className="p-4 flex-1 overflow-auto mx-4"
|
||||
dataSource={operators}
|
||||
pagination={pagination}
|
||||
renderItem={(operator) => (
|
||||
|
||||
@@ -31,7 +31,7 @@ const { TextArea } = Input;
|
||||
const { Option } = Select;
|
||||
|
||||
export default function CreateRatioTask() {
|
||||
return <DevelopmentInProgress />;
|
||||
return <DevelopmentInProgress showTime="2025.11.30" />;
|
||||
|
||||
const navigate = useNavigate();
|
||||
const [form] = Form.useForm();
|
||||
|
||||
@@ -28,7 +28,7 @@ import { SearchControls } from "@/components/SearchControls";
|
||||
import DevelopmentInProgress from "@/components/DevelopmentInProgress";
|
||||
|
||||
export default function RatioTasksPage() {
|
||||
return <DevelopmentInProgress />;
|
||||
return <DevelopmentInProgress showTime="2025.11.30" />;
|
||||
const navigate = useNavigate();
|
||||
const [searchQuery, setSearchQuery] = useState("");
|
||||
const [filterStatus, setFilterStatus] = useState("all");
|
||||
|
||||
@@ -41,7 +41,7 @@ import DevelopmentInProgress from "@/components/DevelopmentInProgress";
|
||||
const { TextArea } = Input;
|
||||
|
||||
export default function SynthesisTaskCreate() {
|
||||
return <DevelopmentInProgress />;
|
||||
return <DevelopmentInProgress showTime="2025.11.30" />;
|
||||
const navigate = useNavigate();
|
||||
const [form] = Form.useForm();
|
||||
const [searchQuery, setSearchQuery] = useState("");
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import { useState, useRef } from "react";
|
||||
import { Card, Select, Input, Button, Badge, Divider, Form, message } from "antd";
|
||||
import {
|
||||
Plus,
|
||||
ArrowLeft,
|
||||
Play,
|
||||
Save,
|
||||
RefreshCw,
|
||||
FileText,
|
||||
Code,
|
||||
X,
|
||||
} from "lucide-react";
|
||||
Card,
|
||||
Select,
|
||||
Input,
|
||||
Button,
|
||||
Badge,
|
||||
Divider,
|
||||
Form,
|
||||
message,
|
||||
} from "antd";
|
||||
import { Plus, ArrowLeft, Play, Save, RefreshCw, Code, X } from "lucide-react";
|
||||
import { useNavigate } from "react-router";
|
||||
import { mockTemplates } from "@/mock/annotation";
|
||||
import DevelopmentInProgress from "@/components/DevelopmentInProgress";
|
||||
@@ -17,9 +17,11 @@ import DevelopmentInProgress from "@/components/DevelopmentInProgress";
|
||||
const { TextArea } = Input;
|
||||
|
||||
export default function InstructionTemplateCreate() {
|
||||
return <DevelopmentInProgress />;
|
||||
return <DevelopmentInProgress showTime="2025.11.30" />;
|
||||
const navigate = useNavigate();
|
||||
const [selectedTemplate, setSelectedTemplate] = useState<Template | null>(null);
|
||||
const [selectedTemplate, setSelectedTemplate] = useState<Template | null>(
|
||||
null
|
||||
);
|
||||
const [isTestingTemplate, setIsTestingTemplate] = useState(false);
|
||||
const [templates, setTemplates] = useState<Template[]>(mockTemplates);
|
||||
const [variables, setVariables] = useState<string[]>([]);
|
||||
@@ -131,10 +133,7 @@ export default function InstructionTemplateCreate() {
|
||||
{/* Header */}
|
||||
<div className="flex items-center justify-between mb-2">
|
||||
<div className="flex items-center">
|
||||
<Button
|
||||
onClick={() => navigate("/data/synthesis/task")}
|
||||
type="text"
|
||||
>
|
||||
<Button onClick={() => navigate("/data/synthesis/task")} type="text">
|
||||
<ArrowLeft className="w-4 h-4 mr-2" />
|
||||
</Button>
|
||||
<h1 className="text-xl font-bold bg-clip-text">
|
||||
@@ -177,7 +176,9 @@ export default function InstructionTemplateCreate() {
|
||||
<Form.Item label="模板描述" name="description">
|
||||
<Input placeholder="简要描述模板的用途和特点" />
|
||||
</Form.Item>
|
||||
<h2 className="font-medium text-gray-900 text-lg mt-6 mb-2">Prompt内容</h2>
|
||||
<h2 className="font-medium text-gray-900 text-lg mt-6 mb-2">
|
||||
Prompt内容
|
||||
</h2>
|
||||
<Form.Item
|
||||
label="Prompt内容"
|
||||
name="prompt"
|
||||
@@ -194,7 +195,9 @@ export default function InstructionTemplateCreate() {
|
||||
提示:使用 {"{变量名}"} 格式定义变量,例如 {"{text}"} 或 {"{input}"}
|
||||
</p>
|
||||
<div className="mb-4">
|
||||
<span className="text-sm font-semibold text-gray-700">变量管理</span>
|
||||
<span className="text-sm font-semibold text-gray-700">
|
||||
变量管理
|
||||
</span>
|
||||
<div className="flex flex-wrap gap-2 min-h-[50px] p-3 border rounded-xl bg-gray-50 mt-2">
|
||||
{variables.map((variable, index) => (
|
||||
<Badge
|
||||
@@ -226,13 +229,19 @@ export default function InstructionTemplateCreate() {
|
||||
className="h-8 text-sm"
|
||||
onPressEnter={handleAddVariable}
|
||||
/>
|
||||
<Button onClick={handleAddVariable} type="default" className="px-4 text-sm">
|
||||
<Button
|
||||
onClick={handleAddVariable}
|
||||
type="default"
|
||||
className="px-4 text-sm"
|
||||
>
|
||||
<Plus className="w-3 h-3 mr-1" />
|
||||
添加
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<h2 className="font-medium text-gray-900 text-lg mb-2 pt-2">模板测试</h2>
|
||||
<h2 className="font-medium text-gray-900 text-lg mb-2 pt-2">
|
||||
模板测试
|
||||
</h2>
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<Form.Item label="测试输入" name="testInput">
|
||||
<TextArea
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useState } from "react";
|
||||
import { Tabs, Button, Card } from "antd";
|
||||
import { Tabs, Button } from "antd";
|
||||
import { Plus, ArrowRight } from "lucide-react";
|
||||
import DataAnnotation from "../DataAnnotation/Annotate/components/TextAnnotation";
|
||||
import { useNavigate } from "react-router";
|
||||
@@ -8,7 +8,7 @@ import SynthesisTaskTab from "./components/SynthesisTaskTab";
|
||||
import DevelopmentInProgress from "@/components/DevelopmentInProgress";
|
||||
|
||||
export default function DataSynthesisPage() {
|
||||
return <DevelopmentInProgress />;
|
||||
return <DevelopmentInProgress showTime="2025.11.30" />;
|
||||
const navigate = useNavigate();
|
||||
|
||||
const [activeTab, setActiveTab] = useState("tasks");
|
||||
|
||||
Reference in New Issue
Block a user