[st] feat: H-B 통계검증, I-MR 검증이력 페이지 수정
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# apps/cs/src/shared/config/env.ts 참고
|
||||
NEXT_PUBLIC_PORT=3000
|
||||
NEXT_PUBLIC_PROXY_HOST=http://localhost:3000
|
||||
NEXT_PUBLIC_PORT=3001
|
||||
NEXT_PUBLIC_PROXY_HOST=http://localhost:3001
|
||||
SERVER_API_URL=http://192.168.0.102:8000
|
||||
NEXT_PUBLIC_SITE_ID=CS
|
||||
NEXT_PUBLIC_SITE_ID=ST
|
||||
NEXT_PUBLIC_SUB_DOMAIN=http://localhost:3000
|
||||
NEXT_PUBLIC_TINY_API_KEY=t9nc4z6inquvvd5pq1vea8wcp7lb01qmqseh6egms9vpaju2
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
ST_SERVICE_URL,
|
||||
} from "./src/shared/config";
|
||||
|
||||
const serverApiUrl = process.env.SERVER_API_URL ?? "http://localhost:3000";
|
||||
const serverApiUrl = process.env.SERVER_API_URL;
|
||||
|
||||
const stServiceUrl = ST_SERVICE_URL;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
"dev": "next dev -p 3001",
|
||||
"build": "next build",
|
||||
"start": "next start",
|
||||
"lint": "next lint"
|
||||
|
||||
@@ -73,7 +73,7 @@ interface VerificationFormState {
|
||||
percentile: string;
|
||||
a: string;
|
||||
c: string;
|
||||
verificationYear: string;
|
||||
statisticsYear: string;
|
||||
}
|
||||
|
||||
interface OutlierDialogState {
|
||||
@@ -118,7 +118,7 @@ export default function HbStatisticsVerification() {
|
||||
percentile: "",
|
||||
a: "",
|
||||
c: "",
|
||||
verificationYear: defaultYear,
|
||||
statisticsYear: defaultYear,
|
||||
});
|
||||
const [selectedTargets, setSelectedTargets] = useState<string[]>([]);
|
||||
const [outlierDialog, setOutlierDialog] = useState<OutlierDialogState>({
|
||||
@@ -298,8 +298,8 @@ export default function HbStatisticsVerification() {
|
||||
}
|
||||
|
||||
async function handleSubmit() {
|
||||
if (!formState.verificationYear) {
|
||||
alert("검증년도를 선택해 주세요.");
|
||||
if (!formState.statisticsYear) {
|
||||
alert("통계년도를 선택해 주세요.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -308,7 +308,7 @@ export default function HbStatisticsVerification() {
|
||||
return;
|
||||
}
|
||||
|
||||
const yearNew = toNumber(formState.verificationYear);
|
||||
const yearNew = toNumber(formState.statisticsYear);
|
||||
const payload: AnalysisRequestPayload = {
|
||||
dataset:
|
||||
verifyType === "ALL"
|
||||
@@ -337,7 +337,7 @@ export default function HbStatisticsVerification() {
|
||||
percentile: "0",
|
||||
a: "0",
|
||||
c: "0",
|
||||
verificationYear: defaultYear,
|
||||
statisticsYear: defaultYear,
|
||||
});
|
||||
setSelectedTargets([]);
|
||||
}
|
||||
@@ -385,13 +385,13 @@ export default function HbStatisticsVerification() {
|
||||
<div className="flex items-center gap-6">
|
||||
<div className="flex items-center gap-4 pl-2">
|
||||
<Label className="text-[1.3rem] font-medium text-label">
|
||||
검증 년도
|
||||
통계년도
|
||||
</Label>
|
||||
<Select
|
||||
value={formState.verificationYear}
|
||||
value={formState.statisticsYear}
|
||||
onValueChange={(value) =>
|
||||
handleFormChange(
|
||||
"verificationYear",
|
||||
"statisticsYear",
|
||||
value,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -86,10 +86,27 @@ function getImrDetailGridColumnInfo(statsCd: string): ColumnInfo {
|
||||
};
|
||||
}
|
||||
|
||||
function getVerificationYearOptions(): string[] {
|
||||
const currentYear = dayjs().year();
|
||||
const startYear = 2017;
|
||||
const endYear = currentYear - 1;
|
||||
if (endYear < startYear) return [];
|
||||
return Array.from({ length: endYear - startYear + 1 }, (_, index) =>
|
||||
String(startYear + index),
|
||||
);
|
||||
}
|
||||
|
||||
const ImrVerificationHistory = () => {
|
||||
const yearOptions = useMemo(() => getVerificationYearOptions(), []);
|
||||
const defaultYear: string =
|
||||
yearOptions.length > 0
|
||||
? (yearOptions[yearOptions.length - 1] ?? "")
|
||||
: "";
|
||||
|
||||
// Area A Search States
|
||||
const [searchSido, setSearchSido] = useState<string>("");
|
||||
const [searchSigungu, setSearchSigungu] = useState<string>("");
|
||||
const [searchStatsYr, setSearchStatsYr] = useState<string>(defaultYear);
|
||||
const [searchStatsCd, setSearchStatsCd] = useState<string>("");
|
||||
const [dateRange, setDateRange] = useState<DateRangeValue | undefined>({
|
||||
from: dayjs().subtract(1, "month").toDate(),
|
||||
@@ -101,6 +118,7 @@ const ImrVerificationHistory = () => {
|
||||
size: 10,
|
||||
vrfcMthdCd: "IMR",
|
||||
sort: "anlsSn,desc",
|
||||
statsYr: defaultYear,
|
||||
});
|
||||
|
||||
// Selected States
|
||||
@@ -226,6 +244,7 @@ const ImrVerificationHistory = () => {
|
||||
if (searchSido !== "")
|
||||
params.sewerBzmnCd =
|
||||
searchSigungu !== "" ? searchSigungu : searchSido;
|
||||
if (searchStatsYr) params.statsYr = searchStatsYr;
|
||||
if (searchStatsCd) params.statsCd = searchStatsCd;
|
||||
if (dateRange?.from)
|
||||
params.verifyDtStart = dayjs(dateRange.from).format("YYYY-MM-DD");
|
||||
@@ -368,7 +387,7 @@ const ImrVerificationHistory = () => {
|
||||
return (
|
||||
<div className="flex flex-col gap-4">
|
||||
{/* 영역 A: 검증 이력 그리드 + 검색 필터 */}
|
||||
<div className="card card-border bg-white p-6">
|
||||
<div className="card card-border bg-white px-4">
|
||||
<div className="flex flex-wrap items-end gap-6 p-2">
|
||||
<div className="flex items-center gap-2">
|
||||
<Label className="text-[1.3rem] font-medium text-label">
|
||||
@@ -422,6 +441,27 @@ const ImrVerificationHistory = () => {
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-2">
|
||||
<Label className="text-[1.3rem] font-medium text-label">
|
||||
통계년도
|
||||
</Label>
|
||||
<Select
|
||||
value={searchStatsYr}
|
||||
onValueChange={setSearchStatsYr}
|
||||
>
|
||||
<SelectTrigger className="w-[10rem] flex-1">
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{yearOptions.map((year) => (
|
||||
<SelectItem key={year} value={year}>
|
||||
{year}년
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-2">
|
||||
<Label className="text-[1.3rem] font-medium text-label">
|
||||
검증일시
|
||||
|
||||
@@ -147,7 +147,7 @@ const HbVerificationDetail: React.FC<HbVerificationDetailProps> = ({
|
||||
<h3 className="p-4 pb-0 text-[1.8rem] font-bold text-title">
|
||||
검증 결과 상세
|
||||
</h3>
|
||||
<div className="flex">
|
||||
<div className="grid grid-cols-1 lg:grid-cols-2">
|
||||
<div className="flex-1 p-4">
|
||||
<RegionalGrid
|
||||
anlsSn={anlsSn}
|
||||
|
||||
@@ -104,12 +104,10 @@ const ScatterChart: React.FC<ScatterChartProps> = ({
|
||||
anlsSn,
|
||||
vrfcTrgtSn,
|
||||
);
|
||||
console.log("resultData: ", resultData);
|
||||
const { data: chartData, isLoading: isLoadingChart } = useStAnlsChartData(
|
||||
anlsSn,
|
||||
vrfcTrgtSn,
|
||||
);
|
||||
console.log("chartData: ", chartData);
|
||||
|
||||
const isLoading = isLoadingGrid || isLoadingChart;
|
||||
|
||||
@@ -303,7 +301,7 @@ const ScatterChart: React.FC<ScatterChartProps> = ({
|
||||
</div>
|
||||
</div>
|
||||
) : chartConfig ? (
|
||||
<div className="size-[52rem]">
|
||||
<div className="size-[40rem]">
|
||||
<Scatter
|
||||
data={chartConfig.data}
|
||||
options={chartConfig.options}
|
||||
|
||||
@@ -86,7 +86,7 @@ const VerificationList: React.FC<VerificationListProps> = ({
|
||||
variant="secondary"
|
||||
onRowClick={handleRowClick}
|
||||
viewPagination={false}
|
||||
className="whitespace-nowrap text-[1.2rem] [&_td]:!px-2 [&_th]:!px-2"
|
||||
className="text-[1.2rem] [&_td]:!px-2 [&_th]:!px-2"
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -72,7 +72,7 @@ export const imrVerificationHistoryColumns = [
|
||||
),
|
||||
}),
|
||||
columnHelper.accessor("statsYr", {
|
||||
header: "검증년도",
|
||||
header: "통계년도",
|
||||
cell: (info) => (
|
||||
<div className="px-2 py-4 text-center">
|
||||
{info.getValue() ?? "-"}
|
||||
|
||||
Reference in New Issue
Block a user