refactor: create cluster by steps

This commit is contained in:
jialin
2025-09-16 11:26:17 +08:00
parent 6e5a7035c8
commit 8de272239e
48 changed files with 1392 additions and 227 deletions
@@ -0,0 +1,34 @@
import ListMap from '@/components/dynamic-form/components/list-map';
import { useIntl } from '@umijs/max';
import { Form } from 'antd';
import React, { forwardRef } from 'react';
import { fieldConfig } from '../config/cloud-options-config';
const volumeOptions = fieldConfig.volumes;
const CloudOptions: React.FC<{
ref?: any;
}> = forwardRef((props, ref) => {
const intl = useIntl();
const form = Form.useFormInstance();
const volumes = Form.useWatch(['cloud_options', volumeOptions.name], form);
const handleOnChange = (name: string, value: any) => {
console.log('handleOnChange========', name, value);
form.setFieldValue(['cloud_options', name], value);
};
return (
<Form.Item name={['cloud_options', volumeOptions.name as string]}>
<ListMap
btnText={intl.formatMessage({ id: 'clusters.workerpool.volumes.add' })}
label={intl.formatMessage({ id: 'clusters.workerpool.volumes' })}
dataList={volumes || []}
properties={volumeOptions.properties || {}}
onChange={(value) => handleOnChange(volumeOptions.name, value)}
/>
</Form.Item>
);
});
export default CloudOptions;