import { h } from 'vue'; import { Tag } from 'ant-design-vue'; export const columns = [ { title: '部门名称', dataIndex: 'name', key: 'name', }, { title: '部门类型', dataIndex: 'type', key: 'type', customRender({ record }) { let typeText = '' let color = '' switch (record.type) { case 1: typeText='公司' color='processing' break; case 2: typeText='子公司' color='success' break; case 3: typeText='部门' color='warning' break; case 4: typeText='小组' color='default' break; default: break; } return h( Tag, { color: color, }, { default: () => typeText, }, ); }, }, { title: '部门排序', dataIndex: 'sort', key: 'sort', }, { title: '部门备注', dataIndex: 'note', key: 'note' }, { title: '创建人', dataIndex: 'createUser', key: 'createUser', }, { title: '创建时间', dataIndex: 'createTime', key: 'createTime', }, { title: '操作', width:200, fixed: 'right', key: 'action', dataIndex:'action' }, ];