import React, { useState } from 'react' import { Button, Table, Input } from '@alifd/next'; export default function DesignPic() { // 添加状态管理表格数据 const [tableData, setTableData] = useState(() => { const result = []; for (let i = 0; i < 5; i++) { result.push({ title: { name: `Quotation for 1PCS Nano ${3 + i}.0 controller compatible` }, id: 100306660940 + i, time: 2e3 + i, // 添加名称和标签字段 picName: '', picLabel: '' }); } return result; }); const pic_render = (value: any, index: number, record: any) => { return ( {record.title} ); } // 修改图片名称渲染函数 const name_render = (value: any, index: number, record: any) => { return <> handleNameChange(value, index)} composition placeholder={'请输入图片名称'} /> }; // 修改图片标签渲染函数 const label_render = (value: any, index: number, record: any) => { return <> handleLabelChange(value, index)} composition placeholder={'请输入图片标签'} /> }; // 添加名称变化处理函数 const handleNameChange = (value: string, index: number) => { const newData = [...tableData]; newData[index].picName = value; setTableData(newData); }; // 添加标签变化处理函数 const handleLabelChange = (value: string, index: number) => { const newData = [...tableData]; newData[index].picLabel = value; setTableData(newData); }; const option_render = (value: any, index: number, record: any) => { return ( 删除 ); }; return (
) }