Skip to content

Commit 05fd4c3

Browse files
committed
fixbug: 修改算子配置字段,修改数据管理主页统计信息
1 parent d19d3b4 commit 05fd4c3

File tree

3 files changed

+41
-18
lines changed

3 files changed

+41
-18
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,26 @@ function operatorItem() {
1010
inputs: Mock.Random.integer(1, 5),
1111
outputs: Mock.Random.integer(1, 5),
1212
settings: JSON.stringify({
13-
host: { type: "input", label: "主机地址", value: "localhost" },
13+
host: { type: "input", name: "主机地址", defaultVal: "localhost" },
1414
limit: {
1515
type: "range",
16-
label: "读取行数",
17-
value: [1000, 2000],
16+
name: "读取行数",
17+
defaultVal: [1000, 2000],
1818
min: 100,
1919
max: 10000,
2020
step: 100,
2121
},
22-
filepath: { type: "input", label: "文件路径", value: "" },
22+
filepath: { type: "input", name: "文件路径", defaultVal: "/path" },
2323
encoding: {
2424
type: "select",
25-
label: "编码",
26-
value: "utf-8",
25+
name: "编码",
26+
defaultVal: "utf-8",
2727
options: ["utf-8", "gbk", "ascii"],
2828
},
2929
features: {
3030
type: "checkbox",
31-
label: "特征列",
32-
value: [],
31+
name: "特征列",
32+
defaultVal: ["feature1", "feature3"],
3333
options: ["feature1", "feature2", "feature3"],
3434
},
3535
repeatPhraseRatio: {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const ParamConfig: React.FC<ParamConfigProps> = ({
2323
param,
2424
onParamChange,
2525
}) => {
26-
const [value, setValue] = React.useState(param.value || param.default);
26+
const [value, setValue] = React.useState(param.value || param.defaultVal);
2727
const updateValue = (newValue: any) => {
2828
setValue(newValue);
2929
return onParamChange && onParamChange(operator.id, paramKey, newValue);

frontend/src/pages/DataManagement/Home/DataManagement.tsx

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,16 @@ export default function DatasetManagementPage() {
4444
const statistics = {
4545
size: [
4646
{
47-
title: "总计",
48-
value: data?.totalDatasets,
47+
title: "文本",
48+
value: data?.size?.text || "0 MB",
4949
},
5050
{
51-
title: "文件数",
52-
value: data?.totalFiles,
51+
title: "图像",
52+
value: data?.size?.image || "0 MB",
5353
},
5454
{
55-
title: "大小",
56-
value: formatBytes(data?.totalSize),
55+
title: "音频",
56+
value: data?.size?.audio || "0 MB",
5757
},
5858
{
5959
title: "视频",
@@ -79,6 +79,7 @@ export default function DatasetManagementPage() {
7979
},
8080
],
8181
};
82+
console.log(statistics);
8283
setStatisticsData(statistics);
8384
}
8485

@@ -281,17 +282,39 @@ export default function DatasetManagementPage() {
281282
</div>
282283

283284
{/* Statistics */}
284-
<div className="grid grid-cols-1 mt-4">
285-
<Card>
285+
<div className="grid grid-cols-2 gap-4 mt-4">
286+
{/* <Card>
286287
<div className="grid grid-cols-4">
287288
{statisticsData.size?.map?.((item) => (
288289
<Statistic
289-
key={item.title}
290290
title={item.title}
291+
key={item.title}
291292
value={`${item.value}`}
292293
/>
293294
))}
294295
</div>
296+
</Card> */}
297+
<Card title="数量统计">
298+
<div className="grid grid-cols-4">
299+
{statisticsData.count?.map?.((item) => (
300+
<Statistic
301+
key={item.title}
302+
title={item.title}
303+
value={item.value}
304+
/>
305+
))}
306+
</div>
307+
</Card>
308+
<Card title="大小统计">
309+
<div className="grid grid-cols-4">
310+
{statisticsData.size?.map?.((item) => (
311+
<Statistic
312+
key={item.title}
313+
title={item.title}
314+
value={item.value}
315+
/>
316+
))}
317+
</div>
295318
</Card>
296319
</div>
297320
<SearchControls

0 commit comments

Comments
 (0)