columns.ts 773 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import { h } from 'vue';
  2. import { BasicColumn } from '@/components/Table';
  3. export const columns: BasicColumn[] = [
  4. {
  5. label: '角色id',
  6. prop: 'roleId',
  7. },
  8. {
  9. label: '角色类型',
  10. prop: 'role_type',
  11. render(record) {
  12. let type = '管理员';
  13. if (record.row.role_type === 1) {
  14. type = '超级管理员';
  15. } else if (record.row.role_type === 3) {
  16. type = '用户';
  17. }
  18. return h(
  19. 'span',
  20. {},
  21. {
  22. default: () => type,
  23. },
  24. );
  25. },
  26. },
  27. {
  28. label: '角色编码',
  29. prop: 'roleCode',
  30. },
  31. {
  32. label: '角色名称',
  33. prop: 'roleName',
  34. },
  35. {
  36. label: '备注',
  37. prop: 'remark',
  38. },
  39. {
  40. label: '创建时间',
  41. prop: 'createTime',
  42. },
  43. ];