fix: submit form data error

This commit is contained in:
jialin
2025-04-01 22:53:25 +08:00
parent 5cbb5e7d40
commit 3fa19cf977
9 changed files with 40 additions and 67 deletions
+10 -9
View File
@@ -159,7 +159,9 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
const generateGPUIds = (data: FormData) => {
const gpu_ids = _.get(data, 'gpu_selector.gpu_ids', []);
if (!gpu_ids.length) {
return {};
return {
gpu_selector: null
};
}
const result = _.reduce(
@@ -175,14 +177,11 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
[]
);
if (result.length) {
return {
gpu_selector: {
gpu_ids: result
}
};
}
return {};
return {
gpu_selector: {
gpu_ids: result
}
};
};
const handleOk = async (formdata: FormData) => {
@@ -198,6 +197,8 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
...gpuSelector
};
console.log('allValues--------', allValues);
onOk(allValues);
};