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

// 创建损失记录表单信息（应急处置事件）
export const LOSS_ITEM_FORM_OF_EMERGENCY_PROCEDURE: FormConfig[] = [
  {
    label: '损失楼号、楼层、房间号：',
    prop: 'affectedRoom',
    slot: 'affectedRoom',
  },
  {
    label: '受灾物品：',
    prop: 'affectedItems',
    component: 'ElInput',
    componentProps: {
      placeholder: '请输入受灾物品',
    },
  },
  {
    label: '损失描述：',
    prop: 'description',
    component: 'ElInput',
    componentProps: {
      placeholder: '请输入损失描述',
      type: 'textarea',
      rows: 4,
      maxlength: 1000,
      showWordLimit: true,
    },
  },
  {
    label: '影响安全评估：',
    prop: 'safetyLevel',
    slot: 'safetyLevel',
  },
  {
    label: '整改责任部门：',
    prop: 'responsibleDeptId',
    slot: 'responsibleDeptId',
  },
];

// 创建损失记录表单规则（应急处置事件）
export const LOSS_ITEM_FORM_RULES_OF_EMERGENCY_PROCEDURE = {
  affectedRoom: [{ required: true, message: '', trigger: 'blur' }],
  buildingNo: [{ required: true, message: '请输入楼号', trigger: 'blur' }],
  floorNo: [{ required: true, message: '请输入楼层', trigger: 'blur' }],
  roomNo: [{ required: true, message: '请输入房间号', trigger: 'blur' }],
  affectedItems: [{ required: true, message: '请输入受灾物品', trigger: 'blur' }],
  description: [{ required: true, message: '请输入损失描述', trigger: 'blur' }],
  safetyLevel: [{ required: true, message: '请选择影响安全评估', trigger: 'change' }],
  responsibleDeptId: [{ required: true, message: '请选择整改责任部门', trigger: 'change' }],
};

export const LOSS_ITEM_PARAM_OF_EMERGENCY_PROCEDURE = {
  reportTaskName: '',
  isLoss: 1,
  buildingNo: '',
  floorNo: '',
  roomNo: '',
  affectedItems: '',
  images: [],
  description: '',
  safetyLevel: '',
  isAffectWork: null,
  estimatedLoss: null,
  responsibleDeptId: null,
  userGroupList: [],
  isPush: 1,
  priority: '',
  createdBy: '',
  remark: '',
  affectedRoom: '永远存在', //自己创造的一个数值，不要传给后端 这个数值永远存在
  uploadImages: [],
};
