production-labels.ts 508 B

12345678910111213141516
  1. import type { TagType } from '@/utils/status-tag-registry'
  2. /** 生产结论 cg=成功 sb=失败 */
  3. export function productionConclusionLabel(code?: string | null): string {
  4. const c = (code || '').trim()
  5. if (c === 'cg') return '成功'
  6. if (c === 'sb') return '失败'
  7. return c || '—'
  8. }
  9. export function productionConclusionTagType(code?: string | null): TagType | undefined {
  10. const c = (code || '').trim()
  11. if (c === 'cg') return 'success'
  12. if (c === 'sb') return 'danger'
  13. return undefined
  14. }