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

export const ACT_FORM_CONFIG: FormConfig[] = [
  {
    prop: 'carNumber',
    label: '车牌号：',
    component: 'ElInput',
    componentProps: {
      placeholder: '请输入违规车辆车牌号码',
      maxlength: 8,
      showWordLimit: false,
    },
  },
  {
    prop: 'violateType',
    slot: 'violateType',
    label: '违规类型：',
  },
  {
    prop: 'violateLocation',
    label: '违规地点：',
    component: 'ElInput',
    componentProps: {
      placeholder: '请输入违规地点',
    },
  },
  {
    prop: 'captureTime',
    label: '抓拍时间：',
    slot: 'captureTime',
  },
  {
    prop: 'capturePhotos',
    label: '抓拍图片：',
    slot: 'capturePhotos',
  },
  {
    label: '备注：',
    prop: 'remark',
    component: 'ElInput',
    componentProps: {
      type: 'textarea',
      rows: 5,
    },
  },
  {
    label: '创建人：',
    prop: 'creatName',
    component: 'ElInput',
    componentProps: {
      disabled: true,
    },
  },
];

export const ACT_FORM_DATA = {
  carNumber: '',
  violateType: null,
  captureTime: '',
  capturePhotos: [],
  violateLocation: '',
  remark: '',
  creatName: '',
};

export const ACT_FORM_RULES = {
  carNumber: [{ required: true, message: '车牌号格式错误', trigger: 'blur' }],
  violateType: [{ required: true, message: '请选择违规类型', trigger: 'change' }],
  captureTime: [{ required: true, message: '请选择抓拍时间', trigger: 'change' }],
};
