/*
 * @Author: liuJie
 * @Date: 2026-03-05 10:11:20
 * @LastEditors: liuJie
 * @LastEditTime: 2026-03-17 10:31:07
 * @Describe: file describe
 */
import type { FormConfig } from '@/types/basic-form';

/** 设备类别选项（设备类别名称） */
export const DEVICE_CATEGORY_OPTIONS = [
  { label: '报警器', value: 'siren' },
  { label: '传感器', value: 'sensor' },
];

export const DEVICE_TYPE = {
    siren:'报警器',
    sensor: '传感器'
}


/** 告警类型 */
export const Alarm_TYPE_OPTIONS = [
  { label: '安全告警', value: 'safe_alarm' },
  { label: '通讯告警', value: 'communicate_alarm' },
  { label: '其他告警', value: 'other_alarm' },
];

export const ALARM_TYPE = {
    safe_alarm:'安全告警',
    communicate_alarm: '通讯告警',
    other_alarm: '其他告警',

}
export const ALARM_STATUS = {
    to_solve:'待解决',
    solved:'已解决'
}

export const HANDLE_STATUS = {
    to_handle:'待处理',
    handled:'已处理'
}
export interface DETAIL_DATA_TYPE {
alarmContent?: string;
alarmCount?: number;
alarmStatus: string;
alarmTitle?: string;
alarmType?: string;
deptId?: number;
deptName?: string;
deviceId?: number;
deviceName?: string;
deviceNo?: string;
deviceType: string;
firstAlarmTime?: string;
firstAlarmTimeStr?: any;
handleDesc?: string;
handleResult?: any;
handleStatus: string;
handleTime?: string;
handleUser?: number;
handleUserName?: string;
id?: number;
lastAlarmTime?: string;
location?: string;
regionId?: number;
regionName?: string;
};



export const SPECIAL_EQUIPMENT_FORM_DATA = {
  deviceId: '',
  assetId: '',
  deviceName: '',
  useUnit: '',
  categoryId: undefined as number | undefined,
  typeId: undefined as number | undefined,
  registerCode: '',
  licenseNo: '',
  deviceCode: '',
  safeLocation: '',
  useDepartment: '',
  responsibilityDeptId: undefined as number | undefined,
  responsiblePerson: '',
  jobNo: '',
  factoryNo: '',
  productionDate: '',
  startUseDate: '',
  inspectionCycle: undefined as number | undefined,
  useYears: undefined as number | undefined,
  inspectionTime: '',
  deviceStatus: 1,
  nextInspectionDate: '',
};

export const SPECIAL_EQUIPMENT_FORM_RULES = {
  deviceId: [{ required: true, message: '设备ID不能为空', trigger: 'blur' }],
  assetId: [{ required: true, message: '设备固资ID不能为空', trigger: 'blur' }],
  deviceName: [{ required: true, message: '设备名称不能为空', trigger: 'blur' }],
  useUnit: [{ required: true, message: '使用单位不能为空', trigger: 'blur' }],
  categoryId: [{ required: true, message: '请选择设备类别', trigger: 'change' }],
  typeId: [{ required: true, message: '请选择设备种类', trigger: 'change' }],
  registerCode: [{ required: true, message: '注册代码不能为空', trigger: 'blur' }],
  licenseNo: [{ required: true, message: '使用证号不能为空', trigger: 'blur' }],
  // deviceCode: [{ required: true, message: '设备编码不能为空', trigger: 'blur' }],
  safeLocation: [{ required: true, message: '安全地点不能为空', trigger: 'blur' }],
  useDepartment: [{ required: true, message: '请选择使用部门', trigger: 'change' }],
  responsibilityDeptId: [{ required: true, message: '请选择责任部门', trigger: 'change' }],
  responsiblePerson: [{ required: true, message: '责任人不能为空', trigger: 'blur' }],
  jobNo: [{ required: true, message: '工号不能为空', trigger: 'blur' }],
  // factoryNo: [{ required: true, message: '出厂编号不能为空', trigger: 'blur' }],
  // productionDate: [{ required: true, message: '请选择生产日期', trigger: 'change' }],
  startUseDate: [{ required: true, message: '请选择启用日期', trigger: 'change' }],
  inspectionCycle: [{ required: true, message: '检测周期不能为空', trigger: 'blur' }],
  useYears: [{ required: true, message: '使用年限不能为空', trigger: 'blur' }],
  inspectionTime: [{ required: true, message: '请选择检测时间', trigger: 'change' }],
  deviceStatus: [{ required: true, message: '请选择设备状态', trigger: 'change' }],
  // nextInspectionDate: [{ required: true, message: '请选择下次检测时间', trigger: 'change' }],
};


