import React, { useEffect, useRef, useState } from 'react'; import ContentCard from '@/components/ContentCard'; import { Button, Collapse, Select, Space } from 'antd'; import { ActionType, EditableProTable, ProColumns } from '@ant-design/pro-table'; // import ProForm, { ProFormInstance } from '@ant-design/pro-form'; import { getOnlyKey } from '@/utils/utils'; import { PlusCircleOutlined } from '@ant-design/icons'; import './index.less'; import { isArray } from 'lodash'; const { Panel } = Collapse; const DEMAND_DICT = [ { label: 'M1-1', value: '1', }, { label: 'M1-2', value: '2', }, { label: 'M1-3', value: '3', }, ]; const REF_MAP = {};

const VersionConfiguration: React.FC = () => { // const actionRef = useRef(null); const [editKeys, setEditKeys] = useState<React.Key[]>([]); // const formRef = useRef(); const [activeKeys, setActiveKeys] = useState<string[]>([...DEMAND_DICT.map((_) => _.value)]); const otherRef=useRef(); const columns: ProColumns[] = [ { title: '节点版本', dataIndex: 'nodeVersion', align: 'center', }, { title: '测试项', dataIndex: 'testingItem', align: 'center', }, { title: '负责人', dataIndex: 'head', align: 'center', }, { title: '用例库名称', dataIndex: 'caseLibraryName', align: 'center', }, { title: '交付件模板', dataIndex: 'deliveryTemplate', align: 'center', }, { title: '测试周期(天)', dataIndex: 'testCycle', align: 'center', }, { title: '参考投入人力(人天)', dataIndex: 'referenceInputManpower', align: 'center', }, { title: '操作', valueType: 'option', width: 120, align: 'center', render: (text, record, _, action) => [ <a key="editable" onClick={() => { action?.startEditable?.(record.key); }} > 配置 , 删除, // <Popconfirm // title="确定删除此行?" // key="delete" // onConfirm={async () => { // try { // const { code, msg } = await deletedCategory({ // id: record.id, // }); // if ((code as unknown as string) !== 'BIZ_SUCCESS') throw new Error(msg); // message.success('删除成功!'); // staragyList(); // } catch (error) {} // }} // okText="确定" // cancelText="取消" // > // 删除 // , ], }, ]; useEffect(() => { // const data = [ // { // nodeVersion: '1', // testingItem: '全功能用例测试', // head: '张三', // caseLibraryName: '222', // }, // { // nodeVersion: '2', // testingItem: '全功能用例测试', // head: '张三', // caseLibraryName: '111', // }, // ]; // formRef.current?.setFieldsValue({ // dataSource: data.map((item: any) => ({ key: getOnlyKey(), ...item })), // }); }, []);

if (DEMAND_DICT.length > 0) { DEMAND_DICT.forEach((item) => { REF_MAP[item.value] = otherRef; }); } return ( <div className="riskmMonthly" style={{ marginBottom: 15 }}> <span style={{ fontWeight: 'bold', fontSize: '14px' }}>测试节点类型: <Select style={{ width: 230 }} />