common.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. export const tableHeader = (selectEquiType) => {
  2. switch (+selectEquiType) {
  3. case 3:
  4. return [
  5. { label: '型号', prop: 'modelType' },
  6. { label: '规格', prop: 'specification' },
  7. { label: '牌号', prop: 'brandNum' }
  8. ];
  9. case 8:
  10. return [
  11. { label: '型号', prop: 'modelType' },
  12. { label: '规格', prop: 'specification' },
  13. { label: '牌号', prop: 'brandNum' }
  14. ];
  15. case 4:
  16. return [
  17. { label: '型号', prop: 'modelType' },
  18. { label: '规格', prop: 'specification' },
  19. { label: '牌号', prop: 'brandNum' }
  20. ];
  21. case 9:
  22. return [
  23. { label: '型号', prop: 'modelType' },
  24. { label: '规格', prop: 'specification' },
  25. { label: '牌号', prop: 'brandNum' }
  26. ];
  27. case 5: //'周转车'
  28. return [
  29. { label: '型号', prop: 'modelType' },
  30. { label: '规格', prop: 'specification' },
  31. { label: '牌号', prop: 'brandNum' },
  32. {
  33. label: '材质',
  34. prop: 'texture',
  35. formatter(row) {
  36. if (!row?.extendField) return '';
  37. const extendField = JSON.parse(row.extendField);
  38. return extendField.texture;
  39. }
  40. },
  41. {
  42. label: '长宽高',
  43. prop: '',
  44. formatter(row) {
  45. if (!row?.extendField) return '';
  46. const extendField = JSON.parse(row.extendField);
  47. return `${extendField.length || '-'}*${extendField.width || '-'}*${
  48. extendField.high || '-'
  49. }`;
  50. }
  51. }
  52. ];
  53. case 2: //'舟皿'
  54. return [
  55. { label: '型号', prop: 'modelType' },
  56. { label: '规格', prop: 'specification' },
  57. { label: '牌号', prop: 'brandNum' },
  58. {
  59. label: '长宽高',
  60. prop: '',
  61. formatter(row) {
  62. if (!row?.extendField) return '';
  63. const extendField = JSON.parse(row.extendField);
  64. return `${extendField.length || '-'}*${extendField.width || '-'}*${
  65. extendField.high || '-'
  66. }`;
  67. }
  68. }
  69. ];
  70. case 1: //'设备'
  71. return [
  72. { label: '型号', prop: 'modelType' },
  73. { label: '规格', prop: 'specification' },
  74. { label: '牌号', prop: 'brandNum' }
  75. ];
  76. case 6: //'模具'
  77. return [
  78. { label: '型号', prop: 'modelType' },
  79. { label: '规格', prop: 'specification' },
  80. { label: '牌号', prop: 'brandNum' },
  81. {
  82. label: '收缩系数',
  83. prop: '',
  84. formatter(row) {
  85. if (!row?.extendField) return '';
  86. const extendField = JSON.parse(row.extendField);
  87. return extendField.shrinkageCoefficient;
  88. }
  89. }
  90. ];
  91. case 7: //'备品备件'
  92. return [
  93. { label: '型号', prop: 'modelType' },
  94. { label: '规格', prop: 'specification' },
  95. { label: '牌号', prop: 'brandNum' }
  96. ];
  97. default:
  98. return [
  99. { label: '型号', prop: 'modelType' },
  100. { label: '规格', prop: 'specification' },
  101. { label: '牌号', prop: 'brandNum' }
  102. ];
  103. }
  104. return [];
  105. };