fo: 유량현황 팝업 강우시 강우일 음영표시

This commit is contained in:
2026-01-30 18:14:30 +09:00
parent 164fc1388e
commit c6cfedb28b
4 changed files with 26 additions and 9 deletions
@@ -447,7 +447,9 @@ export default function WaterQualityModal({ fcltyName = '', facilityCd = '', sea
</div>
<div className="card-header border-t mt-1">
<h3 className="text-2xl font-medium text-label">수질 TMS</h3>
<h3 className="text-2xl font-medium text-label text-right">({msrmtDate ? msrmtDate.substring(0, 4) + '-' + msrmtDate.substring(4, 6) + '-' + msrmtDate.substring(6, 8) : yesterDayStr})</h3>
<h3 className="text-2xl font-medium text-label text-right">
({msrmtDate ? msrmtDate.substring(0, 4) + '-' + msrmtDate.substring(4, 6) + '-' + msrmtDate.substring(6, 8) : yesterDayStr})
</h3>
</div>
<div className="overflow-y-auto h-[250px]">
<UiTable
@@ -208,16 +208,29 @@ export default function FlowRateModal(props: { fcltyName: string; facilityCd: st
prevExcelListRef.current = excelDownList;
}
const rainCellClassName = useCallback(
(row: FlowRateModalInterface, headId: string, rowIndex: number) => {
// const rainCellClassName = useCallback(
// (row: FlowRateModalInterface, headId: string, rowIndex: number) => {
// if (activeTab !== "tab_term_rain") return "";
// if (headId !== "infoRnDay") return "";
// if (rowIndex < 3) return "";
// const raw = row.infoRnDay;
// const value = typeof raw === "string" ? Number(raw.replace(/,/g, "").trim()) : Number(raw);
// if (!Number.isFinite(value)) return "";
// return value > 3 ? "bg-red-50 font-semibold" : "";
// },
// [activeTab],
// );
const rainRowClassName = useCallback(
(row: FlowRateModalInterface, rowIndex: number) => {
if (activeTab !== "tab_term_rain") return "";
if (headId !== "infoRnDay") return "";
if (rowIndex < 3) return "";
const raw = row.infoRnDay;
const value = typeof raw === "string" ? Number(raw.replace(/,/g, "").trim()) : Number(raw);
if (!Number.isFinite(value)) return "";
return value > 3 ? "bg-red-50 font-semibold" : "";
return value > 3 ? "bg-slate-50" : "";
},
[activeTab],
);
@@ -353,7 +366,7 @@ export default function FlowRateModal(props: { fcltyName: string; facilityCd: st
<div className="h-[370px] overflow-y-auto overflow-x-hidden">
<UiTable headName="유량현황" tableData={copyYearList} headlist={upHeadListFlowRateModalYear} pageSize={0} total={0}
cellClick={undefined} onPageChange={() => { }} className="h-[370px]" boldArray={[0, 1, 2]}
cellClassName={rainCellClassName} />
rowClassName={rainRowClassName} />
</div>
<div className="mt-20">
<UnderComment commentArray={["미처리하수 추정량 산식 =[(강우시 일별유입유량*강우시 일별유입BOD)-(청천시 연평균유입유량*청천시 연평균유입BOD)]/강우시 일별유입BOD)", "강우량 3mm 이상만 날과 강우영향일(강우일+2일)의 날"]} />
+2 -2
View File
@@ -388,7 +388,7 @@ export const flowRateSearchReducer: (set: (fn: (state: FlowRateSearchType) => Fl
const yearSunnyAmnt = sunnyDay > 0 ? sunnyInflAmnt / sunnyDay : 0; // 청천시 연평균유입유량
const yearSunnyBod = sunnyDay > 0 ? sunnyBod / sunnyDay : 0; // 청천시 연평균유입BOD
console.log(inflData);
//console.log(inflData);
const rtnData = inflData.map((item: FlowRateModalProps) => {
const targetWqItem = wqltData?.find(wqitem => wqitem.msrDt === item.msrDt.replaceAll('-', ''));
const dayBod = targetWqItem ? Number(targetWqItem.inflAssctBfrWqltBod) : 0;
@@ -404,7 +404,7 @@ export const flowRateSearchReducer: (set: (fn: (state: FlowRateSearchType) => Fl
: item.msrDt,
};
});
console.log(rtnData);
//console.log(rtnData);
set((state: FlowRateSearchType) => ({
...state,
FlowRateModal: {
@@ -25,6 +25,7 @@ type UiTableProps<T extends object> = {
cellClick: ((index: number | undefined, headId: string) => void) | undefined;
onPageChange: (page: number) => void;
cellClassName?: (row: T, headId: string, rowIndex: number) => string;
rowClassName?: (row: T, rowIndex: number) => string;
className?: string;
resetPageNo?: boolean;
children?: React.ReactNode | undefined;
@@ -57,6 +58,7 @@ export function UiTable<T extends object = Record<string, unknown>>({
cellClick,
onPageChange,
cellClassName,
rowClassName,
className = "",
resetPageNo = false,
boldArray = [],
@@ -151,7 +153,7 @@ export function UiTable<T extends object = Record<string, unknown>>({
<TableBody className="text-center">
{tableData.length > 0 ? (
tableData?.map((el: T, index) => (
<TableRow key={`row-${index}`}>
<TableRow key={`row-${index}`} className={rowClassName ? rowClassName(el, index) : ""}>
{headlist
.filter((item) => item.visible != false)
.map(