Ant Design ProV5 Table columns定义valueType

本文介绍ProTable组件,一种增强型表格方案,用于简化中后台应用开发。它支持多种配置选项,如自定义列标题、搜索栏下拉选择、时间区间筛选等,并提供了丰富的示例说明。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 ProTable - 高级表格 - ProComponents🏆 让中后台开发更简单 包含 table form 等多个组件。https://procomponents.ant.design/components/table

 https://procomponents.ant.design/components/schema#valuetype-列表

// 多种配置
{
      title: (_, type) => {
        if (type === 'table') {
          return '商户名称';
        }
        return '商户'; // 搜索框label
      },
      hideInSearch: false,
      hideInForm: false,
      hideInTable: false,
      align: 'center',
      dataIndex: 'name',
      renderText: (val) => val || '-',
}

 

//搜索栏 下拉选择 valueType: 'select',
{
      title: '运营中心',
      dataIndex: 'merchantId',
      valueType: 'select',
      fieldProps: {
        options: operateOption, // 动态变量项
      },
      hideInTable: true // 列表隐藏
},
// 搜索栏 时间区间 valueType: 'dateRange',
{
      title: '合同签订日期',
      dataIndex: 'contractDate',
      valueType: 'dateRange',
      hideInTable: true // 列表隐藏
},
{
      title: '品牌名称',
      dataIndex: 'brandName',
      fixed: 'left',
      width: 250,
      hideInSearch: true, // 搜索栏 隐藏
},
// 下拉选项 枚举 valueEnum
{
      title: '合同状态',
      dataIndex: 'contractStatus',
      align: 'center',
      valueEnum: statusOptionEnum,
      width: 200,
    },
// 操作 valueType: 'option',
{
      title: '操作',
      dataIndex: 'option',
      valueType: 'option',
      render: (_, record) => [
        <a
          key="view"
          onClick={() => {
            setCurrentRow(record);
            setViewVisible(true);
          }}
        >
          查看
        </a>,
        <a
          key="del"
          onClick={() => {            
            requestDel(record.id);
          }}
        >
          删除
        </a>,
      ],
},

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

张三风啊

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值