import type { VbenFormSchema } from '@vben/common-ui';
import type { VxeColumnPropTypes } from '#/adapter/vxe-table';

/**
 * 搜索表单配置
 */
export function queryFormSchema(): VbenFormSchema[] {
  return [
    {
      component: 'Input',
      componentProps: {
        placeholder: '请输入考试姓名',
      },
      fieldName: 'examName',
      label: '考试姓名',
    },
    {
      component: 'Select',
      componentProps: {
        placeholder: '请选择批改状态',
        options: [
          { label: '待批改', value: 'pending' },
          { label: '已批改', value: 'completed' },
          { label: '部分批改', value: 'partial' },
        ],
      },
      fieldName: 'correctStatus',
      label: '批改状态',
    },
  ];
}

/**
 * 表格列配置
 */
export const tableColumns: VxeColumnPropTypes[] = [
  {
    title: '考试姓名',
    field: 'examName',
    showOverflow: true,
  },
  {
    title: '批改人员',
    field: 'corrector',
    showOverflow: true,
  },
  {
    title: '批改状态',
    field: 'correctStatus',
    showOverflow: true,
  },
  {
    title: '批改时间',
    field: 'correctTime',
    showOverflow: true,
  },
  {
    title: '操作',
    field: 'action',
    align: 'center',
    slots: { default: 'action' },
  },
];
