60 lines
1.0 KiB
TypeScript
60 lines
1.0 KiB
TypeScript
import { h } from 'vue';
|
|
import { Tag } from 'ant-design-vue';
|
|
|
|
export const columns2 = [
|
|
{
|
|
title: 'ID',
|
|
dataIndex: 'id',
|
|
width: 100,
|
|
fixed: 'left',
|
|
},
|
|
{
|
|
title: '通知标题',
|
|
dataIndex: 'title',
|
|
width: 200,
|
|
},
|
|
{
|
|
title: '通知类型',
|
|
dataIndex: 'type',
|
|
customRender({ record }) {
|
|
return h(
|
|
Tag,
|
|
{
|
|
color: record.type == 1 ? 'processing' : 'success',
|
|
},
|
|
{
|
|
default: () => (record.type == 1 ? '通知' : '公告'),
|
|
},
|
|
);
|
|
},
|
|
},
|
|
{
|
|
title: '通知状态',
|
|
dataIndex: 'status',
|
|
customRender({ record }) {
|
|
return h(
|
|
Tag,
|
|
{
|
|
color: record.status == 1 ? 'success' : 'error',
|
|
},
|
|
{
|
|
default: () => (record.status == 1 ? '正常' : '禁用'),
|
|
},
|
|
);
|
|
},
|
|
},
|
|
{
|
|
title: '点击率',
|
|
dataIndex: 'clickNum',
|
|
},
|
|
{
|
|
title: '创建人',
|
|
dataIndex: 'createUser',
|
|
},
|
|
{
|
|
title: '创建时间',
|
|
dataIndex: 'createTime',
|
|
width: 180,
|
|
},
|
|
];
|