import { Form } from 'antd'; import React, { useState } from 'react'; import { ArrowUpOutlined, ArrowDownOutlined, DeleteOutlined } from '@ant-design/icons'; function FormContent(props) { const { list, onChange, onSelect } = props; const [currentItem, setCurrentItem] = useState(null); const handleDelete = index => { let _list = [...list]; _list.splice(index, 1); onChange(_list); }; const handleUp = index => { let _list = [...list]; // 跟上一位置换位置 const temp = _list[index - 1]; _list[index - 1] = _list[index]; _list[index] = temp; onChange(_list); }; const handleDown = index => { let _list = [...list]; const temp = _list[index + 1]; _list[index + 1] = _list[index]; _list[index] = temp; onChange(_list); }; const handleSelect = index => { setCurrentItem(index); onSelect(index); }; return (