@@ -7,7 +7,6 @@ import { useNavigate } from "react-router";
77import SelectDataset from "@/pages/RatioTask/Create/components/SelectDataset.tsx" ;
88import BasicInformation from "@/pages/RatioTask/Create/components/BasicInformation.tsx" ;
99import RatioConfig from "@/pages/RatioTask/Create/components/RatioConfig.tsx" ;
10- import RatioTransfer from "./components/RatioTransfer" ;
1110
1211export default function CreateRatioTask ( ) {
1312 const navigate = useNavigate ( ) ;
@@ -36,27 +35,12 @@ export default function CreateRatioTask() {
3635 message . error ( "请配置配比项" ) ;
3736 return ;
3837 }
39- // Build request payload
40- const ratio_method =
41- ratioTaskForm . ratioType === "dataset" ? "DATASET" : "TAG" ;
4238 const totals = String ( values . totalTargetCount ) ;
4339 const config = ratioTaskForm . ratioConfigs . map ( ( c ) => {
44- if ( ratio_method === "DATASET" ) {
45- return {
46- datasetId : String ( c . source ) ,
47- counts : String ( c . quantity ?? 0 ) ,
48- filter_conditions : "" ,
49- } ;
50- }
51- // TAG mode: source key like `${datasetId}_${label}`
52- const source = String ( c . source || "" ) ;
53- const idx = source . indexOf ( "_" ) ;
54- const datasetId = idx > 0 ? source . slice ( 0 , idx ) : source ;
55- const label = idx > 0 ? source . slice ( idx + 1 ) : "" ;
5640 return {
57- datasetId,
41+ datasetId : c . id ,
5842 counts : String ( c . quantity ?? 0 ) ,
59- filter_conditions : label ? JSON . stringify ( { label } ) : "" ,
43+ filterConditions : { label : c . labelFilter , dateRange : String ( c . dateRange ?? 0 ) } ,
6044 } ;
6145 } ) ;
6246
@@ -65,7 +49,6 @@ export default function CreateRatioTask() {
6549 name : values . name ,
6650 description : values . description ,
6751 totals,
68- ratio_method,
6952 config,
7053 } ) ;
7154 message . success ( "配比任务创建成功" ) ;
@@ -108,13 +91,6 @@ export default function CreateRatioTask() {
10891 totalTargetCount = { ratioTaskForm . totalTargetCount }
10992 />
11093
111- { /* <RatioTransfer
112- ratioTaskForm={ratioTaskForm}
113- distributions={distributions}
114- updateRatioConfig={updateRatioConfig}
115- updateLabelRatioConfig={updateLabelRatioConfig}
116- /> */ }
117-
11894 < div className = "flex h-full" >
11995 < SelectDataset
12096 selectedDatasets = { ratioTaskForm . selectedDatasets }
0 commit comments