import type { SearchConfig } from '@/types/basic-search';
import { EMERGENCY_SUPPLY_STATUS_OPTIONS, INVENTORY_RESULT_OPTIONS, SUPPLY_REQUEST_STATUS_OPTIONS } from '../constant';

const BASIC_SEARCH_CONFIG = {
  EMERGENCY_TYPE: {
    label: '应急类型：',
    prop: 'emergencyType',
    slot: 'emergencyType',
  },
  SUPPLY_TYPE: {
    label: '物资类型：',
    prop: 'supplyType',
    slot: 'supplyType',
  },
  SUPPLY_NAME: {
    label: '应急物资名称：',
    prop: 'supplyName',
    component: 'ElInput',
    componentProps: {
      placeholder: '请输入应急物资名称',
    },
  },
  KEEPER_NAME: {
    label: '保管人：',
    prop: 'keeperName',
    component: 'ElInput',
    componentProps: {
      placeholder: '请输入保管人姓名',
    },
  },
};

export const SUPPLY_LIST_SEARCH_CONFIG: SearchConfig[] = [
  BASIC_SEARCH_CONFIG.EMERGENCY_TYPE,
  BASIC_SEARCH_CONFIG.SUPPLY_TYPE,
  BASIC_SEARCH_CONFIG.SUPPLY_NAME,
  {
    label: '园区：',
    prop: 'park',
    slot: 'park',
  },
  {
    label: '地点：',
    prop: 'location',
    component: 'ElInput',
    componentProps: {
      placeholder: '请输入地点',
    },
  },
  BASIC_SEARCH_CONFIG.KEEPER_NAME,
  {
    label: '使用状态：',
    prop: 'status',
    component: 'ElSelect',
    selectOptions: EMERGENCY_SUPPLY_STATUS_OPTIONS,
    componentProps: {
      placeholder: '请选择使用状态',
    },
  },
];

export const INVENTORY_LIST_SEARCH_CONFIG: SearchConfig[] = [
  {
    label: '盘点任务：',
    prop: 'taskId',
    slot: 'taskId',
  },
  BASIC_SEARCH_CONFIG.EMERGENCY_TYPE,
  BASIC_SEARCH_CONFIG.SUPPLY_TYPE,
  BASIC_SEARCH_CONFIG.SUPPLY_NAME,
  BASIC_SEARCH_CONFIG.KEEPER_NAME,
  {
    label: '盘点结果：',
    prop: 'inventoryResult',
    component: 'ElSelect',
    selectOptions: INVENTORY_RESULT_OPTIONS,
    componentProps: {
      placeholder: '请选择盘点结果',
    },
  },
];

// 物资申领搜索配置
export const SUPPLY_REQUEST_SEARCH_CONFIG: SearchConfig[] = [
  {
    label: '物资申领计划：',
    prop: 'planName',
    slot: 'planName',
  },
  {
    label: '状态：',
    prop: 'status',
    component: 'ElSelect',
    selectOptions: SUPPLY_REQUEST_STATUS_OPTIONS,
    componentProps: {
      placeholder: '请选择状态',
    },
  },
];
