[ST] - fix: 입력: 새로고침 시 열려있는 모든 텝의 공통 api가 실행되는 현상 수정, 하수도보급률 저장&제출 request 수정(외국인총인구 제거, 총면적 추가), 검증 툴팁 max-width 추가, 지난 검증 결과 및 제출 결과 데이터 마우스 툴팁 추가
This commit is contained in:
+3
-3
@@ -50,9 +50,9 @@ export const PublicSewageFactColumn = {
|
||||
{ name: 'prcsQnt', fieldName: 'prcsQnt', header: { text: '방류량(500m³/일 이상/미만)' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0', styleName: 'rg-cell-readonly' },
|
||||
|
||||
// 방류량 - (m³/일)
|
||||
{ name: 'prcsPhysCpct', fieldName: 'prcsPhysCpct', header: { text: '물리적' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0', styleName: 'rg-cell-readonly' },
|
||||
{ name: 'prcsBoilCpct', fieldName: 'prcsBoilCpct', header: { text: '생물학적' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0', styleName: 'rg-cell-readonly' },
|
||||
{ name: 'prcsAltdCpct', fieldName: 'prcsAltdCpct', header: { text: '고도' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0', styleName: 'rg-cell-readonly' },
|
||||
{ name: 'prcsPhysCpct', fieldName: 'prcsPhysCpct', header: { text: '물리적' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
|
||||
{ name: 'prcsBoilCpct', fieldName: 'prcsBoilCpct', header: { text: '생물학적' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
|
||||
{ name: 'prcsAltdCpct', fieldName: 'prcsAltdCpct', header: { text: '고도' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
|
||||
|
||||
// 수질
|
||||
{ name: 'inflwBodVl', fieldName: 'inflwBodVl', header: { text: '유입BOD' }, editable: false, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0', styleName: 'rg-cell-readonly' },
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
import { statisticsApi } from "@/entities/statistics/api/statistics-service";
|
||||
|
||||
/** column-guides API 응답 → fieldName(engColNm) → guide 텍스트 */
|
||||
export function mapColumnGuideListToRecord(
|
||||
data: { engColNm?: string; columnGuide?: string }[],
|
||||
): Record<string, string> {
|
||||
const next: Record<string, string> = {};
|
||||
for (const item of data) {
|
||||
const key = item.engColNm?.trim();
|
||||
const guide = item.columnGuide?.trim();
|
||||
if (key && guide) next[key] = guide;
|
||||
}
|
||||
return next;
|
||||
}
|
||||
|
||||
export async function fetchColumnGuidesRecord(
|
||||
statsCd: string,
|
||||
): Promise<Record<string, string>> {
|
||||
try {
|
||||
const res = await statisticsApi.getColumnGuides(statsCd);
|
||||
if (res.status !== "success" || !Array.isArray(res.data)) {
|
||||
return {};
|
||||
}
|
||||
return mapColumnGuideListToRecord(res.data);
|
||||
} catch {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,16 @@ function truncateToFirstDecimal(value: number): number {
|
||||
return Math.floor(value * 10) / 10;
|
||||
}
|
||||
|
||||
/**
|
||||
* IEEE 754 가산 잡음 제거.
|
||||
* 통계 표시 자릿수(대개 0~3)보다 충분히 큰 자리로 반올림해
|
||||
* 112.229999… → 112.23 처럼 만들어 RealGrid `#,##0.000` 표시 오차를 막는다.
|
||||
*/
|
||||
function sanitizeFloatNoise(value: number): number {
|
||||
if (!Number.isFinite(value)) return 0;
|
||||
return Math.round(value * 1e6) / 1e6;
|
||||
}
|
||||
|
||||
/** 합계용 valueCallback 생성 */
|
||||
export function createSumValueCallback(fieldNames: string[]): DataFieldValueCallback {
|
||||
return (_prod, _dataRow, _fieldName, fieldNamesArr, values) => {
|
||||
@@ -22,7 +32,7 @@ export function createSumValueCallback(fieldNames: string[]): DataFieldValueCall
|
||||
const idx = fieldNamesArr.indexOf(f);
|
||||
if (idx >= 0) sum += toNum(values[idx]);
|
||||
}
|
||||
return sum;
|
||||
return sanitizeFloatNoise(sum);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user