// 流程状态
export const ProcessStatus = {
  NOT_STARTED: 'not_started',
  IN_PROGRESS: 'in_progress',
  COMPLETED: 'completed',
};

export const ProcessStatusText = {
  [ProcessStatus.NOT_STARTED]: '未开始',
  [ProcessStatus.IN_PROGRESS]: '进行中',
  [ProcessStatus.COMPLETED]: '已结束',
};

export const ProcessStatusColor = {
  [ProcessStatus.NOT_STARTED]: 'default',
  [ProcessStatus.IN_PROGRESS]: 'processing',
  [ProcessStatus.COMPLETED]: 'success',
};

// 审批结果
export const ApprovalResult = {
  PENDING: 'pending',
  APPROVED: 'approved',
  REJECTED: 'rejected',
};

export const ApprovalResultText = {
  [ApprovalResult.PENDING]: '待审批',
  [ApprovalResult.APPROVED]: '审核通过',
  [ApprovalResult.REJECTED]: '审核驳回',
};

export const ApprovalResultColor = {
  [ApprovalResult.PENDING]: 'orange',
  [ApprovalResult.APPROVED]: 'green',
  [ApprovalResult.REJECTED]: 'red',
};

// 导入评价等级
import { EvaluateLevel, EvaluateLevelText, EvaluateLevelColor } from './supplierTemplateDict';

// 重新导出评价等级
export { EvaluateLevel, EvaluateLevelText, EvaluateLevelColor };

// 评价分数对应等级
export const getEvaluateLevel = (score: number): string => {
  if (score >= 90) {
    return EvaluateLevel.EXCELLENT;
  } else if (score >= 80) {
    return EvaluateLevel.GOOD;
  } else if (score >= 70) {
    return EvaluateLevel.AVERAGE;
  } else {
    return EvaluateLevel.POOR;
  }
};
