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

export const ACADEMY_FILE_FORM_CONFIG: FormConfig[] = [
  {
    prop: 'planName',
    label: '安全文化活动计划名称：',
    component: 'ElInput',
    componentProps: {
      placeholder: '请输入文件名称',
    },
  },
  {
    prop: 'actionContent',
    label: '行动项内容：',
    component: 'ElInput',
    componentProps: {
      placeholder: '请输入行动项内容',
    },
  },
  {
    prop: 'categoryName',
    label: '分类名称：',
    slot: 'categoryName',
  },
  {
    prop: 'responsibleDeptId',
    label: '责任部门：',
    slot: 'responsibleDeptId',
  },
  {
    prop: 'responsiblePersonId',
    label: '责任人：',
    slot: 'responsiblePersonId',
  },
  {
    prop: 'cooperateDeptIds',
    label: '配合部门：',
    slot: 'cooperateDeptIds',
  },
];

export const ACADEMY_FILE_FORM_DATA = {
  planName: '',
  actionContent: '',
  categoryName: '',
  responsibleDeptId: undefined as number | undefined,
  responsiblePersonId: undefined as number | undefined,
  cooperateDeptIds: [] as number[],
};

export const ACADEMY_FILE_FORM_RULES = {
  planName: [{ required: true, message: '请输入安全活动计划名称', trigger: 'blur' }],
  actionContent: [{ required: true, message: '请选择行动项内容', trigger: 'change' }],
  categoryName: [{ required: true, message: '请输入分类名称', trigger: 'blur' }],
  responsibleDeptId: [{ required: true, message: '请选择责任部门', trigger: 'change' }],
  responsiblePersonId: [{ required: true, message: '请选择责任人', trigger: 'change' }],
  cooperateDeptIds: [{ required: true, message: '请选择配合部门', trigger: 'change' }],
};
