st: fix: db표준화 작업에 맞춰 수정

This commit is contained in:
2026-03-06 10:37:50 +09:00
parent a5aa6bfdf4
commit 727d448dc5
10 changed files with 164 additions and 47 deletions
@@ -951,6 +951,8 @@ const DataGrid = ({
);
}
});
// valueCallback 적용 후 푸터 셀 다시 그리기 (API 합계 등 우선 표시 반영)
currentGridView.refresh?.();
}, 200);
if (getGridDataRef) {
+3 -9
View File
@@ -1,6 +1,6 @@
"use client";
import { useState, useEffect, useRef } from "react";
import { useState, useEffect } from "react";
import useSWR from 'swr';
import {
@@ -19,7 +19,6 @@ import { useAlertStore } from "@/shared/lib";
import { type SearchFormProps, type SearchFormValues, defaultSearchFormProps } from "../type/SearchForm.type";
import { statisticsAPi } from "@/entities/statistics/api/statistics-service";
import type { ApiResponse, SearchCondition, Sgg } from "@/entities/statistics/model/statistics-interface";
import { doList } from "../util/column/input/DoList";
const getSidoListFetcher = async (): Promise<ApiResponse<SearchCondition>> => {
return statisticsAPi.getSidoList();
@@ -68,7 +67,6 @@ const SearchForm = (props: SearchFormProps = {}) => {
});
const sggKey: [string, string] | null =
// values.sido && values.sido !== "ALL" && doList.includes(values.bsnmCd ?? "")
values.sido && values.sido !== "ALL"
? ["sgg-list", values.sido]
: null;
@@ -93,9 +91,7 @@ const SearchForm = (props: SearchFormProps = {}) => {
},
}
);
const lastSggListRef = useRef<Sgg[]>([]);
if (sggList?.data) lastSggListRef.current = sggList.data;
const sggOptions = sggList?.data ?? (values.sido && values.sido !== "ALL" ? lastSggListRef.current : []);
const sggOptions = sggList?.data ?? [];
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
@@ -103,7 +99,6 @@ const SearchForm = (props: SearchFormProps = {}) => {
};
const handleReset = () => {
lastSggListRef.current = [];
const resetValues: SearchFormValues = {
sido: '',
gugun: '',
@@ -118,7 +113,6 @@ const SearchForm = (props: SearchFormProps = {}) => {
const handleSidoChange = (value: string) => {
const selectedBsnm = sidoList?.data.sidoList.find((v) => v.sido === value)?.bsnmCd || '';
lastSggListRef.current = []; // 시도 변경 시 이전 시군구 목록 제거(조건 안 맞는 시도로 바꿀 때 옵션 안 남도록)
setValues((prev) => ({
...prev,
sido: value,
@@ -128,7 +122,7 @@ const SearchForm = (props: SearchFormProps = {}) => {
};
const handleSggChange = (value: string) => {
const listForBsnm = sggList?.data ?? lastSggListRef.current;
const listForBsnm = sggList?.data ?? [];
const selectedBsnm = value === 'ALL'
? (sidoList?.data.sidoList.find((v) => v.sido === values.sido)?.bsnmCd || '')
: (listForBsnm.find((v) => v.gugun === value)?.bsnmCd || '');