import {FilterGroupMap, MapValue} from '@components';
import {contextState} from '../context';

export const fixedMap: MapValue<typeof contextState>[] = [
  {label: '物料编号', type: 'field', value: 'wllbCode'},
  {label: '物料名称', type: 'field', value: 'materialName'},
  {label: '库位名称', type: 'field', value: 'storageLocationName'},
  {
    label: '分组',
    type: 'select',
    value: 'groupBy',
    multiple: true,
    options: [
      {label: '物料编号', value: 'a.material_id'},
      {label: '库位名称', value: 'a.storage_location_code'},
      {label: 'WBS编号', value: 'a.wbs'},
      {label: '所属公司', value: 'a.account_sleeve'},
    ],
  },
];

export const sourceMap: FilterGroupMap<typeof contextState> = new Map([
  [
    '1',
    {
      label: '所属公司',
      type: 'keySelect',
      selectKey: '公司',
      value: 'companyCode',
    },
  ],
  [
    '2',
    {
      label: '所属仓库',
      type: 'keySelect',
      value: 'warehouseId',
      selectKey: '仓库',
    },
  ],
  [
    '3',
    {
      label: '供应商',
      type: 'keySelect',
      selectKey: '供应商/客户',
      value: 'supplierId',
    },
  ],
  ['4', {label: 'WBS编号', type: 'field', value: 'wbs'}],
  ['5', {label: '物料类别', type: 'field', value: 'partType'}],
  [
    '6',
    {
      label: '物料类型',
      type: 'keySelect',
      value: 'wllbClass',
      selectKey: '物料类型',
    },
  ],
  [
    '7',
    {
      label: '计量单位',
      type: 'keySelect',
      value: 'unitOfMeasurement',
      selectKey: '计量单位',
    },
  ],
]);
