Skip to content

Commit cc439a2

Browse files
committed
frontend: 算子市场页面更新
1 parent 14e19ae commit cc439a2

File tree

17 files changed

+413
-634
lines changed

17 files changed

+413
-634
lines changed

frontend/src/hooks/useFetchData.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,14 @@ export default function useFetchData<T>(
5555
return arr[0];
5656
}
5757

58-
async function fetchData() {
58+
async function fetchData(extraParams = {}) {
5959
const { keywords, filter, current, pageSize } = searchParams;
6060
Loading.show();
6161
setLoading(true);
6262
try {
6363
const { data } = await fetchFunc({
6464
...filter,
65+
...extraParams,
6566
keywords,
6667
type: getFirstOfArray(filter?.type) || undefined,
6768
status: getFirstOfArray(filter?.status) || undefined,

frontend/src/pages/DataCleansing/Create/components/OperatorConfig.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React from "react";
22
import { Tag, Divider, Form } from "antd";
33
import ParamConfig from "./ParamConfig";
4-
import { OperatorI } from "../../cleansing.model";
54
import { Settings } from "lucide-react";
5+
import { OperatorI } from "@/pages/OperatorMarket/operator.model";
66

77
// OperatorConfig/OperatorTemplate 类型需根据主文件实际导入
88
interface OperatorConfigProps {

frontend/src/pages/DataCleansing/Create/components/OperatorLibrary.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import React, { useMemo, useState } from "react";
22
import { Card, Input, Select, Tooltip, Collapse, Tag, Checkbox } from "antd";
33
import { StarFilled, StarOutlined, SearchOutlined } from "@ant-design/icons";
4-
import type { OperatorI } from "@/pages/DataCleansing/cleansing.model";
5-
import { CategoryI } from "@/pages/OperatorMarket/operator.model";
4+
import { CategoryI, OperatorI } from "@/pages/OperatorMarket/operator.model";
65
import { Layers } from "lucide-react";
76

87
interface OperatorListProps {

frontend/src/pages/DataCleansing/Create/components/OperatorOrchestration.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import React, { useState } from "react";
22
import { Card, Input, Tag, Select, Button } from "antd";
33
import { DeleteOutlined } from "@ant-design/icons";
4-
import { CleansingTemplate, OperatorI } from "../../cleansing.model";
4+
import { CleansingTemplate } from "../../cleansing.model";
55
import { Workflow } from "lucide-react";
6+
import { OperatorI } from "@/pages/OperatorMarket/operator.model";
67

78
interface OperatorFlowProps {
89
selectedOperators: OperatorI[];

frontend/src/pages/DataCleansing/Create/components/ParamConfig.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
22
import { Input, Select, Radio, Checkbox, Form, InputNumber, Slider } from "antd";
3-
import { OperatorI } from "../../cleansing.model";
3+
import { OperatorI } from "@/pages/OperatorMarket/operator.model";
44

55
interface ParamConfigProps {
66
operator: OperatorI;

frontend/src/pages/DataCleansing/Create/hooks/useDragOperators.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { OperatorI } from "@/pages/OperatorMarket/operator.model";
12
import React, { useState } from "react";
2-
import { OperatorI } from "../../cleansing.model";
33

44
export function useDragOperators({
55
operators,

frontend/src/pages/DataCleansing/Create/hooks/useOperatorOperations.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useEffect, useState } from "react";
2-
import { CleansingTemplate, OperatorI } from "../../cleansing.model";
2+
import { OperatorI } from "@/pages/OperatorMarket/operator.model";
3+
import { CleansingTemplate } from "../../cleansing.model";
34
import { queryCleaningTemplatesUsingGet } from "../../cleansing.api";
45
import {
56
queryCategoryTreeUsingGet,

frontend/src/pages/DataCleansing/Detail/components/BasicInfo.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import type {
2-
CleansingTask,
3-
OperatorI,
4-
} from "@/pages/DataCleansing/cleansing.model";
5-
import { Button, Card, Descriptions, Progress, Badge, Tag } from "antd";
1+
import type { CleansingTask } from "@/pages/DataCleansing/cleansing.model";
2+
import { OperatorI } from "@/pages/OperatorMarket/operator.model";
3+
import { Button, Card, Descriptions, Progress, Tag } from "antd";
64
import { Activity, AlertCircle, CheckCircle, Clock } from "lucide-react";
75
import { useNavigate } from "react-router";
86

frontend/src/pages/DataCleansing/cleansing.model.ts

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,4 @@
1-
export interface OperatorI {
2-
id: string;
3-
name: string;
4-
type: string;
5-
icon: React.ReactNode;
6-
description: string;
7-
tags: string[];
8-
isStar?: boolean;
9-
originalId?: string; // 用于标识原始算子ID,便于去重
10-
categories: number[]; // 分类列表
11-
settings: string;
12-
params?: { [key: string]: any }; // 用户配置的参数
13-
defaultParams?: { [key: string]: any }; // 默认参数
14-
configs: {
15-
[key: string]: {
16-
type: "input" | "select" | "radio" | "checkbox" | "range";
17-
label: string;
18-
value: any;
19-
options?: string[] | { label: string; value: any }[];
20-
min?: number;
21-
max?: number;
22-
step?: number;
23-
};
24-
};
25-
}
1+
import { OperatorI } from "../OperatorMarket/operator.model";
262

273
export interface CleansingTask {
284
id: string;

frontend/src/pages/DataCollection/Home/components/TaskManagement.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ import {
1010
import { TaskStatus, type CollectionTask } from "../../collection.model";
1111
import { StatusMap, SyncModeMap } from "../../collection.const";
1212
import useFetchData from "@/hooks/useFetchData";
13+
import { useNavigate } from "react-router";
1314

1415
export default function TaskManagement() {
1516
const { message } = App.useApp();
17+
const navigate = useNavigate();
1618
const filters = [
1719
{
1820
key: "status",
@@ -52,19 +54,17 @@ export default function TaskManagement() {
5254
fetchData();
5355
};
5456

55-
const handleViewDetail = (record: CollectionTask) => {
56-
// Implement your view detail logic here
57-
console.log("Viewing details for task:", record);
58-
};
59-
6057
const columns = [
6158
{
6259
title: "任务名称",
6360
dataIndex: "name",
6461
key: "name",
6562
fixed: "left",
6663
render: (text: string, record: CollectionTask) => (
67-
<Button type="link" onClick={() => handleViewDetail(record)}>
64+
<Button
65+
type="link"
66+
onClick={() => navigate("`/data-collection/tasks/${record.id}`)}>")}
67+
>
6868
{text}
6969
</Button>
7070
),

0 commit comments

Comments
 (0)