Ant Design Pro Form 配置测试节点模态框组件
import { ModalForm, ProFormList, ProFormText } from '@ant-design/pro-form'; import React, { useRef, useState } from 'react'; import type { FormListOperation } from 'antd/lib/form/FormList'; import { Button, Popconfirm, Space, message } from 'antd'; import { getOnlyKey } from '@/utils/utils';
interface UpdateProps {
children: React.ReactElement;
// refresh: () => void;
detail?: DIConfigItem;
}
const ConfigurationModal: React.FC
const [visible, setVisible] = useState(false);
const actionRef = useRef
return (
<>
{React.cloneElement(children, {
onClick: () => setVisible(true),
})}
<ModalForm
title={${detail ? '编辑' : '新增'}配置测试节点}
visible={visible}
initialValues={detail ? detail : { configPlanList: [{ nodeName: '' }] }}
width={900}
labelCol={{ span: 4 }}
layout="horizontal"
modalProps={{ onCancel: () => { setVisible(false); }, destroyOnClose: true }}
>
节点版本${index + 1}} />
原文地址: https://www.cveoy.top/t/topic/qeX7 著作权归作者所有。请勿转载和采集!