import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';

// 字典标识常量 - 急救箱用品暂时不需要字典

// 搜索表单配置
export const queryFormSchema: FormSchemaGetter = () => [
  {
    component: 'Input',
    fieldName: 'itemName',
    label: '用品名称',
    componentProps: {
      placeholder: '请输入用品名称',
    },
  },
];

// 表格列配置
export const tableColumns: VxeGridProps['columns'] = [
  {
    type: 'checkbox',
    width: 80,
  },
  {
    field: 'itemName',
    title: '用品名称',
    minWidth: 150,
  },
  {
    field: 'standardQuantity',
    title: '标准数量',
    minWidth: 120,
  },
  {
    field: 'unit',
    title: '单位',
    minWidth: 100,
  },
  {
    field: 'operationTime',
    title: '操作时间',
    minWidth: 180,
  },
  {
    field: 'operator',
    title: '操作人',
    minWidth: 120,
  },
  {
    field: 'action',
    fixed: 'right',
    slots: { default: 'action' },
    title: '操作',
    width: 150,
  },
];

// 抽屉表单配置
export const drawerFormSchema: FormSchemaGetter = () => [
  {
    component: 'Input',
    dependencies: {
      show: () => false,
      triggerFields: [''],
    },
    fieldName: 'id',
  },
  {
    component: 'Input',
    fieldName: 'itemName',
    label: '用品名称',
    componentProps: {
      placeholder: '请输入用品名称',
      maxlength: 100,
    },
    rules: 'required',
  },
  {
    component: 'InputNumber',
    fieldName: 'standardQuantity',
    label: '标准数量',
    componentProps: {
      placeholder: '请输入标准数量',
      min: 0,
      step: 1,
    },
    rules: 'required',
  },
  {
    component: 'Input',
    fieldName: 'unit',
    label: '单位',
    componentProps: {
      placeholder: '请输入单位',
      maxlength: 20,
    },
    rules: 'required',
  },
];
