DesignPic_20250812155848.tsx 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import React from 'react'
  2. import { Button, Table, Input } from '@alifd/next';
  3. export default function DesignPic() {
  4. const dataSource = () => {
  5. const result = [];
  6. for (let i = 0; i < 5; i++) {
  7. result.push({
  8. title: { name: `Quotation for 1PCS Nano ${3 + i}.0 controller compatible` },
  9. id: 100306660940 + i,
  10. time: 2e3 + i,
  11. });
  12. }
  13. return result;
  14. };
  15. const pic_render = (value: any, index: number, record: any) => {
  16. return (
  17. <img className='size-20' src={record.url} alt={record.title} />
  18. );
  19. }
  20. const name_render = (value: any, index: number, record: any) => {
  21. return <>
  22. <Input.TextArea
  23. value={record.id}
  24. // onChange={handleChange}
  25. composition
  26. placeholder={'请输入'}
  27. />
  28. </>
  29. };
  30. const label_render = (value: any, index: number, record: any) => {
  31. return <>
  32. <Input.TextArea
  33. value={record.id}
  34. // onChange={handleChange}
  35. composition
  36. placeholder={'请输入'}
  37. />
  38. </>
  39. };
  40. const option_render = (value: any, index: number, record: any) => {
  41. return (
  42. <a className='text-red-600'>
  43. 删除
  44. </a>
  45. );
  46. };
  47. return (
  48. <div className='w-3xl h-fit'>
  49. <Button>按钮</Button>
  50. <Table dataSource={dataSource()}>
  51. <Table.Column title="图片" cell={pic_render} />
  52. <Table.Column title="图片名称" cell={name_render} />
  53. <Table.Column title="图片标签" cell={label_render} />
  54. <Table.Column title="操作" cell={option_render} />
  55. </Table>
  56. </div>
  57. )
  58. }