默认输入框内容
{
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),
},
},
]"