feat(z01): 뒤처진 자료 띠(서버 source.outdated 만 · 「이 자료는 ○ 판 · 최신은 ○ 공표 · 받는 자리」) · 고친 것 모아 보기는 서버 쪽 나눔 그대로(page·size · 검색 칸 숨김 · 값에 unit) · 부동소수 끝자리 떠돌이 자름(손료계수 0.0001811) · 실제 API 로 노임 한 칸 고치고 되돌림 확인(브레인)
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016VBGFXB9AbJBwXP19z75Qq
This commit is contained in:
@@ -30,6 +30,8 @@ export function cellText(value: unknown, unit?: string | null): string {
|
||||
return value.toLocaleString("ko-KR", { maximumFractionDigits: 10 });
|
||||
}
|
||||
if (typeof value === "object") return JSON.stringify(value);
|
||||
// 부동소수 끝자리 떠돌이(0.00018109999999999998)를 15자리에서 잘라 원래 수로 보임.
|
||||
if (typeof value === "number") return String(Number(value.toPrecision(15)));
|
||||
return String(value);
|
||||
}
|
||||
|
||||
@@ -54,8 +56,30 @@ export function valueWithUnit(value: unknown, unit?: string | null): string {
|
||||
return text && unit ? `${text} ${unit}` : text;
|
||||
}
|
||||
|
||||
/** 자료 출처표 한 줄 — 어디서 받고 최신이 무엇인지(데스크탑 서브 출처표 · 메인이 표 수준에 실음). */
|
||||
export interface TableSource {
|
||||
publisher: string;
|
||||
where: string;
|
||||
cycle?: string;
|
||||
latest_published?: string;
|
||||
our_edition?: string;
|
||||
checked_at?: string;
|
||||
/** 뒤처짐 판정 — 서버만 함 */
|
||||
outdated?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 뒤처진 자료 띠 글자 — 서버가 outdated 라 할 때만. 화면은 날짜를 견주지 않음(판정 두 벌 금지).
|
||||
* 받는 자리를 꼭 적음 — 최신이 무엇인지·어디서 받는지가 없어 건설 노임이 반 년 뒤처졌음.
|
||||
*/
|
||||
export function outdatedBanner(source?: TableSource): string | null {
|
||||
if (source?.outdated !== true) return null;
|
||||
return `이 자료는 ${source.our_edition ?? "판 모름"} 판 · 최신은 ${source.latest_published ?? "?"} 공표 · ${source.publisher} ${source.where}`;
|
||||
}
|
||||
|
||||
/** 기초단가 표 머리 — 열 하나에 한 문장이라 표에 한 번만 옴(2026-09-15 브레인 ④). */
|
||||
export interface TableMeta {
|
||||
source?: TableSource;
|
||||
editable?: string[];
|
||||
/** 열key → 왜 못 고치나 */
|
||||
locked?: Record<string, string>;
|
||||
|
||||
Reference in New Issue
Block a user