import Api from '@/api';
import type { TableColumn } from '@/components/core/dynamic-table';

export type TableListItem = API.ProductEntity;
export type TableColumnItem = TableColumn<TableListItem>;
export const baseColumns: TableColumnItem[] = [
  {
    title: '产品编号',
    dataIndex: 'productNumber',
  },
  {
    title: '名称',
    dataIndex: 'name',
  },
  {
    title: '产品规格',
    dataIndex: 'productSpecification',
  },

  {
    title: '所属公司',
    dataIndex: 'company',
    customRender: ({ record }) => {
      return record?.company?.name || '';
    },
  },
  {
    title: '单位',
    dataIndex: 'unit',
    width: 80,
    customRender: ({ record }) => {
      return record?.unit?.label || '';
    },
  },
  {
    title: '备注',
    dataIndex: 'remark',
  },
];
