indexColumns.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. function columns(vm) {
  2. const cols = [
  3. {
  4. title: '序号',
  5. key: 'rowIndex',
  6. width: 60,
  7. align: 'center',
  8. customRender: function(t, r, index) {
  9. return parseInt(index) + 1
  10. }
  11. },
  12. {
  13. title: '姓名',
  14. align: 'center',
  15. dataIndex: 'nickName',
  16. key: 'nickName'
  17. },
  18. {
  19. title: '部门',
  20. align: 'center',
  21. dataIndex: 'dept',
  22. scopedSlots: { customRender: 'dept' },
  23. key: 'dept'
  24. },
  25. {
  26. title: '职务',
  27. align: 'center',
  28. dataIndex: 'leader',
  29. scopedSlots: { customRender: 'leader' },
  30. key: 'leader'
  31. },
  32. {
  33. title: '手机号',
  34. align: 'center',
  35. dataIndex: 'phonenumber',
  36. key: 'phonenumber'
  37. },
  38. {
  39. title: '状态',
  40. align: 'center',
  41. dataIndex: 'status',
  42. scopedSlots: { customRender: 'status' },
  43. key: 'status'
  44. },
  45. {
  46. title: '操作',
  47. dataIndex: 'action',
  48. width: 350,
  49. align: 'center',
  50. slots: { title: 'actionName' },
  51. scopedSlots: { customRender: 'action' }
  52. }
  53. ]
  54. return cols
  55. }
  56. export default columns