import type { VbenFormProps } from '#/adapter/form';

import { logTimeRangeSchema } from '../../shared/normalizeLogFilters';

export const formOptions: VbenFormProps = {
  collapsed: false,
  schema: [
    {
      component: 'VbenInput',
      componentProps: { placeholder: '电话 / 结论 / 备注', allowClear: true },
      fieldName: 'keyword',
      label: '关键词',
    },
    {
      component: 'Select',
      componentProps: {
        allowClear: true,
        options: [
          { label: '医生', value: 1 },
          { label: '门店管理员', value: 2 },
          { label: '平台管理员', value: 3 },
        ],
        placeholder: '全部',
      },
      fieldName: 'caller_role',
      label: '拨打角色',
    },
    {
      component: 'Select',
      componentProps: {
        allowClear: true,
        options: [
          { label: '接通', value: 'connected' },
          { label: '未接', value: 'no_answer' },
          { label: '挂断', value: 'hangup' },
          { label: '空号/无效', value: 'invalid' },
        ],
        placeholder: '全部',
      },
      fieldName: 'result',
      label: '回访结果',
    },
    { ...logTimeRangeSchema },
  ],
  showCollapseButton: true,
  submitButtonOptions: { content: '查询' },
  submitOnChange: false,
  submitOnEnter: true,
};
