/**
 * 文档状态枚举
 */
export enum DocumentStatus {
  /** 未上传 */
  UN_UPLOAD = 0,
  /** 待审核 */
  UN_AUDIT = 1,
  /** 审核拒绝 */
  AUDIT_REJECT = 2,
  /** 待归档 */
  UN_FILING = 3,
  /** 已归档 */
  FILING = 4,
  /** 待质控 */
  UN_QUALITY_CONTROL = 5,
  /** 质控通过 */
  QUALITY_CONTROL_PASS = 6,
  /** 质控拒绝 */
  QUALITY_CONTROL_REJECT = 7
}

/**
 * 文档状态配置
 */
export interface DocumentStatusConfig {
  label: string;
  type?: 'success' | 'warning' | 'danger' | 'info' | '';
  color?: string;
  textColor?: string;
}

/**
 * 文档状态配置映射
 */
export const DOCUMENT_STATUS_CONFIG: Record<DocumentStatus, DocumentStatusConfig> = {
  [DocumentStatus.UN_UPLOAD]: {
    label: 'document.document.documentList.statusOptions.unUpload',
    color: 'rgba(140, 140, 140, 0.15)',
    textColor: '#8C8C8C'
  },
  [DocumentStatus.UN_AUDIT]: {
    label: 'document.document.documentList.statusOptions.unAudit',
    color: 'rgba(250, 173, 20, 0.15)',
    textColor: '#D48806'
  },
  [DocumentStatus.AUDIT_REJECT]: {
    label: 'document.document.documentList.statusOptions.auditReject',
    color: 'rgba(245, 34, 45, 0.15)',
    textColor: '#CF1322'
  },
  [DocumentStatus.UN_FILING]: {
    label: 'document.document.documentList.statusOptions.unFiling',
    color: 'rgba(24, 144, 255, 0.15)',
    textColor: '#096DD9'
  },
  [DocumentStatus.FILING]: {
    label: 'document.document.documentList.statusOptions.filing',
    color: 'rgba(82, 196, 26, 0.15)',
    textColor: '#389E0D'
  },
  [DocumentStatus.UN_QUALITY_CONTROL]: {
    label: 'document.document.documentList.statusOptions.unQc',
    color: 'rgba(250, 84, 28, 0.15)',
    textColor: '#D4380D'
  },
  [DocumentStatus.QUALITY_CONTROL_PASS]: {
    label: 'document.document.documentList.statusOptions.qcPass',
    color: 'rgba(19, 194, 194, 0.15)',
    textColor: '#08979C'
  },
  [DocumentStatus.QUALITY_CONTROL_REJECT]: {
    label: 'document.document.documentList.statusOptions.qcReject',
    color: 'rgba(235, 47, 150, 0.15)',
    textColor: '#C41D7F'
  }
};

/**
 * 获取文档状态配置
 * @param status 状态值
 * @returns 状态配置
 */
export const getDocumentStatusConfig = (status: number): DocumentStatusConfig | null => {
  return DOCUMENT_STATUS_CONFIG[status as DocumentStatus] || null;
};
