overviewColumns.ts 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import { h } from 'vue';
  2. import { ElTooltip } from 'element-plus';
  3. import type { BasicColumn } from '@/components/Table';
  4. export const userGroupCol: BasicColumn[] = [
  5. {
  6. label: '分组名称',
  7. prop: 'name',
  8. },
  9. {
  10. label: '分组描述',
  11. prop: 'description',
  12. minWidth: 100,
  13. render(record) {
  14. const truncatedDescription = record.row.description.length > 15 ? record.row.description.substring(0, 15) + '...' : record.row.description;
  15. return h(
  16. ElTooltip,
  17. {
  18. content: record.row.description,
  19. disabled:record.row.description.length<=15,
  20. effect: 'light',
  21. },
  22. {
  23. default: () =>
  24. h(
  25. 'span',
  26. {
  27. style: {
  28. whiteSpace: 'nowrap',
  29. overflow: 'hidden',
  30. textOverflow: 'ellipsis',
  31. display: 'inline-block',
  32. maxWidth:'80%',
  33. },
  34. },
  35. truncatedDescription
  36. ),
  37. }
  38. );
  39. }
  40. },
  41. {
  42. label: '组内人员',
  43. prop: 'total',
  44. },
  45. {
  46. label: '操作人',
  47. prop: 'operatorName',
  48. },
  49. {
  50. label: '操作时间',
  51. prop: 'operationTime',
  52. },
  53. ];