export const tableHeader = (selectEquiType) => {
  switch (+selectEquiType) {
    case 3:
      return [{ label: '牌号', prop: 'brandNum' }];
    case 8:
      return [
        { label: '型号', prop: 'modelType' },
        { label: '规格', prop: 'specification' }
      ];
    case 4:
      return [
        { label: '牌号', prop: 'brandNum' },
        { label: '型号', prop: 'modelType' }
      ];
    case 9:
      return [
        { label: '牌号', prop: 'brandNum' },
        { label: '型号', prop: 'modelType' }
      ];
    case 5: //'周转车'
      return [
        { label: '规格', prop: 'specification' },
        {
          label: '材质',
          prop: 'texture',
          formatter(row) {
            if (!row?.extendField) return '';
            const extendField = JSON.parse(row.extendField);
            return extendField.texture;
          }
        },
        {
          label: '长宽高',
          prop: '',
          formatter(row) {
            if (!row?.extendField) return '';
            const extendField = JSON.parse(row.extendField);
            return `${extendField.length || '-'}*${extendField.width || '-'}*${
              extendField.high || '-'
            }`;
          }
        }
      ];
    case 2: //'舟皿'
      return [
        { label: '规格', prop: 'specification' },
        { label: '型号', prop: 'modelType' },
        {
          label: '长宽高',
          prop: '',
          formatter(row) {
            if (!row?.extendField) return '';
            const extendField = JSON.parse(row.extendField);
            return `${extendField.length || '-'}*${extendField.width || '-'}*${
              extendField.high || '-'
            }`;
          }
        }
      ];
    case 1: //'设备'
      return [
        { label: '型号', prop: 'modelType' },
        { label: '规格', prop: 'specification' }
      ];
    case 6: //'模具'
      return [
        { label: '牌号', prop: 'brandNum' },
        { label: '型号', prop: 'modelType' },
        {
          label: '收缩系数',
          prop: '',
          formatter(row) {
            if (!row?.extendField) return '';
            const extendField = JSON.parse(row.extendField);
            return extendField.shrinkageCoefficient;
          }
        }
      ];
    case 7: //'备品备件'
      return [
        { label: '规格', prop: 'specification' },
        { label: '型号', prop: 'modelType' }
      ];
    default:
      return [
        { label: '牌号', prop: 'brandNum' },
        { label: '规格', prop: 'specification' },
        { label: '型号', prop: 'modelType' }
      ];
  }

  return [];
};
