/**
 * 常量定义
 */

/** 资产状态 */
export const ASSET_STATUS = {
  pending: { label: '待入库', value: 'pending', type: 'info' },
  in_stock: { label: '在库', value: 'in_stock', type: 'success' },
  in_use: { label: '使用中', value: 'in_use', type: 'primary' },
  transferring: { label: '调拨中', value: 'transferring', type: 'warning' },
  maintenance: { label: '维修中', value: 'maintenance', type: 'warning' },
  pending_scrap: { label: '待报废', value: 'pending_scrap', type: 'danger' },
  scrapped: { label: '已报废', value: 'scrapped', type: 'danger' },
  lost: { label: '已丢失', value: 'lost', type: 'danger' }
} as const

/** 分配单类型 */
export const ALLOCATION_ORDER_TYPE = {
  allocation: { label: '资产分配', value: 'allocation' },
  transfer: { label: '资产调拨', value: 'transfer' },
  recovery: { label: '资产回收', value: 'recovery' },
  maintenance: { label: '维修申请', value: 'maintenance' },
  scrap: { label: '报废申请', value: 'scrap' }
} as const

/** 审批状态 */
export const APPROVAL_STATUS = {
  pending: { label: '待审批', value: 'pending', type: 'warning' },
  approved: { label: '已通过', value: 'approved', type: 'success' },
  rejected: { label: '已拒绝', value: 'rejected', type: 'danger' },
  cancelled: { label: '已取消', value: 'cancelled', type: 'info' }
} as const

/** 用户状态 */
export const USER_STATUS = {
  active: { label: '正常', value: 'active', type: 'success' },
  disabled: { label: '禁用', value: 'disabled', type: 'danger' },
  locked: { label: '锁定', value: 'locked', type: 'warning' }
} as const

/** 机构类型 */
export const ORG_TYPE = {
  province: { label: '省级', value: 'province' },
  city: { label: '市级', value: 'city' },
  outlet: { label: '网点', value: 'outlet' }
} as const

/** 维修优先级 */
export const MAINTENANCE_PRIORITY = {
  low: { label: '低', value: 'low', type: 'info' },
  medium: { label: '中', value: 'medium', type: 'warning' },
  high: { label: '高', value: 'high', type: 'danger' }
} as const

/** 维修类型 */
export const MAINTENANCE_TYPE = {
  self_repair: { label: '自行维修', value: 'self_repair' },
  vendor_repair: { label: '厂商维修', value: 'vendor_repair' }
} as const

/** 故障类型 */
export const FAULT_TYPE = {
  hardware: { label: '硬件故障', value: 'hardware' },
  software: { label: '软件故障', value: 'software' },
  other: { label: '其他', value: 'other' }
} as const

/** 字段类型 */
export const FIELD_TYPE = {
  text: { label: '单行文本', value: 'text' },
  textarea: { label: '多行文本', value: 'textarea' },
  number: { label: '数字', value: 'number' },
  date: { label: '日期', value: 'date' },
  select: { label: '下拉选择', value: 'select' },
  checkbox: { label: '复选框', value: 'checkbox' },
  url: { label: '链接', value: 'url' },
  email: { label: '邮箱', value: 'email' },
  phone: { label: '手机号', value: 'phone' }
} as const

/** 分页大小选项 */
export const PAGE_SIZES = [10, 20, 50, 100]

/** 日期格式 */
export const DATE_FORMAT = 'YYYY-MM-DD'
export const DATETIME_FORMAT = 'YYYY-MM-DD HH:mm:ss'
