tab2Columns.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. import dayjs from 'dayjs'
  2. function columns(vm) {
  3. const cols = [
  4. {
  5. title: '序号',
  6. key: 'rowIndex',
  7. width: 60,
  8. align: 'center',
  9. customRender: function(t, r, index) {
  10. return parseInt(index) + 1
  11. }
  12. },
  13. {
  14. title: '线别',
  15. align: 'center',
  16. dataIndex: 'lineName',
  17. key: 'lineName'
  18. },
  19. {
  20. title: '所亭名称',
  21. align: 'center',
  22. dataIndex: 'substationName',
  23. key: 'substationName'
  24. },
  25. {
  26. title: '设备名称',
  27. align: 'center',
  28. dataIndex: 'sbmc',
  29. key: 'sbmc'
  30. },
  31. {
  32. title: '运行编号',
  33. align: 'center',
  34. dataIndex: 'yxbh',
  35. key: 'yxbh'
  36. },
  37. {
  38. title: '试验周期',
  39. align: 'center',
  40. dataIndex: 'testCycle',
  41. key: 'testCycle'
  42. },
  43. {
  44. title: '计划试验日期',
  45. align: 'center',
  46. dataIndex: 'testPlanDate',
  47. key: 'testPlanDate',
  48. customRender: function(data, r, index) {
  49. return dayjs(data).format('YYYY-MM-DD')
  50. }
  51. },
  52. {
  53. title: '完成日期',
  54. align: 'center',
  55. dataIndex: 'completionDate',
  56. key: 'completionDate',
  57. customRender: function(data, r, index) {
  58. return dayjs(data).format('YYYY-MM-DD')
  59. }
  60. }
  61. ]
  62. return cols
  63. }
  64. export default columns