Blame view

泰额版/Food Labeling Management App UniApp/src/utils/emptyDisplay.ts 376 Bytes
540ac0e3   杨鑫   前端修改bug
1
2
3
4
5
6
7
8
9
10
11
12
  /** Backend empty placeholder (US API may return this literal). */
  export const BACKEND_EMPTY_DISPLAY = '无'
  
  /** Map API empty sentinels to English UI text. */
  export function formatDisplayText (
    value: string | null | undefined,
    fallback = 'None',
  ): string {
    const s = String(value ?? '').trim()
    if (!s || s === BACKEND_EMPTY_DISPLAY) return fallback
    return s
  }