一些JSX

51 阅读1分钟
 {
      title: "封面",
      search: false,
      dataIndex: 'pic',
      render: (text: string) => {
        return <img className="data-img-src" src={text} />;
      },
    },
  const statusType = [
    t('待支付'),
    t('待配货'),
    t('待发货'),
    t('发货中'),
    t('已完成'),
  ];

{
      title: "状态",
      search: false,
      dataIndex: 'status',
      render: (text: number) => {
        return statusType[text - 1]
      },
  },
    
    
  tabs: {
                onChange: (key) => handleStatus(key),
                items: [
                  {
                    key: '-1',
                    tab: t('order.all'),
                  },
                  ...statusType.map((tab, index) => ({ key: '' + index, tab }))

                ],
         },
    {
      title: "价格",
      search: false,
      dataIndex: 'price',
      render: (text: string, record) => {
        return (record?.currency == 0 ? "Y " : "$ ") + text
      },
    },
    {
      title: "时间",
      search: false,
      // dataIndex: '',
      render: (value: any) => {
        // console.log('1', value);
        return <><p>创建时间:{value.createDate}</p>
          {!!(value.payDate) && <p>支付时间:{value.payDate}</p>}
          {!!(value.shippingDate) && <p>发货时间:{value.shippingDate}</p>}</>
      }
    }