vben admin from自定义 <template #bodyCell=“{ column, record }“>

默认输入框内容
 {
    field: 'userIds',
    label: '指定用户',
    component: 'Input',
    componentProps: {
      placeholder: '请选择用户',
    },
    required: true,
    colProps: { lg: 85, md: 24 },
  },
颜色跟自定义复现内容
 {
    title: '优先级',
    dataIndex: 'priority',
    width: 200,
    customRender: ({ record }) => {
      const colors = { H: 'red', M: 'yellow', L: 'green' };
      const texts = { H: '高', M: '中', L: '低' };
      const color = colors[record.priority] || ''; // 默认颜色为灰色
      const text = texts[record.priority] || '/';
      return h(Tag, { color: color }, () => text);
    },
    align: 'center',
  },









  {
    title: '通告对象',
绑定事件
    onClick: handleEdit.bind(null, record),
    dataIndex: 'msgType',
    width: 200,
    customRender: ({ record }) => {
      const text = record.msgType === 'USER' ? '指定用户' : '全体用户';
      return h('span', text);
    },
    align: 'center',
  }
,  








更多操作按钮
     :dropDownActions="[
                {
                color: 'error',
                label: '删除',
                popConfirm: {
                  title: '是否确认删除',
                  placement: 'left',
                  confirm: handleDelete.bind(null, record),
                },
              },
              {
                label: '发布',
                ifShow: (_action) => {
                  return record.sendStatus !== '1';
                },
                popConfirm: {
                  title: '是否确认发布',
                  placement: 'left',
                 
                  confirm: handlepush.bind(null, record),
                },
              },
              {
                label: '撤销发布',
                ifShow: (_action) => {
                  return record.sendStatus !== '2';
                },
                popConfirm: {
                  title: '是否确认撤销',
                  placement: 'left',
                  confirm: handlenopush.bind(null, record),
                },
              },
             ]"

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值