From cddfe9b149413455d60aca980a50888175dd2250 Mon Sep 17 00:00:00 2001 From: hefanli <76611805+hefanli@users.noreply.github.com> Date: Thu, 20 Nov 2025 18:50:51 +0800 Subject: [PATCH] =?UTF-8?q?feature:=20=E6=95=B0=E6=8D=AE=E9=85=8D=E6=AF=94?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=80=9A=E8=BF=87=E6=9B=B4=E6=96=B0=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=9D=A5=E9=85=8D=E7=BD=AE=20(#95)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feature: 数据配比增加通过更新时间来配置 * fix: 修复配比时间参数传递的问题 --- .../RatioTask/Create/CreateRatioTask.tsx | 28 +- .../Create/components/BasicInformation.tsx | 2 +- .../Create/components/RatioConfig.tsx | 375 +++++++++--------- .../Create/components/RatioTransfer.tsx | 169 -------- .../Create/components/SelectDataset.tsx | 66 ++- .../app/module/shared/schema/__init__.py | 8 +- .../app/module/shared/schema/common.py | 13 +- .../module/synthesis/interface/ratio_task.py | 88 ++-- .../app/module/synthesis/schema/ratio_task.py | 40 +- .../module/synthesis/service/ratio_task.py | 264 +++++++----- 10 files changed, 458 insertions(+), 595 deletions(-) delete mode 100644 frontend/src/pages/RatioTask/Create/components/RatioTransfer.tsx diff --git a/frontend/src/pages/RatioTask/Create/CreateRatioTask.tsx b/frontend/src/pages/RatioTask/Create/CreateRatioTask.tsx index 2c94f0d..e27b4aa 100644 --- a/frontend/src/pages/RatioTask/Create/CreateRatioTask.tsx +++ b/frontend/src/pages/RatioTask/Create/CreateRatioTask.tsx @@ -7,7 +7,6 @@ import { useNavigate } from "react-router"; import SelectDataset from "@/pages/RatioTask/Create/components/SelectDataset.tsx"; import BasicInformation from "@/pages/RatioTask/Create/components/BasicInformation.tsx"; import RatioConfig from "@/pages/RatioTask/Create/components/RatioConfig.tsx"; -import RatioTransfer from "./components/RatioTransfer"; export default function CreateRatioTask() { const navigate = useNavigate(); @@ -36,27 +35,12 @@ export default function CreateRatioTask() { message.error("请配置配比项"); return; } - // Build request payload - const ratio_method = - ratioTaskForm.ratioType === "dataset" ? "DATASET" : "TAG"; const totals = String(values.totalTargetCount); const config = ratioTaskForm.ratioConfigs.map((c) => { - if (ratio_method === "DATASET") { - return { - datasetId: String(c.source), - counts: String(c.quantity ?? 0), - filter_conditions: "", - }; - } - // TAG mode: source key like `${datasetId}_${label}` - const source = String(c.source || ""); - const idx = source.indexOf("_"); - const datasetId = idx > 0 ? source.slice(0, idx) : source; - const label = idx > 0 ? source.slice(idx + 1) : ""; return { - datasetId, + datasetId: c.id, counts: String(c.quantity ?? 0), - filter_conditions: label ? JSON.stringify({ label }) : "", + filterConditions: { label: c.labelFilter, dateRange: String(c.dateRange ?? 0)}, }; }); @@ -65,7 +49,6 @@ export default function CreateRatioTask() { name: values.name, description: values.description, totals, - ratio_method, config, }); message.success("配比任务创建成功"); @@ -108,13 +91,6 @@ export default function CreateRatioTask() { totalTargetCount={ratioTaskForm.totalTargetCount} /> - {/* */} -
= ({ -