wms-antdvue/.svn/pristine/cb/cb65ef831849c5d0defdb0d99acb4ff72ea2f318.svn-base
2024-11-07 16:33:03 +08:00

75 lines
1.3 KiB
Plaintext

import { h } from 'vue';
import { Tag } from 'ant-design-vue';
export const columns = [
{
title:'ID',
dataIndex: 'id',
fixed:'left'
},
{
title: '友链名称',
dataIndex: 'name',
},
{
title: '友链类型',
dataIndex: 'type',
customRender({ record }) {
return h('span', record.type === 1 ? '友情链接' : '合作伙伴')
},
},
{
title: '友链形式',
dataIndex: 'form',
customRender({ record }) {
return h('span', record.form === 1 ? '文字链接' : '图片链接')
},
},
{
title: '友链地址',
dataIndex: 'url',
width: 200,
customRender({ record }) {
return h('a', {
href: record.url,
target:"_blank"
}, record.url);
},
},
{
title: '状态',
dataIndex: 'status',
customRender({ record }) {
return h(
Tag,
{
color: record.status ==1 ? 'success' : 'error',
},
{
default: () => (record.status ==1 ? '正常' : '停用'),
},
);
},
},
{
title: '排序',
dataIndex: 'sort',
},
{
title: '创建人',
dataIndex: 'createUser',
},
{
title: '创建时间',
dataIndex: 'createTime',
width: 180,
},
{
title: '操作',
fixed:'right',
dataIndex: 'action',
key: 'action',
width: 200,
},
];