/**
 * 文档状态枚举
 */
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;
}

/**
 * 文档状态配置映射
 */
export const DOCUMENT_STATUS_CONFIG: Record<DocumentStatus, DocumentStatusConfig> = {
    [DocumentStatus.UN_UPLOAD]: {
        label: 'document.document.documentList.statusOptions.unUpload',
        type: 'info'
    },
    [DocumentStatus.UN_AUDIT]: {
        label: 'document.document.documentList.statusOptions.unAudit',
        type: 'warning'
    },
    [DocumentStatus.AUDIT_REJECT]: {
        label: 'document.document.documentList.statusOptions.auditReject',
        type: 'danger'
    },
    [DocumentStatus.UN_FILING]: {
        label: 'document.document.documentList.statusOptions.unFiling',
        type: ''
    },
    [DocumentStatus.FILING]: {
        label: 'document.document.documentList.statusOptions.filing',
        type: 'success'
    },
    [DocumentStatus.UN_QUALITY_CONTROL]: {
        label: 'document.document.documentList.statusOptions.unQualityControl',
        color: '#E6A23C'
    },
    [DocumentStatus.QUALITY_CONTROL_PASS]: {
        label: 'document.document.documentList.statusOptions.qualityControlPass',
        color: '#67C23A'
    },
    [DocumentStatus.QUALITY_CONTROL_REJECT]: {
        label: 'document.document.documentList.statusOptions.qualityControlReject',
        color: '#F56C6C'
    }
};

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