import { FormConfig } from '@/types/basic-form';

/** 举一反三（管理员侧）新增/编辑表单配置 */
export const DRAW_LESSONS_FORM_CONFIG: FormConfig[] = [
  {
    prop: 'dangerId',
    label: '隐患问题：',
    slot: 'dangerId',
    componentProps: {
      placeholder: '请选择隐患',
      style: { width: '100%' },
    },
  },
  {
    prop: 'associationOneThree',
    label: '举一反三要求：',
    component: 'ElInput',
    componentProps: {
      placeholder: '请输入举一反三具体内容和要求',
    },
  },
  {
    prop: 'associationOtObligationDeptIds',
    label: '责任部门：',
    slot: 'associationOtObligationDeptIds',
    componentProps: {
      placeholder: '请选择责任部门，可多选',
      style: { width: '100%' },
    },
  },
  {
    prop: 'associationOtTimeLimit',
    label: '举一反三时限：',
    component: 'ElDatePicker',
    componentProps: {
      type: 'date',
      placeholder: '请选择完成时限',
      valueFormat: 'YYYY-MM-DD',
      style: { width: '100%' },
    },
  },
];

export const DRAW_LESSONS_FORM_DATA = {
  dangerId: undefined as number | undefined,
  problem: '',
  associationOneThree: '',
  associationOtObligationDeptIds: '',
  associationOtTimeLimit: '',
};

export const DRAW_LESSONS_FORM_RULES = {
  dangerId: [{ required: true, message: '请选择隐患', trigger: 'change' }],
  associationOneThree: [{ required: true, message: '请输入举一反三内容', trigger: 'blur' }],
  associationOtObligationDeptIds: [{ required: true, message: '请选择责任部门', trigger: 'change' }],
  associationOtTimeLimit: [{ required: true, message: '请选择举一反三时限', trigger: 'change' }],
};
