Compare commits
87
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c0888ea2a4 | ||
|
|
1ead18b53c | ||
|
|
07db5b1fbd | ||
|
|
6110abebb4 | ||
|
|
05e9082831 | ||
|
|
76a634cf9a | ||
|
|
793c673414 | ||
|
|
2a76c279eb | ||
|
|
5d1ba3fd87 | ||
|
|
99db9a0b77 | ||
|
|
4126bc2234 | ||
|
|
d4f1ec095e | ||
|
|
bbf3ce3948 | ||
|
|
fb5b8356c7 | ||
|
|
1333bd040a | ||
|
|
013c07ef59 | ||
|
|
29fd59a321 | ||
|
|
3bc152c341 | ||
|
|
ea274f8f7d | ||
|
|
7ac53e56d7 | ||
|
|
7b1c12e952 | ||
|
|
17dafe6530 | ||
|
|
ef331363f7 | ||
|
|
4f10864c2c | ||
|
|
4b5ceb0e0a | ||
|
|
4fa50161fd | ||
|
|
3d27e07ccb | ||
|
|
ca1ca71a62 | ||
|
|
bdd6c7b804 | ||
|
|
04b8082f04 | ||
|
|
3451b19b96 | ||
|
|
ae7c1ea1c4 | ||
|
|
9c76b955e2 | ||
|
|
6c4bfe2798 | ||
|
|
98189cd14a | ||
|
|
823ce262bb | ||
|
|
34358400e8 | ||
|
|
da9d069a9a | ||
|
|
58a03678e4 | ||
|
|
f5c281cf86 | ||
|
|
c72bcea7d9 | ||
|
|
49cd160e76 | ||
|
|
5ca93a25ca | ||
|
|
55554fc781 | ||
|
|
8e78c10304 | ||
|
|
0eb74b46ba | ||
|
|
f21dde8f7d | ||
|
|
1fc6707bb3 | ||
|
|
44c5d66afa | ||
|
|
04edb49c9f | ||
|
|
e3eb542e59 | ||
|
|
428b199dd3 | ||
|
|
3c4a6efeea | ||
|
|
dae7024043 | ||
|
|
64e5c26e8c | ||
|
|
84ae60edd6 | ||
|
|
d4c9989069 | ||
|
|
6cda413913 | ||
|
|
a11eaf031d | ||
|
|
3c701359fd | ||
|
|
85ba9fe0ab | ||
|
|
71077f4c8e | ||
|
|
4c7ff53d78 | ||
|
|
b31691dd9c | ||
|
|
0131cae0d7 | ||
|
|
f37b19eab6 | ||
|
|
7c1db5e0e0 | ||
|
|
2c495ab8fd | ||
|
|
ced1b7084d | ||
|
|
b0c871eff7 | ||
|
|
bd83fa3417 | ||
|
|
c0b63a655e | ||
|
|
cc21aaede1 | ||
|
|
0c71c80a25 | ||
|
|
49e42757bc | ||
|
|
0964f442be | ||
|
|
73ceeb1b38 | ||
|
|
814365d7de | ||
|
|
8c1a976b5b | ||
|
|
66db81071e | ||
|
|
6df6e612bc | ||
|
|
3fee2a781f | ||
|
|
55839f0913 | ||
|
|
f68131fc13 | ||
|
|
7b9081a125 | ||
|
|
54d3a35b38 | ||
|
|
ba42b74578 |
@@ -1,17 +1,29 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
import { useConfirm } from "@frontend-opensource/use-react-hooks";
|
import { useConfirm } from "@frontend-opensource/use-react-hooks";
|
||||||
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
||||||
import {
|
import {
|
||||||
getCoreRowModel,
|
getCoreRowModel,
|
||||||
type PaginationState,
|
type PaginationState,
|
||||||
|
type Row,
|
||||||
type RowSelectionState,
|
type RowSelectionState,
|
||||||
type Table,
|
type Table,
|
||||||
type Row,
|
|
||||||
} from "@tanstack/react-table";
|
} from "@tanstack/react-table";
|
||||||
|
|
||||||
|
import { ENDPOINT } from "@/shared/config";
|
||||||
|
import { useAlertStore, useDataTable } from "@/shared/lib";
|
||||||
|
import { GroupApi } from "@/entities/group";
|
||||||
|
import { GroupUsersApi } from "@/entities/group-user";
|
||||||
|
import {
|
||||||
|
type AdminUserListResponse,
|
||||||
|
UserApi,
|
||||||
|
type UserSearchParams,
|
||||||
|
} from "@/entities/user";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
|
Checkbox,
|
||||||
Input,
|
Input,
|
||||||
Label,
|
Label,
|
||||||
Select,
|
Select,
|
||||||
@@ -19,18 +31,10 @@ import {
|
|||||||
SelectItem,
|
SelectItem,
|
||||||
SelectTrigger,
|
SelectTrigger,
|
||||||
SelectValue,
|
SelectValue,
|
||||||
Checkbox,
|
|
||||||
} from "@common/components";
|
} from "@common/components";
|
||||||
import { GroupApi } from "@/entities/group";
|
|
||||||
import {
|
|
||||||
UserApi,
|
|
||||||
type UserSearchParams,
|
|
||||||
type AdminUserListResponse,
|
|
||||||
} from "@/entities/user";
|
|
||||||
import { GroupUsersApi } from "@/entities/group-user";
|
|
||||||
import { ENDPOINT } from "@/shared/config";
|
|
||||||
import { useDataTable, useAlertStore } from "@/shared/lib";
|
|
||||||
import { columns } from "../model/table-columns";
|
import { columns } from "../model/table-columns";
|
||||||
|
|
||||||
import { AddAdminDialog } from "./add-admin-dialog";
|
import { AddAdminDialog } from "./add-admin-dialog";
|
||||||
|
|
||||||
function AdminPage() {
|
function AdminPage() {
|
||||||
|
|||||||
@@ -1,20 +1,25 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useEffect, useState, useRef } from "react";
|
import { useEffect, useRef, useState } from "react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useQuery } from "@tanstack/react-query";
|
|
||||||
|
import { keepPreviousData, useQuery } from "@tanstack/react-query";
|
||||||
import {
|
import {
|
||||||
getCoreRowModel,
|
getCoreRowModel,
|
||||||
|
type OnChangeFn,
|
||||||
type PaginationState,
|
type PaginationState,
|
||||||
type RowSelectionState,
|
type RowSelectionState,
|
||||||
} from "@tanstack/react-table";
|
} from "@tanstack/react-table";
|
||||||
import { Button, Input, Label } from "@common/components";
|
|
||||||
import { POSTING_TYPE, PostingDialog } from "@/entities/posting";
|
|
||||||
import { ENDPOINT } from "@/shared/config";
|
import { ENDPOINT } from "@/shared/config";
|
||||||
import { useDataTable } from "@/shared/lib";
|
import { useDataTable, useSearchParamsState } from "@/shared/lib";
|
||||||
|
import { POSTING_TYPE, PostingDialog } from "@/entities/posting";
|
||||||
|
import { Button, Input, Label } from "@common/components";
|
||||||
|
|
||||||
import { BannerApi } from "../api/banner-service";
|
import { BannerApi } from "../api/banner-service";
|
||||||
|
import { type Banner } from "../model/banner-interface";
|
||||||
import { createColumns } from "../model/banner-table-columns";
|
import { createColumns } from "../model/banner-table-columns";
|
||||||
import { type Banner, type BannerParams } from "../model/banner-interface";
|
|
||||||
import { PreviewBannerDialog } from "./preview-banner-dialog";
|
import { PreviewBannerDialog } from "./preview-banner-dialog";
|
||||||
|
|
||||||
type PostingTarget = {
|
type PostingTarget = {
|
||||||
@@ -22,50 +27,52 @@ type PostingTarget = {
|
|||||||
pstgTrgtNo: number;
|
pstgTrgtNo: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const DEFAULT_PARAMS = {
|
||||||
|
bnrTtl: "",
|
||||||
|
sort: "regDt,desc",
|
||||||
|
page: 0,
|
||||||
|
size: 10,
|
||||||
|
};
|
||||||
|
|
||||||
function BannerPage() {
|
function BannerPage() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const imageRefs = useRef<Map<number, string>>(new Map());
|
const imageRefs = useRef<Map<number, string>>(new Map());
|
||||||
|
const { params, setParams, resetParams } =
|
||||||
|
useSearchParamsState(DEFAULT_PARAMS);
|
||||||
const [rowSelection, setRowSelection] = useState<RowSelectionState>({});
|
const [rowSelection, setRowSelection] = useState<RowSelectionState>({});
|
||||||
const [postingTargets, setPostingTargets] = useState<PostingTarget[]>([]);
|
const [postingTargets, setPostingTargets] = useState<PostingTarget[]>([]);
|
||||||
const [bnrTtl, setBnrTtl] = useState("");
|
const [bnrTtl, setBnrTtl] = useState(params.bnrTtl);
|
||||||
const [searchParams, setSearchParams] = useState<BannerParams>({
|
|
||||||
bnrTtl: "",
|
|
||||||
sort: "regDt,desc",
|
|
||||||
});
|
|
||||||
const [pagination, setPagination] = useState<PaginationState>({
|
|
||||||
pageIndex: 0,
|
|
||||||
pageSize: 10,
|
|
||||||
});
|
|
||||||
|
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: [ENDPOINT.CMS_SERVICE.BANNERS, searchParams, pagination],
|
queryKey: [ENDPOINT.CMS_SERVICE.BANNERS, params],
|
||||||
queryFn: () =>
|
queryFn: () =>
|
||||||
BannerApi.getBannerList({
|
BannerApi.getBannerList({
|
||||||
...searchParams,
|
bnrTtl: params.bnrTtl,
|
||||||
page: pagination.pageIndex,
|
sort: params.sort,
|
||||||
size: pagination.pageSize,
|
page: params.page,
|
||||||
|
size: params.size,
|
||||||
}),
|
}),
|
||||||
|
placeholderData: keepPreviousData,
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleSubmit = (e: React.SubmitEvent<HTMLFormElement>) => {
|
const pagination: PaginationState = {
|
||||||
|
pageIndex: params.page,
|
||||||
|
pageSize: params.size,
|
||||||
|
};
|
||||||
|
|
||||||
|
const handlePaginationChange: OnChangeFn<PaginationState> = (updater) => {
|
||||||
|
const next = typeof updater === "function" ? updater(pagination) : updater;
|
||||||
|
setParams({ page: next.pageIndex, size: next.pageSize });
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
setPagination({
|
setParams({ bnrTtl, page: 0 });
|
||||||
...pagination,
|
|
||||||
pageIndex: 0,
|
|
||||||
});
|
|
||||||
setSearchParams({
|
|
||||||
...searchParams,
|
|
||||||
bnrTtl,
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
setBnrTtl("");
|
setBnrTtl("");
|
||||||
setSearchParams({
|
resetParams();
|
||||||
...searchParams,
|
|
||||||
bnrTtl: "",
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleRowClick = (row: Banner) => {
|
const handleRowClick = (row: Banner) => {
|
||||||
@@ -92,7 +99,7 @@ function BannerPage() {
|
|||||||
manualPagination: true,
|
manualPagination: true,
|
||||||
enableMultiRowSelection: true,
|
enableMultiRowSelection: true,
|
||||||
getCoreRowModel: getCoreRowModel(),
|
getCoreRowModel: getCoreRowModel(),
|
||||||
onPaginationChange: setPagination,
|
onPaginationChange: handlePaginationChange,
|
||||||
onRowSelectionChange: setRowSelection,
|
onRowSelectionChange: setRowSelection,
|
||||||
},
|
},
|
||||||
dataTableOptions: {
|
dataTableOptions: {
|
||||||
|
|||||||
@@ -2,12 +2,19 @@
|
|||||||
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useQuery } from "@tanstack/react-query";
|
|
||||||
|
import { keepPreviousData, useQuery } from "@tanstack/react-query";
|
||||||
import {
|
import {
|
||||||
getCoreRowModel,
|
getCoreRowModel,
|
||||||
|
type OnChangeFn,
|
||||||
type PaginationState,
|
type PaginationState,
|
||||||
type RowSelectionState,
|
type RowSelectionState,
|
||||||
} from "@tanstack/react-table";
|
} from "@tanstack/react-table";
|
||||||
|
|
||||||
|
import { ENDPOINT } from "@/shared/config";
|
||||||
|
import { useDataTable, useSearchParamsState } from "@/shared/lib";
|
||||||
|
import { type Board, BoardApi } from "@/entities/board";
|
||||||
|
import { CodeSelect } from "@/entities/code";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Input,
|
Input,
|
||||||
@@ -18,60 +25,57 @@ import {
|
|||||||
SelectTrigger,
|
SelectTrigger,
|
||||||
SelectValue,
|
SelectValue,
|
||||||
} from "@common/components";
|
} from "@common/components";
|
||||||
import { CodeSelect } from "@/entities/code";
|
|
||||||
import { BoardApi, type BoardParams } from "@/entities/board";
|
|
||||||
import { ENDPOINT } from "@/shared/config";
|
|
||||||
import { useDataTable } from "@/shared/lib";
|
|
||||||
import { type Board } from "@/entities/board";
|
|
||||||
import { columns } from "../model/table-columns";
|
import { columns } from "../model/table-columns";
|
||||||
|
|
||||||
|
const DEFAULT_PARAMS = {
|
||||||
|
bbsTypeCd: "",
|
||||||
|
bbsNm: "",
|
||||||
|
sort: "regDt,desc",
|
||||||
|
page: 0,
|
||||||
|
size: 10,
|
||||||
|
};
|
||||||
|
|
||||||
function BbsPage() {
|
function BbsPage() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const { params, setParams, resetParams } =
|
||||||
|
useSearchParamsState(DEFAULT_PARAMS);
|
||||||
const [rowSelection, setRowSelection] = useState<RowSelectionState>({});
|
const [rowSelection, setRowSelection] = useState<RowSelectionState>({});
|
||||||
const [bbsTypeCd, setBbsTypeCd] = useState("");
|
const [bbsTypeCd, setBbsTypeCd] = useState(params.bbsTypeCd);
|
||||||
const [bbsNm, setBbsNm] = useState("");
|
const [bbsNm, setBbsNm] = useState(params.bbsNm);
|
||||||
const [searchParams, setSearchParams] = useState<BoardParams>({
|
|
||||||
bbsTypeCd: "",
|
|
||||||
bbsNm: "",
|
|
||||||
sort: "regDt,desc",
|
|
||||||
});
|
|
||||||
const [pagination, setPagination] = useState<PaginationState>({
|
|
||||||
pageIndex: 0,
|
|
||||||
pageSize: 10,
|
|
||||||
});
|
|
||||||
|
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: [ENDPOINT.BOARD_SERVICE.BBS, searchParams, pagination],
|
queryKey: [ENDPOINT.BOARD_SERVICE.BBS, params],
|
||||||
queryFn: () =>
|
queryFn: () =>
|
||||||
BoardApi.getBoardList({
|
BoardApi.getBoardList({
|
||||||
...searchParams,
|
bbsTypeCd: params.bbsTypeCd,
|
||||||
page: pagination.pageIndex,
|
bbsNm: params.bbsNm,
|
||||||
size: pagination.pageSize,
|
sort: params.sort,
|
||||||
|
page: params.page,
|
||||||
|
size: params.size,
|
||||||
}),
|
}),
|
||||||
|
placeholderData: keepPreviousData,
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleSubmit = (e: React.SubmitEvent<HTMLFormElement>) => {
|
const pagination: PaginationState = {
|
||||||
|
pageIndex: params.page,
|
||||||
|
pageSize: params.size,
|
||||||
|
};
|
||||||
|
|
||||||
|
const handlePaginationChange: OnChangeFn<PaginationState> = (updater) => {
|
||||||
|
const next = typeof updater === "function" ? updater(pagination) : updater;
|
||||||
|
setParams({ page: next.pageIndex, size: next.pageSize });
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
setPagination({
|
setParams({ bbsTypeCd, bbsNm, page: 0 });
|
||||||
...pagination,
|
|
||||||
pageIndex: 0,
|
|
||||||
});
|
|
||||||
setSearchParams({
|
|
||||||
...searchParams,
|
|
||||||
bbsTypeCd,
|
|
||||||
bbsNm,
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
setBbsTypeCd("");
|
setBbsTypeCd("");
|
||||||
setBbsNm("");
|
setBbsNm("");
|
||||||
setSearchParams({
|
resetParams();
|
||||||
...searchParams,
|
|
||||||
bbsTypeCd: "",
|
|
||||||
bbsNm: "",
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleRowClick = (row: Board) => {
|
const handleRowClick = (row: Board) => {
|
||||||
@@ -89,7 +93,7 @@ function BbsPage() {
|
|||||||
manualPagination: true,
|
manualPagination: true,
|
||||||
enableMultiRowSelection: true,
|
enableMultiRowSelection: true,
|
||||||
getCoreRowModel: getCoreRowModel(),
|
getCoreRowModel: getCoreRowModel(),
|
||||||
onPaginationChange: setPagination,
|
onPaginationChange: handlePaginationChange,
|
||||||
onRowSelectionChange: setRowSelection,
|
onRowSelectionChange: setRowSelection,
|
||||||
},
|
},
|
||||||
dataTableOptions: {
|
dataTableOptions: {
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
import dayjs from "dayjs";
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
import type { ColumnDef } from "@tanstack/react-table";
|
import type { ColumnDef } from "@tanstack/react-table";
|
||||||
import { Button } from "@common/components";
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
import type { UpCode } from "@/entities/code";
|
import type { UpCode } from "@/entities/code";
|
||||||
|
import { Button } from "@common/components";
|
||||||
|
|
||||||
import { UpCodeManagementDialog } from "../ui/upcode-dialog";
|
import { UpCodeManagementDialog } from "../ui/upcode-dialog";
|
||||||
|
|
||||||
export const columns: ColumnDef<UpCode>[] = [
|
export const columns: ColumnDef<UpCode>[] = [
|
||||||
@@ -24,7 +27,7 @@ export const columns: ColumnDef<UpCode>[] = [
|
|||||||
header: "상위코드명",
|
header: "상위코드명",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessorKey: "cdSe",
|
accessorKey: "cdSeNm",
|
||||||
header: "코드구분",
|
header: "코드구분",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,60 +2,64 @@
|
|||||||
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
|
|
||||||
import { keepPreviousData, useQuery } from "@tanstack/react-query";
|
import { keepPreviousData, useQuery } from "@tanstack/react-query";
|
||||||
import { getCoreRowModel, type PaginationState } from "@tanstack/react-table";
|
|
||||||
import { Button, Input, Label } from "@common/components";
|
|
||||||
import {
|
import {
|
||||||
ContentsApi,
|
getCoreRowModel,
|
||||||
type Contents,
|
type OnChangeFn,
|
||||||
type ContentsParams,
|
type PaginationState,
|
||||||
} from "@/entities/content";
|
} from "@tanstack/react-table";
|
||||||
|
|
||||||
import { ENDPOINT } from "@/shared/config";
|
import { ENDPOINT } from "@/shared/config";
|
||||||
import { useDataTable } from "@/shared/lib";
|
import { useDataTable, useSearchParamsState } from "@/shared/lib";
|
||||||
|
import { type Contents, ContentsApi } from "@/entities/content";
|
||||||
|
import { Button, Input, Label } from "@common/components";
|
||||||
|
|
||||||
import { columns } from "../model/table-columns";
|
import { columns } from "../model/table-columns";
|
||||||
|
|
||||||
|
const DEFAULT_PARAMS = {
|
||||||
|
contsTtl: "",
|
||||||
|
sort: "regDt,desc",
|
||||||
|
page: 0,
|
||||||
|
size: 10,
|
||||||
|
};
|
||||||
|
|
||||||
function ContentsPage() {
|
function ContentsPage() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const { params, setParams, resetParams } =
|
||||||
const [contsTtl, setContsTtl] = useState("");
|
useSearchParamsState(DEFAULT_PARAMS);
|
||||||
const [searchParams, setSearchParams] = useState<ContentsParams>({
|
const [contsTtl, setContsTtl] = useState(params.contsTtl);
|
||||||
contsTtl: "",
|
|
||||||
sort: "regDt,desc",
|
|
||||||
});
|
|
||||||
const [pagination, setPagination] = useState<PaginationState>({
|
|
||||||
pageIndex: 0,
|
|
||||||
pageSize: 10,
|
|
||||||
});
|
|
||||||
|
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: [ENDPOINT.CMS_SERVICE.CONTENTS, searchParams, pagination],
|
queryKey: [ENDPOINT.CMS_SERVICE.CONTENTS, params],
|
||||||
queryFn: () =>
|
queryFn: () =>
|
||||||
ContentsApi.getContentsList({
|
ContentsApi.getContentsList({
|
||||||
...searchParams,
|
contsTtl: params.contsTtl,
|
||||||
page: pagination.pageIndex,
|
sort: params.sort,
|
||||||
size: pagination.pageSize,
|
page: params.page,
|
||||||
|
size: params.size,
|
||||||
}),
|
}),
|
||||||
placeholderData: keepPreviousData,
|
placeholderData: keepPreviousData,
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleSubmit = (e: React.SubmitEvent<HTMLFormElement>) => {
|
const pagination: PaginationState = {
|
||||||
|
pageIndex: params.page,
|
||||||
|
pageSize: params.size,
|
||||||
|
};
|
||||||
|
|
||||||
|
const handlePaginationChange: OnChangeFn<PaginationState> = (updater) => {
|
||||||
|
const next = typeof updater === "function" ? updater(pagination) : updater;
|
||||||
|
setParams({ page: next.pageIndex, size: next.pageSize });
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
setPagination({
|
setParams({ contsTtl, page: 0 });
|
||||||
...pagination,
|
|
||||||
pageIndex: 0,
|
|
||||||
});
|
|
||||||
setSearchParams({
|
|
||||||
...searchParams,
|
|
||||||
contsTtl,
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
setContsTtl("");
|
setContsTtl("");
|
||||||
setSearchParams({
|
resetParams();
|
||||||
...searchParams,
|
|
||||||
contsTtl: "",
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleRowClick = (row: Contents) => {
|
const handleRowClick = (row: Contents) => {
|
||||||
@@ -69,7 +73,7 @@ function ContentsPage() {
|
|||||||
state: {
|
state: {
|
||||||
pagination,
|
pagination,
|
||||||
},
|
},
|
||||||
onPaginationChange: setPagination,
|
onPaginationChange: handlePaginationChange,
|
||||||
getCoreRowModel: getCoreRowModel(),
|
getCoreRowModel: getCoreRowModel(),
|
||||||
manualPagination: true,
|
manualPagination: true,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -354,7 +354,7 @@ function DashboardPage() {
|
|||||||
<div className="card-header text-foreground">
|
<div className="card-header text-foreground">
|
||||||
<h3 className="text-2xl font-medium">실시간 알림</h3>
|
<h3 className="text-2xl font-medium">실시간 알림</h3>
|
||||||
</div>
|
</div>
|
||||||
<div className="p-4">
|
<div className="p-4" style={{ height: "120px", overflowY: "auto" }}>
|
||||||
<div className="space-y-4 text-foreground">
|
<div className="space-y-4 text-foreground">
|
||||||
{noticeUserList?.map((item) => (
|
{noticeUserList?.map((item) => (
|
||||||
<div
|
<div
|
||||||
@@ -373,7 +373,7 @@ function DashboardPage() {
|
|||||||
<div className="card-header text-foreground">
|
<div className="card-header text-foreground">
|
||||||
<h3 className="text-2xl font-medium">일정 알림</h3>
|
<h3 className="text-2xl font-medium">일정 알림</h3>
|
||||||
</div>
|
</div>
|
||||||
<div className="p-4">
|
<div className="p-4" style={{ height: "120px", overflowY: "auto" }}>
|
||||||
<div className="space-y-4 text-foreground">
|
<div className="space-y-4 text-foreground">
|
||||||
{scheduleList && scheduleList.length > 0 ? (
|
{scheduleList && scheduleList.length > 0 ? (
|
||||||
scheduleList.map((schedule, index) => {
|
scheduleList.map((schedule, index) => {
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
|
import { useConfirm } from "@frontend-opensource/use-react-hooks";
|
||||||
import { keepPreviousData, useQuery } from "@tanstack/react-query";
|
import { keepPreviousData, useQuery } from "@tanstack/react-query";
|
||||||
import { getCoreRowModel, type PaginationState } from "@tanstack/react-table";
|
import { getCoreRowModel, type PaginationState } from "@tanstack/react-table";
|
||||||
import { useConfirm } from "@frontend-opensource/use-react-hooks";
|
|
||||||
import { Button, Input, Label } from "@common/components";
|
|
||||||
import { AttachmentApi, type AttachmentParams } from "@/entities/attachment";
|
|
||||||
import { useAlertStore, useDataTable, useMutationWrapper } from "@/shared/lib";
|
|
||||||
import { ENDPOINT } from "@/shared/config";
|
import { ENDPOINT } from "@/shared/config";
|
||||||
|
import { useAlertStore, useDataTable, useMutationWrapper } from "@/shared/lib";
|
||||||
|
import { AttachmentApi, type AttachmentParams } from "@/entities/attachment";
|
||||||
|
import { Button, Input, Label } from "@common/components";
|
||||||
|
|
||||||
import { createColumns } from "../model/table-columns";
|
import { createColumns } from "../model/table-columns";
|
||||||
|
|
||||||
function FilePage() {
|
function FilePage() {
|
||||||
|
|||||||
@@ -2,68 +2,73 @@
|
|||||||
|
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
|
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
import {
|
import {
|
||||||
getCoreRowModel,
|
getCoreRowModel,
|
||||||
|
type OnChangeFn,
|
||||||
type PaginationState,
|
type PaginationState,
|
||||||
type RowSelectionState,
|
type RowSelectionState,
|
||||||
} from "@tanstack/react-table";
|
} from "@tanstack/react-table";
|
||||||
import { Button, Input, Label } from "@common/components";
|
|
||||||
import { POSTING_TYPE, PostingDialog } from "@/entities/posting";
|
|
||||||
import { ENDPOINT } from "@/shared/config";
|
import { ENDPOINT } from "@/shared/config";
|
||||||
import { useDataTable } from "@/shared/lib";
|
import { useDataTable, useSearchParamsState } from "@/shared/lib";
|
||||||
|
import { POSTING_TYPE, PostingDialog } from "@/entities/posting";
|
||||||
|
import { Button, Input, Label } from "@common/components";
|
||||||
|
|
||||||
import { ImageApi } from "../api/image-service";
|
import { ImageApi } from "../api/image-service";
|
||||||
|
import { type Image } from "../model/image-interface";
|
||||||
import { columns } from "../model/image-table-columns";
|
import { columns } from "../model/image-table-columns";
|
||||||
import { type Image, type ImageParams } from "../model/image-interface";
|
|
||||||
|
|
||||||
type PostingTarget = {
|
type PostingTarget = {
|
||||||
pstgTrgtNm: string;
|
pstgTrgtNm: string;
|
||||||
pstgTrgtNo: number;
|
pstgTrgtNo: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const DEFAULT_PARAMS = {
|
||||||
|
keyword: "",
|
||||||
|
sort: "regDt,desc",
|
||||||
|
page: 0,
|
||||||
|
size: 10,
|
||||||
|
};
|
||||||
|
|
||||||
function ImagePage() {
|
function ImagePage() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const { params, setParams, resetParams } =
|
||||||
const [keyword, setKeyword] = useState("");
|
useSearchParamsState(DEFAULT_PARAMS);
|
||||||
const [searchParams, setSearchParams] = useState<ImageParams>({
|
const [keyword, setKeyword] = useState(params.keyword);
|
||||||
keyword: "",
|
|
||||||
sort: "regDt,desc",
|
|
||||||
});
|
|
||||||
const [pagination, setPagination] = useState<PaginationState>({
|
|
||||||
pageIndex: 0,
|
|
||||||
pageSize: 10,
|
|
||||||
});
|
|
||||||
const [rowSelection, setRowSelection] = useState<RowSelectionState>({});
|
const [rowSelection, setRowSelection] = useState<RowSelectionState>({});
|
||||||
const [postingTargets, setPostingTargets] = useState<PostingTarget[]>([]);
|
const [postingTargets, setPostingTargets] = useState<PostingTarget[]>([]);
|
||||||
|
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: [ENDPOINT.CMS_SERVICE.IMAGES, searchParams, pagination],
|
queryKey: [ENDPOINT.CMS_SERVICE.IMAGES, params],
|
||||||
queryFn: () =>
|
queryFn: () =>
|
||||||
ImageApi.getImageList({
|
ImageApi.getImageList({
|
||||||
...searchParams,
|
keyword: params.keyword,
|
||||||
page: pagination.pageIndex,
|
sort: params.sort,
|
||||||
size: pagination.pageSize,
|
page: params.page,
|
||||||
|
size: params.size,
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleSubmit = (e: React.SubmitEvent<HTMLFormElement>) => {
|
const pagination: PaginationState = {
|
||||||
|
pageIndex: params.page,
|
||||||
|
pageSize: params.size,
|
||||||
|
};
|
||||||
|
|
||||||
|
const handlePaginationChange: OnChangeFn<PaginationState> = (updater) => {
|
||||||
|
const next = typeof updater === "function" ? updater(pagination) : updater;
|
||||||
|
setParams({ page: next.pageIndex, size: next.pageSize });
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
setPagination({
|
setParams({ keyword, page: 0 });
|
||||||
...pagination,
|
|
||||||
pageIndex: 0,
|
|
||||||
});
|
|
||||||
setSearchParams({
|
|
||||||
...searchParams,
|
|
||||||
keyword,
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
setKeyword("");
|
setKeyword("");
|
||||||
setSearchParams({
|
resetParams();
|
||||||
...searchParams,
|
|
||||||
keyword: "",
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleRowClick = (row: Image) => {
|
const handleRowClick = (row: Image) => {
|
||||||
@@ -81,7 +86,7 @@ function ImagePage() {
|
|||||||
manualPagination: true,
|
manualPagination: true,
|
||||||
enableMultiRowSelection: true,
|
enableMultiRowSelection: true,
|
||||||
getCoreRowModel: getCoreRowModel(),
|
getCoreRowModel: getCoreRowModel(),
|
||||||
onPaginationChange: setPagination,
|
onPaginationChange: handlePaginationChange,
|
||||||
onRowSelectionChange: setRowSelection,
|
onRowSelectionChange: setRowSelection,
|
||||||
},
|
},
|
||||||
dataTableOptions: {
|
dataTableOptions: {
|
||||||
|
|||||||
@@ -2,45 +2,76 @@
|
|||||||
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
|
|
||||||
import { keepPreviousData, useQuery } from "@tanstack/react-query";
|
import { keepPreviousData, useQuery } from "@tanstack/react-query";
|
||||||
import { getCoreRowModel, type PaginationState } from "@tanstack/react-table";
|
|
||||||
import { Button, Input, Label } from "@common/components";
|
|
||||||
import { CodeSelect } from "@/entities/code";
|
|
||||||
import { ENDPOINT } from "@/shared/config";
|
|
||||||
import { useDataTable } from "@/shared/lib";
|
|
||||||
import {
|
import {
|
||||||
AuthorizationsApi,
|
getCoreRowModel,
|
||||||
|
type OnChangeFn,
|
||||||
|
type PaginationState,
|
||||||
|
} from "@tanstack/react-table";
|
||||||
|
|
||||||
|
import { ENDPOINT } from "@/shared/config";
|
||||||
|
import { useDataTable, useSearchParamsState } from "@/shared/lib";
|
||||||
|
import {
|
||||||
type Authorizations,
|
type Authorizations,
|
||||||
type AuthorizationsParams,
|
AuthorizationsApi,
|
||||||
} from "@/entities/authorization";
|
} from "@/entities/authorization";
|
||||||
|
import { CodeSelect } from "@/entities/code";
|
||||||
|
import { Button, Input, Label } from "@common/components";
|
||||||
|
|
||||||
import { columns } from "../model/authorizations-table-columns";
|
import { columns } from "../model/authorizations-table-columns";
|
||||||
|
|
||||||
|
const DEFAULT_PARAMS = {
|
||||||
|
authorizationName: "",
|
||||||
|
httpMethodCode: "",
|
||||||
|
sort: "regDt,desc",
|
||||||
|
page: 0,
|
||||||
|
size: 10,
|
||||||
|
};
|
||||||
|
|
||||||
function ModulePage() {
|
function ModulePage() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const { params, setParams, resetParams } =
|
||||||
const [authorizationName, setAuthorizationName] = useState("");
|
useSearchParamsState(DEFAULT_PARAMS);
|
||||||
const [httpMethodCode, setHttpMethodCode] = useState("");
|
const [authorizationName, setAuthorizationName] = useState(
|
||||||
const [searchParams, setSearchParams] = useState<AuthorizationsParams>({
|
params.authorizationName,
|
||||||
authorizationName: "",
|
);
|
||||||
httpMethodCode: "",
|
const [httpMethodCode, setHttpMethodCode] = useState(params.httpMethodCode);
|
||||||
sort: "regDt,desc",
|
|
||||||
});
|
|
||||||
const [pagination, setPagination] = useState<PaginationState>({
|
|
||||||
pageIndex: 0,
|
|
||||||
pageSize: 10,
|
|
||||||
});
|
|
||||||
|
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: [ENDPOINT.USER_SERVICE.AUTHORIZATIONS, searchParams, pagination],
|
queryKey: [ENDPOINT.USER_SERVICE.AUTHORIZATIONS, params],
|
||||||
queryFn: () =>
|
queryFn: () =>
|
||||||
AuthorizationsApi.getAuthorizationsList({
|
AuthorizationsApi.getAuthorizationsList({
|
||||||
...searchParams,
|
authorizationName: params.authorizationName,
|
||||||
page: pagination.pageIndex,
|
httpMethodCode: params.httpMethodCode,
|
||||||
size: pagination.pageSize,
|
sort: params.sort,
|
||||||
|
page: params.page,
|
||||||
|
size: params.size,
|
||||||
}),
|
}),
|
||||||
placeholderData: keepPreviousData,
|
placeholderData: keepPreviousData,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const pagination: PaginationState = {
|
||||||
|
pageIndex: params.page,
|
||||||
|
pageSize: params.size,
|
||||||
|
};
|
||||||
|
|
||||||
|
const handlePaginationChange: OnChangeFn<PaginationState> = (updater) => {
|
||||||
|
const next = typeof updater === "function" ? updater(pagination) : updater;
|
||||||
|
setParams({ page: next.pageIndex, size: next.pageSize });
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
|
||||||
|
e.preventDefault();
|
||||||
|
setParams({ authorizationName, httpMethodCode, page: 0 });
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleReset = () => {
|
||||||
|
setAuthorizationName("");
|
||||||
|
setHttpMethodCode("");
|
||||||
|
resetParams();
|
||||||
|
};
|
||||||
|
|
||||||
const handleRowClick = (row: Authorizations) => {
|
const handleRowClick = (row: Authorizations) => {
|
||||||
router.push(`/module/register/${row.authorizationNo}`);
|
router.push(`/module/register/${row.authorizationNo}`);
|
||||||
};
|
};
|
||||||
@@ -52,7 +83,7 @@ function ModulePage() {
|
|||||||
state: {
|
state: {
|
||||||
pagination,
|
pagination,
|
||||||
},
|
},
|
||||||
onPaginationChange: setPagination,
|
onPaginationChange: handlePaginationChange,
|
||||||
getCoreRowModel: getCoreRowModel(),
|
getCoreRowModel: getCoreRowModel(),
|
||||||
manualPagination: true,
|
manualPagination: true,
|
||||||
},
|
},
|
||||||
@@ -62,29 +93,6 @@ function ModulePage() {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleSubmit = (e: React.SubmitEvent<HTMLFormElement>) => {
|
|
||||||
e.preventDefault();
|
|
||||||
setPagination({
|
|
||||||
...pagination,
|
|
||||||
pageIndex: 0,
|
|
||||||
});
|
|
||||||
setSearchParams({
|
|
||||||
...searchParams,
|
|
||||||
authorizationName,
|
|
||||||
httpMethodCode,
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleReset = () => {
|
|
||||||
setAuthorizationName("");
|
|
||||||
setHttpMethodCode("");
|
|
||||||
setSearchParams({
|
|
||||||
...searchParams,
|
|
||||||
authorizationName: "",
|
|
||||||
httpMethodCode: "",
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="card card-border !mt-6">
|
<div className="card card-border !mt-6">
|
||||||
<div className="card card-border">
|
<div className="card card-border">
|
||||||
|
|||||||
@@ -2,70 +2,75 @@
|
|||||||
|
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
|
|
||||||
import { keepPreviousData, useQuery } from "@tanstack/react-query";
|
import { keepPreviousData, useQuery } from "@tanstack/react-query";
|
||||||
import {
|
import {
|
||||||
getCoreRowModel,
|
getCoreRowModel,
|
||||||
|
type OnChangeFn,
|
||||||
type PaginationState,
|
type PaginationState,
|
||||||
type RowSelectionState,
|
type RowSelectionState,
|
||||||
} from "@tanstack/react-table";
|
} from "@tanstack/react-table";
|
||||||
import { Button, Input, Label } from "@common/components";
|
|
||||||
|
import { ENDPOINT } from "@/shared/config";
|
||||||
|
import { useDataTable, useSearchParamsState } from "@/shared/lib";
|
||||||
import { AuthorityButton } from "@/entities/menu-authority";
|
import { AuthorityButton } from "@/entities/menu-authority";
|
||||||
import { POSTING_TYPE, PostingDialog } from "@/entities/posting";
|
import { POSTING_TYPE, PostingDialog } from "@/entities/posting";
|
||||||
import { ENDPOINT } from "@/shared/config";
|
import { Button, Input, Label } from "@common/components";
|
||||||
import { useDataTable } from "@/shared/lib";
|
|
||||||
import { PopupApi } from "../api/popup-service";
|
import { PopupApi } from "../api/popup-service";
|
||||||
|
import type { Popup } from "../model/popup-interface";
|
||||||
import { columns } from "../model/table-columns";
|
import { columns } from "../model/table-columns";
|
||||||
import type { Popup, PopupParams } from "../model/popup-interface";
|
|
||||||
|
|
||||||
type PostingTarget = {
|
type PostingTarget = {
|
||||||
pstgTrgtNm: string;
|
pstgTrgtNm: string;
|
||||||
pstgTrgtNo: number;
|
pstgTrgtNo: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const DEFAULT_PARAMS = {
|
||||||
|
keyword: "",
|
||||||
|
sort: "regDt,desc",
|
||||||
|
page: 0,
|
||||||
|
size: 10,
|
||||||
|
};
|
||||||
|
|
||||||
function PopupPage() {
|
function PopupPage() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const { params, setParams, resetParams } =
|
||||||
const [keyword, setKeyword] = useState("");
|
useSearchParamsState(DEFAULT_PARAMS);
|
||||||
const [searchParams, setSearchParams] = useState<PopupParams>({
|
const [keyword, setKeyword] = useState(params.keyword);
|
||||||
keyword: "",
|
|
||||||
sort: "regDt,desc",
|
|
||||||
});
|
|
||||||
const [pagination, setPagination] = useState<PaginationState>({
|
|
||||||
pageIndex: 0,
|
|
||||||
pageSize: 10,
|
|
||||||
});
|
|
||||||
const [rowSelection, setRowSelection] = useState<RowSelectionState>({});
|
const [rowSelection, setRowSelection] = useState<RowSelectionState>({});
|
||||||
const [postingTargets, setPostingTargets] = useState<PostingTarget[]>([]);
|
const [postingTargets, setPostingTargets] = useState<PostingTarget[]>([]);
|
||||||
|
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: [ENDPOINT.CMS_SERVICE.POPUPS, searchParams, pagination],
|
queryKey: [ENDPOINT.CMS_SERVICE.POPUPS, params],
|
||||||
queryFn: () =>
|
queryFn: () =>
|
||||||
PopupApi.getPopupList({
|
PopupApi.getPopupList({
|
||||||
...searchParams,
|
keyword: params.keyword,
|
||||||
page: pagination.pageIndex,
|
sort: params.sort,
|
||||||
size: pagination.pageSize,
|
page: params.page,
|
||||||
|
size: params.size,
|
||||||
}),
|
}),
|
||||||
placeholderData: keepPreviousData,
|
placeholderData: keepPreviousData,
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleSubmit = (e: React.SubmitEvent<HTMLFormElement>) => {
|
const pagination: PaginationState = {
|
||||||
|
pageIndex: params.page,
|
||||||
|
pageSize: params.size,
|
||||||
|
};
|
||||||
|
|
||||||
|
const handlePaginationChange: OnChangeFn<PaginationState> = (updater) => {
|
||||||
|
const next = typeof updater === "function" ? updater(pagination) : updater;
|
||||||
|
setParams({ page: next.pageIndex, size: next.pageSize });
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
setPagination({
|
setParams({ keyword, page: 0 });
|
||||||
...pagination,
|
|
||||||
pageIndex: 0,
|
|
||||||
});
|
|
||||||
setSearchParams({
|
|
||||||
...searchParams,
|
|
||||||
keyword,
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
setKeyword("");
|
setKeyword("");
|
||||||
setSearchParams({
|
resetParams();
|
||||||
...searchParams,
|
|
||||||
keyword: "",
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleRowClick = (row: Popup) => {
|
const handleRowClick = (row: Popup) => {
|
||||||
@@ -82,7 +87,7 @@ function PopupPage() {
|
|||||||
},
|
},
|
||||||
manualPagination: true,
|
manualPagination: true,
|
||||||
getCoreRowModel: getCoreRowModel(),
|
getCoreRowModel: getCoreRowModel(),
|
||||||
onPaginationChange: setPagination,
|
onPaginationChange: handlePaginationChange,
|
||||||
onRowSelectionChange: setRowSelection,
|
onRowSelectionChange: setRowSelection,
|
||||||
},
|
},
|
||||||
dataTableOptions: {
|
dataTableOptions: {
|
||||||
|
|||||||
@@ -1,15 +1,35 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import dayjs from "dayjs";
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useRouter } from "next/navigation";
|
import { usePathname, useRouter, useSearchParams } from "next/navigation";
|
||||||
|
|
||||||
import { useConfirm } from "@frontend-opensource/use-react-hooks";
|
import { useConfirm } from "@frontend-opensource/use-react-hooks";
|
||||||
import { keepPreviousData, useQuery } from "@tanstack/react-query";
|
import { keepPreviousData, useQuery } from "@tanstack/react-query";
|
||||||
import {
|
import {
|
||||||
getCoreRowModel,
|
getCoreRowModel,
|
||||||
|
type OnChangeFn,
|
||||||
type PaginationState,
|
type PaginationState,
|
||||||
type RowSelectionState,
|
type RowSelectionState,
|
||||||
} from "@tanstack/react-table";
|
} from "@tanstack/react-table";
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
|
import { ENDPOINT } from "@/shared/config";
|
||||||
|
import {
|
||||||
|
useAlertStore,
|
||||||
|
useDataTable,
|
||||||
|
useSearchParamsState,
|
||||||
|
useSelectPrompt,
|
||||||
|
} from "@/shared/lib";
|
||||||
|
import { InputDateRangePicker } from "@/shared/ui/input-date-range-picker";
|
||||||
|
import { BoardApi } from "@/entities/board";
|
||||||
|
import { AuthorityButton } from "@/entities/menu-authority";
|
||||||
|
import {
|
||||||
|
type DeletePost,
|
||||||
|
deleteReasonMessages,
|
||||||
|
PostApi,
|
||||||
|
type RecentPost,
|
||||||
|
} from "@/entities/post";
|
||||||
|
import { SortSelect } from "@/widgets/post";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Input,
|
Input,
|
||||||
@@ -20,76 +40,72 @@ import {
|
|||||||
SelectTrigger,
|
SelectTrigger,
|
||||||
SelectValue,
|
SelectValue,
|
||||||
} from "@common/components";
|
} from "@common/components";
|
||||||
import { SortSelect } from "@/widgets/post";
|
|
||||||
import {
|
|
||||||
PostApi,
|
|
||||||
deleteReasonMessages,
|
|
||||||
type DeletePost,
|
|
||||||
type RecentPost,
|
|
||||||
type RecentPostParams,
|
|
||||||
} from "@/entities/post";
|
|
||||||
import { BoardApi } from "@/entities/board";
|
|
||||||
import { AuthorityButton } from "@/entities/menu-authority";
|
|
||||||
import { ENDPOINT } from "@/shared/config";
|
|
||||||
import { InputDateRangePicker } from "@/shared/ui/input-date-range-picker";
|
|
||||||
import { useAlertStore, useSelectPrompt, useDataTable } from "@/shared/lib";
|
|
||||||
import { columns } from "../model/table-columns";
|
import { columns } from "../model/table-columns";
|
||||||
|
|
||||||
import { MovePostDialog } from "./move-post-dialog";
|
import { MovePostDialog } from "./move-post-dialog";
|
||||||
|
|
||||||
type DateRange = {
|
type DateRange = {
|
||||||
from?: Date | undefined;
|
from?: Date | null | undefined;
|
||||||
to?: Date | undefined;
|
to?: Date | null | undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
const selectData = Object.entries(deleteReasonMessages).map(
|
const selectData = Object.entries(deleteReasonMessages).map(
|
||||||
([label, value]) => ({ label, value }),
|
([label, value]) => ({ label, value }),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const DEFAULT_PARAMS = {
|
||||||
|
keywordType: "",
|
||||||
|
keyword: "",
|
||||||
|
bbsId: "",
|
||||||
|
delYn: "N",
|
||||||
|
frDateYmd: "",
|
||||||
|
toDateYmd: "",
|
||||||
|
sort: "regDt,desc",
|
||||||
|
page: 0,
|
||||||
|
size: 10,
|
||||||
|
};
|
||||||
|
|
||||||
|
function parseDateRange(frDateYmd: string, toDateYmd: string): DateRange {
|
||||||
|
return {
|
||||||
|
from: frDateYmd ? dayjs(frDateYmd, "YYYYMMDD").toDate() : undefined,
|
||||||
|
to: toDateYmd ? dayjs(toDateYmd, "YYYYMMDD").toDate() : undefined,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
function RecentPage() {
|
function RecentPage() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const pathname = usePathname();
|
||||||
|
const searchParams = useSearchParams();
|
||||||
const { prompt } = useSelectPrompt(selectData);
|
const { prompt } = useSelectPrompt(selectData);
|
||||||
const { confirm } = useConfirm();
|
const { confirm } = useConfirm();
|
||||||
const alert = useAlertStore((state) => state.setMessage);
|
const alert = useAlertStore((state) => state.setMessage);
|
||||||
|
const { params, setParams, resetParams } =
|
||||||
|
useSearchParamsState(DEFAULT_PARAMS);
|
||||||
|
|
||||||
const [tableSort, setTableSort] = useState("regDt,desc");
|
|
||||||
const [pagination, setPagination] = useState<PaginationState>({
|
|
||||||
pageIndex: 0,
|
|
||||||
pageSize: 10,
|
|
||||||
});
|
|
||||||
const [rowSelection, setRowSelection] = useState<RowSelectionState>({});
|
const [rowSelection, setRowSelection] = useState<RowSelectionState>({});
|
||||||
const [presetDateRange, setPresetDateRange] = useState("");
|
const [presetDateRange, setPresetDateRange] = useState("");
|
||||||
const [dateRange, setDateRange] = useState<DateRange>({
|
const [dateRange, setDateRange] = useState<DateRange>(() =>
|
||||||
from: undefined,
|
parseDateRange(params.frDateYmd, params.toDateYmd),
|
||||||
to: undefined,
|
);
|
||||||
});
|
const [keywordType, setKeywordType] = useState(params.keywordType);
|
||||||
const [keywordType, setKeywordType] = useState("");
|
const [keyword, setKeyword] = useState(params.keyword);
|
||||||
const [keyword, setKeyword] = useState("");
|
const [bbsId, setBbsId] = useState(params.bbsId);
|
||||||
const [bbsId, setBbsId] = useState<string | null>(null);
|
const [delYn, setDelYn] = useState(params.delYn);
|
||||||
const [delYn, setDelYn] = useState("N");
|
|
||||||
const [searchParams, setSearchParams] = useState<RecentPostParams>({
|
|
||||||
keywordType: "",
|
|
||||||
keyword: "",
|
|
||||||
bbsId: null,
|
|
||||||
delYn: "N",
|
|
||||||
frDateYmd: "",
|
|
||||||
toDateYmd: "",
|
|
||||||
sort: "regDt,desc",
|
|
||||||
});
|
|
||||||
const [isDeletePostData, setIsDeletePostData] = useState(false);
|
|
||||||
|
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: [
|
queryKey: [ENDPOINT.BOARD_SERVICE.POSTS, params],
|
||||||
ENDPOINT.BOARD_SERVICE.POSTS,
|
|
||||||
searchParams,
|
|
||||||
pagination,
|
|
||||||
tableSort,
|
|
||||||
],
|
|
||||||
queryFn: () =>
|
queryFn: () =>
|
||||||
PostApi.getRecentPostList({
|
PostApi.getRecentPostList({
|
||||||
...searchParams,
|
keywordType: params.keywordType,
|
||||||
page: pagination.pageIndex,
|
keyword: params.keyword,
|
||||||
size: pagination.pageSize,
|
bbsId: params.bbsId ? parseInt(params.bbsId) : null,
|
||||||
sort: tableSort,
|
delYn: params.delYn,
|
||||||
|
frDateYmd: params.frDateYmd,
|
||||||
|
toDateYmd: params.toDateYmd,
|
||||||
|
sort: params.sort,
|
||||||
|
page: params.page,
|
||||||
|
size: params.size,
|
||||||
}),
|
}),
|
||||||
placeholderData: keepPreviousData,
|
placeholderData: keepPreviousData,
|
||||||
});
|
});
|
||||||
@@ -99,9 +115,22 @@ function RecentPage() {
|
|||||||
queryFn: () => BoardApi.getBoardList(),
|
queryFn: () => BoardApi.getBoardList(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const pagination: PaginationState = {
|
||||||
|
pageIndex: params.page,
|
||||||
|
pageSize: params.size,
|
||||||
|
};
|
||||||
|
|
||||||
|
const handlePaginationChange: OnChangeFn<PaginationState> = (updater) => {
|
||||||
|
const next = typeof updater === "function" ? updater(pagination) : updater;
|
||||||
|
setParams({ page: next.pageIndex, size: next.pageSize });
|
||||||
|
};
|
||||||
|
|
||||||
|
const isDeletePostData = params.delYn === "Y";
|
||||||
|
|
||||||
const handleRowClick = (row: RecentPost) => {
|
const handleRowClick = (row: RecentPost) => {
|
||||||
|
const from = `${pathname}${searchParams?.toString() ? `?${searchParams.toString()}` : ""}`;
|
||||||
router.push(
|
router.push(
|
||||||
`/bbs/${row.bbsTypeCd.toLowerCase()}/${row.bbsId}/${row.pstNo}`,
|
`/bbs/${row.bbsTypeCd.toLowerCase()}/${row.bbsId}/${row.pstNo}?from=${encodeURIComponent(from)}`,
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -116,7 +145,7 @@ function RecentPage() {
|
|||||||
manualPagination: true,
|
manualPagination: true,
|
||||||
enableMultiRowSelection: true,
|
enableMultiRowSelection: true,
|
||||||
getCoreRowModel: getCoreRowModel(),
|
getCoreRowModel: getCoreRowModel(),
|
||||||
onPaginationChange: setPagination,
|
onPaginationChange: handlePaginationChange,
|
||||||
onRowSelectionChange: setRowSelection,
|
onRowSelectionChange: setRowSelection,
|
||||||
},
|
},
|
||||||
dataTableOptions: {
|
dataTableOptions: {
|
||||||
@@ -127,45 +156,32 @@ function RecentPage() {
|
|||||||
|
|
||||||
const isSelectedRow = table.getFilteredSelectedRowModel().rows.length > 0;
|
const isSelectedRow = table.getFilteredSelectedRowModel().rows.length > 0;
|
||||||
|
|
||||||
const handleSubmit = (e: React.SubmitEvent<HTMLFormElement>) => {
|
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
setIsDeletePostData(delYn === "Y");
|
setParams({
|
||||||
setPagination({
|
|
||||||
...pagination,
|
|
||||||
pageIndex: 0,
|
|
||||||
});
|
|
||||||
setSearchParams({
|
|
||||||
...searchParams,
|
|
||||||
keywordType,
|
keywordType,
|
||||||
keyword,
|
keyword,
|
||||||
bbsId: bbsId ? parseInt(bbsId) : null,
|
bbsId,
|
||||||
delYn,
|
delYn,
|
||||||
frDateYmd: dateRange?.from
|
frDateYmd: dateRange?.from
|
||||||
? dayjs(dateRange.from).format("YYYYMMDD")
|
? dayjs(dateRange.from).format("YYYYMMDD")
|
||||||
: "",
|
: "",
|
||||||
toDateYmd: dateRange?.to ? dayjs(dateRange.to).format("YYYYMMDD") : "",
|
toDateYmd: dateRange?.to ? dayjs(dateRange.to).format("YYYYMMDD") : "",
|
||||||
|
page: 0,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
setKeywordType("");
|
setKeywordType("");
|
||||||
setKeyword("");
|
setKeyword("");
|
||||||
setBbsId(null);
|
setBbsId("");
|
||||||
setDelYn("N");
|
setDelYn("N");
|
||||||
|
setPresetDateRange("");
|
||||||
setDateRange({
|
setDateRange({
|
||||||
from: undefined,
|
from: undefined,
|
||||||
to: undefined,
|
to: undefined,
|
||||||
});
|
});
|
||||||
setSearchParams({
|
resetParams();
|
||||||
...searchParams,
|
|
||||||
keywordType: "",
|
|
||||||
keyword: "",
|
|
||||||
bbsId: null,
|
|
||||||
delYn: "N",
|
|
||||||
frDateYmd: "",
|
|
||||||
toDateYmd: "",
|
|
||||||
});
|
|
||||||
setIsDeletePostData(false);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handlePresetDateRange = (value: string) => {
|
const handlePresetDateRange = (value: string) => {
|
||||||
@@ -273,10 +289,7 @@ function RecentPage() {
|
|||||||
setDateRange={handleDateRangeChange}
|
setDateRange={handleDateRangeChange}
|
||||||
/>
|
/>
|
||||||
<Label className="ml-4 mr-2 text-label">게시판</Label>
|
<Label className="ml-4 mr-2 text-label">게시판</Label>
|
||||||
<Select
|
<Select value={bbsId} onValueChange={setBbsId}>
|
||||||
value={bbsId?.toString() || ""}
|
|
||||||
onValueChange={(value) => setBbsId(value ? value : null)}
|
|
||||||
>
|
|
||||||
<SelectTrigger className="w-[12rem]">
|
<SelectTrigger className="w-[12rem]">
|
||||||
<SelectValue placeholder="선택" />
|
<SelectValue placeholder="선택" />
|
||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
@@ -289,7 +302,7 @@ function RecentPage() {
|
|||||||
</SelectContent>
|
</SelectContent>
|
||||||
</Select>
|
</Select>
|
||||||
<Label className="ml-4 mr-2 text-label">상태</Label>
|
<Label className="ml-4 mr-2 text-label">상태</Label>
|
||||||
<Select value={delYn} onValueChange={(value) => setDelYn(value)}>
|
<Select value={delYn} onValueChange={setDelYn}>
|
||||||
<SelectTrigger className="w-[10rem]">
|
<SelectTrigger className="w-[10rem]">
|
||||||
<SelectValue placeholder="선택" />
|
<SelectValue placeholder="선택" />
|
||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
@@ -376,10 +389,10 @@ function RecentPage() {
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
<Select
|
<Select
|
||||||
value={table.getState().pagination.pageSize.toString()}
|
value={params.size.toString()}
|
||||||
onValueChange={(value) => {
|
onValueChange={(value) =>
|
||||||
table.setPageSize(parseInt(value));
|
setParams({ size: parseInt(value), page: 0 })
|
||||||
}}
|
}
|
||||||
>
|
>
|
||||||
<SelectTrigger className="h-[3.2rem] w-[12rem]">
|
<SelectTrigger className="h-[3.2rem] w-[12rem]">
|
||||||
<SelectValue placeholder="페이지 크기" />
|
<SelectValue placeholder="페이지 크기" />
|
||||||
@@ -392,7 +405,10 @@ function RecentPage() {
|
|||||||
))}
|
))}
|
||||||
</SelectContent>
|
</SelectContent>
|
||||||
</Select>
|
</Select>
|
||||||
<SortSelect value={tableSort} onValueChange={setTableSort} />
|
<SortSelect
|
||||||
|
value={params.sort}
|
||||||
|
onValueChange={(value) => setParams({ sort: value })}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,39 +2,68 @@
|
|||||||
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useQuery } from "@tanstack/react-query";
|
|
||||||
import { getCoreRowModel, type PaginationState } from "@tanstack/react-table";
|
import { keepPreviousData, useQuery } from "@tanstack/react-query";
|
||||||
import { Button, Input, Label } from "@common/components";
|
import {
|
||||||
import { RoleApi, type Role, type RoleParams } from "@/entities/role";
|
getCoreRowModel,
|
||||||
|
type OnChangeFn,
|
||||||
|
type PaginationState,
|
||||||
|
} from "@tanstack/react-table";
|
||||||
|
|
||||||
import { ENDPOINT } from "@/shared/config";
|
import { ENDPOINT } from "@/shared/config";
|
||||||
import { useAlertStore, useDataTable } from "@/shared/lib";
|
import { useDataTable, useSearchParamsState } from "@/shared/lib";
|
||||||
|
import { type Role, RoleApi } from "@/entities/role";
|
||||||
|
import { Button, Input, Label } from "@common/components";
|
||||||
|
|
||||||
import { createColumns } from "../model/table-columns";
|
import { createColumns } from "../model/table-columns";
|
||||||
|
|
||||||
|
const DEFAULT_PARAMS = {
|
||||||
|
keywordType: "roleName",
|
||||||
|
keyword: "",
|
||||||
|
sort: "regDt,desc",
|
||||||
|
page: 0,
|
||||||
|
size: 10,
|
||||||
|
};
|
||||||
|
|
||||||
function RolePage() {
|
function RolePage() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const alert = useAlertStore((state) => state.setMessage);
|
const { params, setParams, resetParams } =
|
||||||
|
useSearchParamsState(DEFAULT_PARAMS);
|
||||||
const [keyword, setKeyword] = useState("");
|
const [keyword, setKeyword] = useState(params.keyword);
|
||||||
const [searchParams, setSearchParams] = useState<RoleParams>({
|
|
||||||
keywordType: "roleName",
|
|
||||||
keyword: "",
|
|
||||||
sort: "regDt,desc",
|
|
||||||
});
|
|
||||||
const [pagination, setPagination] = useState<PaginationState>({
|
|
||||||
pageIndex: 0,
|
|
||||||
pageSize: 10,
|
|
||||||
});
|
|
||||||
|
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: [ENDPOINT.USER_SERVICE.ROLES, searchParams, pagination],
|
queryKey: [ENDPOINT.USER_SERVICE.ROLES, params],
|
||||||
queryFn: () =>
|
queryFn: () =>
|
||||||
RoleApi.getRoles({
|
RoleApi.getRoles({
|
||||||
...searchParams,
|
keywordType: params.keywordType,
|
||||||
page: pagination.pageIndex,
|
keyword: params.keyword,
|
||||||
size: pagination.pageSize,
|
sort: params.sort,
|
||||||
|
page: params.page,
|
||||||
|
size: params.size,
|
||||||
}),
|
}),
|
||||||
|
placeholderData: keepPreviousData,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const pagination: PaginationState = {
|
||||||
|
pageIndex: params.page,
|
||||||
|
pageSize: params.size,
|
||||||
|
};
|
||||||
|
|
||||||
|
const handlePaginationChange: OnChangeFn<PaginationState> = (updater) => {
|
||||||
|
const next = typeof updater === "function" ? updater(pagination) : updater;
|
||||||
|
setParams({ page: next.pageIndex, size: next.pageSize });
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
|
||||||
|
e.preventDefault();
|
||||||
|
setParams({ keyword, page: 0 });
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleReset = () => {
|
||||||
|
setKeyword("");
|
||||||
|
resetParams();
|
||||||
|
};
|
||||||
|
|
||||||
const handleRowClick = (row: Role) => {
|
const handleRowClick = (row: Role) => {
|
||||||
router.push(`/role/register/${row.roleId}`);
|
router.push(`/role/register/${row.roleId}`);
|
||||||
};
|
};
|
||||||
@@ -48,7 +77,7 @@ function RolePage() {
|
|||||||
},
|
},
|
||||||
manualPagination: true,
|
manualPagination: true,
|
||||||
getCoreRowModel: getCoreRowModel(),
|
getCoreRowModel: getCoreRowModel(),
|
||||||
onPaginationChange: setPagination,
|
onPaginationChange: handlePaginationChange,
|
||||||
},
|
},
|
||||||
dataTableOptions: {
|
dataTableOptions: {
|
||||||
onRowClick: handleRowClick,
|
onRowClick: handleRowClick,
|
||||||
@@ -56,26 +85,6 @@ function RolePage() {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleSubmit = (e: React.SubmitEvent<HTMLFormElement>) => {
|
|
||||||
e.preventDefault();
|
|
||||||
setPagination({
|
|
||||||
...pagination,
|
|
||||||
pageIndex: 0,
|
|
||||||
});
|
|
||||||
setSearchParams({
|
|
||||||
...searchParams,
|
|
||||||
keyword,
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleReset = () => {
|
|
||||||
setKeyword("");
|
|
||||||
setSearchParams({
|
|
||||||
...searchParams,
|
|
||||||
keyword: "",
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="card card-border !mt-6">
|
<div className="card card-border !mt-6">
|
||||||
<div className="card card-border">
|
<div className="card card-border">
|
||||||
|
|||||||
@@ -1,54 +1,65 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import "@common/assets/styles/grid.css";
|
|
||||||
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
|
|
||||||
import { keepPreviousData, useQuery } from "@tanstack/react-query";
|
import { keepPreviousData, useQuery } from "@tanstack/react-query";
|
||||||
import { getCoreRowModel, type PaginationState } from "@tanstack/react-table";
|
import {
|
||||||
import { Button, Input, Label } from "@common/components";
|
getCoreRowModel,
|
||||||
import { SiteApi, type Site, type SiteParams } from "@/entities/site";
|
type OnChangeFn,
|
||||||
|
type PaginationState,
|
||||||
|
} from "@tanstack/react-table";
|
||||||
|
|
||||||
import { ENDPOINT } from "@/shared/config";
|
import { ENDPOINT } from "@/shared/config";
|
||||||
import { useDataTable } from "@/shared/lib";
|
import { useDataTable, useSearchParamsState } from "@/shared/lib";
|
||||||
|
import { type Site, SiteApi } from "@/entities/site";
|
||||||
|
import { Button, Input, Label } from "@common/components";
|
||||||
|
|
||||||
import { columns } from "../model/table-columns";
|
import { columns } from "../model/table-columns";
|
||||||
|
|
||||||
|
const DEFAULT_PARAMS = {
|
||||||
|
siteNm: "",
|
||||||
|
sort: "regDt,desc",
|
||||||
|
page: 0,
|
||||||
|
size: 10,
|
||||||
|
};
|
||||||
|
|
||||||
function SitePage() {
|
function SitePage() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [siteNm, setSiteNm] = useState("");
|
const { params, setParams, resetParams } =
|
||||||
const [searchParams, setSearchParams] = useState<SiteParams>({
|
useSearchParamsState(DEFAULT_PARAMS);
|
||||||
siteNm: "",
|
const [siteNm, setSiteNm] = useState(params.siteNm);
|
||||||
sort: "regDt,desc",
|
|
||||||
});
|
|
||||||
const [pagination, setPagination] = useState<PaginationState>({
|
|
||||||
pageIndex: 0,
|
|
||||||
pageSize: 10,
|
|
||||||
});
|
|
||||||
|
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: [ENDPOINT.CMS_SERVICE.SITES, searchParams, pagination],
|
queryKey: [ENDPOINT.CMS_SERVICE.SITES, params],
|
||||||
queryFn: () =>
|
queryFn: () =>
|
||||||
SiteApi.getSiteList({
|
SiteApi.getSiteList({
|
||||||
...searchParams,
|
siteNm: params.siteNm,
|
||||||
page: pagination.pageIndex,
|
sort: params.sort,
|
||||||
size: pagination.pageSize,
|
page: params.page,
|
||||||
|
size: params.size,
|
||||||
}),
|
}),
|
||||||
placeholderData: keepPreviousData,
|
placeholderData: keepPreviousData,
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleSubmit = (e: React.SubmitEvent<HTMLFormElement>) => {
|
const pagination: PaginationState = {
|
||||||
|
pageIndex: params.page,
|
||||||
|
pageSize: params.size,
|
||||||
|
};
|
||||||
|
|
||||||
|
const handlePaginationChange: OnChangeFn<PaginationState> = (updater) => {
|
||||||
|
const next = typeof updater === "function" ? updater(pagination) : updater;
|
||||||
|
setParams({ page: next.pageIndex, size: next.pageSize });
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
setSearchParams({
|
setParams({ siteNm, page: 0 });
|
||||||
...searchParams,
|
|
||||||
siteNm,
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
setSiteNm("");
|
setSiteNm("");
|
||||||
setSearchParams({
|
resetParams();
|
||||||
...searchParams,
|
|
||||||
siteNm: "",
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleRowClick = (row: Site) => {
|
const handleRowClick = (row: Site) => {
|
||||||
@@ -62,7 +73,7 @@ function SitePage() {
|
|||||||
state: {
|
state: {
|
||||||
pagination,
|
pagination,
|
||||||
},
|
},
|
||||||
onPaginationChange: setPagination,
|
onPaginationChange: handlePaginationChange,
|
||||||
getCoreRowModel: getCoreRowModel(),
|
getCoreRowModel: getCoreRowModel(),
|
||||||
manualPagination: true,
|
manualPagination: true,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,19 +2,23 @@
|
|||||||
|
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
|
|
||||||
import { keepPreviousData, useQuery } from "@tanstack/react-query";
|
import { keepPreviousData, useQuery } from "@tanstack/react-query";
|
||||||
import {
|
import {
|
||||||
getCoreRowModel,
|
getCoreRowModel,
|
||||||
|
type OnChangeFn,
|
||||||
type PaginationState,
|
type PaginationState,
|
||||||
type RowSelectionState,
|
type RowSelectionState,
|
||||||
} from "@tanstack/react-table";
|
} from "@tanstack/react-table";
|
||||||
import { Button, Input, Label } from "@common/components";
|
|
||||||
import { POSTING_TYPE, PostingDialog } from "@/entities/posting";
|
|
||||||
import { AuthorityButton } from "@/entities/menu-authority";
|
|
||||||
import { ENDPOINT } from "@/shared/config";
|
import { ENDPOINT } from "@/shared/config";
|
||||||
import { useDataTable } from "@/shared/lib";
|
import { useDataTable, useSearchParamsState } from "@/shared/lib";
|
||||||
|
import { AuthorityButton } from "@/entities/menu-authority";
|
||||||
|
import { POSTING_TYPE, PostingDialog } from "@/entities/posting";
|
||||||
|
import { Button, Input, Label } from "@common/components";
|
||||||
|
|
||||||
import { SurveyApi } from "../api/survey-service";
|
import { SurveyApi } from "../api/survey-service";
|
||||||
import type { Survey, SurveyParams } from "../model/survey-interface";
|
import type { Survey } from "../model/survey-interface";
|
||||||
import { columns } from "../model/survey-table-columns";
|
import { columns } from "../model/survey-table-columns";
|
||||||
|
|
||||||
type PostingTarget = {
|
type PostingTarget = {
|
||||||
@@ -22,32 +26,53 @@ type PostingTarget = {
|
|||||||
pstgTrgtNo: number;
|
pstgTrgtNo: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const DEFAULT_PARAMS = {
|
||||||
|
srvyTtl: "",
|
||||||
|
sort: "regDt,desc",
|
||||||
|
page: 0,
|
||||||
|
size: 10,
|
||||||
|
};
|
||||||
|
|
||||||
function SurveyPage() {
|
function SurveyPage() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const { params, setParams, resetParams } =
|
||||||
const [srvyTtl, setSrvyTtl] = useState("");
|
useSearchParamsState(DEFAULT_PARAMS);
|
||||||
const [searchParams, setSearchParams] = useState<SurveyParams>({
|
const [srvyTtl, setSrvyTtl] = useState(params.srvyTtl);
|
||||||
srvyTtl: "",
|
|
||||||
sort: "regDt,desc",
|
|
||||||
});
|
|
||||||
const [pagination, setPagination] = useState<PaginationState>({
|
|
||||||
pageIndex: 0,
|
|
||||||
pageSize: 10,
|
|
||||||
});
|
|
||||||
const [rowSelection, setRowSelection] = useState<RowSelectionState>({});
|
const [rowSelection, setRowSelection] = useState<RowSelectionState>({});
|
||||||
const [postingTargets, setPostingTargets] = useState<PostingTarget[]>([]);
|
const [postingTargets, setPostingTargets] = useState<PostingTarget[]>([]);
|
||||||
|
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: [ENDPOINT.CMS_SERVICE.SURVEY, searchParams, pagination],
|
queryKey: [ENDPOINT.CMS_SERVICE.SURVEY, params],
|
||||||
queryFn: () =>
|
queryFn: () =>
|
||||||
SurveyApi.getSurveyList({
|
SurveyApi.getSurveyList({
|
||||||
...searchParams,
|
srvyTtl: params.srvyTtl,
|
||||||
page: pagination.pageIndex,
|
sort: params.sort,
|
||||||
size: pagination.pageSize,
|
page: params.page,
|
||||||
|
size: params.size,
|
||||||
}),
|
}),
|
||||||
placeholderData: keepPreviousData,
|
placeholderData: keepPreviousData,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const pagination: PaginationState = {
|
||||||
|
pageIndex: params.page,
|
||||||
|
pageSize: params.size,
|
||||||
|
};
|
||||||
|
|
||||||
|
const handlePaginationChange: OnChangeFn<PaginationState> = (updater) => {
|
||||||
|
const next = typeof updater === "function" ? updater(pagination) : updater;
|
||||||
|
setParams({ page: next.pageIndex, size: next.pageSize });
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
|
||||||
|
e.preventDefault();
|
||||||
|
setParams({ srvyTtl, page: 0 });
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleReset = () => {
|
||||||
|
setSrvyTtl("");
|
||||||
|
resetParams();
|
||||||
|
};
|
||||||
|
|
||||||
const handleRowClick = (row: Survey) => {
|
const handleRowClick = (row: Survey) => {
|
||||||
router.push(`/survey/${row.srvySn}`);
|
router.push(`/survey/${row.srvySn}`);
|
||||||
};
|
};
|
||||||
@@ -62,7 +87,7 @@ function SurveyPage() {
|
|||||||
},
|
},
|
||||||
manualPagination: true,
|
manualPagination: true,
|
||||||
getCoreRowModel: getCoreRowModel(),
|
getCoreRowModel: getCoreRowModel(),
|
||||||
onPaginationChange: setPagination,
|
onPaginationChange: handlePaginationChange,
|
||||||
onRowSelectionChange: setRowSelection,
|
onRowSelectionChange: setRowSelection,
|
||||||
},
|
},
|
||||||
dataTableOptions: {
|
dataTableOptions: {
|
||||||
@@ -71,26 +96,6 @@ function SurveyPage() {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleSubmit = (e: React.SubmitEvent<HTMLFormElement>) => {
|
|
||||||
e.preventDefault();
|
|
||||||
setPagination({
|
|
||||||
...pagination,
|
|
||||||
pageIndex: 0,
|
|
||||||
});
|
|
||||||
setSearchParams({
|
|
||||||
...searchParams,
|
|
||||||
srvyTtl,
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleReset = () => {
|
|
||||||
setSrvyTtl("");
|
|
||||||
setSearchParams({
|
|
||||||
...searchParams,
|
|
||||||
srvyTtl: "",
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const postingTargets = table
|
const postingTargets = table
|
||||||
.getFilteredSelectedRowModel()
|
.getFilteredSelectedRowModel()
|
||||||
|
|||||||
@@ -2,58 +2,70 @@
|
|||||||
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
|
|
||||||
import { keepPreviousData, useQuery } from "@tanstack/react-query";
|
import { keepPreviousData, useQuery } from "@tanstack/react-query";
|
||||||
import { getCoreRowModel, type PaginationState } from "@tanstack/react-table";
|
import {
|
||||||
import { Button, Input, Label } from "@common/components";
|
getCoreRowModel,
|
||||||
import { CodeSelect } from "@/entities/code";
|
type OnChangeFn,
|
||||||
|
type PaginationState,
|
||||||
|
} from "@tanstack/react-table";
|
||||||
|
|
||||||
import { ENDPOINT } from "@/shared/config";
|
import { ENDPOINT } from "@/shared/config";
|
||||||
import { useDataTable } from "@/shared/lib";
|
import { useDataTable, useSearchParamsState } from "@/shared/lib";
|
||||||
|
import { CodeSelect } from "@/entities/code";
|
||||||
|
import { Button, Input, Label } from "@common/components";
|
||||||
|
|
||||||
import { TemplateApi } from "../api/template-service";
|
import { TemplateApi } from "../api/template-service";
|
||||||
|
import type { Template } from "../model/template-interface";
|
||||||
import { columns } from "../model/template-table-columns";
|
import { columns } from "../model/template-table-columns";
|
||||||
import type { Template, TemplateParams } from "../model/template-interface";
|
|
||||||
|
const DEFAULT_PARAMS = {
|
||||||
|
keyword: "",
|
||||||
|
tmpltSeCd: "",
|
||||||
|
sort: "regDt,desc",
|
||||||
|
page: 0,
|
||||||
|
size: 10,
|
||||||
|
};
|
||||||
|
|
||||||
function TemplatePage() {
|
function TemplatePage() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [keyword, setKeyword] = useState("");
|
const { params, setParams, resetParams } =
|
||||||
const [tmpltSeCd, setTmpltSeCd] = useState("");
|
useSearchParamsState(DEFAULT_PARAMS);
|
||||||
const [searchParams, setSearchParams] = useState<TemplateParams>({
|
const [keyword, setKeyword] = useState(params.keyword);
|
||||||
keyword: "",
|
const [tmpltSeCd, setTmpltSeCd] = useState(params.tmpltSeCd);
|
||||||
tmpltSeCd: "",
|
|
||||||
sort: "regDt,desc",
|
|
||||||
});
|
|
||||||
const [pagination, setPagination] = useState<PaginationState>({
|
|
||||||
pageIndex: 0,
|
|
||||||
pageSize: 10,
|
|
||||||
});
|
|
||||||
|
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: [ENDPOINT.CMS_SERVICE.TEMPLATE, searchParams, pagination],
|
queryKey: [ENDPOINT.CMS_SERVICE.TEMPLATE, params],
|
||||||
queryFn: () =>
|
queryFn: () =>
|
||||||
TemplateApi.getTemplateList({
|
TemplateApi.getTemplateList({
|
||||||
...searchParams,
|
keyword: params.keyword,
|
||||||
page: pagination.pageIndex,
|
tmpltSeCd: params.tmpltSeCd,
|
||||||
size: pagination.pageSize,
|
sort: params.sort,
|
||||||
|
page: params.page,
|
||||||
|
size: params.size,
|
||||||
}),
|
}),
|
||||||
placeholderData: keepPreviousData,
|
placeholderData: keepPreviousData,
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleSubmit = (e: React.SubmitEvent<HTMLFormElement>) => {
|
const pagination: PaginationState = {
|
||||||
|
pageIndex: params.page,
|
||||||
|
pageSize: params.size,
|
||||||
|
};
|
||||||
|
|
||||||
|
const handlePaginationChange: OnChangeFn<PaginationState> = (updater) => {
|
||||||
|
const next = typeof updater === "function" ? updater(pagination) : updater;
|
||||||
|
setParams({ page: next.pageIndex, size: next.pageSize });
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
setSearchParams({
|
setParams({ keyword, tmpltSeCd, page: 0 });
|
||||||
...searchParams,
|
|
||||||
keyword,
|
|
||||||
tmpltSeCd,
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
setKeyword("");
|
setKeyword("");
|
||||||
setTmpltSeCd("");
|
setTmpltSeCd("");
|
||||||
setSearchParams({
|
resetParams();
|
||||||
...searchParams,
|
|
||||||
keyword: "",
|
|
||||||
tmpltSeCd: "",
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleRowClick = (row: Template) => {
|
const handleRowClick = (row: Template) => {
|
||||||
@@ -67,7 +79,7 @@ function TemplatePage() {
|
|||||||
state: {
|
state: {
|
||||||
pagination,
|
pagination,
|
||||||
},
|
},
|
||||||
onPaginationChange: setPagination,
|
onPaginationChange: handlePaginationChange,
|
||||||
getCoreRowModel: getCoreRowModel(),
|
getCoreRowModel: getCoreRowModel(),
|
||||||
manualPagination: true,
|
manualPagination: true,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,63 +2,70 @@
|
|||||||
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
|
|
||||||
import { keepPreviousData, useQuery } from "@tanstack/react-query";
|
import { keepPreviousData, useQuery } from "@tanstack/react-query";
|
||||||
import { getCoreRowModel, type PaginationState } from "@tanstack/react-table";
|
import {
|
||||||
import { Button, Input, Label } from "@common/components";
|
getCoreRowModel,
|
||||||
import { CodeSelect } from "@/entities/code";
|
type OnChangeFn,
|
||||||
|
type PaginationState,
|
||||||
|
} from "@tanstack/react-table";
|
||||||
|
|
||||||
import { ENDPOINT } from "@/shared/config";
|
import { ENDPOINT } from "@/shared/config";
|
||||||
import { useDataTable } from "@/shared/lib";
|
import { useDataTable, useSearchParamsState } from "@/shared/lib";
|
||||||
|
import { CodeSelect } from "@/entities/code";
|
||||||
|
import { Button, Input, Label } from "@common/components";
|
||||||
|
|
||||||
import { TermsApi } from "../api/terms-service";
|
import { TermsApi } from "../api/terms-service";
|
||||||
|
import type { Terms } from "../model/terms-interface";
|
||||||
import { columns } from "../model/terms-table-columns";
|
import { columns } from "../model/terms-table-columns";
|
||||||
import type { TermsParams, Terms } from "../model/terms-interface";
|
|
||||||
|
const DEFAULT_PARAMS = {
|
||||||
|
keyword: "",
|
||||||
|
trmsSeCd: "",
|
||||||
|
sort: "regDt,desc",
|
||||||
|
page: 0,
|
||||||
|
size: 10,
|
||||||
|
};
|
||||||
|
|
||||||
function TermsPage() {
|
function TermsPage() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const { params, setParams, resetParams } =
|
||||||
const [keyword, setKeyword] = useState("");
|
useSearchParamsState(DEFAULT_PARAMS);
|
||||||
const [trmsSeCd, setTrmsSeCd] = useState("");
|
const [keyword, setKeyword] = useState(params.keyword);
|
||||||
const [searchParams, setSearchParams] = useState<TermsParams>({
|
const [trmsSeCd, setTrmsSeCd] = useState(params.trmsSeCd);
|
||||||
keyword: "",
|
|
||||||
trmsSeCd: "",
|
|
||||||
sort: "regDt,desc",
|
|
||||||
});
|
|
||||||
const [pagination, setPagination] = useState<PaginationState>({
|
|
||||||
pageIndex: 0,
|
|
||||||
pageSize: 10,
|
|
||||||
});
|
|
||||||
|
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: [ENDPOINT.CMS_SERVICE.TERMS, searchParams, pagination],
|
queryKey: [ENDPOINT.CMS_SERVICE.TERMS, params],
|
||||||
queryFn: () =>
|
queryFn: () =>
|
||||||
TermsApi.getTermsList({
|
TermsApi.getTermsList({
|
||||||
...searchParams,
|
keyword: params.keyword,
|
||||||
page: pagination.pageIndex,
|
trmsSeCd: params.trmsSeCd,
|
||||||
size: pagination.pageSize,
|
sort: params.sort,
|
||||||
|
page: params.page,
|
||||||
|
size: params.size,
|
||||||
}),
|
}),
|
||||||
placeholderData: keepPreviousData,
|
placeholderData: keepPreviousData,
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleSubmit = (e: React.SubmitEvent<HTMLFormElement>) => {
|
const pagination: PaginationState = {
|
||||||
|
pageIndex: params.page,
|
||||||
|
pageSize: params.size,
|
||||||
|
};
|
||||||
|
|
||||||
|
const handlePaginationChange: OnChangeFn<PaginationState> = (updater) => {
|
||||||
|
const next = typeof updater === "function" ? updater(pagination) : updater;
|
||||||
|
setParams({ page: next.pageIndex, size: next.pageSize });
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
setPagination({
|
setParams({ keyword, trmsSeCd, page: 0 });
|
||||||
...pagination,
|
|
||||||
pageIndex: 0,
|
|
||||||
});
|
|
||||||
setSearchParams({
|
|
||||||
...searchParams,
|
|
||||||
keyword,
|
|
||||||
trmsSeCd,
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
setKeyword("");
|
setKeyword("");
|
||||||
setTrmsSeCd("");
|
setTrmsSeCd("");
|
||||||
setSearchParams({
|
resetParams();
|
||||||
...searchParams,
|
|
||||||
keyword: "",
|
|
||||||
trmsSeCd: "",
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleRowClick = (row: Terms) => {
|
const handleRowClick = (row: Terms) => {
|
||||||
@@ -72,7 +79,7 @@ function TermsPage() {
|
|||||||
state: {
|
state: {
|
||||||
pagination,
|
pagination,
|
||||||
},
|
},
|
||||||
onPaginationChange: setPagination,
|
onPaginationChange: handlePaginationChange,
|
||||||
getCoreRowModel: getCoreRowModel(),
|
getCoreRowModel: getCoreRowModel(),
|
||||||
manualPagination: true,
|
manualPagination: true,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,19 +3,19 @@
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
|
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { keepPreviousData, useQuery } from "@tanstack/react-query";
|
||||||
import { getCoreRowModel, type PaginationState } from "@tanstack/react-table";
|
import {
|
||||||
|
getCoreRowModel,
|
||||||
|
type OnChangeFn,
|
||||||
|
type PaginationState,
|
||||||
|
} from "@tanstack/react-table";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
import { ENDPOINT } from "@/shared/config";
|
import { ENDPOINT } from "@/shared/config";
|
||||||
import { useDataTable } from "@/shared/lib";
|
import { useDataTable, useSearchParamsState } from "@/shared/lib";
|
||||||
import { InputDateRangePicker } from "@/shared/ui/input-date-range-picker";
|
import { InputDateRangePicker } from "@/shared/ui/input-date-range-picker";
|
||||||
import { CodeApi } from "@/entities/code";
|
import { CodeApi } from "@/entities/code";
|
||||||
import {
|
import { UserApi, type UserListResponse } from "@/entities/user";
|
||||||
UserApi,
|
|
||||||
type UserListResponse,
|
|
||||||
type UserSearchParams,
|
|
||||||
} from "@/entities/user";
|
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Checkbox,
|
Checkbox,
|
||||||
@@ -35,34 +35,39 @@ type DateRange = {
|
|||||||
to?: Date | null;
|
to?: Date | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const DEFAULT_PARAMS = {
|
||||||
|
keywordType: "all",
|
||||||
|
keyword: "",
|
||||||
|
userStateCode: "",
|
||||||
|
aprvYn: "",
|
||||||
|
grpId: "",
|
||||||
|
frDateYmd: "",
|
||||||
|
toDateYmd: "",
|
||||||
|
sort: "regDt,desc",
|
||||||
|
page: 0,
|
||||||
|
size: 10,
|
||||||
|
};
|
||||||
|
|
||||||
|
function parseDateRange(frDateYmd: string, toDateYmd: string): DateRange {
|
||||||
|
return {
|
||||||
|
from: frDateYmd ? dayjs(frDateYmd, "YYYYMMDD").toDate() : undefined,
|
||||||
|
to: toDateYmd ? dayjs(toDateYmd, "YYYYMMDD").toDate() : undefined,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
function UsersPage() {
|
function UsersPage() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const { params, setParams, resetParams } =
|
||||||
const [pagination, setPagination] = useState<PaginationState>({
|
useSearchParamsState(DEFAULT_PARAMS);
|
||||||
pageIndex: 0,
|
|
||||||
pageSize: 10,
|
|
||||||
});
|
|
||||||
const [presetDateRange, setPresetDateRange] = useState("");
|
const [presetDateRange, setPresetDateRange] = useState("");
|
||||||
const [dateRange, setDateRange] = useState<DateRange>({
|
const [dateRange, setDateRange] = useState<DateRange>(() =>
|
||||||
from: undefined,
|
parseDateRange(params.frDateYmd, params.toDateYmd),
|
||||||
to: undefined,
|
);
|
||||||
});
|
const [keywordType, setKeywordType] = useState(params.keywordType);
|
||||||
const [keywordType, setKeywordType] = useState("all");
|
const [keyword, setKeyword] = useState(params.keyword);
|
||||||
const [keyword, setKeyword] = useState("");
|
const [userStateCode, setUserStateCode] = useState(params.userStateCode);
|
||||||
const [userStateCode, setUserStateCode] = useState("");
|
const [aprvYn, setAprvYn] = useState(params.aprvYn);
|
||||||
const [aprvYn, setAprvYn] = useState("");
|
const [grpId, setGrpId] = useState(params.grpId);
|
||||||
const [grpId, setGrpId] = useState("");
|
|
||||||
|
|
||||||
const [searchParams, setSearchParams] = useState<UserSearchParams>({
|
|
||||||
keywordType: "all",
|
|
||||||
keyword: "",
|
|
||||||
userStateCode: "",
|
|
||||||
aprvYn: "",
|
|
||||||
grpId: "",
|
|
||||||
frDateYmd: "",
|
|
||||||
toDateYmd: "",
|
|
||||||
sort: "regDt,desc",
|
|
||||||
});
|
|
||||||
|
|
||||||
const { data: userSttsStats } = useQuery({
|
const { data: userSttsStats } = useQuery({
|
||||||
queryKey: [ENDPOINT.USER_SERVICE.USERS, "userStatusStatistics"],
|
queryKey: [ENDPOINT.USER_SERVICE.USERS, "userStatusStatistics"],
|
||||||
@@ -70,13 +75,21 @@ function UsersPage() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: [ENDPOINT.USER_SERVICE.USERS, searchParams, pagination],
|
queryKey: [ENDPOINT.USER_SERVICE.USERS, params],
|
||||||
queryFn: () =>
|
queryFn: () =>
|
||||||
UserApi.findPageUser({
|
UserApi.findPageUser({
|
||||||
...searchParams,
|
keywordType: params.keywordType,
|
||||||
page: pagination.pageIndex,
|
keyword: params.keyword,
|
||||||
size: pagination.pageSize,
|
userStateCode: params.userStateCode,
|
||||||
|
aprvYn: params.aprvYn,
|
||||||
|
grpId: params.grpId,
|
||||||
|
frDateYmd: params.frDateYmd,
|
||||||
|
toDateYmd: params.toDateYmd,
|
||||||
|
sort: params.sort,
|
||||||
|
page: params.page,
|
||||||
|
size: params.size,
|
||||||
}),
|
}),
|
||||||
|
placeholderData: keepPreviousData,
|
||||||
});
|
});
|
||||||
|
|
||||||
const { data: userStateCodes } = useQuery({
|
const { data: userStateCodes } = useQuery({
|
||||||
@@ -84,6 +97,16 @@ function UsersPage() {
|
|||||||
queryFn: () => CodeApi.getCode("USERSTTS"),
|
queryFn: () => CodeApi.getCode("USERSTTS"),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const pagination: PaginationState = {
|
||||||
|
pageIndex: params.page,
|
||||||
|
pageSize: params.size,
|
||||||
|
};
|
||||||
|
|
||||||
|
const handlePaginationChange: OnChangeFn<PaginationState> = (updater) => {
|
||||||
|
const next = typeof updater === "function" ? updater(pagination) : updater;
|
||||||
|
setParams({ page: next.pageIndex, size: next.pageSize });
|
||||||
|
};
|
||||||
|
|
||||||
const handleRowClick = (row: UserListResponse) => {
|
const handleRowClick = (row: UserListResponse) => {
|
||||||
router.push(`/users/${row.userUnqId}`);
|
router.push(`/users/${row.userUnqId}`);
|
||||||
};
|
};
|
||||||
@@ -97,7 +120,7 @@ function UsersPage() {
|
|||||||
},
|
},
|
||||||
manualPagination: true,
|
manualPagination: true,
|
||||||
getCoreRowModel: getCoreRowModel(),
|
getCoreRowModel: getCoreRowModel(),
|
||||||
onPaginationChange: setPagination,
|
onPaginationChange: handlePaginationChange,
|
||||||
},
|
},
|
||||||
dataTableOptions: {
|
dataTableOptions: {
|
||||||
onRowClick: handleRowClick,
|
onRowClick: handleRowClick,
|
||||||
@@ -105,14 +128,9 @@ function UsersPage() {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleSubmit = (e: React.SubmitEvent<HTMLFormElement>) => {
|
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
setPagination({
|
setParams({
|
||||||
...pagination,
|
|
||||||
pageIndex: 0,
|
|
||||||
});
|
|
||||||
setSearchParams({
|
|
||||||
...searchParams,
|
|
||||||
keywordType,
|
keywordType,
|
||||||
keyword,
|
keyword,
|
||||||
userStateCode,
|
userStateCode,
|
||||||
@@ -122,6 +140,7 @@ function UsersPage() {
|
|||||||
? dayjs(dateRange.from).format("YYYYMMDD")
|
? dayjs(dateRange.from).format("YYYYMMDD")
|
||||||
: "",
|
: "",
|
||||||
toDateYmd: dateRange?.to ? dayjs(dateRange.to).format("YYYYMMDD") : "",
|
toDateYmd: dateRange?.to ? dayjs(dateRange.to).format("YYYYMMDD") : "",
|
||||||
|
page: 0,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -131,20 +150,12 @@ function UsersPage() {
|
|||||||
setUserStateCode("");
|
setUserStateCode("");
|
||||||
setAprvYn("");
|
setAprvYn("");
|
||||||
setGrpId("");
|
setGrpId("");
|
||||||
|
setPresetDateRange("");
|
||||||
setDateRange({
|
setDateRange({
|
||||||
from: undefined,
|
from: undefined,
|
||||||
to: undefined,
|
to: undefined,
|
||||||
});
|
});
|
||||||
setSearchParams({
|
resetParams();
|
||||||
...searchParams,
|
|
||||||
keywordType: "all",
|
|
||||||
keyword: "",
|
|
||||||
userStateCode: "",
|
|
||||||
aprvYn: "",
|
|
||||||
grpId: "",
|
|
||||||
frDateYmd: "",
|
|
||||||
toDateYmd: "",
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handlePresetDateRange = (value: string) => {
|
const handlePresetDateRange = (value: string) => {
|
||||||
@@ -351,12 +362,9 @@ function UsersPage() {
|
|||||||
<h3 className="text-2xl font-medium text-label">회원 목록</h3>
|
<h3 className="text-2xl font-medium text-label">회원 목록</h3>
|
||||||
<div className="flex gap-2">
|
<div className="flex gap-2">
|
||||||
<Select
|
<Select
|
||||||
defaultValue="regDt,desc"
|
value={params.sort}
|
||||||
onValueChange={(value) => {
|
onValueChange={(value) => {
|
||||||
setSearchParams({
|
setParams({ sort: value });
|
||||||
...searchParams,
|
|
||||||
sort: value,
|
|
||||||
});
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<SelectTrigger>
|
<SelectTrigger>
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
export { getCookie, setCookie, removeCookie } from "./cookie";
|
export { getCookie, removeCookie, setCookie } from "./cookie";
|
||||||
export { useMutationWrapper } from "./use-mutation-wrapper";
|
|
||||||
export { useAlertStore } from "./use-alert-store";
|
export { useAlertStore } from "./use-alert-store";
|
||||||
export { useDataTable } from "./use-data-table";
|
export { useDataTable } from "./use-data-table";
|
||||||
export { useMenuStore } from "./use-menu-store";
|
export { useMenuStore } from "./use-menu-store";
|
||||||
export { useUserStore } from "./use-user-store";
|
export { useMutationWrapper } from "./use-mutation-wrapper";
|
||||||
export { usePrompt } from "./use-prompt";
|
export { usePrompt } from "./use-prompt";
|
||||||
|
export { useSearchParamsState } from "./use-search-params-state";
|
||||||
export { useSelectPrompt } from "./use-select-prompt";
|
export { useSelectPrompt } from "./use-select-prompt";
|
||||||
|
export { useUserStore } from "./use-user-store";
|
||||||
|
|||||||
@@ -0,0 +1,90 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { useCallback, useMemo, useRef } from "react";
|
||||||
|
import { useSearchParams } from "next/navigation";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 조회 조건을 URL searchParams와 동기화하는 훅.
|
||||||
|
*
|
||||||
|
* - URL이 단일 소스 오브 트루스(SSOT)이며, 새로고침·뒤로가기 시에도 조건이 유지된다.
|
||||||
|
* - 기본값과 동일한 값은 URL에서 제거해 쿼리스트링을 깨끗하게 유지한다.
|
||||||
|
* - `window.history.replaceState` 기반 shallow 갱신으로 서버 라운드트립 없이 동작한다.
|
||||||
|
* - 숫자 기본값이 주어진 키는 자동으로 `Number` 파싱한다.
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* const { params, setParams, resetParams } = useSearchParamsState({
|
||||||
|
* keyword: "",
|
||||||
|
* page: 0,
|
||||||
|
* size: 10,
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function useSearchParamsState<T extends Record<string, ParamValue>>(
|
||||||
|
defaults: T,
|
||||||
|
): UseSearchParamsStateReturn<T> {
|
||||||
|
const searchParams = useSearchParams();
|
||||||
|
const defaultsRef = useRef(defaults);
|
||||||
|
|
||||||
|
const params = useMemo(
|
||||||
|
() => parseParams(searchParams, defaultsRef.current),
|
||||||
|
[searchParams],
|
||||||
|
);
|
||||||
|
|
||||||
|
const setParams = useCallback((partial: Partial<T>) => {
|
||||||
|
const next = new URLSearchParams(window.location.search);
|
||||||
|
for (const [key, value] of Object.entries(partial)) {
|
||||||
|
if (value === undefined || value === defaultsRef.current[key]) {
|
||||||
|
next.delete(key);
|
||||||
|
} else {
|
||||||
|
next.set(key, String(value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
replaceUrl(next);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const resetParams = useCallback(() => {
|
||||||
|
const next = new URLSearchParams(window.location.search);
|
||||||
|
for (const key of Object.keys(defaultsRef.current)) {
|
||||||
|
next.delete(key);
|
||||||
|
}
|
||||||
|
replaceUrl(next);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return { params, setParams, resetParams };
|
||||||
|
}
|
||||||
|
|
||||||
|
function parseParams<T extends Record<string, ParamValue>>(
|
||||||
|
searchParams: ReturnType<typeof useSearchParams>,
|
||||||
|
defaults: T,
|
||||||
|
): T {
|
||||||
|
const result = { ...defaults };
|
||||||
|
|
||||||
|
for (const key of Object.keys(defaults) as (keyof T)[]) {
|
||||||
|
const raw = searchParams?.get(key as string) ?? null;
|
||||||
|
if (raw === null) continue;
|
||||||
|
|
||||||
|
if (typeof defaults[key] === "number") {
|
||||||
|
const parsed = Number(raw);
|
||||||
|
if (!Number.isNaN(parsed)) result[key] = parsed as T[keyof T];
|
||||||
|
} else {
|
||||||
|
result[key] = raw as T[keyof T];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
function replaceUrl(searchParams: URLSearchParams) {
|
||||||
|
const qs = searchParams.toString();
|
||||||
|
const url = qs
|
||||||
|
? `${window.location.pathname}?${qs}`
|
||||||
|
: window.location.pathname;
|
||||||
|
window.history.replaceState(null, "", url);
|
||||||
|
}
|
||||||
|
|
||||||
|
type ParamValue = string | number | null;
|
||||||
|
|
||||||
|
interface UseSearchParamsStateReturn<T> {
|
||||||
|
params: T;
|
||||||
|
setParams: (partial: Partial<T>) => void;
|
||||||
|
resetParams: () => void;
|
||||||
|
}
|
||||||
@@ -1,11 +1,13 @@
|
|||||||
import { toast } from "sonner";
|
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { useRouter, usePathname } from "next/navigation";
|
import { usePathname, useRouter, useSearchParams } from "next/navigation";
|
||||||
|
|
||||||
import { useClipboard } from "@frontend-opensource/use-react-hooks";
|
import { useClipboard } from "@frontend-opensource/use-react-hooks";
|
||||||
import { Button } from "@common/components";
|
import { toast } from "sonner";
|
||||||
import { deleteReasonMessages } from "@/entities/post";
|
|
||||||
import { AuthorityButton } from "@/entities/menu-authority";
|
|
||||||
import { useMenuStore, useSelectPrompt, useUserStore } from "@/shared/lib";
|
import { useMenuStore, useSelectPrompt, useUserStore } from "@/shared/lib";
|
||||||
|
import { AuthorityButton } from "@/entities/menu-authority";
|
||||||
|
import { deleteReasonMessages } from "@/entities/post";
|
||||||
|
import { Button } from "@common/components";
|
||||||
|
|
||||||
type PostActionProps = {
|
type PostActionProps = {
|
||||||
bbsId: string;
|
bbsId: string;
|
||||||
@@ -21,11 +23,14 @@ const selectData = Object.entries(deleteReasonMessages).map(
|
|||||||
function PostAction({ children, handleDelete }: PostActionProps) {
|
function PostAction({ children, handleDelete }: PostActionProps) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const pathname = usePathname();
|
const pathname = usePathname();
|
||||||
|
const searchParams = useSearchParams();
|
||||||
const { copyText, copied } = useClipboard();
|
const { copyText, copied } = useClipboard();
|
||||||
const { prompt } = useSelectPrompt(selectData);
|
const { prompt } = useSelectPrompt(selectData);
|
||||||
const bbsInfo = useMenuStore((state) => state.bbsInfo);
|
const bbsInfo = useMenuStore((state) => state.bbsInfo);
|
||||||
const userInfo = useUserStore((state) => state.userInfo);
|
const userInfo = useUserStore((state) => state.userInfo);
|
||||||
const postPageLink = `/bbs/${bbsInfo?.bbsTypeCd.toLowerCase()}/${bbsInfo?.bbsId}`;
|
const postPageLink = `/bbs/${bbsInfo?.bbsTypeCd.toLowerCase()}/${bbsInfo?.bbsId}`;
|
||||||
|
const from = searchParams?.get("from");
|
||||||
|
const backLink = from ?? postPageLink;
|
||||||
|
|
||||||
const onDelete = async () => {
|
const onDelete = async () => {
|
||||||
const { resolved, value } = await prompt("삭제 사유를 입력해주세요.");
|
const { resolved, value } = await prompt("삭제 사유를 입력해주세요.");
|
||||||
@@ -65,7 +70,7 @@ function PostAction({ children, handleDelete }: PostActionProps) {
|
|||||||
size="lg"
|
size="lg"
|
||||||
color="white"
|
color="white"
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => router.push(postPageLink)}
|
onClick={() => router.push(backLink)}
|
||||||
>
|
>
|
||||||
목록
|
목록
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ NEXT_PUBLIC_SEWERAGE_API_URL = http://apigateway.iipbs-was.svc.cluster.local:800
|
|||||||
NEXT_PUBLIC_NGII_URL = http://172.29.143.87/poiact
|
NEXT_PUBLIC_NGII_URL = http://172.29.143.87/poiact
|
||||||
NEXT_PUBLIC_NGII_PARAM = BDE2BEF39DAFEC293AB6730150F222AC&service=WMTS&request=GetTile&version=1.0.0&format=image/png&layer=korean_map&style=korean&tilematrixset=korean&tilematrix={z}&tilecol={y}&tilerow={x}
|
NEXT_PUBLIC_NGII_PARAM = BDE2BEF39DAFEC293AB6730150F222AC&service=WMTS&request=GetTile&version=1.0.0&format=image/png&layer=korean_map&style=korean&tilematrixset=korean&tilematrix={z}&tilecol={y}&tilerow={x}
|
||||||
NEXT_PUBLIC_GATEWAY_URL = http://apigateway.iipbs-was.svc.cluster.local:8000
|
NEXT_PUBLIC_GATEWAY_URL = http://apigateway.iipbs-was.svc.cluster.local:8000
|
||||||
CONTENTS_INTRO = 31
|
CONTENTS_INTRO = 24
|
||||||
CONTENTS_EXAMPLE = 32
|
CONTENTS_EXAMPLE = 25
|
||||||
|
|
||||||
NEXT_PUBLIC_FINDADRESS_URL=https://business.juso.go.kr/addrlink/addrLinkApi.do
|
NEXT_PUBLIC_FINDADRESS_URL=https://business.juso.go.kr/addrlink/addrLinkApi.do
|
||||||
NEXT_PRIVATE_WR_ADDRESS_KEY = U01TXOFVVEgyMDI1MDgyODE0MTAxNzExNjEyMjA=
|
NEXT_PRIVATE_WR_ADDRESS_KEY = U01TXOFVVEgyMDI1MDgyODE0MTAxNzExNjEyMjA=
|
||||||
|
|||||||
@@ -365,7 +365,7 @@ export default function SimilarCaseModal({
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th rowSpan={2} className={thBase}>
|
<th rowSpan={2} className={thBase}>
|
||||||
총대장균군수<br />(개/100ml)
|
총대장균군수<br />(개/100mL)
|
||||||
</th>
|
</th>
|
||||||
<th rowSpan={2} className={thBase}>
|
<th rowSpan={2} className={thBase}>
|
||||||
용도별 결합 잔류염소<br />(mg/L)
|
용도별 결합 잔류염소<br />(mg/L)
|
||||||
|
|||||||
@@ -428,7 +428,7 @@ export default function DemandRegisterPage() {
|
|||||||
</FormRow>
|
</FormRow>
|
||||||
<Divider />
|
<Divider />
|
||||||
|
|
||||||
<FormRow label="요구수량(m²/d)" required>
|
<FormRow label="요구수량(㎥/d)" required>
|
||||||
<TextInput value={reqQty} onChange={setReqQty} />
|
<TextInput value={reqQty} onChange={setReqQty} />
|
||||||
</FormRow>
|
</FormRow>
|
||||||
<Divider />
|
<Divider />
|
||||||
@@ -438,7 +438,7 @@ export default function DemandRegisterPage() {
|
|||||||
</FormRow>
|
</FormRow>
|
||||||
<Divider />
|
<Divider />
|
||||||
|
|
||||||
<FormRow label="희망단가(원)" required>
|
<FormRow label="희망단가(원/㎥)" required>
|
||||||
<TextInput value={hopePrice} onChange={setHopePrice} />
|
<TextInput value={hopePrice} onChange={setHopePrice} />
|
||||||
</FormRow>
|
</FormRow>
|
||||||
</div>
|
</div>
|
||||||
@@ -464,7 +464,7 @@ export default function DemandRegisterPage() {
|
|||||||
|
|
||||||
<div className="border border-neutral-200 bg-white">
|
<div className="border border-neutral-200 bg-white">
|
||||||
<QualityRow
|
<QualityRow
|
||||||
leftLabel="총대장균군수(개/mg)"
|
leftLabel="총대장균군수(개/100㎖)"
|
||||||
leftRequired
|
leftRequired
|
||||||
leftControl={
|
leftControl={
|
||||||
<div className="flex items-center gap-4">
|
<div className="flex items-center gap-4">
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ export default function DemandStatusPage() {
|
|||||||
{ label: "요구시기", value: selected.detail.reqDate, required: true },
|
{ label: "요구시기", value: selected.detail.reqDate, required: true },
|
||||||
{ label: "요구수량(㎡/d)", value: selected.detail.reqQty },
|
{ label: "요구수량(㎡/d)", value: selected.detail.reqQty },
|
||||||
{ label: "사용용도", value: selected.detail.usePurpose },
|
{ label: "사용용도", value: selected.detail.usePurpose },
|
||||||
{ label: "희망단가(원)", value: selected.detail.price },
|
{ label: "희망단가(원/㎥)", value: selected.detail.price },
|
||||||
];
|
];
|
||||||
}, [selected]);
|
}, [selected]);
|
||||||
|
|
||||||
@@ -157,7 +157,7 @@ export default function DemandStatusPage() {
|
|||||||
if (!selected) return [];
|
if (!selected) return [];
|
||||||
const w = selected.detail.water;
|
const w = selected.detail.water;
|
||||||
return [
|
return [
|
||||||
{ label: "총대장균군수(개/100mℓ)", value: w.coliform },
|
{ label: "총대장균군수(개/100㎖)", value: w.coliform },
|
||||||
{ label: "결합잔류염소(mg/L)", value: "-" },
|
{ label: "결합잔류염소(mg/L)", value: "-" },
|
||||||
{ label: "탁도(NTU)", value: w.turbidity },
|
{ label: "탁도(NTU)", value: w.turbidity },
|
||||||
|
|
||||||
|
|||||||
@@ -44,17 +44,17 @@ export default function DemandRegisterPage() {
|
|||||||
const [coliform, setColiform] = useState<string>(""); // 총대장균군수
|
const [coliform, setColiform] = useState<string>(""); // 총대장균군수
|
||||||
const [noDetect, setNoDetect] = useState<boolean>(false);
|
const [noDetect, setNoDetect] = useState<boolean>(false);
|
||||||
|
|
||||||
const [tn, setTn] = useState<string>("");
|
const [tn, setTn] = useState<string>(""); // 총질소(T-N)
|
||||||
const [residualCl, setResidualCl] = useState<string>("");
|
const [residualCl, setResidualCl] = useState<string>(""); // 결합잔류염소
|
||||||
const [tp, setTp] = useState<string>("");
|
const [tp, setTp] = useState<string>(""); // 총인(T-P)
|
||||||
const [turbidity, setTurbidity] = useState<string>("");
|
const [turbidity, setTurbidity] = useState<string>(""); // 탁도
|
||||||
const [ph, setPh] = useState<PHRange>({ min: "", max: "" });
|
const [ph, setPh] = useState<PHRange>({ min: "", max: "" }); // 수소이온농도(pH)
|
||||||
const [bod, setBod] = useState<string>("");
|
const [bod, setBod] = useState<string>(""); // 생물학적산소요구량(BOD)
|
||||||
const [chloride, setChloride] = useState<string>("");
|
const [chloride, setChloride] = useState<string>(""); // 염화물
|
||||||
const [odor, setOdor] = useState<string>("불쾌하지 않을 것");
|
const [odor, setOdor] = useState<string>("불쾌하지 않을 것"); // 냄새
|
||||||
const [ec, setEc] = useState<string>("");
|
const [ec, setEc] = useState<string>(""); // 전기전도도
|
||||||
const [color, setColor] = useState<string>("");
|
const [color, setColor] = useState<string>(""); // 색도
|
||||||
const [remark, setRemark] = useState<string>("");
|
const [remark, setRemark] = useState<string>(""); // 비고
|
||||||
|
|
||||||
// 공급처 후보지 선택(필수아님)
|
// 공급처 후보지 선택(필수아님)
|
||||||
const [cand1, setCand1] = useState("");
|
const [cand1, setCand1] = useState("");
|
||||||
@@ -373,7 +373,8 @@ export default function DemandRegisterPage() {
|
|||||||
switch (value) {
|
switch (value) {
|
||||||
// 청소화장실용도
|
// 청소화장실용도
|
||||||
case '01':
|
case '01':
|
||||||
setTp('0.2');
|
setNoDetect(true); // 총대장균군수 불검출
|
||||||
|
setResidualCl('0.2'); // 잔류염소
|
||||||
setTurbidity('2');
|
setTurbidity('2');
|
||||||
setPh({ min: '5.8', max: '8.5' });
|
setPh({ min: '5.8', max: '8.5' });
|
||||||
setBod('5');
|
setBod('5');
|
||||||
@@ -381,23 +382,35 @@ export default function DemandRegisterPage() {
|
|||||||
break;
|
break;
|
||||||
// 세척살수용도
|
// 세척살수용도
|
||||||
case '02':
|
case '02':
|
||||||
setTp('0.2');
|
setColiform('1000');
|
||||||
setTurbidity('2');
|
setTurbidity('2'); // 탁도
|
||||||
setPh({ min: '5.8', max: '8.5' });
|
setPh({ min: '5.8', max: '8.5' });
|
||||||
setBod('5');
|
setBod('5');
|
||||||
break;
|
break;
|
||||||
// 조경용도
|
// 조경용도
|
||||||
case '03':
|
case '03':
|
||||||
setTp('0.2');
|
setColiform('1000');
|
||||||
setTurbidity('2');
|
setTurbidity('2');
|
||||||
setPh({ min: '5.8', max: '8.5' });
|
setPh({ min: '5.8', max: '8.5' });
|
||||||
setBod('5');
|
setBod('5');
|
||||||
setChloride('250');
|
setChloride('250'); // 염화물
|
||||||
break;
|
break;
|
||||||
// 지하수
|
// 친수용도
|
||||||
|
case '04':
|
||||||
|
setNoDetect(true); // 총대장균군수 불검출
|
||||||
|
setResidualCl('0.1'); // 잔류염소
|
||||||
|
setTurbidity('2');
|
||||||
|
setBod('3');
|
||||||
|
setColor('10');
|
||||||
|
setTn('10'); // 총질소
|
||||||
|
setTp('0.5'); // 총인
|
||||||
|
setPh({ min: '5.8', max: '8.5' });
|
||||||
|
setChloride('0.5');
|
||||||
|
break;
|
||||||
|
// 지하수충전
|
||||||
case '05':
|
case '05':
|
||||||
break;
|
break;
|
||||||
// 농업용도
|
// 농업용수
|
||||||
case '06':
|
case '06':
|
||||||
setTurbidity('5');
|
setTurbidity('5');
|
||||||
setPh({ min: '5.8', max: '8.5' });
|
setPh({ min: '5.8', max: '8.5' });
|
||||||
@@ -405,16 +418,18 @@ export default function DemandRegisterPage() {
|
|||||||
setEc('2000');
|
setEc('2000');
|
||||||
setFarmText("이하 (** 간접:2000,직접:700 )");
|
setFarmText("이하 (** 간접:2000,직접:700 )");
|
||||||
break;
|
break;
|
||||||
// 하천 등 유지보수
|
// 하천 등 유지용수
|
||||||
case '07':
|
case '07':
|
||||||
setColiform('1000');
|
setColiform('1000');
|
||||||
setTn('10');
|
setBod('5');
|
||||||
|
setTn('20');
|
||||||
setTp('0.5');
|
setTp('0.5');
|
||||||
setPh({ min: '5.8', max: '8.5' });
|
setPh({ min: '5.8', max: '8.5' });
|
||||||
setBod('5');
|
setChloride('0.5');
|
||||||
break;
|
break;
|
||||||
// 공업
|
// 공업용수
|
||||||
case '08':
|
case '08':
|
||||||
|
setBod('20');
|
||||||
setPh({ min: '5.8', max: '8.5' });
|
setPh({ min: '5.8', max: '8.5' });
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -467,7 +482,7 @@ export default function DemandRegisterPage() {
|
|||||||
|
|
||||||
<Divider />
|
<Divider />
|
||||||
|
|
||||||
<FormRow label="요구수량(m²/d)" required>
|
<FormRow label="요구수량(㎥/d)" required>
|
||||||
<TextInput value={reqQty} onChange={setReqQty} placeholder="" />
|
<TextInput value={reqQty} onChange={setReqQty} placeholder="" />
|
||||||
</FormRow>
|
</FormRow>
|
||||||
|
|
||||||
@@ -490,7 +505,7 @@ export default function DemandRegisterPage() {
|
|||||||
|
|
||||||
<Divider />
|
<Divider />
|
||||||
|
|
||||||
<FormRow label="희망단가(원)" required>
|
<FormRow label="희망단가(원/㎥)" required>
|
||||||
<TextInput value={hopePrice} onChange={setHopePrice} />
|
<TextInput value={hopePrice} onChange={setHopePrice} />
|
||||||
</FormRow>
|
</FormRow>
|
||||||
</div>
|
</div>
|
||||||
@@ -519,7 +534,7 @@ export default function DemandRegisterPage() {
|
|||||||
<div className="border border-neutral-200 bg-white">
|
<div className="border border-neutral-200 bg-white">
|
||||||
{/* 1행 */}
|
{/* 1행 */}
|
||||||
<QualityRow
|
<QualityRow
|
||||||
leftLabel="총대장균군수(개/mg)"
|
leftLabel="총대장균군수(개/100㎖)"
|
||||||
|
|
||||||
leftControl={
|
leftControl={
|
||||||
<div className="flex items-center gap-4">
|
<div className="flex items-center gap-4">
|
||||||
|
|||||||
@@ -30,6 +30,19 @@ const formatValue = (value: string | number | null | undefined) => {
|
|||||||
return String(value);
|
return String(value);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const formatNumberWithComma = (value: string | number | null | undefined) => {
|
||||||
|
if (value === null || value === undefined || value === "") return "-";
|
||||||
|
|
||||||
|
const normalized =
|
||||||
|
typeof value === "string" ? Number(value.replace(/,/g, "")) : Number(value);
|
||||||
|
|
||||||
|
if (Number.isNaN(normalized)) {
|
||||||
|
return String(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return normalized.toLocaleString("ko-KR");
|
||||||
|
};
|
||||||
|
|
||||||
const formatBelow = (value: string | number | null | undefined) => {
|
const formatBelow = (value: string | number | null | undefined) => {
|
||||||
if (value === null || value === undefined || value === "") return "-";
|
if (value === null || value === undefined || value === "") return "-";
|
||||||
if (Number(value) === -1) return "불검출";
|
if (Number(value) === -1) return "불검출";
|
||||||
@@ -234,9 +247,9 @@ export default function DemandStatusPage() {
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
{ label: "요구시기", key: "dmndTmng", value: formatDate(selectedSdmInfoStatus.dmndTmng), required: true },
|
{ label: "요구시기", key: "dmndTmng", value: formatDate(selectedSdmInfoStatus.dmndTmng), required: true },
|
||||||
{ label: "요구수량(㎥/d)", key: "dmndQty", value: formatValue(selectedSdmInfoStatus.dmndQty) },
|
{ label: "요구수량(㎥/d)", key: "dmndQty", value: formatNumberWithComma(selectedSdmInfoStatus.dmndQty) },
|
||||||
{ label: "사용용도", key: "useUsgCd", value: formatValue(selectedSdmInfoStatus.useUsgCd) },
|
{ label: "사용용도", key: "useUsgCd", value: formatValue(selectedSdmInfoStatus.useUsgCd) },
|
||||||
{ label: "희망단가(원/㎥)", key: "wntUntprc", value: formatValue(selectedSdmInfoStatus.wntUntprc) },
|
{ label: "희망단가(원/㎥)", key: "wntUntprc", value: formatNumberWithComma(selectedSdmInfoStatus.wntUntprc) },
|
||||||
];
|
];
|
||||||
}, [selectedSdmInfoStatus]);
|
}, [selectedSdmInfoStatus]);
|
||||||
|
|
||||||
@@ -244,7 +257,7 @@ export default function DemandStatusPage() {
|
|||||||
if (!selectedSdmInfoStatus) return [];
|
if (!selectedSdmInfoStatus) return [];
|
||||||
|
|
||||||
return [
|
return [
|
||||||
{ label: "총대장균군수(개/100mL)", key: "grssClfg", value: formatBelow(selectedSdmInfoStatus.grssClfg) },
|
{ label: "총대장균군수(개/100㎖)", key: "grssClfg", value: formatBelow(selectedSdmInfoStatus.grssClfg) },
|
||||||
{ label: "결합잔류염소(mg/L)", key:"combResdch", value: formatBelow(selectedSdmInfoStatus.combResdch) },
|
{ label: "결합잔류염소(mg/L)", key:"combResdch", value: formatBelow(selectedSdmInfoStatus.combResdch) },
|
||||||
{ label: "탁도(NTU)", key:"trbt", value: formatBelow(selectedSdmInfoStatus.trbt) },
|
{ label: "탁도(NTU)", key:"trbt", value: formatBelow(selectedSdmInfoStatus.trbt) },
|
||||||
|
|
||||||
@@ -520,7 +533,7 @@ export default function DemandStatusPage() {
|
|||||||
|
|
||||||
{!selectedSdmInfoStatus ? (
|
{!selectedSdmInfoStatus ? (
|
||||||
<div className="mt-3 border border-neutral-200 px-6 py-10 text-center text-sm text-slate-400">
|
<div className="mt-3 border border-neutral-200 px-6 py-10 text-center text-sm text-slate-400">
|
||||||
상세 정보를 표시할 신청건이 없습니다.
|
조회된 결과가 없습니다.
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="mt-3 border border-neutral-200">
|
<div className="mt-3 border border-neutral-200">
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ type IntroCardItem = {
|
|||||||
|
|
||||||
const INTRO_CARDS: IntroCardItem[] = [
|
const INTRO_CARDS: IntroCardItem[] = [
|
||||||
{
|
{
|
||||||
title: "물 재이용 법",
|
title: "물재이용법",
|
||||||
desc: "물의 재이용 촉진 및 지원에 관한 법률을 시행하고, 일부 법률은 개정되었습니다.",
|
desc: "물의 재이용 촉진 및 지원에 관한 법률을 시행하고, 일부 법률은 개정되었습니다.",
|
||||||
image: card01,
|
image: card01,
|
||||||
href: "/intro#law-plan",
|
href: "/intro#law-plan",
|
||||||
|
|||||||
@@ -770,7 +770,7 @@ export const SdmReducer = (set: any): SdmActions => {
|
|||||||
"/cms-service/api/v1/lwpo-cds/?lwpoCdNm=&sort=regDt,desc&upCd=WR018&page=0&size=100"
|
"/cms-service/api/v1/lwpo-cds/?lwpoCdNm=&sort=regDt,desc&upCd=WR018&page=0&size=100"
|
||||||
);
|
);
|
||||||
|
|
||||||
const comUseTypes = upCd.content.filter(el=>el.lwpoCdNm != '친수용수').map((el: any) => ({ text: el.lwpoCdNm, val: el.lwpoCd }));
|
const comUseTypes = upCd.content.map((el: any) => ({ text: el.lwpoCdNm, val: el.lwpoCd }));
|
||||||
|
|
||||||
set((state: SdmType) => ({
|
set((state: SdmType) => ({
|
||||||
Sdm: {
|
Sdm: {
|
||||||
|
|||||||
@@ -83,14 +83,14 @@ const MOCK: Record<TabKey, CaseItem[]> = {
|
|||||||
sewage: [
|
sewage: [
|
||||||
{
|
{
|
||||||
id: "sewage-1",
|
id: "sewage-1",
|
||||||
title: "구리시 하수 재이용",
|
title: "구리시 하수처리수 재이용",
|
||||||
desc: "고농도 미세먼지 발생 및 폭염의 급증에 따라 공공하수처리시설 발생 재이용수 일부를 도로자동청소시스템에 활용하여 미세먼지 저감 및 폭염 취약성 완화",
|
desc: "고농도 미세먼지 발생 및 폭염의 급증에 따라 공공하수처리시설 발생 재이용수 일부를 도로자동청소시스템에 활용하여 미세먼지 저감 및 폭염 취약성 완화",
|
||||||
imageSrc: "/images/landing/business/sewage/guri_01.png",
|
imageSrc: "/images/landing/business/sewage/guri_01.png",
|
||||||
href: "/example#example-sewage-guri",
|
href: "/example#example-sewage-guri",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "sewage-2",
|
id: "sewage-2",
|
||||||
title: "부천시 하수재이용",
|
title: "부천시 하수처리수 재이용",
|
||||||
desc: "굴포하수처리시설 하수처리수 재이용수 생산시설 설치 운영을 통해 여월천 등 부천 관내 하천의 건천화 방지, 하천 생태계 보존 및 주민들에게 친수 공간 제공",
|
desc: "굴포하수처리시설 하수처리수 재이용수 생산시설 설치 운영을 통해 여월천 등 부천 관내 하천의 건천화 방지, 하천 생태계 보존 및 주민들에게 친수 공간 제공",
|
||||||
imageSrc: "/images/landing/business/sewage/bucheon_01.png",
|
imageSrc: "/images/landing/business/sewage/bucheon_01.png",
|
||||||
href: "/example#example-sewage-bucheon",
|
href: "/example#example-sewage-bucheon",
|
||||||
@@ -104,42 +104,42 @@ const MOCK: Record<TabKey, CaseItem[]> = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "sewage-4",
|
id: "sewage-4",
|
||||||
title: "파주시 하수 재이용 시설",
|
title: "파주시 하수처리수 재이용",
|
||||||
desc: "운정 및 금촌하수처리시설의 하수처리수를 막공법으로 재처리하여 파주LCD산업단지 내 3개 업체에 공업용수를 공급(LG디스플레이, 희성전자, 엔비텍)",
|
desc: "운정 및 금촌하수처리시설의 하수처리수를 막공법으로 재처리하여 파주LCD산업단지 내 3개 업체에 공업용수를 공급(LG디스플레이, 희성전자, 엔비텍)",
|
||||||
imageSrc: "/images/landing/business/sewage/paju_01.png",
|
imageSrc: "/images/landing/business/sewage/paju_01.png",
|
||||||
href: "/example#example-sewage-paju",
|
href: "/example#example-sewage-paju",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "sewage-5",
|
id: "sewage-5",
|
||||||
title: "포항시 하수 재이용 시설",
|
title: "포항시 하수처리수 재이용",
|
||||||
desc: "포항시 내 공단 개발 확대로 지속적이고 안정적인 공업용수 공급 추진(포스코, 동국산업 등), 포항하수처리장 하수처리수를 재처리하여 공업용수로 공급",
|
desc: "포항시 내 공단 개발 확대로 지속적이고 안정적인 공업용수 공급 추진(포스코, 동국산업 등), 포항하수처리장 하수처리수를 재처리하여 공업용수로 공급",
|
||||||
imageSrc: "/images/landing/business/sewage/pohang_01.png",
|
imageSrc: "/images/landing/business/sewage/pohang_01.png",
|
||||||
href: "/example#example-sewage-pohang",
|
href: "/example#example-sewage-pohang",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "sewage-6",
|
id: "sewage-6",
|
||||||
title: "울산광역시 하수 재이용 시설",
|
title: "울산광역시 하수처리수 재이용",
|
||||||
desc: "18년 갈수기시 낙동강 수질 악화로 울산석유화학단지 용수 공급 부족을 해소하기 위해 미포산단 내 한화케미칼 등 8개사 공업용수 공급",
|
desc: "18년 갈수기시 낙동강 수질 악화로 울산석유화학단지 용수 공급 부족을 해소하기 위해 미포산단 내 한화케미칼 등 8개사 공업용수 공급",
|
||||||
imageSrc: "/images/landing/business/sewage/ulsan_01.png",
|
imageSrc: "/images/landing/business/sewage/ulsan_01.png",
|
||||||
href: "/example#example-sewage-ulsan",
|
href: "/example#example-sewage-ulsan",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "sewage-7",
|
id: "sewage-7",
|
||||||
title: "여수시 하수 재이용 시설",
|
title: "여수시 하수처리수 재이용",
|
||||||
desc: "수요자가 원하는 양질의 공업용수를 저렴하게 공급하여 한정된 수자원의 효율적 이용 및 지역적 물 부족 해소, 하수재이용을 통한 오염총량 저감 및 방류수역 수질개선을 위한 여수국가산단 내 공업용수 공급(GS칼텍스, YNCC 등)",
|
desc: "수요자가 원하는 양질의 공업용수를 저렴하게 공급하여 한정된 수자원의 효율적 이용 및 지역적 물 부족 해소, 하수재이용을 통한 오염총량 저감 및 방류수역 수질개선을 위한 여수국가산단 내 공업용수 공급(GS칼텍스, YNCC 등)",
|
||||||
imageSrc: "/images/landing/business/sewage/yeosu_01.png",
|
imageSrc: "/images/landing/business/sewage/yeosu_01.png",
|
||||||
href: "/example#example-sewage-yeosu",
|
href: "/example#example-sewage-yeosu",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "sewage-8",
|
id: "sewage-8",
|
||||||
title: "보령시 하수 재이용 시설",
|
title: "보령시 하수처리수 재이용",
|
||||||
desc: "한국중부발전(주)의 보령 및 신보령화력발전소에 10,000㎥/일의 탈황용수 공급을 위해 보령하수처리시설의 하수처리수 재이용 사업 추진, 하수처리수 재이용을 통한 수자원 절약 및 지역 물 부족 해소",
|
desc: "한국중부발전(주)의 보령 및 신보령화력발전소에 10,000㎥/일의 탈황용수 공급을 위해 보령하수처리시설의 하수처리수 재이용 사업 추진, 하수처리수 재이용을 통한 수자원 절약 및 지역 물 부족 해소",
|
||||||
imageSrc: "/images/landing/business/sewage/boryeong_01.png",
|
imageSrc: "/images/landing/business/sewage/boryeong_01.png",
|
||||||
href: "/example#example-sewage-boryeong",
|
href: "/example#example-sewage-boryeong",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "sewage-9",
|
id: "sewage-9",
|
||||||
title: "아산시 하수 재이용 시설",
|
title: "아산시 하수처리수 재이용",
|
||||||
desc: "신도시 개발에 따른 인구 급증으로 발생하는 하수를 재처리하여 탕정산업단지(삼성디스플레이)에 공업용수를 안정적으로 공급함으로써 지역기반 및 활성화를 도모",
|
desc: "신도시 개발에 따른 인구 급증으로 발생하는 하수를 재처리하여 탕정산업단지(삼성디스플레이)에 공업용수를 안정적으로 공급함으로써 지역기반 및 활성화를 도모",
|
||||||
imageSrc: "/images/landing/business/sewage/asan_01.png",
|
imageSrc: "/images/landing/business/sewage/asan_01.png",
|
||||||
href: "/example#example-sewage-asan",
|
href: "/example#example-sewage-asan",
|
||||||
|
|||||||
@@ -282,7 +282,7 @@
|
|||||||
// },
|
// },
|
||||||
// {
|
// {
|
||||||
// name: "money",
|
// name: "money",
|
||||||
// label: "희망단가(원)",
|
// label: "희망단가(원/㎥)",
|
||||||
// formIndex: 0,
|
// formIndex: 0,
|
||||||
// required: true,
|
// required: true,
|
||||||
// component: (field) => (
|
// component: (field) => (
|
||||||
@@ -375,7 +375,7 @@
|
|||||||
// render={({ field }) =>
|
// render={({ field }) =>
|
||||||
// name === "money" ? (
|
// name === "money" ? (
|
||||||
// <div>
|
// <div>
|
||||||
// <Label className="text-black">희망단가(원)*</Label>
|
// <Label className="text-black">희망단가(원/㎥)*</Label>
|
||||||
// {component(field)}
|
// {component(field)}
|
||||||
// </div>
|
// </div>
|
||||||
// ) : (
|
// ) : (
|
||||||
@@ -411,7 +411,7 @@
|
|||||||
// return (
|
// return (
|
||||||
// <FormUi
|
// <FormUi
|
||||||
// label={
|
// label={
|
||||||
// !isDisabled ? `총대장균군수(개/mg)*` : "총대장균군수(개/mg)"
|
// !isDisabled ? `총대장균군수(개/100㎖)*` : "총대장균군수(개/100㎖)"
|
||||||
// }
|
// }
|
||||||
// >
|
// >
|
||||||
// <div className="flex items-center gap-2">
|
// <div className="flex items-center gap-2">
|
||||||
|
|||||||
Vendored
+1
@@ -1,5 +1,6 @@
|
|||||||
/// <reference types="next" />
|
/// <reference types="next" />
|
||||||
/// <reference types="next/image-types/global" />
|
/// <reference types="next/image-types/global" />
|
||||||
|
/// <reference path="./.next/types/routes.d.ts" />
|
||||||
|
|
||||||
// NOTE: This file should not be edited
|
// NOTE: This file should not be edited
|
||||||
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 139 KiB After Width: | Height: | Size: 60 KiB |
@@ -237,7 +237,7 @@ export default function FacilityTermModalHeader<T extends { msrDt: string }>({
|
|||||||
onSelectValue={(val) => setFlowPanel(val.toString())}
|
onSelectValue={(val) => setFlowPanel(val.toString())}
|
||||||
className="mx-3 w-[150px]"
|
className="mx-3 w-[150px]"
|
||||||
label=""
|
label=""
|
||||||
selectClass="w-full p-1 border rounded bg-white"
|
selectClass="w-full rounded border border-input bg-form p-1"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
@@ -251,7 +251,7 @@ export default function FacilityTermModalHeader<T extends { msrDt: string }>({
|
|||||||
mode="single"
|
mode="single"
|
||||||
selected={startDate}
|
selected={startDate}
|
||||||
onSelect={(date) => handleStartDateSelect(date as Date)}
|
onSelect={(date) => handleStartDateSelect(date as Date)}
|
||||||
className="w-full p-1 border rounded bg-white"
|
className="w-full rounded border border-input bg-form p-1 text-foreground"
|
||||||
disabled={(date) => !isDateInRanges(date)}
|
disabled={(date) => !isDateInRanges(date)}
|
||||||
defaultMonth={startDate}
|
defaultMonth={startDate}
|
||||||
/>
|
/>
|
||||||
@@ -262,7 +262,7 @@ export default function FacilityTermModalHeader<T extends { msrDt: string }>({
|
|||||||
mode="single"
|
mode="single"
|
||||||
selected={endDate}
|
selected={endDate}
|
||||||
onSelect={(date) => handleEndDateSelect(date as Date)}
|
onSelect={(date) => handleEndDateSelect(date as Date)}
|
||||||
className="w-full p-1 border rounded bg-white"
|
className="w-full rounded border border-input bg-form p-1 text-foreground"
|
||||||
disabled={(date) => !isDateInRanges(date)}
|
disabled={(date) => !isDateInRanges(date)}
|
||||||
defaultMonth={endDate}
|
defaultMonth={endDate}
|
||||||
/>
|
/>
|
||||||
@@ -275,4 +275,4 @@ export default function FacilityTermModalHeader<T extends { msrDt: string }>({
|
|||||||
</div>
|
</div>
|
||||||
</ListDiv>
|
</ListDiv>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ export default function FacilityTermModalHeaderMonth<T extends { msrDt: string }
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<ListDiv className="!h-[100px]">
|
<ListDiv className="!h-[100px]">
|
||||||
<div className="card !m-[1.2rem] max-h-[40rem] overflow-auto !p-0r">
|
<div className="card !m-[1.2rem] max-h-[40rem] overflow-auto !p-0">
|
||||||
<Table>
|
<Table>
|
||||||
<thead>
|
<thead>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
@@ -237,7 +237,7 @@ export default function FacilityTermModalHeaderMonth<T extends { msrDt: string }
|
|||||||
onSelectValue={(val) => setFlowPanel(val.toString())}
|
onSelectValue={(val) => setFlowPanel(val.toString())}
|
||||||
className="mx-3 w-[150px]"
|
className="mx-3 w-[150px]"
|
||||||
label=""
|
label=""
|
||||||
selectClass="w-full p-1 border rounded bg-white"
|
selectClass="w-full rounded border border-input bg-form p-1"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
@@ -251,7 +251,7 @@ export default function FacilityTermModalHeaderMonth<T extends { msrDt: string }
|
|||||||
mode="single"
|
mode="single"
|
||||||
selected={startDate}
|
selected={startDate}
|
||||||
onSelect={(date) => handleStartDateSelect(date as Date)}
|
onSelect={(date) => handleStartDateSelect(date as Date)}
|
||||||
className="w-full p-1 border rounded bg-white"
|
className="w-full rounded border border-input bg-form p-1 text-foreground"
|
||||||
defaultMonth={startDate}
|
defaultMonth={startDate}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -261,7 +261,7 @@ export default function FacilityTermModalHeaderMonth<T extends { msrDt: string }
|
|||||||
mode="single"
|
mode="single"
|
||||||
selected={endDate}
|
selected={endDate}
|
||||||
onSelect={(date) => handleEndDateSelect(date as Date)}
|
onSelect={(date) => handleEndDateSelect(date as Date)}
|
||||||
className="w-full p-1 border rounded bg-white"
|
className="w-full rounded border border-input bg-form p-1 text-foreground"
|
||||||
defaultMonth={endDate}
|
defaultMonth={endDate}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -273,4 +273,4 @@ export default function FacilityTermModalHeaderMonth<T extends { msrDt: string }
|
|||||||
</div>
|
</div>
|
||||||
</ListDiv>
|
</ListDiv>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,55 +5,55 @@ const HeadMakeColSpan = ({ upHeadList, layoutNum }: { upHeadList: TableUpperProp
|
|||||||
return (
|
return (
|
||||||
layoutNum === 'A' ? (
|
layoutNum === 'A' ? (
|
||||||
<>
|
<>
|
||||||
<TableRow className="bg-gray-50">{upHeadList.map((head: TableUpperProps) =>
|
<TableRow className="bg-secondary">{upHeadList.map((head: TableUpperProps) =>
|
||||||
(head.id === 'trtFrfNm' ? <TableHead className="w-1/12" rowSpan={2} key={head.id}>{head.title}</TableHead> :
|
(head.id === 'trtFrfNm' ? <TableHead className="w-1/12" rowSpan={2} key={head.id}>{head.title}</TableHead> :
|
||||||
head.id === 'laeNm' ? <TableHead className="w-1/12" rowSpan={2} key={head.id}>{head.title}</TableHead> :
|
head.id === 'laeNm' ? <TableHead className="w-1/12" rowSpan={2} key={head.id}>{head.title}</TableHead> :
|
||||||
head.id == 'fctCpc' || head.id == 'planInputWaterQlty' || head.id == 'designInputWaterQlty' ? <TableHead rowSpan={2} className="w-40" style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead> :
|
head.id == 'fctCpc' || head.id == 'planInputWaterQlty' || head.id == 'designInputWaterQlty' ? <TableHead rowSpan={2} className="w-40" style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead> :
|
||||||
head.id === 'trstOprEtpNm' ? <TableHead className="w-1/15" rowSpan={2} key={head.id}>{head.title}</TableHead> :
|
head.id === 'trstOprEtpNm' ? <TableHead className="w-1/15" rowSpan={2} key={head.id}>{head.title}</TableHead> :
|
||||||
head.upName === 'upChangeRe' && head.upSequnce === 1 ? <TableHead className="bg-gray-50" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={1} colSpan={2}>{'행정구역'}</TableHead> :
|
head.upName === 'upChangeRe' && head.upSequnce === 1 ? <TableHead className="bg-secondary" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={1} colSpan={2}>{'행정구역'}</TableHead> :
|
||||||
!head.upName ? <TableHead rowSpan={2} className="w-1/20 bg-gray-20" style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead> : null))}
|
!head.upName ? <TableHead rowSpan={2} className="w-1/20 bg-accent text-accent-foreground" style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead> : null))}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
<TableRow className="bg-gray-50">
|
<TableRow className="bg-secondary">
|
||||||
{upHeadList.map((head: TableUpperProps) => {
|
{upHeadList.map((head: TableUpperProps) => {
|
||||||
if (head.upName === 'upChangeRe') {
|
if (head.upName === 'upChangeRe') {
|
||||||
return <TableHead key={head.id} style={{ whiteSpace: 'pre-line' }} className="w-40 bg-gray-50">{head.title}</TableHead>;
|
return <TableHead key={head.id} style={{ whiteSpace: 'pre-line' }} className="w-40 bg-secondary">{head.title}</TableHead>;
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</>
|
</>
|
||||||
) : layoutNum === 'R' ? (
|
) : layoutNum === 'R' ? (
|
||||||
<>
|
<>
|
||||||
<TableRow className="bg-gray-50">{upHeadList.map((head: TableUpperProps) =>
|
<TableRow className="bg-secondary">{upHeadList.map((head: TableUpperProps) =>
|
||||||
(head.id === 'trtFrfNm' ? <TableHead className="w-1/12" rowSpan={2} key={head.id}>{head.title}</TableHead> :
|
(head.id === 'trtFrfNm' ? <TableHead className="w-1/12" rowSpan={2} key={head.id}>{head.title}</TableHead> :
|
||||||
head.id === 'laeNm' ? <TableHead className="w-1/12" rowSpan={2} key={head.id}>{head.title}</TableHead> :
|
head.id === 'laeNm' ? <TableHead className="w-1/12" rowSpan={2} key={head.id}>{head.title}</TableHead> :
|
||||||
head.id == 'fctCpc' || head.id == 'planInputWaterQlty' || head.id == 'designInputWaterQlty' ? <TableHead rowSpan={2} className="w-40" style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead> :
|
head.id == 'fctCpc' || head.id == 'planInputWaterQlty' || head.id == 'designInputWaterQlty' ? <TableHead rowSpan={2} className="w-40" style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead> :
|
||||||
head.id === 'trstOprEtpNm' ? <TableHead className="w-1/15" rowSpan={2} key={head.id}>{head.title}</TableHead> :
|
head.id === 'trstOprEtpNm' ? <TableHead className="w-1/15" rowSpan={2} key={head.id}>{head.title}</TableHead> :
|
||||||
head.upName === 'upChangeRe' && head.upSequnce === 1 ? <TableHead className="w-75 bg-gray-50" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={1} colSpan={3}>{'유역'}</TableHead> :
|
head.upName === 'upChangeRe' && head.upSequnce === 1 ? <TableHead className="w-75 bg-secondary" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={1} colSpan={3}>{'유역'}</TableHead> :
|
||||||
!head.upName ? <TableHead rowSpan={2} className="w-1/20 bg-gray-20" style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead> : null))}
|
!head.upName ? <TableHead rowSpan={2} className="w-1/20 bg-accent text-accent-foreground" style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead> : null))}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
<TableRow className="bg-gray-50">
|
<TableRow className="bg-secondary">
|
||||||
{upHeadList.map((head: TableUpperProps) => {
|
{upHeadList.map((head: TableUpperProps) => {
|
||||||
if (head.upName === 'upChangeRe') {
|
if (head.upName === 'upChangeRe') {
|
||||||
return <TableHead key={head.id} style={{ whiteSpace: 'pre-line' }} className="w-40 bg-gray-50">{head.title}</TableHead>;
|
return <TableHead key={head.id} style={{ whiteSpace: 'pre-line' }} className="w-40 bg-secondary">{head.title}</TableHead>;
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<TableRow className="bg-gray-50">{upHeadList.map((head: TableUpperProps) =>
|
<TableRow className="bg-secondary">{upHeadList.map((head: TableUpperProps) =>
|
||||||
(head.id === 'trtFrfNm' ? <TableHead className="w-1/12" rowSpan={2} key={head.id}>{head.title}</TableHead> :
|
(head.id === 'trtFrfNm' ? <TableHead className="w-1/12" rowSpan={2} key={head.id}>{head.title}</TableHead> :
|
||||||
head.id === 'laeNm' ? <TableHead className="w-1/12" rowSpan={2} key={head.id}>{head.title}</TableHead> :
|
head.id === 'laeNm' ? <TableHead className="w-1/12" rowSpan={2} key={head.id}>{head.title}</TableHead> :
|
||||||
head.id == 'fctCpc' || head.id == 'planInputWaterQlty' || head.id == 'designInputWaterQlty' ? <TableHead rowSpan={2} className="w-40" style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead> :
|
head.id == 'fctCpc' || head.id == 'planInputWaterQlty' || head.id == 'designInputWaterQlty' ? <TableHead rowSpan={2} className="w-40" style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead> :
|
||||||
head.id === 'trstOprEtpNm' ? <TableHead className="w-1/15" rowSpan={2} key={head.id}>{head.title}</TableHead> :
|
head.id === 'trstOprEtpNm' ? <TableHead className="w-1/15" rowSpan={2} key={head.id}>{head.title}</TableHead> :
|
||||||
head.upName === 'upChangeRe1' && head.upSequnce === 1 ? <TableHead className="w-75 bg-gray-50" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={1} colSpan={3}>{'권역'}</TableHead> :
|
head.upName === 'upChangeRe1' && head.upSequnce === 1 ? <TableHead className="w-75 bg-secondary" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={1} colSpan={3}>{'권역'}</TableHead> :
|
||||||
head.upName === 'upChangeRe2' && head.upSequnce === 1 ? <TableHead className="w-75 bg-gray-50" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={1} colSpan={2}>{'행정구역'}</TableHead> :
|
head.upName === 'upChangeRe2' && head.upSequnce === 1 ? <TableHead className="w-75 bg-secondary" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={1} colSpan={2}>{'행정구역'}</TableHead> :
|
||||||
!head.upName ? <TableHead rowSpan={2} className="w-1/20 bg-gray-20" style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead> : null))}
|
!head.upName ? <TableHead rowSpan={2} className="w-1/20 bg-accent text-accent-foreground" style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead> : null))}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
<TableRow className="bg-gray-50">
|
<TableRow className="bg-secondary">
|
||||||
{upHeadList.map((head: TableUpperProps) => {
|
{upHeadList.map((head: TableUpperProps) => {
|
||||||
if (head.upName === 'upChangeRe1' || head.upName === 'upChangeRe2') {
|
if (head.upName === 'upChangeRe1' || head.upName === 'upChangeRe2') {
|
||||||
return <TableHead key={head.id} style={{ whiteSpace: 'pre-line' }} className="w-40 bg-gray-50">{head.title}</TableHead>;
|
return <TableHead key={head.id} style={{ whiteSpace: 'pre-line' }} className="w-40 bg-secondary">{head.title}</TableHead>;
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|||||||
@@ -99,22 +99,22 @@ export default function SearchInputText({label=undefined, setValue=()=>{}, sidoS
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={'relative'} ref={wrapperRef}>
|
<div className={'relative'} ref={wrapperRef}>
|
||||||
{label && <Label className="w-20 text-xl text-gray-600 justify-self-center">{label}</Label>}
|
{label && <Label className="w-20 justify-self-center text-xl text-label">{label}</Label>}
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
value={textValue}
|
value={textValue}
|
||||||
onChange={handleInputChange}
|
onChange={handleInputChange}
|
||||||
onFocus={onInputFocus}
|
onFocus={onInputFocus}
|
||||||
className="w-[200px] ml-6 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
|
className="ml-6 w-[200px] rounded-md border border-input bg-form px-3 py-2 text-foreground focus:outline-none focus:ring-2 focus:ring-ring"
|
||||||
placeholder={`${label}을(를) 입력하세요`}
|
placeholder={`${label}을(를) 입력하세요`}
|
||||||
/>
|
/>
|
||||||
{isOpen && processFacilityList.length > 0 && (
|
{isOpen && processFacilityList.length > 0 && (
|
||||||
<div className="absolute z-10 w-[300px] px-2 py-1 !mt-5 ml-20 bg-white border border-gray-300 rounded-md shadow-lg h-90 overflow-auto">
|
<div className="absolute z-10 ml-20 !mt-5 h-[90px] w-[300px] overflow-auto rounded-md border border-border bg-popover px-2 py-1 text-popover-foreground shadow-lg">
|
||||||
<div className="max-h-72">
|
<div className="max-h-72">
|
||||||
{processFacilityList.map((item : facilityListProps, index : number) => (
|
{processFacilityList.map((item : facilityListProps, index : number) => (
|
||||||
<div
|
<div
|
||||||
key={index}
|
key={index}
|
||||||
className="w-full text-left pl-1 pr-10 py-2 hover:bg-gray-100 cursor-pointer overflow-auto"
|
className="w-full cursor-pointer overflow-auto py-2 pl-1 pr-10 text-left hover:bg-accent hover:text-accent-foreground"
|
||||||
onClick={() => handleSuggestionClick(item.bscFctCd, item.bscFctNm, Number(item.fctCpc), item.trtFrfNm, item.efflWqltStndrdNm)}
|
onClick={() => handleSuggestionClick(item.bscFctCd, item.bscFctNm, Number(item.fctCpc), item.trtFrfNm, item.efflWqltStndrdNm)}
|
||||||
role="button"
|
role="button"
|
||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ function UnderComment({commentStartPoint="☞", commentArray=[], divHeight="14"}
|
|||||||
<div className={"mt-"+divHeight}>
|
<div className={"mt-"+divHeight}>
|
||||||
{commentArray.map((item, index) => (
|
{commentArray.map((item, index) => (
|
||||||
<React.Fragment key={"comment" + index}>
|
<React.Fragment key={"comment" + index}>
|
||||||
<span className="text-2xl font-bold text-gray-500">
|
<span className="text-2xl font-bold text-muted-foreground">
|
||||||
{commentStartPoint} {item}
|
{commentStartPoint} {item}
|
||||||
</span>
|
</span>
|
||||||
<br/>
|
<br/>
|
||||||
@@ -28,4 +28,4 @@ function UnderComment({commentStartPoint="☞", commentArray=[], divHeight="14"}
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default UnderComment;
|
export default UnderComment;
|
||||||
|
|||||||
@@ -127,15 +127,18 @@ const Map = () => {
|
|||||||
}
|
}
|
||||||
const el = overlayContainerRef.current;
|
const el = overlayContainerRef.current;
|
||||||
el.className =
|
el.className =
|
||||||
"ol-custom-overlay shadow-xl rounded-2xl bg-white/95 backdrop-blur p-3 border border-gray-200 min-w-[220px] max-w-[350px] ";
|
"ol-custom-overlay shadow-xl rounded-2xl backdrop-blur p-3 min-w-[220px] max-w-[350px]";
|
||||||
|
el.style.backgroundColor = "color-mix(in srgb, var(--popover) 95%, transparent)";
|
||||||
|
el.style.color = "var(--popover-foreground)";
|
||||||
|
el.style.border = "1px solid var(--border)";
|
||||||
el.innerHTML = `
|
el.innerHTML = `
|
||||||
<div class="font-semibold text-lg text-gray-800 mb-2 text-center bg-green-400">${title}</div>
|
<div class="mb-2 rounded-md px-2 py-1 text-center text-lg font-semibold" style="background-color: var(--secondary); color: var(--secondary-foreground);">${title}</div>
|
||||||
<table class="w-full text-base text-gray-800">
|
<table class="w-full text-base" style="color: var(--foreground);">
|
||||||
${Object.entries(props)
|
${Object.entries(props)
|
||||||
.map(
|
.map(
|
||||||
([k, v]) => `
|
([k, v]) => `
|
||||||
<tr>
|
<tr>
|
||||||
<td class="py-1 pr-2 text-gray-500 whitespace-nowrap">${k}</td>
|
<td class="whitespace-nowrap py-1 pr-2" style="color: var(--muted-foreground);">${k}</td>
|
||||||
<td class="py-1 font-medium">${safe(v)}</td>
|
<td class="py-1 font-medium">${safe(v)}</td>
|
||||||
</tr>`
|
</tr>`
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -54,23 +54,23 @@ export default function DrainageEquipment({searchYear = '', fcltyList = []}: Dra
|
|||||||
const HeadMakeColSpan = ({ upHeadList }: { upHeadList: TableUpperProps[] }) => {
|
const HeadMakeColSpan = ({ upHeadList }: { upHeadList: TableUpperProps[] }) => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<TableRow className="bg-gray-50">{upHeadList.map((head: TableUpperProps) =>
|
<TableRow className="bg-secondary">{upHeadList.map((head: TableUpperProps) =>
|
||||||
(head.id === 'part1' ? <TableHead rowSpan={3} className='w-60' key={head.id}>구분</TableHead> :
|
(head.id === 'part1' ? <TableHead rowSpan={3} className='w-60' key={head.id}>구분</TableHead> :
|
||||||
head.id === 'part2' ? <TableHead rowSpan={3} className='w-60' key={head.id}>구분</TableHead> :
|
head.id === 'part2' ? <TableHead rowSpan={3} className='w-60' key={head.id}>구분</TableHead> :
|
||||||
head.id == 'nowSum' ? <TableHead rowSpan={2} colSpan={3} key={head.id} style={{ whiteSpace: 'pre-line' }}>{'현재\n(기준년도)'}</TableHead> :
|
head.id == 'nowSum' ? <TableHead rowSpan={2} colSpan={3} key={head.id} style={{ whiteSpace: 'pre-line' }}>{'현재\n(기준년도)'}</TableHead> :
|
||||||
head.id == 'stepOneSum' ? <TableHead rowSpan={1} colSpan={12} key={head.id} style={{ whiteSpace: 'pre-line' }}>{'변경(금회계획)'}</TableHead> :
|
head.id == 'stepOneSum' ? <TableHead rowSpan={1} colSpan={12} key={head.id} style={{ whiteSpace: 'pre-line' }}>{'변경(금회계획)'}</TableHead> :
|
||||||
head.id == 'etc' ? <TableHead rowSpan={3} key={head.id}>비고</TableHead> : null))}
|
head.id == 'etc' ? <TableHead rowSpan={3} key={head.id}>비고</TableHead> : null))}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
<TableRow className="bg-gray-50">{upHeadList.map((head: TableUpperProps) =>
|
<TableRow className="bg-secondary">{upHeadList.map((head: TableUpperProps) =>
|
||||||
(head.id === 'stepOneSum' ? <TableHead rowSpan={1} colSpan={3} key={head.id}>1단계</TableHead> :
|
(head.id === 'stepOneSum' ? <TableHead rowSpan={1} colSpan={3} key={head.id}>1단계</TableHead> :
|
||||||
head.id === 'stepTwoSum' ? <TableHead rowSpan={1} colSpan={3} key={head.id}>2단계</TableHead> :
|
head.id === 'stepTwoSum' ? <TableHead rowSpan={1} colSpan={3} key={head.id}>2단계</TableHead> :
|
||||||
head.id === 'stepThreeSum' ? <TableHead rowSpan={1} colSpan={3} key={head.id}>3단계</TableHead> :
|
head.id === 'stepThreeSum' ? <TableHead rowSpan={1} colSpan={3} key={head.id}>3단계</TableHead> :
|
||||||
head.id === 'stepFourSum' ? <TableHead rowSpan={1} colSpan={3} key={head.id}>4단계</TableHead> : null))}
|
head.id === 'stepFourSum' ? <TableHead rowSpan={1} colSpan={3} key={head.id}>4단계</TableHead> : null))}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
<TableRow className="bg-gray-50">
|
<TableRow className="bg-secondary">
|
||||||
{upHeadList.map((head: TableUpperProps) => {
|
{upHeadList.map((head: TableUpperProps) => {
|
||||||
if (head.upName === 'upChangeRe2' || head.upName === 'upChangeRe3' || head.upName === 'upChangeRe4' || head.upName === 'upChangeRe5' || head.upName === 'upChangeRe6') {
|
if (head.upName === 'upChangeRe2' || head.upName === 'upChangeRe3' || head.upName === 'upChangeRe4' || head.upName === 'upChangeRe5' || head.upName === 'upChangeRe6') {
|
||||||
return <TableHead key={head.id} style={{ whiteSpace: 'pre-line' }} className="w-40 bg-gray-50">{head.title}</TableHead>;
|
return <TableHead key={head.id} style={{ whiteSpace: 'pre-line' }} className="w-40 bg-secondary">{head.title}</TableHead>;
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ export default function DashBoardChartModal({item='', period='', title='',modalD
|
|||||||
if (label) {
|
if (label) {
|
||||||
config[label] = {
|
config[label] = {
|
||||||
label: label,
|
label: label,
|
||||||
color : "hsl(var(--chart-1))"
|
color : "var(--chart-1)"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return config;
|
return config;
|
||||||
|
|||||||
@@ -32,12 +32,12 @@ const headMakeColSpanPlanFclty = (upHeadList: TableUpperProps[], planYearList: s
|
|||||||
return ( <>
|
return ( <>
|
||||||
<TableRow>{
|
<TableRow>{
|
||||||
upHeadList.map((head: TableUpperProps) =>
|
upHeadList.map((head: TableUpperProps) =>
|
||||||
(!head.upSequnce?<TableHead rowSpan={2}key={head.id}>{head.title}</TableHead>:
|
(!head.upSequnce?<TableHead className="fo-facility-info-header-surface" rowSpan={2}key={head.id}>{head.title}</TableHead>:
|
||||||
head.upName === 'upChangeRe'&& head.upSequnce=== 1?<TableHead key={head.id} rowSpan={1} colSpan={7} style={{ whiteSpace: 'pre-line' }}>{'시설계획\n(금회)'}</TableHead>:null))}
|
head.upName === 'upChangeRe'&& head.upSequnce=== 1?<TableHead className="fo-facility-info-header-surface" key={head.id} rowSpan={1} colSpan={7} style={{ whiteSpace: 'pre-line' }}>{'시설계획\n(금회)'}</TableHead>:null))}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
{upHeadList.map((head: TableUpperProps, index: number) =>
|
{upHeadList.map((head: TableUpperProps, index: number) =>
|
||||||
(head.upName === 'upChangeRe'?<TableHead key={head.id} style={{ whiteSpace: 'pre-line' }}>{index===0?head.title:head.title+'\n('+planYearList[index-1]+')'}</TableHead>:null))}
|
(head.upName === 'upChangeRe'?<TableHead className="fo-facility-info-header-surface" key={head.id} style={{ whiteSpace: 'pre-line' }}>{index===0?head.title:head.title+'\n('+planYearList[index-1]+')'}</TableHead>:null))}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</> )
|
</> )
|
||||||
}
|
}
|
||||||
@@ -52,20 +52,20 @@ const headMakeColSpanPlanFclty = (upHeadList: TableUpperProps[], planYearList: s
|
|||||||
const headMakeColSpanOperationStatus = (upHeadList: TableUpperProps[], searchYear: string) => {
|
const headMakeColSpanOperationStatus = (upHeadList: TableUpperProps[], searchYear: string) => {
|
||||||
return ( <>
|
return ( <>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableHead rowSpan={1} colSpan={17} style={{ whiteSpace: 'pre-line' }}>{searchYear+'년도 운영실태'}</TableHead>
|
<TableHead className="fo-facility-info-header-surface" rowSpan={1} colSpan={17} style={{ whiteSpace: 'pre-line' }}>{searchYear+'년도 운영실태'}</TableHead>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
<TableRow>{
|
<TableRow>{
|
||||||
upHeadList.map((head: TableUpperProps) =>
|
upHeadList.map((head: TableUpperProps) =>
|
||||||
(head.upName === 'upChangeRe1'&&head.upSequnce===1?<TableHead key={head.id} rowSpan={2}colSpan={2} style={{ whiteSpace: 'pre-line' }}>{head.title}</TableHead>:
|
(head.upName === 'upChangeRe1'&&head.upSequnce===1?<TableHead className="fo-facility-info-header-surface" key={head.id} rowSpan={2}colSpan={2} style={{ whiteSpace: 'pre-line' }}>{head.title}</TableHead>:
|
||||||
!head.upSequnce?<TableHead style={{ whiteSpace: 'pre-line' }} rowSpan={2}key={head.id}>{head.title}</TableHead>:
|
!head.upSequnce?<TableHead className="fo-facility-info-header-surface" style={{ whiteSpace: 'pre-line' }} rowSpan={2}key={head.id}>{head.title}</TableHead>:
|
||||||
head.upName === 'upChangeRe2'&&head.upSequnce===1?<TableHead key={head.id} colSpan={3} style={{ whiteSpace: 'pre-line' }}>{'연간 운영실태'}</TableHead>:
|
head.upName === 'upChangeRe2'&&head.upSequnce===1?<TableHead className="fo-facility-info-header-surface" key={head.id} colSpan={3} style={{ whiteSpace: 'pre-line' }}>{'연간 운영실태'}</TableHead>:
|
||||||
head.upName === 'upChangeRe3'&&head.upSequnce===1?<TableHead key={head.id} colSpan={3} style={{ whiteSpace: 'pre-line' }}>{'하절기 운영실태\n(6~8월)'}</TableHead>:
|
head.upName === 'upChangeRe3'&&head.upSequnce===1?<TableHead className="fo-facility-info-header-surface" key={head.id} colSpan={3} style={{ whiteSpace: 'pre-line' }}>{'하절기 운영실태\n(6~8월)'}</TableHead>:
|
||||||
head.upName === 'upChangeRe4'&&head.upSequnce===1?<TableHead key={head.id} colSpan={4} style={{ whiteSpace: 'pre-line' }}>{'동절기 운영실태\n(1~2월)'}</TableHead>:
|
head.upName === 'upChangeRe4'&&head.upSequnce===1?<TableHead className="fo-facility-info-header-surface" key={head.id} colSpan={4} style={{ whiteSpace: 'pre-line' }}>{'동절기 운영실태\n(1~2월)'}</TableHead>:
|
||||||
head.upName === 'upChangeRe5'&&head.upSequnce===1?<TableHead key={head.id} colSpan={3} style={{ whiteSpace: 'pre-line' }}>{'지하수 유입량 추정'}</TableHead>:null))}
|
head.upName === 'upChangeRe5'&&head.upSequnce===1?<TableHead className="fo-facility-info-header-surface" key={head.id} colSpan={3} style={{ whiteSpace: 'pre-line' }}>{'지하수 유입량 추정'}</TableHead>:null))}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
{upHeadList.map((head: TableUpperProps) =>
|
{upHeadList.map((head: TableUpperProps) =>
|
||||||
(head.upName === 'upChangeRe2'||head.upName === 'upChangeRe3'||head.upName === 'upChangeRe4'||head.upName === 'upChangeRe5'?<TableHead style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead>:null))}
|
(head.upName === 'upChangeRe2'||head.upName === 'upChangeRe3'||head.upName === 'upChangeRe4'||head.upName === 'upChangeRe5'?<TableHead className="fo-facility-info-header-surface" style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead>:null))}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</> )
|
</> )
|
||||||
}
|
}
|
||||||
@@ -239,18 +239,18 @@ export default function ProcessFacilitySearch({searchYear = '', fcltyList = []}:
|
|||||||
:((index === 6 || index === 7 || index === 8) && (head.id === 'now' || head.id === 'stepOne' || head.id === 'stepThree' || head.id === 'stepFour'))?
|
:((index === 6 || index === 7 || index === 8) && (head.id === 'now' || head.id === 'stepOne' || head.id === 'stepThree' || head.id === 'stepFour'))?
|
||||||
null
|
null
|
||||||
:((index === 5) && (head.id === 'provisionalApproval' || head.id === 'stepTwo'))?
|
:((index === 5) && (head.id === 'provisionalApproval' || head.id === 'stepTwo'))?
|
||||||
<TableCell colSpan={3} className="text-center border border-[var(--border)] bg-[rgb(234,243,251)] text-[rgb(100,119,132)]" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{el[head.id]}</TableCell>
|
<TableCell colSpan={3} className="fo-facility-info-header-surface text-center" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{el[head.id]}</TableCell>
|
||||||
:((index === 5) && (head.id === 'now' || head.id === 'stepOne' || head.id === 'stepThree'|| head.id === 'stepFour'))?
|
:((index === 5) && (head.id === 'now' || head.id === 'stepOne' || head.id === 'stepThree'|| head.id === 'stepFour'))?
|
||||||
null
|
null
|
||||||
:(index < 5 || index > 5)&& (index!= 4) && (head.id ==='provisionalApproval'||head.id ==='now'||head.id ==='stepOne'||head.id ==='stepTwo'||head.id ==='stepThree'||head.id ==='stepFour')
|
:(index < 5 || index > 5)&& (index!= 4) && (head.id ==='provisionalApproval'||head.id ==='now'||head.id ==='stepOne'||head.id ==='stepTwo'||head.id ==='stepThree'||head.id ==='stepFour')
|
||||||
?<TableCell className="text-right" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{el[head.id]}</TableCell>
|
?<TableCell className="text-right" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{el[head.id]}</TableCell>
|
||||||
:(head.id === "provisionalApproval" && index === 4)
|
:(head.id === "provisionalApproval" && index === 4)
|
||||||
?<TableCell colSpan={6} className="text-right border border-[var(--border)] text-[rgb(100,119,132)]" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{roundNumber(String((Number(waterUsage1)+Number(waterUsage2)+Number(waterUsage3))/3), 0)}</TableCell>
|
?<TableCell colSpan={6} className="text-right border border-border text-label" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{roundNumber(String((Number(waterUsage1)+Number(waterUsage2)+Number(waterUsage3))/3), 0)}</TableCell>
|
||||||
:((head.id ==='now'||head.id ==='stepOne'||head.id ==='stepTwo'||head.id ==='stepThree'||head.id ==='stepFour') )
|
:((head.id ==='now'||head.id ==='stepOne'||head.id ==='stepTwo'||head.id ==='stepThree'||head.id ==='stepFour') )
|
||||||
?null
|
?null
|
||||||
:(head.id === 'item' && index != 5)?
|
:(head.id === 'item' && index != 5)?
|
||||||
<TableCell className="text-center text-[rgb(100,119,132)]" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{el[head.id]}</TableCell>
|
<TableCell className="text-center text-label" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{el[head.id]}</TableCell>
|
||||||
:<TableCell className="text-center border border-[var(--border)] bg-[rgb(234,243,251)] text-[rgb(100,119,132)]" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{el[head.id]}</TableCell>
|
:<TableCell className="fo-facility-info-header-surface text-center" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{el[head.id]}</TableCell>
|
||||||
))}
|
))}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
))}
|
))}
|
||||||
@@ -278,15 +278,15 @@ export default function ProcessFacilitySearch({searchYear = '', fcltyList = []}:
|
|||||||
(head.id === 'rdiRain'&&index === 0)?<TableCell rowSpan={7} className="text-right" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{el['rdiRain']}</TableCell>:
|
(head.id === 'rdiRain'&&index === 0)?<TableCell rowSpan={7} className="text-right" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{el['rdiRain']}</TableCell>:
|
||||||
(head.id === 'rdiRain'&&index === 7)?<TableCell rowSpan={6} className="text-right" style={{ whiteSpace: 'pre-line' }} key={head.id+index}></TableCell>:
|
(head.id === 'rdiRain'&&index === 7)?<TableCell rowSpan={6} className="text-right" style={{ whiteSpace: 'pre-line' }} key={head.id+index}></TableCell>:
|
||||||
(head.id === 'waterQlty')?<TableCell className="text-center" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{el[head.id]}</TableCell>:
|
(head.id === 'waterQlty')?<TableCell className="text-center" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{el[head.id]}</TableCell>:
|
||||||
((head.id === 'yearAvg' || head.id === 'yearMax' || head.id === 'yearMin') && (index>=0 && index<=4))?<TableCell className="bg-yellow-50 text-right cursor-pointer" style={{ whiteSpace: 'pre-line' }} key={head.id+index} onClick={()=>{fncLoadModal('flowRate', 'year', el['waterQlty'] as string);}}>{el[head.id]}</TableCell>:
|
((head.id === 'yearAvg' || head.id === 'yearMax' || head.id === 'yearMin') && (index>=0 && index<=4))?<TableCell className="fo-facility-info-flow-year text-right cursor-pointer" style={{ whiteSpace: 'pre-line' }} key={head.id+index} onClick={()=>{fncLoadModal('flowRate', 'year', el['waterQlty'] as string);}}>{el[head.id]}</TableCell>:
|
||||||
((head.id === 'yearAvg' || head.id === 'yearMax' || head.id === 'yearMin') && (index>=5 && index<=10))?<TableCell className="bg-green-50 text-right cursor-pointer" style={{ whiteSpace: 'pre-line' }} key={head.id+index} onClick={()=>{fncLoadModal('waterQlty', 'year', el['waterQlty'] as string);}}>{el[head.id]}</TableCell>:
|
((head.id === 'yearAvg' || head.id === 'yearMax' || head.id === 'yearMin') && (index>=5 && index<=10))?<TableCell className="fo-facility-info-water-year text-right cursor-pointer" style={{ whiteSpace: 'pre-line' }} key={head.id+index} onClick={()=>{fncLoadModal('waterQlty', 'year', el['waterQlty'] as string);}}>{el[head.id]}</TableCell>:
|
||||||
((head.id === 'yearAvg' || head.id === 'yearMax' || head.id === 'yearMin') && (index>=11 && index<=12))?<TableCell className="bg-blue-50 text-right cursor-pointer" style={{ whiteSpace: 'pre-line' }} key={head.id+index} onClick={()=>{fncLoadModal('chongin', 'year', el['waterQlty'] as string);}}>{el[head.id]}</TableCell>:
|
((head.id === 'yearAvg' || head.id === 'yearMax' || head.id === 'yearMin') && (index>=11 && index<=12))?<TableCell className="fo-facility-info-phosphorus-year text-right cursor-pointer" style={{ whiteSpace: 'pre-line' }} key={head.id+index} onClick={()=>{fncLoadModal('chongin', 'year', el['waterQlty'] as string);}}>{el[head.id]}</TableCell>:
|
||||||
((head.id === 'summerAll' || head.id === 'summerThree' || head.id === 'summerRain') && (index>=0 && index<=4))?<TableCell className="bg-yellow-100 text-right cursor-pointer" style={{ whiteSpace: 'pre-line' }} key={head.id+index} onClick={()=>{fncLoadModal('flowRate', 'summer', el['waterQlty'] as string);}}>{el[head.id]}</TableCell>:
|
((head.id === 'summerAll' || head.id === 'summerThree' || head.id === 'summerRain') && (index>=0 && index<=4))?<TableCell className="fo-facility-info-flow-summer text-right cursor-pointer" style={{ whiteSpace: 'pre-line' }} key={head.id+index} onClick={()=>{fncLoadModal('flowRate', 'summer', el['waterQlty'] as string);}}>{el[head.id]}</TableCell>:
|
||||||
((head.id === 'summerAll' || head.id === 'summerThree' || head.id === 'summerRain') && (index>=5 && index<=10))?<TableCell className="bg-green-100 text-right cursor-pointer" style={{ whiteSpace: 'pre-line' }} key={head.id+index} onClick={()=>{fncLoadModal('waterQlty', 'summer', el['waterQlty'] as string);}}>{el[head.id]}</TableCell>:
|
((head.id === 'summerAll' || head.id === 'summerThree' || head.id === 'summerRain') && (index>=5 && index<=10))?<TableCell className="fo-facility-info-water-summer text-right cursor-pointer" style={{ whiteSpace: 'pre-line' }} key={head.id+index} onClick={()=>{fncLoadModal('waterQlty', 'summer', el['waterQlty'] as string);}}>{el[head.id]}</TableCell>:
|
||||||
((head.id === 'summerAll' || head.id === 'summerThree' || head.id === 'summerRain') && (index>=11 && index<=12))?<TableCell className="bg-blue-100 text-right cursor-pointer" style={{ whiteSpace: 'pre-line' }} key={head.id+index} onClick={()=>{fncLoadModal('chongin', 'summer', el['waterQlty'] as string);}}>{el[head.id]}</TableCell>:
|
((head.id === 'summerAll' || head.id === 'summerThree' || head.id === 'summerRain') && (index>=11 && index<=12))?<TableCell className="fo-facility-info-phosphorus-summer text-right cursor-pointer" style={{ whiteSpace: 'pre-line' }} key={head.id+index} onClick={()=>{fncLoadModal('chongin', 'summer', el['waterQlty'] as string);}}>{el[head.id]}</TableCell>:
|
||||||
((head.id === 'winterAll' || head.id === 'winterSunnyAvg' || head.id === 'winterSunnyMax' || head.id === 'winterSunnyMin') && (index>=0 && index<=4))?<TableCell className="bg-yellow-200 text-right cursor-pointer" style={{ whiteSpace: 'pre-line' }} key={head.id+index} onClick={()=>{fncLoadModal('flowRate', 'winter', el['waterQlty'] as string);}}>{el[head.id]}</TableCell>:
|
((head.id === 'winterAll' || head.id === 'winterSunnyAvg' || head.id === 'winterSunnyMax' || head.id === 'winterSunnyMin') && (index>=0 && index<=4))?<TableCell className="fo-facility-info-flow-winter text-right cursor-pointer" style={{ whiteSpace: 'pre-line' }} key={head.id+index} onClick={()=>{fncLoadModal('flowRate', 'winter', el['waterQlty'] as string);}}>{el[head.id]}</TableCell>:
|
||||||
((head.id === 'winterAll' || head.id === 'winterSunnyAvg' || head.id === 'winterSunnyMax' || head.id === 'winterSunnyMin') && (index>=5 && index<=10))?<TableCell className="bg-green-200 text-right cursor-pointer" style={{ whiteSpace: 'pre-line' }} key={head.id+index} onClick={()=>{fncLoadModal('waterQlty', 'winter', el['waterQlty'] as string);}}>{el[head.id]}</TableCell>:
|
((head.id === 'winterAll' || head.id === 'winterSunnyAvg' || head.id === 'winterSunnyMax' || head.id === 'winterSunnyMin') && (index>=5 && index<=10))?<TableCell className="fo-facility-info-water-winter text-right cursor-pointer" style={{ whiteSpace: 'pre-line' }} key={head.id+index} onClick={()=>{fncLoadModal('waterQlty', 'winter', el['waterQlty'] as string);}}>{el[head.id]}</TableCell>:
|
||||||
((head.id === 'winterAll' || head.id === 'winterSunnyAvg' || head.id === 'winterSunnyMax' || head.id === 'winterSunnyMin') && (index>=11 && index<=12))?<TableCell className="bg-blue-200 text-right cursor-pointer" style={{ whiteSpace: 'pre-line' }} key={head.id+index} onClick={()=>{fncLoadModal('chongin', 'winter', el['waterQlty'] as string);}}>{el[head.id]}</TableCell>:
|
((head.id === 'winterAll' || head.id === 'winterSunnyAvg' || head.id === 'winterSunnyMax' || head.id === 'winterSunnyMin') && (index>=11 && index<=12))?<TableCell className="fo-facility-info-phosphorus-winter text-right cursor-pointer" style={{ whiteSpace: 'pre-line' }} key={head.id+index} onClick={()=>{fncLoadModal('chongin', 'winter', el['waterQlty'] as string);}}>{el[head.id]}</TableCell>:
|
||||||
null
|
null
|
||||||
))}
|
))}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|||||||
@@ -60,7 +60,14 @@ export default function DashBoardChart({searchYear = '', fcltyList = []}: facili
|
|||||||
/**
|
/**
|
||||||
* 차트 Config
|
* 차트 Config
|
||||||
*/
|
*/
|
||||||
const colors = ["#FF6B6B", "#4ECDC4", "#45B7D1", "#96CEB4", "#00b50c", "#D4A5A5"];
|
const colors = [
|
||||||
|
"var(--chart-5)",
|
||||||
|
"var(--chart-2)",
|
||||||
|
"var(--chart-1)",
|
||||||
|
"var(--chart-3)",
|
||||||
|
"var(--primary)",
|
||||||
|
"var(--chart-6)",
|
||||||
|
];
|
||||||
|
|
||||||
//유입하수량-강수량
|
//유입하수량-강수량
|
||||||
const chartConfig_inflowRain = {
|
const chartConfig_inflowRain = {
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ export default function RainManageTab({ searchYear = '', fcltyList = [] }: facil
|
|||||||
widthFixed={true}
|
widthFixed={true}
|
||||||
>
|
>
|
||||||
</UiTable>
|
</UiTable>
|
||||||
<span className="text-2xl font-bold text-gray-500">☞ 일수에 강우영향일 포함됨</span>
|
<span className="text-2xl font-bold text-muted-foreground">☞ 일수에 강우영향일 포함됨</span>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* 대시보드 - 표로보기 상단구역 페에지
|
* 대시보드 - 표로보기 상단구역 페이지
|
||||||
*
|
*
|
||||||
* - 대시보드 - 표로보기의 3개의 탭 상단에 조회년도, 행정정보, 시설명의 구역을 컴포넌트
|
* - 대시보드 - 표로보기의 3개의 탭 상단에 조회년도, 행정정보, 시설명의 구역을 컴포넌트
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ export default function PrecipitationModal(props: PrecipitationModalProps) {
|
|||||||
mode="single"
|
mode="single"
|
||||||
selected={startDate}
|
selected={startDate}
|
||||||
onSelect={(date) => handleStartDateSelect(date as Date)}
|
onSelect={(date) => handleStartDateSelect(date as Date)}
|
||||||
className="w-full p-1 border rounded bg-white"
|
className="w-full rounded border border-input bg-form p-1 text-foreground"
|
||||||
disabled={(date) => !isDateInRanges(date)}
|
disabled={(date) => !isDateInRanges(date)}
|
||||||
defaultMonth={startDate}
|
defaultMonth={startDate}
|
||||||
/>
|
/>
|
||||||
@@ -209,7 +209,7 @@ export default function PrecipitationModal(props: PrecipitationModalProps) {
|
|||||||
mode="single"
|
mode="single"
|
||||||
selected={endDate}
|
selected={endDate}
|
||||||
onSelect={(date) => handleEndDateSelect(date as Date)}
|
onSelect={(date) => handleEndDateSelect(date as Date)}
|
||||||
className="w-full p-1 border rounded bg-white"
|
className="w-full rounded border border-input bg-form p-1 text-foreground"
|
||||||
disabled={(date) => !isDateInRanges(date)}
|
disabled={(date) => !isDateInRanges(date)}
|
||||||
defaultMonth={endDate}
|
defaultMonth={endDate}
|
||||||
/>
|
/>
|
||||||
@@ -239,4 +239,4 @@ export default function PrecipitationModal(props: PrecipitationModalProps) {
|
|||||||
</ListDiv>
|
</ListDiv>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,27 +17,27 @@ const HeadMakeColSpan = ({ upHeadList, layoutNum }: { upHeadList: TableUpperProp
|
|||||||
return (
|
return (
|
||||||
layoutNum === 0 ? (
|
layoutNum === 0 ? (
|
||||||
<>
|
<>
|
||||||
<TableRow className="bg-gray-50">
|
<TableRow className="bg-secondary">
|
||||||
{upHeadList.map((head: TableUpperProps) => {
|
{upHeadList.map((head: TableUpperProps) => {
|
||||||
if(!head.upName) {
|
if(!head.upName) {
|
||||||
return <TableHead className="bg-gray-50" rowSpan={2} style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead>
|
return <TableHead className="bg-secondary" rowSpan={2} style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead>
|
||||||
}else if(head.upName==="upChangeRe1"&&head.upSequnce===1) {
|
}else if(head.upName==="upChangeRe1"&&head.upSequnce===1) {
|
||||||
return <TableHead className="bg-gray-50" colSpan={2} style={{ whiteSpace: 'pre-line' }} key={head.id}>행정구역</TableHead>
|
return <TableHead className="bg-secondary" colSpan={2} style={{ whiteSpace: 'pre-line' }} key={head.id}>행정구역</TableHead>
|
||||||
}else if(head.upName==="upChangeRe3"&&head.upSequnce===1) {
|
}else if(head.upName==="upChangeRe3"&&head.upSequnce===1) {
|
||||||
return <TableHead className="bg-gray-50" colSpan={5} style={{ whiteSpace: 'pre-line' }} key={head.id}>유입</TableHead>
|
return <TableHead className="bg-secondary" colSpan={5} style={{ whiteSpace: 'pre-line' }} key={head.id}>유입</TableHead>
|
||||||
}else if(head.upName==="upChangeRe4"&&head.upSequnce===1) {
|
}else if(head.upName==="upChangeRe4"&&head.upSequnce===1) {
|
||||||
return <TableHead className="bg-gray-50" colSpan={5} style={{ whiteSpace: 'pre-line' }} key={head.id}>유출</TableHead>
|
return <TableHead className="bg-secondary" colSpan={5} style={{ whiteSpace: 'pre-line' }} key={head.id}>유출</TableHead>
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
<TableRow className="bg-gray-50">
|
<TableRow className="bg-secondary">
|
||||||
{upHeadList.map((head: TableUpperProps, idx: number) => {
|
{upHeadList.map((head: TableUpperProps, idx: number) => {
|
||||||
if (head.upName === 'upChangeRe1' || head.upName === 'upChangeRe3' || head.upName === 'upChangeRe4') {
|
if (head.upName === 'upChangeRe1' || head.upName === 'upChangeRe3' || head.upName === 'upChangeRe4') {
|
||||||
if (idx == 1 || idx == 2 || idx == 3) {
|
if (idx == 1 || idx == 2 || idx == 3) {
|
||||||
return <TableHead key={head.id} style={{ whiteSpace: 'pre-line' }} className="w-1/8 bg-gray-50">{head.title}</TableHead>;
|
return <TableHead key={head.id} style={{ whiteSpace: 'pre-line' }} className="w-1/8 bg-secondary">{head.title}</TableHead>;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return <TableHead key={head.id} style={{ whiteSpace: 'pre-line' }} className="w-1/8 bg-gray-50">{head.title}</TableHead>;
|
return <TableHead key={head.id} style={{ whiteSpace: 'pre-line' }} className="w-1/8 bg-secondary">{head.title}</TableHead>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
@@ -45,27 +45,27 @@ const HeadMakeColSpan = ({ upHeadList, layoutNum }: { upHeadList: TableUpperProp
|
|||||||
</>
|
</>
|
||||||
) : layoutNum === 1 ? (
|
) : layoutNum === 1 ? (
|
||||||
<>
|
<>
|
||||||
<TableRow className="bg-gray-50">
|
<TableRow className="bg-secondary">
|
||||||
{upHeadList.map((head: TableUpperProps) => {
|
{upHeadList.map((head: TableUpperProps) => {
|
||||||
if(!head.upName) {
|
if(!head.upName) {
|
||||||
return <TableHead className="bg-gray-50" rowSpan={2} style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead>
|
return <TableHead className="bg-secondary" rowSpan={2} style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead>
|
||||||
}else if(head.upName==="upChangeRe1"&&head.upSequnce===1) {
|
}else if(head.upName==="upChangeRe1"&&head.upSequnce===1) {
|
||||||
return <TableHead className="bg-gray-50" colSpan={3} style={{ whiteSpace: 'pre-line' }} key={head.id}>권역</TableHead>
|
return <TableHead className="bg-secondary" colSpan={3} style={{ whiteSpace: 'pre-line' }} key={head.id}>권역</TableHead>
|
||||||
}else if(head.upName==="upChangeRe3"&&head.upSequnce===1) {
|
}else if(head.upName==="upChangeRe3"&&head.upSequnce===1) {
|
||||||
return <TableHead className="bg-gray-50" colSpan={5} style={{ whiteSpace: 'pre-line' }} key={head.id}>유입</TableHead>
|
return <TableHead className="bg-secondary" colSpan={5} style={{ whiteSpace: 'pre-line' }} key={head.id}>유입</TableHead>
|
||||||
}else if(head.upName==="upChangeRe4"&&head.upSequnce===1) {
|
}else if(head.upName==="upChangeRe4"&&head.upSequnce===1) {
|
||||||
return <TableHead className="bg-gray-50" colSpan={5} style={{ whiteSpace: 'pre-line' }} key={head.id}>유출</TableHead>
|
return <TableHead className="bg-secondary" colSpan={5} style={{ whiteSpace: 'pre-line' }} key={head.id}>유출</TableHead>
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
<TableRow className="bg-gray-50">
|
<TableRow className="bg-secondary">
|
||||||
{upHeadList.map((head: TableUpperProps, idx: number) => {
|
{upHeadList.map((head: TableUpperProps, idx: number) => {
|
||||||
if (head.upName === 'upChangeRe1' || head.upName === 'upChangeRe3' || head.upName === 'upChangeRe4') {
|
if (head.upName === 'upChangeRe1' || head.upName === 'upChangeRe3' || head.upName === 'upChangeRe4') {
|
||||||
if (idx == 1 || idx == 2 || idx == 3) {
|
if (idx == 1 || idx == 2 || idx == 3) {
|
||||||
return <TableHead key={head.id} style={{ whiteSpace: 'pre-line' }} className="w-1/8 bg-gray-50">{head.title}</TableHead>;
|
return <TableHead key={head.id} style={{ whiteSpace: 'pre-line' }} className="w-1/8 bg-secondary">{head.title}</TableHead>;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return <TableHead key={head.id} style={{ whiteSpace: 'pre-line' }} className="w-1/8 bg-gray-50">{head.title}</TableHead>;
|
return <TableHead key={head.id} style={{ whiteSpace: 'pre-line' }} className="w-1/8 bg-secondary">{head.title}</TableHead>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
@@ -73,29 +73,29 @@ const HeadMakeColSpan = ({ upHeadList, layoutNum }: { upHeadList: TableUpperProp
|
|||||||
</>
|
</>
|
||||||
) : layoutNum === 2 ? (
|
) : layoutNum === 2 ? (
|
||||||
<>
|
<>
|
||||||
<TableRow className="bg-gray-50">
|
<TableRow className="bg-secondary">
|
||||||
{upHeadList.map((head: TableUpperProps) => {
|
{upHeadList.map((head: TableUpperProps) => {
|
||||||
if(!head.upName) {
|
if(!head.upName) {
|
||||||
return <TableHead className="bg-gray-50" rowSpan={2} style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead>
|
return <TableHead className="bg-secondary" rowSpan={2} style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead>
|
||||||
}else if(head.upName==="upChangeRe1"&&head.upSequnce===1) {
|
}else if(head.upName==="upChangeRe1"&&head.upSequnce===1) {
|
||||||
return <TableHead className="bg-gray-50" colSpan={3} style={{ whiteSpace: 'pre-line' }} key={head.id}>권역</TableHead>
|
return <TableHead className="bg-secondary" colSpan={3} style={{ whiteSpace: 'pre-line' }} key={head.id}>권역</TableHead>
|
||||||
}else if(head.upName==="upChangeRe2"&&head.upSequnce===1) {
|
}else if(head.upName==="upChangeRe2"&&head.upSequnce===1) {
|
||||||
return <TableHead className="bg-gray-50" colSpan={2} style={{ whiteSpace: 'pre-line' }} key={head.id}>행정구역</TableHead>
|
return <TableHead className="bg-secondary" colSpan={2} style={{ whiteSpace: 'pre-line' }} key={head.id}>행정구역</TableHead>
|
||||||
}else if(head.upName==="upChangeRe3"&&head.upSequnce===1) {
|
}else if(head.upName==="upChangeRe3"&&head.upSequnce===1) {
|
||||||
return <TableHead className="bg-gray-50" colSpan={5} style={{ whiteSpace: 'pre-line' }} key={head.id}>유입</TableHead>
|
return <TableHead className="bg-secondary" colSpan={5} style={{ whiteSpace: 'pre-line' }} key={head.id}>유입</TableHead>
|
||||||
}else if(head.upName==="upChangeRe4"&&head.upSequnce===1) {
|
}else if(head.upName==="upChangeRe4"&&head.upSequnce===1) {
|
||||||
return <TableHead className="bg-gray-50" colSpan={5} style={{ whiteSpace: 'pre-line' }} key={head.id}>유출</TableHead>
|
return <TableHead className="bg-secondary" colSpan={5} style={{ whiteSpace: 'pre-line' }} key={head.id}>유출</TableHead>
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
<TableRow className="bg-gray-50">
|
<TableRow className="bg-secondary">
|
||||||
{upHeadList.map((head: TableUpperProps, idx: number) => {
|
{upHeadList.map((head: TableUpperProps, idx: number) => {
|
||||||
if (head.upName === 'upChangeRe1' || head.upName === 'upChangeRe2' || head.upName === 'upChangeRe3' || head.upName === 'upChangeRe4') {
|
if (head.upName === 'upChangeRe1' || head.upName === 'upChangeRe2' || head.upName === 'upChangeRe3' || head.upName === 'upChangeRe4') {
|
||||||
if (idx == 1 || idx == 2 || idx == 3) {
|
if (idx == 1 || idx == 2 || idx == 3) {
|
||||||
return <TableHead key={head.id} style={{ whiteSpace: 'pre-line' }} className="w-1/8 bg-gray-50">{head.title}</TableHead>;
|
return <TableHead key={head.id} style={{ whiteSpace: 'pre-line' }} className="w-1/8 bg-secondary">{head.title}</TableHead>;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return <TableHead key={head.id} style={{ whiteSpace: 'pre-line' }} className="w-1/8 bg-gray-50">{head.title}</TableHead>;
|
return <TableHead key={head.id} style={{ whiteSpace: 'pre-line' }} className="w-1/8 bg-secondary">{head.title}</TableHead>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
@@ -103,25 +103,25 @@ const HeadMakeColSpan = ({ upHeadList, layoutNum }: { upHeadList: TableUpperProp
|
|||||||
</>
|
</>
|
||||||
) : layoutNum === 3 ? (
|
) : layoutNum === 3 ? (
|
||||||
<>
|
<>
|
||||||
<TableRow className="bg-gray-50">
|
<TableRow className="bg-secondary">
|
||||||
{upHeadList.map((head: TableUpperProps) => {
|
{upHeadList.map((head: TableUpperProps) => {
|
||||||
if(!head.upName) {
|
if(!head.upName) {
|
||||||
return <TableHead className="bg-gray-50" rowSpan={2} style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead>
|
return <TableHead className="bg-secondary" rowSpan={2} style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead>
|
||||||
}else if(head.upName==="upChangeRe1"&&head.upSequnce===1) {
|
}else if(head.upName==="upChangeRe1"&&head.upSequnce===1) {
|
||||||
return <TableHead className="bg-gray-50" colSpan={5} style={{ whiteSpace: 'pre-line' }} key={head.id}>유입</TableHead>
|
return <TableHead className="bg-secondary" colSpan={5} style={{ whiteSpace: 'pre-line' }} key={head.id}>유입</TableHead>
|
||||||
}else if(head.upName==="upChangeRe2"&&head.upSequnce===1) {
|
}else if(head.upName==="upChangeRe2"&&head.upSequnce===1) {
|
||||||
return <TableHead className="bg-gray-50" colSpan={5} style={{ whiteSpace: 'pre-line' }} key={head.id}>방류</TableHead>
|
return <TableHead className="bg-secondary" colSpan={5} style={{ whiteSpace: 'pre-line' }} key={head.id}>방류</TableHead>
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
<TableRow className="bg-gray-50">
|
<TableRow className="bg-secondary">
|
||||||
{upHeadList.map((head: TableUpperProps, idx: number) => {
|
{upHeadList.map((head: TableUpperProps, idx: number) => {
|
||||||
if (head.upName === 'upChangeRe1' || head.upName === 'upChangeRe2') {
|
if (head.upName === 'upChangeRe1' || head.upName === 'upChangeRe2') {
|
||||||
if (idx == 1 || idx == 2 || idx == 3) {
|
if (idx == 1 || idx == 2 || idx == 3) {
|
||||||
return <TableHead key={head.id} style={{ whiteSpace: 'pre-line' }} className="w-1/8 bg-gray-50">{head.title}</TableHead>;
|
return <TableHead key={head.id} style={{ whiteSpace: 'pre-line' }} className="w-1/8 bg-secondary">{head.title}</TableHead>;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return <TableHead key={head.id} style={{ whiteSpace: 'pre-line' }} className="w-1/8 bg-gray-50">{head.title}</TableHead>;
|
return <TableHead key={head.id} style={{ whiteSpace: 'pre-line' }} className="w-1/8 bg-secondary">{head.title}</TableHead>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
@@ -129,23 +129,23 @@ const HeadMakeColSpan = ({ upHeadList, layoutNum }: { upHeadList: TableUpperProp
|
|||||||
</>
|
</>
|
||||||
) : layoutNum === 4 ? (
|
) : layoutNum === 4 ? (
|
||||||
<>
|
<>
|
||||||
<TableRow className="bg-gray-50">
|
<TableRow className="bg-secondary">
|
||||||
{upHeadList.map((head: TableUpperProps) => {
|
{upHeadList.map((head: TableUpperProps) => {
|
||||||
if(!head.upName) {
|
if(!head.upName) {
|
||||||
return <TableHead className="bg-gray-50" rowSpan={2} style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead>
|
return <TableHead className="bg-secondary" rowSpan={2} style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead>
|
||||||
}else if(head.upName==="upChangeRe"&&head.upSequnce===1) {
|
}else if(head.upName==="upChangeRe"&&head.upSequnce===1) {
|
||||||
return <TableHead className="bg-gray-50" colSpan={4} style={{ whiteSpace: 'pre-line' }} key={head.id}>방류</TableHead>
|
return <TableHead className="bg-secondary" colSpan={4} style={{ whiteSpace: 'pre-line' }} key={head.id}>방류</TableHead>
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
<TableRow className="bg-gray-50">
|
<TableRow className="bg-secondary">
|
||||||
{upHeadList.map((head: TableUpperProps, idx: number) => {
|
{upHeadList.map((head: TableUpperProps, idx: number) => {
|
||||||
if (head.upName === 'upChangeRe') {
|
if (head.upName === 'upChangeRe') {
|
||||||
if (idx == 1 || idx == 2 || idx == 3) {
|
if (idx == 1 || idx == 2 || idx == 3) {
|
||||||
return <TableHead key={head.id} style={{ whiteSpace: 'pre-line' }} className="w-1/8 bg-gray-50">{head.title}</TableHead>;
|
return <TableHead key={head.id} style={{ whiteSpace: 'pre-line' }} className="w-1/8 bg-secondary">{head.title}</TableHead>;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return <TableHead key={head.id} style={{ whiteSpace: 'pre-line' }} className="w-1/8 bg-gray-50">{head.title}</TableHead>;
|
return <TableHead key={head.id} style={{ whiteSpace: 'pre-line' }} className="w-1/8 bg-secondary">{head.title}</TableHead>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
@@ -153,21 +153,21 @@ const HeadMakeColSpan = ({ upHeadList, layoutNum }: { upHeadList: TableUpperProp
|
|||||||
</>
|
</>
|
||||||
) : layoutNum === 5 ? ( // 총인설비 수질현황 헤더
|
) : layoutNum === 5 ? ( // 총인설비 수질현황 헤더
|
||||||
<>
|
<>
|
||||||
<TableRow className="bg-gray-50">
|
<TableRow className="bg-secondary">
|
||||||
{upHeadList.map((head: TableUpperProps) => {
|
{upHeadList.map((head: TableUpperProps) => {
|
||||||
if(!head.upName) {
|
if(!head.upName) {
|
||||||
return <TableHead className="w-[180px] bg-gray-50" rowSpan={2} style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead>
|
return <TableHead className="w-[180px] bg-secondary" rowSpan={2} style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead>
|
||||||
}else if(head.upName==="upChangeRe1" && head.upSequnce===1) {
|
}else if(head.upName==="upChangeRe1" && head.upSequnce===1) {
|
||||||
return <TableHead className="bg-gray-50" colSpan={2} style={{ whiteSpace: 'pre-line' }} key={head.id}>유입</TableHead>
|
return <TableHead className="bg-secondary" colSpan={2} style={{ whiteSpace: 'pre-line' }} key={head.id}>유입</TableHead>
|
||||||
}else if(head.upName==="upChangeRe2" && head.upSequnce===1) {
|
}else if(head.upName==="upChangeRe2" && head.upSequnce===1) {
|
||||||
return <TableHead className="bg-gray-50" colSpan={2} style={{ whiteSpace: 'pre-line' }} key={head.id}>방류</TableHead>
|
return <TableHead className="bg-secondary" colSpan={2} style={{ whiteSpace: 'pre-line' }} key={head.id}>방류</TableHead>
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
<TableRow className="bg-gray-50">
|
<TableRow className="bg-secondary">
|
||||||
{upHeadList.map((head: TableUpperProps) => {
|
{upHeadList.map((head: TableUpperProps) => {
|
||||||
if (head.upName === 'upChangeRe1' || head.upName === 'upChangeRe2') {
|
if (head.upName === 'upChangeRe1' || head.upName === 'upChangeRe2') {
|
||||||
return <TableHead key={head.id} style={{ whiteSpace: 'pre-line' }} className="w-1/8 bg-gray-50">{head.title}</TableHead>;
|
return <TableHead key={head.id} style={{ whiteSpace: 'pre-line' }} className="w-1/8 bg-secondary">{head.title}</TableHead>;
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|||||||
@@ -237,7 +237,7 @@ export default function FlowRateModal(props: { fcltyName: string; facilityCd: st
|
|||||||
const raw = row.infoRnDay;
|
const raw = row.infoRnDay;
|
||||||
const value = typeof raw === "string" ? Number(raw.replace(/,/g, "").trim()) : Number(raw);
|
const value = typeof raw === "string" ? Number(raw.replace(/,/g, "").trim()) : Number(raw);
|
||||||
if (!Number.isFinite(value)) return "";
|
if (!Number.isFinite(value)) return "";
|
||||||
return value > 3 ? "bg-slate-50" : "";
|
return value > 3 ? "fo-rain-impact-row" : "";
|
||||||
},
|
},
|
||||||
[activeTab],
|
[activeTab],
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -5,77 +5,77 @@ const HeadMakeColSpan = ({ upHeadList, layoutNum }: { upHeadList: TableUpperProp
|
|||||||
return (
|
return (
|
||||||
layoutNum === 0 ? (
|
layoutNum === 0 ? (
|
||||||
<>
|
<>
|
||||||
<TableRow className="bg-gray-50">{upHeadList.map((head: TableUpperProps) =>
|
<TableRow className="bg-secondary">{upHeadList.map((head: TableUpperProps) =>
|
||||||
(head.id === 'trtFrfNm' ? <TableHead className="w-1/12" rowSpan={3} key={head.id}>{head.title}</TableHead> :
|
(head.id === 'trtFrfNm' ? <TableHead className="w-1/12" rowSpan={3} key={head.id}>{head.title}</TableHead> :
|
||||||
head.id === 'laeNm' ? <TableHead className="w-1/12" rowSpan={3} key={head.id}>{head.title}</TableHead> :
|
head.id === 'laeNm' ? <TableHead className="w-1/12" rowSpan={3} key={head.id}>{head.title}</TableHead> :
|
||||||
head.id == 'fctCpc' || head.id == 'planInputWaterQlty' || head.id == 'designInputWaterQlty' ? <TableHead rowSpan={3} className="w-40" style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead> :
|
head.id == 'fctCpc' || head.id == 'planInputWaterQlty' || head.id == 'designInputWaterQlty' ? <TableHead rowSpan={3} className="w-40" style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead> :
|
||||||
head.id === 'trstOprEtpNm' ? <TableHead className="w-1/15" rowSpan={3} key={head.id}>{head.title}</TableHead> :
|
head.id === 'trstOprEtpNm' ? <TableHead className="w-1/15" rowSpan={3} key={head.id}>{head.title}</TableHead> :
|
||||||
head.upName === 'upChangeRe' && head.upSequnce === 1 ? <TableHead className="bg-gray-50" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={2} colSpan={2}>{'행정구역'}</TableHead> :
|
head.upName === 'upChangeRe' && head.upSequnce === 1 ? <TableHead className="bg-secondary" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={2} colSpan={2}>{'행정구역'}</TableHead> :
|
||||||
head.upName === 'upChangeRe3' && head.upSequnce === 1 ? <TableHead className="bg-gray-50" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={2} colSpan={6}>{'증설계획'}</TableHead> :
|
head.upName === 'upChangeRe3' && head.upSequnce === 1 ? <TableHead className="bg-secondary" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={2} colSpan={6}>{'증설계획'}</TableHead> :
|
||||||
head.upName === 'upChangeRe4' && head.upSequnce === 1 ? <TableHead className="bg-gray-50" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={1} colSpan={19}>{'시설계획'}</TableHead> :
|
head.upName === 'upChangeRe4' && head.upSequnce === 1 ? <TableHead className="bg-secondary" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={1} colSpan={19}>{'시설계획'}</TableHead> :
|
||||||
!head.upName ? <TableHead rowSpan={3} className="w-1/20 bg-gray-20" style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead> : null))}
|
!head.upName ? <TableHead rowSpan={3} className="w-1/20 bg-accent text-accent-foreground" style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead> : null))}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
<TableRow className="bg-gray-50">
|
<TableRow className="bg-secondary">
|
||||||
{upHeadList.map((head: TableUpperProps) => (
|
{upHeadList.map((head: TableUpperProps) => (
|
||||||
head.upName === 'upChangeRe4' && head.upSequnce === 1 ? <TableHead className="bg-gray-50" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={1} colSpan={6}>{'증설계획(m³/일)'}</TableHead> :
|
head.upName === 'upChangeRe4' && head.upSequnce === 1 ? <TableHead className="bg-secondary" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={1} colSpan={6}>{'증설계획(m³/일)'}</TableHead> :
|
||||||
head.upName === 'upChangeRe5' && head.upSequnce === 1 ? <TableHead className="bg-gray-50" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={1} colSpan={6}>{'처리인구(인)'}</TableHead> :
|
head.upName === 'upChangeRe5' && head.upSequnce === 1 ? <TableHead className="bg-secondary" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={1} colSpan={6}>{'처리인구(인)'}</TableHead> :
|
||||||
head.upName === 'upChangeRe6' && head.upSequnce === 1 ? <TableHead className="bg-gray-50" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={1} colSpan={7}>{'처리구역(k㎡)'}</TableHead> :
|
head.upName === 'upChangeRe6' && head.upSequnce === 1 ? <TableHead className="bg-secondary" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={1} colSpan={7}>{'처리구역(k㎡)'}</TableHead> :
|
||||||
null
|
null
|
||||||
))}
|
))}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
<TableRow className="bg-gray-50">
|
<TableRow className="bg-secondary">
|
||||||
{upHeadList.map((head: TableUpperProps) => {
|
{upHeadList.map((head: TableUpperProps) => {
|
||||||
if (head.upName === 'upChangeRe' || head.upName === 'upChangeRe1' || head.upName === 'upChangeRe2' || head.upName === 'upChangeRe3' || head.upName === 'upChangeRe4' || head.upName === 'upChangeRe5' || head.upName === 'upChangeRe6') {
|
if (head.upName === 'upChangeRe' || head.upName === 'upChangeRe1' || head.upName === 'upChangeRe2' || head.upName === 'upChangeRe3' || head.upName === 'upChangeRe4' || head.upName === 'upChangeRe5' || head.upName === 'upChangeRe6') {
|
||||||
return <TableHead key={head.id} style={{ whiteSpace: 'pre-line' }} className="w-40 bg-gray-50">{head.title}</TableHead>;
|
return <TableHead key={head.id} style={{ whiteSpace: 'pre-line' }} className="w-40 bg-secondary">{head.title}</TableHead>;
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</>
|
</>
|
||||||
) : layoutNum === 1 ? (
|
) : layoutNum === 1 ? (
|
||||||
<>
|
<>
|
||||||
<TableRow className="bg-gray-50">{upHeadList.map((head: TableUpperProps) =>
|
<TableRow className="bg-secondary">{upHeadList.map((head: TableUpperProps) =>
|
||||||
(head.id === 'trtFrfNm' ? <TableHead className="w-1/12" rowSpan={3} key={head.id}>{head.title}</TableHead> :
|
(head.id === 'trtFrfNm' ? <TableHead className="w-1/12" rowSpan={3} key={head.id}>{head.title}</TableHead> :
|
||||||
head.id === 'laeNm' ? <TableHead className="w-1/12" rowSpan={3} key={head.id}>{head.title}</TableHead> :
|
head.id === 'laeNm' ? <TableHead className="w-1/12" rowSpan={3} key={head.id}>{head.title}</TableHead> :
|
||||||
head.id == 'fctCpc' || head.id == 'planInputWaterQlty' || head.id == 'designInputWaterQlty' ? <TableHead rowSpan={3} className="w-40" style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead> :
|
head.id == 'fctCpc' || head.id == 'planInputWaterQlty' || head.id == 'designInputWaterQlty' ? <TableHead rowSpan={3} className="w-40" style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead> :
|
||||||
head.id === 'trstOprEtpNm' ? <TableHead className="w-1/15" rowSpan={3} key={head.id}>{head.title}</TableHead> :
|
head.id === 'trstOprEtpNm' ? <TableHead className="w-1/15" rowSpan={3} key={head.id}>{head.title}</TableHead> :
|
||||||
head.upName === 'upChangeRe' && head.upSequnce === 1 ? <TableHead className="w-75 bg-gray-50" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={2} colSpan={3}>{'유역'}</TableHead> :
|
head.upName === 'upChangeRe' && head.upSequnce === 1 ? <TableHead className="w-75 bg-secondary" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={2} colSpan={3}>{'유역'}</TableHead> :
|
||||||
head.upName === 'upChangeRe3' && head.upSequnce === 1 ? <TableHead className="bg-gray-50" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={2} colSpan={6}>{'증설계획'}</TableHead> :
|
head.upName === 'upChangeRe3' && head.upSequnce === 1 ? <TableHead className="bg-secondary" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={2} colSpan={6}>{'증설계획'}</TableHead> :
|
||||||
!head.upName ? <TableHead rowSpan={3} className="w-1/20 bg-gray-20" style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead> : null))}
|
!head.upName ? <TableHead rowSpan={3} className="w-1/20 bg-accent text-accent-foreground" style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead> : null))}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
<TableRow className="bg-gray-50">
|
<TableRow className="bg-secondary">
|
||||||
{upHeadList.map((head: TableUpperProps) => (
|
{upHeadList.map((head: TableUpperProps) => (
|
||||||
head.upName === 'upChangeRe4' && head.upSequnce === 1 ? <TableHead className="bg-gray-50" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={1} colSpan={6}>{'증설계획(m³/일)'}</TableHead> :
|
head.upName === 'upChangeRe4' && head.upSequnce === 1 ? <TableHead className="bg-secondary" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={1} colSpan={6}>{'증설계획(m³/일)'}</TableHead> :
|
||||||
head.upName === 'upChangeRe5' && head.upSequnce === 1 ? <TableHead className="bg-gray-50" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={1} colSpan={6}>{'처리인구(인)'}</TableHead> :
|
head.upName === 'upChangeRe5' && head.upSequnce === 1 ? <TableHead className="bg-secondary" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={1} colSpan={6}>{'처리인구(인)'}</TableHead> :
|
||||||
head.upName === 'upChangeRe6' && head.upSequnce === 1 ? <TableHead className="bg-gray-50" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={1} colSpan={7}>{'처리구역(k㎡)'}</TableHead> :
|
head.upName === 'upChangeRe6' && head.upSequnce === 1 ? <TableHead className="bg-secondary" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={1} colSpan={7}>{'처리구역(k㎡)'}</TableHead> :
|
||||||
null
|
null
|
||||||
))}
|
))}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
<TableRow className="bg-gray-50">
|
<TableRow className="bg-secondary">
|
||||||
{upHeadList.map((head: TableUpperProps) => {
|
{upHeadList.map((head: TableUpperProps) => {
|
||||||
if (head.upName === 'upChangeRe' || head.upName === 'upChangeRe1' || head.upName === 'upChangeRe2' || head.upName === 'upChangeRe3' || head.upName === 'upChangeRe4' || head.upName === 'upChangeRe5' || head.upName === 'upChangeRe6') {
|
if (head.upName === 'upChangeRe' || head.upName === 'upChangeRe1' || head.upName === 'upChangeRe2' || head.upName === 'upChangeRe3' || head.upName === 'upChangeRe4' || head.upName === 'upChangeRe5' || head.upName === 'upChangeRe6') {
|
||||||
return <TableHead key={head.id} style={{ whiteSpace: 'pre-line' }} className="w-40 bg-gray-50">{head.title}</TableHead>;
|
return <TableHead key={head.id} style={{ whiteSpace: 'pre-line' }} className="w-40 bg-secondary">{head.title}</TableHead>;
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<TableRow className="bg-gray-50">{upHeadList.map((head: TableUpperProps) =>
|
<TableRow className="bg-secondary">{upHeadList.map((head: TableUpperProps) =>
|
||||||
(head.id === 'trtFrfNm' ? <TableHead className="w-1/12" rowSpan={2} key={head.id}>{head.title}</TableHead> :
|
(head.id === 'trtFrfNm' ? <TableHead className="w-1/12" rowSpan={2} key={head.id}>{head.title}</TableHead> :
|
||||||
head.id === 'laeNm' ? <TableHead className="w-1/12" rowSpan={2} key={head.id}>{head.title}</TableHead> :
|
head.id === 'laeNm' ? <TableHead className="w-1/12" rowSpan={2} key={head.id}>{head.title}</TableHead> :
|
||||||
head.id == 'fctCpc' || head.id == 'planInputWaterQlty' || head.id == 'designInputWaterQlty' ? <TableHead rowSpan={2} className="w-40" style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead> :
|
head.id == 'fctCpc' || head.id == 'planInputWaterQlty' || head.id == 'designInputWaterQlty' ? <TableHead rowSpan={2} className="w-40" style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead> :
|
||||||
head.id === 'trstOprEtpNm' ? <TableHead className="w-1/15" rowSpan={2} key={head.id}>{head.title}</TableHead> :
|
head.id === 'trstOprEtpNm' ? <TableHead className="w-1/15" rowSpan={2} key={head.id}>{head.title}</TableHead> :
|
||||||
head.upName === 'upChangeRe1' && head.upSequnce === 1 ? <TableHead className="w-75 bg-gray-50" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={1} colSpan={3}>{'권역'}</TableHead> :
|
head.upName === 'upChangeRe1' && head.upSequnce === 1 ? <TableHead className="w-75 bg-secondary" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={1} colSpan={3}>{'권역'}</TableHead> :
|
||||||
head.upName === 'upChangeRe2' && head.upSequnce === 1 ? <TableHead className="w-75 bg-gray-50" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={1} colSpan={2}>{'환경청'}</TableHead> :
|
head.upName === 'upChangeRe2' && head.upSequnce === 1 ? <TableHead className="w-75 bg-secondary" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={1} colSpan={2}>{'환경청'}</TableHead> :
|
||||||
head.upName === 'upChangeRe3' && head.upSequnce === 1 ? <TableHead className="w-75 bg-gray-50" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={1} colSpan={6}>{'증설계획(m³/일)'}</TableHead> :
|
head.upName === 'upChangeRe3' && head.upSequnce === 1 ? <TableHead className="w-75 bg-secondary" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={1} colSpan={6}>{'증설계획(m³/일)'}</TableHead> :
|
||||||
head.upName === 'upChangeRe5' && head.upSequnce === 1 ? <TableHead className="w-75 bg-gray-50" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={1} colSpan={6}>{'처리인구(인)'}</TableHead> :
|
head.upName === 'upChangeRe5' && head.upSequnce === 1 ? <TableHead className="w-75 bg-secondary" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={1} colSpan={6}>{'처리인구(인)'}</TableHead> :
|
||||||
head.upName === 'upChangeRe6' && head.upSequnce === 1 ? <TableHead className="w-75 bg-gray-50" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={1} colSpan={7}>{'처리구역(k㎡)'}</TableHead> :
|
head.upName === 'upChangeRe6' && head.upSequnce === 1 ? <TableHead className="w-75 bg-secondary" style={{ whiteSpace: 'pre-line' }} key={head.id} rowSpan={1} colSpan={7}>{'처리구역(k㎡)'}</TableHead> :
|
||||||
!head.upName ? <TableHead rowSpan={2} className="w-1/20 bg-gray-20" style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead> : null))}
|
!head.upName ? <TableHead rowSpan={2} className="w-1/20 bg-accent text-accent-foreground" style={{ whiteSpace: 'pre-line' }} key={head.id}>{head.title}</TableHead> : null))}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
<TableRow className="bg-gray-50">
|
<TableRow className="bg-secondary">
|
||||||
{upHeadList.map((head: TableUpperProps) => {
|
{upHeadList.map((head: TableUpperProps) => {
|
||||||
if (head.upName === 'upChangeRe1' || head.upName === 'upChangeRe2' ||head.upName === 'upChangeRe3' || head.upName === 'upChangeRe4' || head.upName === 'upChangeRe5' || head.upName === 'upChangeRe6') {
|
if (head.upName === 'upChangeRe1' || head.upName === 'upChangeRe2' ||head.upName === 'upChangeRe3' || head.upName === 'upChangeRe4' || head.upName === 'upChangeRe5' || head.upName === 'upChangeRe6') {
|
||||||
return <TableHead key={head.id} style={{ whiteSpace: 'pre-line' }} className="w-40 bg-gray-50">{head.title}</TableHead>;
|
return <TableHead key={head.id} style={{ whiteSpace: 'pre-line' }} className="w-40 bg-secondary">{head.title}</TableHead>;
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
@@ -84,4 +84,4 @@ const HeadMakeColSpan = ({ upHeadList, layoutNum }: { upHeadList: TableUpperProp
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export { HeadMakeColSpan };
|
export { HeadMakeColSpan };
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ export function SearchBar({ onFeatureSelect, gisMaps }: SearchBarProps) {
|
|||||||
<SelectBox
|
<SelectBox
|
||||||
labelClass="w-[40px]"
|
labelClass="w-[40px]"
|
||||||
className="mr-10 w-[200px]"
|
className="mr-10 w-[200px]"
|
||||||
selectClass="rounded-lg bg-white"
|
selectClass="rounded-lg"
|
||||||
label="시도"
|
label="시도"
|
||||||
selectArray={sidoData}
|
selectArray={sidoData}
|
||||||
onSelectValue={(val) => onSelectValue(val.toString(), "ctpvCd")}
|
onSelectValue={(val) => onSelectValue(val.toString(), "ctpvCd")}
|
||||||
@@ -125,7 +125,7 @@ export function SearchBar({ onFeatureSelect, gisMaps }: SearchBarProps) {
|
|||||||
<SelectBox
|
<SelectBox
|
||||||
labelClass="w-[65px]"
|
labelClass="w-[65px]"
|
||||||
className="mr-10 w-[200px]"
|
className="mr-10 w-[200px]"
|
||||||
selectClass="rounded-lg bg-white"
|
selectClass="rounded-lg"
|
||||||
label="시군구"
|
label="시군구"
|
||||||
selectArray={filteredSigunData}
|
selectArray={filteredSigunData}
|
||||||
onSelectValue={(val) => onSelectValue(val.toString(), "sggCd")}
|
onSelectValue={(val) => onSelectValue(val.toString(), "sggCd")}
|
||||||
@@ -134,7 +134,7 @@ export function SearchBar({ onFeatureSelect, gisMaps }: SearchBarProps) {
|
|||||||
<SelectBox
|
<SelectBox
|
||||||
labelClass="w-[140px]"
|
labelClass="w-[140px]"
|
||||||
className="mr-3 w-[250px]"
|
className="mr-3 w-[250px]"
|
||||||
selectClass="rounded-lg bg-white"
|
selectClass="rounded-lg"
|
||||||
label="하수처리시설"
|
label="하수처리시설"
|
||||||
selectArray={facilityData}
|
selectArray={facilityData}
|
||||||
onSelectValue={(val) => onSelectValue(val.toString(), "fcltCd")}
|
onSelectValue={(val) => onSelectValue(val.toString(), "fcltCd")}
|
||||||
|
|||||||
@@ -0,0 +1,164 @@
|
|||||||
|
# apps/fo 테마 적용 작업계획
|
||||||
|
|
||||||
|
작성일: 2026-06-25
|
||||||
|
대상 앱: `D:\iipbs\frontend\apps\fo`
|
||||||
|
|
||||||
|
## 1. 목적
|
||||||
|
|
||||||
|
- `apps/fo` 프로그램 페이지 내부에 직접 박혀 있는 색상 하드코딩을 식별한다.
|
||||||
|
- 가능한 범위는 `packages/common/assets/src/styles/base.css`의 CSS 변수 영향권으로 옮긴다.
|
||||||
|
- 즉 `bg-white`, `text-gray-*`, `border-gray-*`, `bg-blue-*`, `bg-green-*`, `bg-red-*` 같은 직접 색상 표현을 `background`, `foreground`, `label`, `border`, `secondary`, `accent`, `primary`, `destructive` 계열 토큰으로 치환한다.
|
||||||
|
|
||||||
|
## 2. 전제
|
||||||
|
|
||||||
|
- `apps/fo`는 [tailwind.config.ts](D:/iipbs/frontend/apps/fo/tailwind.config.ts:1)에서 공통 preset을 사용한다.
|
||||||
|
- 공통 토큰은 [packages/common/assets/src/styles/base.css](D:/iipbs/frontend/packages/common/assets/src/styles/base.css:1)에 정의되어 있다.
|
||||||
|
- `packages/common/components`, `packages/common/assets`는 기준 레이어이며, 앱 작업은 이 기준을 따르는 방향으로 진행한다.
|
||||||
|
- 단, 이번 요청의 1차 목표는 `apps/fo` 내부 코드에 박혀 있는 색상을 줄이는 것이다.
|
||||||
|
|
||||||
|
## 3. 확인된 하드코딩 유형
|
||||||
|
|
||||||
|
현재 `apps/fo`에서 확인된 대표 패턴은 아래와 같다.
|
||||||
|
|
||||||
|
- 검색 입력/선택 UI
|
||||||
|
- `apps/fo/app/components/common/SearchInput.tsx`
|
||||||
|
- `apps/fo/app/pages/map/searchBar/searchBar.tsx`
|
||||||
|
- `apps/fo/app/components/common/FacilityTermModalHeader.tsx`
|
||||||
|
- `apps/fo/app/components/common/FacilityTermModalHeaderMonth.tsx`
|
||||||
|
- 대시보드/안내문구
|
||||||
|
- `apps/fo/app/components/common/UnderComment.tsx`
|
||||||
|
- `apps/fo/app/pages/(with-layout)/dashboard/rainManage/page.tsx`
|
||||||
|
- 대시보드 표 셀 상태색
|
||||||
|
- `apps/fo/app/pages/(with-layout)/dashboard/facilityInfo/page.tsx`
|
||||||
|
이 페이지는 특별한 페이지로, 연간, 하절기, 동절기 색을 구분하여 보여주어야 한다. 따라서 text-foreground 가 보이도록 하되 연간, 하절기, 동절기 색을 apps\fo\src\app\styles 아래 테마별 css에 정의해서 보여주어야 한다.
|
||||||
|
- 지도 오버레이/팝업
|
||||||
|
- `apps/fo/app/pages/(map-layout)/map/page.tsx`
|
||||||
|
- 테스트/샘플성 버튼
|
||||||
|
- `apps/fo/app/pages/(with-layout)/test/page.tsx`
|
||||||
|
- 모달 입력창
|
||||||
|
- `apps/fo/app/pages/(with-layout)/facilityPrecipitation/modal/page.tsx`
|
||||||
|
|
||||||
|
## 4. 기본 원칙
|
||||||
|
|
||||||
|
### 4.1 바로 토큰 치환 가능한 경우
|
||||||
|
|
||||||
|
아래는 우선 토큰으로 바로 바꾼다.
|
||||||
|
|
||||||
|
- `bg-white` -> `bg-background` 또는 `bg-card` 또는 `bg-popover`
|
||||||
|
- `text-gray-900`, `text-gray-800` -> `text-foreground`
|
||||||
|
- `text-gray-700`, `text-gray-600` -> `text-label` 또는 `text-foreground`
|
||||||
|
- `text-gray-500` -> `text-muted-foreground` 또는 `text-placeholder`
|
||||||
|
- `border-gray-200`, `border-gray-300` -> `border-border`
|
||||||
|
- `focus:ring-blue-500` -> `focus:ring-ring`
|
||||||
|
- `text-blue-500`, `text-blue-600` -> `text-primary`
|
||||||
|
- `bg-blue-500`, `bg-blue-600` -> `bg-primary`
|
||||||
|
- `text-red-500`, `text-red-600` -> `text-destructive`
|
||||||
|
- `bg-red-50` 등 경고 계열 -> `bg-accent` 또는 별도 위험 상태 규칙 검토
|
||||||
|
|
||||||
|
### 4.2 바로 토큰 치환하면 안 되는 경우
|
||||||
|
|
||||||
|
아래는 의미색일 가능성이 높아 바로 토큰화하지 않는다.
|
||||||
|
|
||||||
|
- 범례 색상
|
||||||
|
- 데이터 구분용 heatmap/구간 색상
|
||||||
|
- 수질/계절/유형별 비교 색상
|
||||||
|
- 지도 오버레이에서 정보 카테고리 의미를 나타내는 색
|
||||||
|
|
||||||
|
이 경우는 다음 중 하나로 처리한다.
|
||||||
|
|
||||||
|
- 유지
|
||||||
|
- 별도 의미 클래스 부여
|
||||||
|
- 앱 전용 CSS로 상태 클래스를 만든 뒤 theme-safe surface만 토큰화
|
||||||
|
|
||||||
|
## 5. 우선순위
|
||||||
|
|
||||||
|
### 5.1 1순위: 일반 UI surface
|
||||||
|
|
||||||
|
가장 먼저 처리한다.
|
||||||
|
|
||||||
|
- 검색 입력창 배경/보더/텍스트
|
||||||
|
- 검색 결과 dropdown 배경/hover
|
||||||
|
- 팝업/모달 wrapper 배경/보더
|
||||||
|
- 제목/라벨/안내문구 색
|
||||||
|
- 버튼의 직접 blue/red/white 색상
|
||||||
|
|
||||||
|
이 영역은 theme 적용 체감이 가장 크고, 토큰 치환도 안전하다.
|
||||||
|
|
||||||
|
### 5.2 2순위: 테이블/리스트
|
||||||
|
|
||||||
|
- `selectedFcltList`
|
||||||
|
- `facilityInfo`
|
||||||
|
- modal 내부 표
|
||||||
|
- overlay 내 표 구조
|
||||||
|
|
||||||
|
이 영역은 `bg-secondary`, `bg-accent`, `text-secondary-foreground`, `border-border` 계열로 정리한다.
|
||||||
|
|
||||||
|
### 5.3 3순위: 의미색 데이터 표현
|
||||||
|
|
||||||
|
- `facilityInfo`의 계절/항목별 `bg-green-*`, `bg-blue-*`
|
||||||
|
- 지도 범례 색상
|
||||||
|
- 지도 feature overlay 강조색
|
||||||
|
- 대시보드 표 셀 상태색
|
||||||
|
- `apps/fo/app/pages/(with-layout)/dashboard/facilityInfo/page.tsx`
|
||||||
|
이 페이지는 특별한 페이지로, 연간, 하절기, 동절기 색을 구분하여 보여주어야 한다. 따라서 text-foreground 가 보이도록 하되 연간, 하절기, 동절기 색을 apps\fo\src\app\styles 아래 테마별 css에 정의해서 보여주어야 한다.
|
||||||
|
|
||||||
|
이 영역은 “없애는 것”보다 “역할을 분리하는 것”이 중요하다.
|
||||||
|
|
||||||
|
## 6. 실제 작업 순서
|
||||||
|
|
||||||
|
1. `apps/fo` 내부 하드코딩 색상 파일 목록 확정
|
||||||
|
2. 공통 UI와 데이터 의미색을 분리
|
||||||
|
3. 일반 UI 색상부터 `base.css` 토큰으로 치환
|
||||||
|
4. 필요 시 `apps/fo/app/styles/*.css`에 앱 전용 의미 클래스 추가
|
||||||
|
5. `dashboard`, `map`, `modal`, `search` 대표 화면 점검
|
||||||
|
6. 남은 의미색 영역은 별도 상태색 정책으로 정리
|
||||||
|
|
||||||
|
## 7. 권장 치환 전략
|
||||||
|
|
||||||
|
### 7.1 JSX 안에서 바로 치환
|
||||||
|
|
||||||
|
아래처럼 className을 직접 토큰 기반으로 변경한다.
|
||||||
|
|
||||||
|
- `bg-white` -> `bg-background`
|
||||||
|
- `text-gray-600` -> `text-label`
|
||||||
|
- `border-gray-300` -> `border-border`
|
||||||
|
|
||||||
|
이 방식은 빠르지만 반복이 많으면 유지보수성이 떨어진다.
|
||||||
|
|
||||||
|
### 7.2 반복되는 UI는 앱 전용 클래스 도입
|
||||||
|
|
||||||
|
예:
|
||||||
|
|
||||||
|
- `fo-search-panel`
|
||||||
|
- `fo-search-input`
|
||||||
|
- `fo-popup-card`
|
||||||
|
- `fo-empty-text`
|
||||||
|
|
||||||
|
반복되는 구조는 `apps/fo/app/styles/components*.css`에 올리고, JSX에서는 의미 클래스만 사용한다.
|
||||||
|
|
||||||
|
이 방식이 장기적으로 더 좋다.
|
||||||
|
|
||||||
|
## 8. 예상 주의사항
|
||||||
|
|
||||||
|
- `h-90` 같은 Tailwind v3 미지원 클래스가 섞여 있을 수 있다.
|
||||||
|
- `bg-white`를 `bg-background`로 바꾸면 black theme에서 contrast가 크게 달라질 수 있으므로 텍스트 색도 같이 바꿔야 한다.
|
||||||
|
- `bg-blue-*`, `bg-green-*`는 실제 status color인지 단순 강조색인지 구분하고 바꿔야 한다.
|
||||||
|
- 지도 오버레이는 HTML string으로 만드는 부분이 있으면 className 치환만으로 끝나지 않을 수 있다.
|
||||||
|
|
||||||
|
## 9. 1차 적용 추천 대상
|
||||||
|
|
||||||
|
우선 아래 파일부터 적용하는 것이 효율적이다.
|
||||||
|
|
||||||
|
1. `apps/fo/app/components/common/SearchInput.tsx`
|
||||||
|
2. `apps/fo/app/pages/map/searchBar/searchBar.tsx`
|
||||||
|
3. `apps/fo/app/components/common/UnderComment.tsx`
|
||||||
|
4. `apps/fo/app/pages/(with-layout)/dashboard/rainManage/page.tsx`
|
||||||
|
5. `apps/fo/app/components/common/FacilityTermModalHeader.tsx`
|
||||||
|
6. `apps/fo/app/components/common/FacilityTermModalHeaderMonth.tsx`
|
||||||
|
7. `apps/fo/app/pages/(with-layout)/facilityPrecipitation/modal/page.tsx`
|
||||||
|
|
||||||
|
## 10. 결론
|
||||||
|
|
||||||
|
- `apps/fo`도 `apps/wr`와 동일하게 `base.css` 토큰 중심으로 정리 가능하다.
|
||||||
|
- 1차는 일반 UI 하드코딩 제거에 집중하고, 데이터 의미색은 유지 또는 별도 정책으로 분리하는 것이 맞다.
|
||||||
|
- 가장 안전한 방향은 “반복 UI는 앱 전용 의미 클래스”, “일회성은 JSX에서 직접 토큰 치환”의 혼합 방식이다.
|
||||||
Vendored
+1
@@ -1,5 +1,6 @@
|
|||||||
/// <reference types="next" />
|
/// <reference types="next" />
|
||||||
/// <reference types="next/image-types/global" />
|
/// <reference types="next/image-types/global" />
|
||||||
|
/// <reference path="./.next/types/routes.d.ts" />
|
||||||
|
|
||||||
// NOTE: This file should not be edited
|
// NOTE: This file should not be edited
|
||||||
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
import "./styles/base.css";
|
import "./styles/base.css";
|
||||||
import "./styles/components.css";
|
import "./styles/components.css";
|
||||||
|
import "./styles/components-black.css";
|
||||||
|
import "./styles/components-blue.css";
|
||||||
|
import "./styles/components-green.css";
|
||||||
|
import "./styles/components-red.css";
|
||||||
import "@fontsource-variable/noto-sans-kr";
|
import "@fontsource-variable/noto-sans-kr";
|
||||||
|
|
||||||
import { AppProvider } from "./providers";
|
import { AppProvider } from "./providers";
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
@tailwind components;
|
||||||
|
|
||||||
|
@layer components {
|
||||||
|
.card {
|
||||||
|
@apply relative m-[0.6rem] box-border min-h-[2rem] rounded-[0.5rem] p-[0.6rem] text-[1.3rem] text-[#666];
|
||||||
|
}
|
||||||
|
.card-border {
|
||||||
|
@apply border border-[#dbe2e6] bg-[rgba(255,255,255,0.6)] shadow-blur;
|
||||||
|
}
|
||||||
|
.card-header {
|
||||||
|
@apply -mx-[0.6rem] flex items-center justify-between border-b border-b-[#e1e7eb] p-4;
|
||||||
|
}
|
||||||
|
.card-footer {
|
||||||
|
@apply -mx-[0.6rem] mt-2 flex items-center justify-center border-t border-t-[#e1e7eb] py-4;
|
||||||
|
}
|
||||||
|
|
||||||
|
[data-theme="black"] {
|
||||||
|
--fo-facility-info-flow-year-bg: color-mix(in srgb, var(--chart-4) 20%, var(--secondary));
|
||||||
|
--fo-facility-info-water-year-bg: color-mix(in srgb, var(--chart-3) 20%, var(--secondary));
|
||||||
|
--fo-facility-info-phosphorus-year-bg: color-mix(in srgb, var(--chart-1) 20%, var(--secondary));
|
||||||
|
--fo-facility-info-flow-summer-bg: color-mix(in srgb, var(--chart-4) 28%, var(--secondary));
|
||||||
|
--fo-facility-info-water-summer-bg: color-mix(in srgb, var(--chart-3) 28%, var(--secondary));
|
||||||
|
--fo-facility-info-phosphorus-summer-bg: color-mix(in srgb, var(--chart-1) 28%, var(--secondary));
|
||||||
|
--fo-facility-info-flow-winter-bg: color-mix(in srgb, var(--chart-4) 36%, var(--secondary));
|
||||||
|
--fo-facility-info-water-winter-bg: color-mix(in srgb, var(--chart-3) 36%, var(--secondary));
|
||||||
|
--fo-facility-info-phosphorus-winter-bg: color-mix(in srgb, var(--chart-1) 36%, var(--secondary));
|
||||||
|
--fo-rain-impact-row-bg: color-mix(in srgb, var(--chart-1) 16%, var(--secondary));
|
||||||
|
--fo-facility-info-header-bg: #5e7b9c;
|
||||||
|
--fo-facility-info-header-fg: #ffffff;
|
||||||
|
--fo-facility-info-header-border: var(--border);
|
||||||
|
|
||||||
|
.card-border {
|
||||||
|
@apply border-[#3f4042] bg-[rgba(255,255,255,0.065)];
|
||||||
|
}
|
||||||
|
.card-header {
|
||||||
|
@apply border-b-[#3f4042];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="file"] {
|
||||||
|
@apply w-[200px] h-[40px] px-3 py-2 border border-[#d1d5db] rounded-md bg-white text-sm cursor-pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
@tailwind components;
|
||||||
|
|
||||||
|
@layer components {
|
||||||
|
.card {
|
||||||
|
@apply relative m-[0.6rem] box-border min-h-[2rem] rounded-[0.5rem] p-[0.6rem] text-[1.3rem] text-[#666];
|
||||||
|
}
|
||||||
|
.card-border {
|
||||||
|
@apply border border-[#dbe2e6] bg-[rgba(255,255,255,0.6)] shadow-blur;
|
||||||
|
}
|
||||||
|
.card-header {
|
||||||
|
@apply -mx-[0.6rem] flex items-center justify-between border-b border-b-[#e1e7eb] p-4;
|
||||||
|
}
|
||||||
|
.card-footer {
|
||||||
|
@apply -mx-[0.6rem] mt-2 flex items-center justify-center border-t border-t-[#e1e7eb] py-4;
|
||||||
|
}
|
||||||
|
|
||||||
|
[data-theme="blue"] {
|
||||||
|
--fo-facility-info-flow-year-bg: color-mix(in srgb, var(--chart-4) 16%, var(--background));
|
||||||
|
--fo-facility-info-water-year-bg: color-mix(in srgb, var(--chart-3) 16%, var(--background));
|
||||||
|
--fo-facility-info-phosphorus-year-bg: color-mix(in srgb, var(--chart-1) 16%, var(--background));
|
||||||
|
--fo-facility-info-flow-summer-bg: color-mix(in srgb, var(--chart-4) 24%, var(--background));
|
||||||
|
--fo-facility-info-water-summer-bg: color-mix(in srgb, var(--chart-3) 24%, var(--background));
|
||||||
|
--fo-facility-info-phosphorus-summer-bg: color-mix(in srgb, var(--chart-1) 24%, var(--background));
|
||||||
|
--fo-facility-info-flow-winter-bg: color-mix(in srgb, var(--chart-4) 32%, var(--background));
|
||||||
|
--fo-facility-info-water-winter-bg: color-mix(in srgb, var(--chart-3) 32%, var(--background));
|
||||||
|
--fo-facility-info-phosphorus-winter-bg: color-mix(in srgb, var(--chart-1) 32%, var(--background));
|
||||||
|
--fo-rain-impact-row-bg: color-mix(in srgb, var(--chart-1) 12%, var(--background));
|
||||||
|
--fo-facility-info-header-bg: #eaf3fb;
|
||||||
|
--fo-facility-info-header-fg: #647784;
|
||||||
|
--fo-facility-info-header-border: #e5e5e5;
|
||||||
|
|
||||||
|
.card-border {
|
||||||
|
@apply border-[#d8e3eb] bg-white shadow-blur;
|
||||||
|
}
|
||||||
|
.card-header {
|
||||||
|
@apply border-b-[#d8e3eb];
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
@apply text-[#4b5563];
|
||||||
|
}
|
||||||
|
|
||||||
|
.card.card-border {
|
||||||
|
box-shadow: 0 1px 8px rgba(15, 23, 42, 0.06);
|
||||||
|
}
|
||||||
|
|
||||||
|
.card.card-border .card.card-border {
|
||||||
|
@apply border-[#dde6ed] bg-white;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card.card-border input,
|
||||||
|
.card.card-border button[role="combobox"] {
|
||||||
|
@apply border-[#d8e3eb] bg-white text-[#737373];
|
||||||
|
}
|
||||||
|
|
||||||
|
.card.card-border label {
|
||||||
|
@apply text-[#666666];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
nav[aria-label="pagination"] li a {
|
||||||
|
border-color: transparent !important;
|
||||||
|
background-color: transparent !important;
|
||||||
|
color: #0a0a0a !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav[aria-label="pagination"] li a:hover {
|
||||||
|
background-color: #f6f6f6 !important;
|
||||||
|
color: #0a0a0a !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav[aria-label="pagination"] li a[aria-current="page"] {
|
||||||
|
border-color: #2094fa !important;
|
||||||
|
background-color: #2094fa !important;
|
||||||
|
color: #fafafa !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav[aria-label="pagination"] li a[aria-label="Go to previous page"],
|
||||||
|
nav[aria-label="pagination"] li a[aria-label="Go to next page"] {
|
||||||
|
display: inline-flex !important;
|
||||||
|
align-items: center !important;
|
||||||
|
justify-content: center !important;
|
||||||
|
border: 1px solid #e5e7eb !important;
|
||||||
|
color: #666666 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="file"] {
|
||||||
|
@apply w-[200px] h-[40px] px-3 py-2 border border-[#d1d5db] rounded-md bg-white text-sm cursor-pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
@tailwind components;
|
||||||
|
|
||||||
|
@layer components {
|
||||||
|
.card {
|
||||||
|
@apply relative m-[0.6rem] box-border min-h-[2rem] rounded-[0.5rem] p-[0.6rem] text-[1.3rem] text-[#666];
|
||||||
|
}
|
||||||
|
.card-border {
|
||||||
|
@apply border border-[#dbe2e6] bg-[rgba(255,255,255,0.6)] shadow-blur;
|
||||||
|
}
|
||||||
|
.card-header {
|
||||||
|
@apply -mx-[0.6rem] flex items-center justify-between border-b border-b-[#e1e7eb] p-4;
|
||||||
|
}
|
||||||
|
.card-footer {
|
||||||
|
@apply -mx-[0.6rem] mt-2 flex items-center justify-center border-t border-t-[#e1e7eb] py-4;
|
||||||
|
}
|
||||||
|
|
||||||
|
[data-theme="green"] {
|
||||||
|
--fo-facility-info-flow-year-bg: color-mix(in srgb, var(--chart-4) 15%, var(--background));
|
||||||
|
--fo-facility-info-water-year-bg: color-mix(in srgb, var(--chart-3) 15%, var(--background));
|
||||||
|
--fo-facility-info-phosphorus-year-bg: color-mix(in srgb, var(--chart-1) 15%, var(--background));
|
||||||
|
--fo-facility-info-flow-summer-bg: color-mix(in srgb, var(--chart-4) 23%, var(--background));
|
||||||
|
--fo-facility-info-water-summer-bg: color-mix(in srgb, var(--chart-3) 23%, var(--background));
|
||||||
|
--fo-facility-info-phosphorus-summer-bg: color-mix(in srgb, var(--chart-1) 23%, var(--background));
|
||||||
|
--fo-facility-info-flow-winter-bg: color-mix(in srgb, var(--chart-4) 31%, var(--background));
|
||||||
|
--fo-facility-info-water-winter-bg: color-mix(in srgb, var(--chart-3) 31%, var(--background));
|
||||||
|
--fo-facility-info-phosphorus-winter-bg: color-mix(in srgb, var(--chart-1) 31%, var(--background));
|
||||||
|
--fo-rain-impact-row-bg: color-mix(in srgb, var(--chart-3) 12%, var(--background));
|
||||||
|
--fo-facility-info-header-bg: #ebf7f7;
|
||||||
|
--fo-facility-info-header-fg: #64908f;
|
||||||
|
--fo-facility-info-header-border: var(--border);
|
||||||
|
|
||||||
|
.card-border {
|
||||||
|
@apply border-[#3f4042] bg-[rgba(255,255,255,0.065)];
|
||||||
|
}
|
||||||
|
.card-header {
|
||||||
|
@apply border-b-[#3f4042];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="file"] {
|
||||||
|
@apply w-[200px] h-[40px] px-3 py-2 border border-[#d1d5db] rounded-md bg-white text-sm cursor-pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
@tailwind components;
|
||||||
|
|
||||||
|
@layer components {
|
||||||
|
.card {
|
||||||
|
@apply relative m-[0.6rem] box-border min-h-[2rem] rounded-[0.5rem] p-[0.6rem] text-[1.3rem] text-[#666];
|
||||||
|
}
|
||||||
|
.card-border {
|
||||||
|
@apply border border-[#dbe2e6] bg-[rgba(255,255,255,0.6)] shadow-blur;
|
||||||
|
}
|
||||||
|
.card-header {
|
||||||
|
@apply -mx-[0.6rem] flex items-center justify-between border-b border-b-[#e1e7eb] p-4;
|
||||||
|
}
|
||||||
|
.card-footer {
|
||||||
|
@apply -mx-[0.6rem] mt-2 flex items-center justify-center border-t border-t-[#e1e7eb] py-4;
|
||||||
|
}
|
||||||
|
|
||||||
|
[data-theme="red"] {
|
||||||
|
--fo-facility-info-flow-year-bg: color-mix(in srgb, var(--chart-4) 14%, var(--background));
|
||||||
|
--fo-facility-info-water-year-bg: color-mix(in srgb, var(--chart-3) 14%, var(--background));
|
||||||
|
--fo-facility-info-phosphorus-year-bg: color-mix(in srgb, var(--chart-1) 14%, var(--background));
|
||||||
|
--fo-facility-info-flow-summer-bg: color-mix(in srgb, var(--chart-4) 22%, var(--background));
|
||||||
|
--fo-facility-info-water-summer-bg: color-mix(in srgb, var(--chart-3) 22%, var(--background));
|
||||||
|
--fo-facility-info-phosphorus-summer-bg: color-mix(in srgb, var(--chart-1) 22%, var(--background));
|
||||||
|
--fo-facility-info-flow-winter-bg: color-mix(in srgb, var(--chart-4) 30%, var(--background));
|
||||||
|
--fo-facility-info-water-winter-bg: color-mix(in srgb, var(--chart-3) 30%, var(--background));
|
||||||
|
--fo-facility-info-phosphorus-winter-bg: color-mix(in srgb, var(--chart-1) 30%, var(--background));
|
||||||
|
--fo-rain-impact-row-bg: color-mix(in srgb, var(--destructive) 12%, var(--background));
|
||||||
|
--fo-facility-info-header-bg: #f6f6f9;
|
||||||
|
--fo-facility-info-header-fg: #808080;
|
||||||
|
--fo-facility-info-header-border: var(--border);
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="file"] {
|
||||||
|
@apply w-[200px] h-[40px] px-3 py-2 border border-[#d1d5db] rounded-md bg-white text-sm cursor-pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,22 @@
|
|||||||
@tailwind components;
|
@tailwind components;
|
||||||
|
|
||||||
@layer components {
|
@layer components {
|
||||||
|
:root {
|
||||||
|
--fo-facility-info-flow-year-bg: color-mix(in srgb, var(--chart-4) 18%, var(--background));
|
||||||
|
--fo-facility-info-water-year-bg: color-mix(in srgb, var(--chart-3) 18%, var(--background));
|
||||||
|
--fo-facility-info-phosphorus-year-bg: color-mix(in srgb, var(--chart-1) 18%, var(--background));
|
||||||
|
--fo-facility-info-flow-summer-bg: color-mix(in srgb, var(--chart-4) 28%, var(--background));
|
||||||
|
--fo-facility-info-water-summer-bg: color-mix(in srgb, var(--chart-3) 28%, var(--background));
|
||||||
|
--fo-facility-info-phosphorus-summer-bg: color-mix(in srgb, var(--chart-1) 28%, var(--background));
|
||||||
|
--fo-facility-info-flow-winter-bg: color-mix(in srgb, var(--chart-4) 38%, var(--background));
|
||||||
|
--fo-facility-info-water-winter-bg: color-mix(in srgb, var(--chart-3) 38%, var(--background));
|
||||||
|
--fo-facility-info-phosphorus-winter-bg: color-mix(in srgb, var(--chart-1) 38%, var(--background));
|
||||||
|
--fo-rain-impact-row-bg: color-mix(in srgb, var(--chart-1) 10%, var(--background));
|
||||||
|
--fo-facility-info-header-bg: #eaf3fb;
|
||||||
|
--fo-facility-info-header-fg: #647784;
|
||||||
|
--fo-facility-info-header-border: var(--border);
|
||||||
|
}
|
||||||
|
|
||||||
.card {
|
.card {
|
||||||
@apply relative m-[0.6rem] box-border min-h-[2rem] rounded-[0.5rem] p-[0.6rem] text-[1.3rem] text-[#666];
|
@apply relative m-[0.6rem] box-border min-h-[2rem] rounded-[0.5rem] p-[0.6rem] text-[1.3rem] text-[#666];
|
||||||
}
|
}
|
||||||
@@ -14,13 +30,63 @@
|
|||||||
@apply -mx-[0.6rem] mt-2 flex items-center justify-center border-t border-t-[#e1e7eb] py-4;
|
@apply -mx-[0.6rem] mt-2 flex items-center justify-center border-t border-t-[#e1e7eb] py-4;
|
||||||
}
|
}
|
||||||
|
|
||||||
[data-theme="black"] {
|
.fo-facility-info-flow-year,
|
||||||
.card-border {
|
.fo-facility-info-water-year,
|
||||||
@apply border-[#3f4042] bg-[rgba(255,255,255,0.065)];
|
.fo-facility-info-phosphorus-year,
|
||||||
}
|
.fo-facility-info-flow-summer,
|
||||||
.card-header {
|
.fo-facility-info-water-summer,
|
||||||
@apply border-b-[#3f4042];
|
.fo-facility-info-phosphorus-summer,
|
||||||
}
|
.fo-facility-info-flow-winter,
|
||||||
|
.fo-facility-info-water-winter,
|
||||||
|
.fo-facility-info-phosphorus-winter {
|
||||||
|
color: var(--foreground);
|
||||||
|
}
|
||||||
|
|
||||||
|
.fo-facility-info-flow-year {
|
||||||
|
background-color: var(--fo-facility-info-flow-year-bg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.fo-facility-info-water-year {
|
||||||
|
background-color: var(--fo-facility-info-water-year-bg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.fo-facility-info-phosphorus-year {
|
||||||
|
background-color: var(--fo-facility-info-phosphorus-year-bg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.fo-facility-info-flow-summer {
|
||||||
|
background-color: var(--fo-facility-info-flow-summer-bg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.fo-facility-info-water-summer {
|
||||||
|
background-color: var(--fo-facility-info-water-summer-bg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.fo-facility-info-phosphorus-summer {
|
||||||
|
background-color: var(--fo-facility-info-phosphorus-summer-bg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.fo-facility-info-flow-winter {
|
||||||
|
background-color: var(--fo-facility-info-flow-winter-bg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.fo-facility-info-water-winter {
|
||||||
|
background-color: var(--fo-facility-info-water-winter-bg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.fo-facility-info-phosphorus-winter {
|
||||||
|
background-color: var(--fo-facility-info-phosphorus-winter-bg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.fo-rain-impact-row td {
|
||||||
|
background-color: var(--fo-rain-impact-row-bg);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.fo-facility-info-header-surface {
|
||||||
|
border: 1px solid var(--fo-facility-info-header-border);
|
||||||
|
background-color: var(--fo-facility-info-header-bg);
|
||||||
|
color: var(--fo-facility-info-header-fg);
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type="file"] {
|
input[type="file"] {
|
||||||
|
|||||||
Vendored
+1
@@ -1,5 +1,6 @@
|
|||||||
/// <reference types="next" />
|
/// <reference types="next" />
|
||||||
/// <reference types="next/image-types/global" />
|
/// <reference types="next/image-types/global" />
|
||||||
|
/// <reference path="./.next/types/routes.d.ts" />
|
||||||
|
|
||||||
// NOTE: This file should not be edited
|
// NOTE: This file should not be edited
|
||||||
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
import "./styles/base.css";
|
||||||
|
import "./styles/components.css";
|
||||||
|
import "./styles/components-black.css";
|
||||||
|
import "./styles/components-blue.css";
|
||||||
|
import "./styles/components-green.css";
|
||||||
|
import "./styles/components-red.css";
|
||||||
import { AppProvider } from "./providers";
|
import { AppProvider } from "./providers";
|
||||||
import { cookies } from "next/headers";
|
import { cookies } from "next/headers";
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
@tailwind components;
|
||||||
|
|
||||||
|
@layer components {
|
||||||
|
.card {
|
||||||
|
@apply relative m-[0.6rem] box-border min-h-[2rem] rounded-[0.5rem] p-[0.6rem] text-[1.3rem] text-[#666];
|
||||||
|
}
|
||||||
|
.card-border {
|
||||||
|
@apply border border-[#dbe2e6] bg-[rgba(255,255,255,0.6)] shadow-blur;
|
||||||
|
}
|
||||||
|
.card-header {
|
||||||
|
@apply -mx-[0.6rem] flex items-center justify-between border-b border-b-[#e1e7eb] p-4;
|
||||||
|
}
|
||||||
|
.card-footer {
|
||||||
|
@apply -mx-[0.6rem] mt-2 flex items-center justify-center border-t border-t-[#e1e7eb] py-4;
|
||||||
|
}
|
||||||
|
|
||||||
|
[data-theme="black"] {
|
||||||
|
.card-border {
|
||||||
|
@apply border-[#3f4042] bg-[rgba(255,255,255,0.065)];
|
||||||
|
}
|
||||||
|
.card-header {
|
||||||
|
@apply border-b-[#3f4042];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="file"] {
|
||||||
|
@apply w-[200px] h-[40px] px-3 py-2 border border-[#d1d5db] rounded-md bg-white text-sm cursor-pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
@tailwind components;
|
||||||
|
|
||||||
|
@layer components {
|
||||||
|
.card {
|
||||||
|
@apply relative m-[0.6rem] box-border min-h-[2rem] rounded-[0.5rem] p-[0.6rem] text-[1.3rem] text-[#666];
|
||||||
|
}
|
||||||
|
.card-border {
|
||||||
|
@apply border border-[#dbe2e6] bg-[rgba(255,255,255,0.6)] shadow-blur;
|
||||||
|
}
|
||||||
|
.card-header {
|
||||||
|
@apply -mx-[0.6rem] flex items-center justify-between border-b border-b-[#e1e7eb] p-4;
|
||||||
|
}
|
||||||
|
.card-footer {
|
||||||
|
@apply -mx-[0.6rem] mt-2 flex items-center justify-center border-t border-t-[#e1e7eb] py-4;
|
||||||
|
}
|
||||||
|
|
||||||
|
[data-theme="blue"] {
|
||||||
|
.card-border {
|
||||||
|
@apply border-[#3f4042] bg-[rgba(255,255,255,0.065)];
|
||||||
|
}
|
||||||
|
.card-header {
|
||||||
|
@apply border-b-[#3f4042];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="file"] {
|
||||||
|
@apply w-[200px] h-[40px] px-3 py-2 border border-[#d1d5db] rounded-md bg-white text-sm cursor-pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
@tailwind components;
|
||||||
|
|
||||||
|
@layer components {
|
||||||
|
.card {
|
||||||
|
@apply relative m-[0.6rem] box-border min-h-[2rem] rounded-[0.5rem] p-[0.6rem] text-[1.3rem] text-[#666];
|
||||||
|
}
|
||||||
|
.card-border {
|
||||||
|
@apply border border-[#dbe2e6] bg-[rgba(255,255,255,0.6)] shadow-blur;
|
||||||
|
}
|
||||||
|
.card-header {
|
||||||
|
@apply -mx-[0.6rem] flex items-center justify-between border-b border-b-[#e1e7eb] p-4;
|
||||||
|
}
|
||||||
|
.card-footer {
|
||||||
|
@apply -mx-[0.6rem] mt-2 flex items-center justify-center border-t border-t-[#e1e7eb] py-4;
|
||||||
|
}
|
||||||
|
|
||||||
|
[data-theme="green"] {
|
||||||
|
.card-border {
|
||||||
|
@apply border-[#3f4042] bg-[rgba(255,255,255,0.065)];
|
||||||
|
}
|
||||||
|
.card-header {
|
||||||
|
@apply border-b-[#3f4042];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="file"] {
|
||||||
|
@apply w-[200px] h-[40px] px-3 py-2 border border-[#d1d5db] rounded-md bg-white text-sm cursor-pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
@tailwind components;
|
||||||
|
|
||||||
|
@layer components {
|
||||||
|
.card {
|
||||||
|
@apply relative m-[0.6rem] box-border min-h-[2rem] rounded-[0.5rem] p-[0.6rem] text-[1.3rem] text-[#666];
|
||||||
|
}
|
||||||
|
.card-border {
|
||||||
|
@apply border border-[#dbe2e6] bg-[rgba(255,255,255,0.6)] shadow-blur;
|
||||||
|
}
|
||||||
|
.card-header {
|
||||||
|
@apply -mx-[0.6rem] flex items-center justify-between border-b border-b-[#e1e7eb] p-4;
|
||||||
|
}
|
||||||
|
.card-footer {
|
||||||
|
@apply -mx-[0.6rem] mt-2 flex items-center justify-center border-t border-t-[#e1e7eb] py-4;
|
||||||
|
}
|
||||||
|
|
||||||
|
[data-theme="red"] {
|
||||||
|
.card-border {
|
||||||
|
@apply border-[#3f4042] bg-[rgba(255,255,255,0.065)];
|
||||||
|
}
|
||||||
|
.card-header {
|
||||||
|
@apply border-b-[#3f4042];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="file"] {
|
||||||
|
@apply w-[200px] h-[40px] px-3 py-2 border border-[#d1d5db] rounded-md bg-white text-sm cursor-pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -14,15 +14,6 @@
|
|||||||
@apply -mx-[0.6rem] mt-2 flex items-center justify-center border-t border-t-[#e1e7eb] py-4;
|
@apply -mx-[0.6rem] mt-2 flex items-center justify-center border-t border-t-[#e1e7eb] py-4;
|
||||||
}
|
}
|
||||||
|
|
||||||
[data-theme="black"] {
|
|
||||||
.card-border {
|
|
||||||
@apply border-[#3f4042] bg-[rgba(255,255,255,0.065)];
|
|
||||||
}
|
|
||||||
.card-header {
|
|
||||||
@apply border-b-[#3f4042];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
input[type="file"] {
|
input[type="file"] {
|
||||||
@apply w-[200px] h-[40px] px-3 py-2 border border-[#d1d5db] rounded-md bg-white text-sm cursor-pointer;
|
@apply w-[200px] h-[40px] px-3 py-2 border border-[#d1d5db] rounded-md bg-white text-sm cursor-pointer;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,4 +4,5 @@ NEXT_PUBLIC_PROXY_HOST=http://localhost:3001
|
|||||||
SERVER_API_URL=http://192.168.0.102:8000
|
SERVER_API_URL=http://192.168.0.102:8000
|
||||||
NEXT_PUBLIC_SITE_ID=ST
|
NEXT_PUBLIC_SITE_ID=ST
|
||||||
NEXT_PUBLIC_SUB_DOMAIN=http://localhost:3000
|
NEXT_PUBLIC_SUB_DOMAIN=http://localhost:3000
|
||||||
NEXT_PUBLIC_TINY_API_KEY=t9nc4z6inquvvd5pq1vea8wcp7lb01qmqseh6egms9vpaju2
|
NEXT_PUBLIC_TINY_API_KEY=t9nc4z6inquvvd5pq1vea8wcp7lb01qmqseh6egms9vpaju2
|
||||||
|
NEXT_PUBLIC_ST_DASHBOARD_BBS_ID=13
|
||||||
@@ -1,54 +1,32 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import { Suspense, useCallback, useEffect, useMemo, useState } from "react";
|
import { Suspense, useCallback, useEffect, useMemo, useState } from "react";
|
||||||
|
import { usePathname, useRouter } from "next/navigation";
|
||||||
import { usePathname } from "next/navigation";
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
|
||||||
getTabStoreState as getGridTabStoreState,
|
getTabStoreState as getGridTabStoreState,
|
||||||
|
|
||||||
useTabStore as gridTabStore,
|
useTabStore as gridTabStore,
|
||||||
|
|
||||||
} from "@rsone/components";
|
} from "@rsone/components";
|
||||||
|
|
||||||
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import { ENDPOINT } from "@/shared/config";
|
import { ENDPOINT } from "@/shared/config";
|
||||||
|
|
||||||
import { getCookie, useAlertStore, useMenuStore } from "@/shared/lib";
|
import { getCookie, useAlertStore, useMenuStore } from "@/shared/lib";
|
||||||
|
import { isBbsNoticeMenu } from "@/shared/lib/bbs-notice-menu";
|
||||||
|
import {
|
||||||
|
menuMatchesStatisticsTabId,
|
||||||
|
resolveStatisticsTabId,
|
||||||
|
} from "@/shared/lib/statistics-menu-url";
|
||||||
import { useStatisticsTabUrlSync } from "@/shared/lib/use-statistics-tab-url-sync";
|
import { useStatisticsTabUrlSync } from "@/shared/lib/use-statistics-tab-url-sync";
|
||||||
|
|
||||||
import { isVerificationSelectionReportMenu } from "@/shared/lib/verification-selection-report";
|
import { isVerificationSelectionReportMenu } from "@/shared/lib/verification-selection-report";
|
||||||
|
|
||||||
import { StatisticsPageLayout } from "@/shared/ui/statistics-page-layout";
|
import { StatisticsPageLayout } from "@/shared/ui/statistics-page-layout";
|
||||||
|
|
||||||
import { tokenManager } from "@/entities/auth";
|
import { tokenManager } from "@/entities/auth";
|
||||||
|
|
||||||
import type { MenuItem } from "@/entities/menu";
|
import type { MenuItem } from "@/entities/menu";
|
||||||
|
|
||||||
import { MenuApi } from "@/entities/menu";
|
import { MenuApi } from "@/entities/menu";
|
||||||
|
|
||||||
import { BaseLayout } from "@common/components";
|
import { BaseLayout } from "@common/components";
|
||||||
|
|
||||||
import { getConfig } from "@common/config";
|
import { getConfig } from "@common/config";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import { getTabStoreState, useTabStore } from "@/store/tab-store";
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import VerificationSelectionReport from "@/components/statistics/VerificationSelectionReport";
|
import VerificationSelectionReport from "@/components/statistics/VerificationSelectionReport";
|
||||||
|
import { getTabStoreState, useTabStore } from "@/store/tab-store";
|
||||||
|
|
||||||
|
|
||||||
const appConfig = getConfig();
|
const appConfig = getConfig();
|
||||||
|
|
||||||
@@ -58,42 +36,23 @@ const appSiteId = getCookie("site-id-key") ?? "";
|
|||||||
|
|
||||||
const isLoggedIn = !!userId;
|
const isLoggedIn = !!userId;
|
||||||
|
|
||||||
|
function WithBaseLayoutInner({ children }: { children: React.ReactNode }) {
|
||||||
|
|
||||||
function WithBaseLayoutInner({
|
|
||||||
|
|
||||||
children,
|
|
||||||
|
|
||||||
}: {
|
|
||||||
|
|
||||||
children: React.ReactNode;
|
|
||||||
|
|
||||||
}) {
|
|
||||||
|
|
||||||
const pathname = usePathname();
|
const pathname = usePathname();
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** 탭 추가 없이 메뉴만 눌렀을 때 패널 유지 (다른 메뉴 클릭해도 유지) */
|
/** 탭 추가 없이 메뉴만 눌렀을 때 패널 유지 (다른 메뉴 클릭해도 유지) */
|
||||||
|
|
||||||
const [isVerificationSelectionReportPanelOpen, setReportPanelOpen] =
|
const [isVerificationSelectionReportPanelOpen, setReportPanelOpen] =
|
||||||
|
|
||||||
useState(false);
|
useState(false);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const setCurrentMenuInfo = useMenuStore(
|
const setCurrentMenuInfo = useMenuStore(
|
||||||
|
|
||||||
(state) => state.setCurrentMenuInfo,
|
(state) => state.setCurrentMenuInfo,
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const currentMenuInfo = useMenuStore((state) => state.currentMenuInfo);
|
const currentMenuInfo = useMenuStore((state) => state.currentMenuInfo);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const addTab = useTabStore((state) => state.addTab);
|
const addTab = useTabStore((state) => state.addTab);
|
||||||
|
|
||||||
const setActiveTab = useTabStore((state) => state.setActiveTab);
|
const setActiveTab = useTabStore((state) => state.setActiveTab);
|
||||||
@@ -108,16 +67,11 @@ function WithBaseLayoutInner({
|
|||||||
|
|
||||||
const addTabForGrid = gridTabStore((state) => state.addTab);
|
const addTabForGrid = gridTabStore((state) => state.addTab);
|
||||||
|
|
||||||
const setActiveTabForGrid = gridTabStore((state) => state.setActiveTab);
|
|
||||||
|
|
||||||
const setMenuListForGrid = gridTabStore((state) => state.setMenuList);
|
const setMenuListForGrid = gridTabStore((state) => state.setMenuList);
|
||||||
|
|
||||||
const alert = useAlertStore((state) => state.setMessage);
|
const alert = useAlertStore((state) => state.setMessage);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const { syncTabToUrl } = useStatisticsTabUrlSync({
|
const { syncTabToUrl } = useStatisticsTabUrlSync({
|
||||||
|
|
||||||
pathname,
|
pathname,
|
||||||
|
|
||||||
menuList,
|
menuList,
|
||||||
@@ -129,41 +83,27 @@ function WithBaseLayoutInner({
|
|||||||
addTabForGrid,
|
addTabForGrid,
|
||||||
|
|
||||||
setCurrentMenuInfo,
|
setCurrentMenuInfo,
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const { data: menuListData } = useQuery({
|
const { data: menuListData } = useQuery({
|
||||||
|
|
||||||
queryKey: [ENDPOINT.CMS_SERVICE.MENU_ROLES],
|
queryKey: [ENDPOINT.CMS_SERVICE.MENU_ROLES],
|
||||||
|
|
||||||
queryFn: () => MenuApi.getMenuRoles(appSiteId),
|
queryFn: () => MenuApi.getMenuRoles(appSiteId),
|
||||||
|
|
||||||
enabled: isLoggedIn,
|
enabled: isLoggedIn,
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
||||||
if (menuListData) {
|
if (menuListData) {
|
||||||
|
|
||||||
setMenuList(menuListData);
|
setMenuList(menuListData);
|
||||||
|
|
||||||
setMenuListForGrid(menuListData);
|
setMenuListForGrid(menuListData);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}, [menuListData, setMenuList, setMenuListForGrid]);
|
}, [menuListData, setMenuList, setMenuListForGrid]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 새로고침 후 persist로 앱 탭만 복원된 경우 rsone 그리드 스토어에 탭을 맞춤
|
// 새로고침 후 persist로 앱 탭만 복원된 경우 rsone 그리드 스토어에 탭을 맞춤
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
||||||
if (!menuList) return;
|
if (!menuList) return;
|
||||||
|
|
||||||
const appTabs = getTabStoreState().tabs;
|
const appTabs = getTabStoreState().tabs;
|
||||||
@@ -172,20 +112,13 @@ function WithBaseLayoutInner({
|
|||||||
|
|
||||||
if (getGridTabStoreState().tabs.length > 0) return;
|
if (getGridTabStoreState().tabs.length > 0) return;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for (const tab of appTabs) {
|
for (const tab of appTabs) {
|
||||||
|
|
||||||
getGridTabStoreState().addTab(tab.menuItem);
|
getGridTabStoreState().addTab(tab.menuItem);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const activeId = getTabStoreState().activeTabId;
|
const activeId = getTabStoreState().activeTabId;
|
||||||
|
|
||||||
if (activeId) {
|
if (activeId) {
|
||||||
|
|
||||||
setActiveTab(activeId);
|
setActiveTab(activeId);
|
||||||
|
|
||||||
const activeTab = appTabs.find((t) => t.id === activeId);
|
const activeTab = appTabs.find((t) => t.id === activeId);
|
||||||
@@ -193,155 +126,104 @@ function WithBaseLayoutInner({
|
|||||||
const gridActiveId = activeTab?.menuItem.menuEngNm;
|
const gridActiveId = activeTab?.menuItem.menuEngNm;
|
||||||
|
|
||||||
if (gridActiveId) {
|
if (gridActiveId) {
|
||||||
|
|
||||||
getGridTabStoreState().setActiveTab(gridActiveId);
|
getGridTabStoreState().setActiveTab(gridActiveId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}, [menuList, tabs, setActiveTab]);
|
}, [menuList, tabs, setActiveTab]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 활성 탭의 메뉴를 찾아서 urlPath를 가져옴. 탭이 전부 닫히면 ''를 넘겨 LNB에서 메뉴 강조 제거
|
// 활성 탭의 메뉴를 찾아서 urlPath를 가져옴. 탭이 전부 닫히면 ''를 넘겨 LNB에서 메뉴 강조 제거
|
||||||
|
|
||||||
const currentPath = useMemo(() => {
|
const currentPath = useMemo(() => {
|
||||||
|
|
||||||
if (tabs.length === 0) return "";
|
if (tabs.length === 0) return "";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (activeTabId && menuList) {
|
if (activeTabId && menuList) {
|
||||||
|
|
||||||
// menuList에서 활성 탭의 메뉴 찾기
|
// menuList에서 활성 탭의 메뉴 찾기
|
||||||
|
|
||||||
const findMenuByEngNm = (items: MenuItem[]): MenuItem | null => {
|
const findMenuByEngNm = (items: MenuItem[]): MenuItem | null => {
|
||||||
|
|
||||||
for (const item of items) {
|
for (const item of items) {
|
||||||
|
if (menuMatchesStatisticsTabId(item, activeTabId)) {
|
||||||
if (item.urlPath === activeTabId) {
|
|
||||||
|
|
||||||
return item;
|
return item;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.children) {
|
if (item.children) {
|
||||||
|
|
||||||
const found = findMenuByEngNm(item.children);
|
const found = findMenuByEngNm(item.children);
|
||||||
|
|
||||||
if (found) return found;
|
if (found) return found;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const activeMenu = findMenuByEngNm(menuList);
|
const activeMenu = findMenuByEngNm(menuList);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (activeMenu?.urlPath) {
|
if (activeMenu?.urlPath) {
|
||||||
|
|
||||||
return activeMenu.urlPath;
|
return activeMenu.urlPath;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 탭에서 직접 찾기
|
// 탭에서 직접 찾기
|
||||||
|
|
||||||
if (activeTabId) {
|
if (activeTabId) {
|
||||||
|
|
||||||
const currentTabs = getTabStoreState().tabs;
|
const currentTabs = getTabStoreState().tabs;
|
||||||
|
|
||||||
const activeTab = currentTabs.find((t) => t.id === activeTabId);
|
const activeTab = currentTabs.find((t) => t.id === activeTabId);
|
||||||
|
|
||||||
if (activeTab?.menuItem?.urlPath) {
|
if (activeTab?.menuItem?.urlPath) {
|
||||||
|
|
||||||
return activeTab.menuItem.urlPath;
|
return activeTab.menuItem.urlPath;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// currentMenuInfo에서 가져오기
|
// currentMenuInfo에서 가져오기
|
||||||
|
|
||||||
if (currentMenuInfo?.urlPath) {
|
if (currentMenuInfo?.urlPath) {
|
||||||
|
|
||||||
return currentMenuInfo.urlPath;
|
return currentMenuInfo.urlPath;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 기본값으로 pathname 사용
|
// 기본값으로 pathname 사용
|
||||||
|
|
||||||
return pathname ?? "";
|
return pathname ?? "";
|
||||||
|
|
||||||
}, [tabs.length, activeTabId, menuList, currentMenuInfo, pathname]);
|
}, [tabs.length, activeTabId, menuList, currentMenuInfo, pathname]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const handleMenuClick = useCallback(
|
const handleMenuClick = useCallback(
|
||||||
|
|
||||||
(item: MenuItem) => {
|
(item: MenuItem) => {
|
||||||
|
if (item.urlPath.includes("/cms/")) return;
|
||||||
|
|
||||||
setCurrentMenuInfo(item);
|
setCurrentMenuInfo(item);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (isVerificationSelectionReportMenu(item)) {
|
if (isVerificationSelectionReportMenu(item)) {
|
||||||
|
|
||||||
setReportPanelOpen(true);
|
setReportPanelOpen(true);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isBbsNoticeMenu(item)) {
|
||||||
|
if (item.urlPath) {
|
||||||
|
router.push(item.urlPath);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const addTabResult: boolean = addTab(item);
|
const addTabResult: boolean = addTab(item);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// packages/rsone의 스토어에도 동기화
|
// packages/rsone의 스토어에도 동기화
|
||||||
|
|
||||||
if (addTabResult) {
|
if (addTabResult) {
|
||||||
|
|
||||||
addTabForGrid(item);
|
addTabForGrid(item);
|
||||||
|
|
||||||
if (item.urlPath) {
|
if (item.urlPath) {
|
||||||
|
syncTabToUrl(resolveStatisticsTabId(item.urlPath));
|
||||||
syncTabToUrl(item.urlPath);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!addTabResult) {
|
if (!addTabResult) {
|
||||||
|
|
||||||
alert(`최대 추가 할 수 있는 화면 수(10개)를 \n초과 하였습니다.
|
alert(`최대 추가 할 수 있는 화면 수(10개)를 \n초과 하였습니다.
|
||||||
|
|
||||||
기존 화면을 닫은 후 이용해주세요.`);
|
기존 화면을 닫은 후 이용해주세요.`);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
[
|
[
|
||||||
|
|
||||||
setCurrentMenuInfo,
|
setCurrentMenuInfo,
|
||||||
|
|
||||||
addTab,
|
addTab,
|
||||||
@@ -354,70 +236,38 @@ function WithBaseLayoutInner({
|
|||||||
|
|
||||||
syncTabToUrl,
|
syncTabToUrl,
|
||||||
|
|
||||||
|
router,
|
||||||
],
|
],
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
||||||
<BaseLayout
|
<BaseLayout
|
||||||
|
|
||||||
queryClient={queryClient}
|
queryClient={queryClient}
|
||||||
|
|
||||||
tokenManager={tokenManager}
|
tokenManager={tokenManager}
|
||||||
|
|
||||||
currentPath={currentPath}
|
currentPath={currentPath}
|
||||||
|
|
||||||
handleMenuClick={handleMenuClick}
|
handleMenuClick={handleMenuClick}
|
||||||
|
|
||||||
>
|
>
|
||||||
|
<div className="flex h-full flex-1">
|
||||||
<div className="flex flex-1 h-full">
|
|
||||||
|
|
||||||
{isVerificationSelectionReportPanelOpen && (
|
{isVerificationSelectionReportPanelOpen && (
|
||||||
|
|
||||||
<VerificationSelectionReport
|
<VerificationSelectionReport
|
||||||
|
|
||||||
onClose={() => setReportPanelOpen(false)}
|
onClose={() => setReportPanelOpen(false)}
|
||||||
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<StatisticsPageLayout>{children}</StatisticsPageLayout>
|
<StatisticsPageLayout>{children}</StatisticsPageLayout>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</BaseLayout>
|
</BaseLayout>
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default function WithBaseLayout({
|
export default function WithBaseLayout({
|
||||||
|
|
||||||
children,
|
children,
|
||||||
|
|
||||||
}: {
|
}: {
|
||||||
|
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
|
|
||||||
}) {
|
}) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
||||||
<Suspense fallback={null}>
|
<Suspense fallback={null}>
|
||||||
|
|
||||||
<WithBaseLayoutInner>{children}</WithBaseLayoutInner>
|
<WithBaseLayoutInner>{children}</WithBaseLayoutInner>
|
||||||
|
|
||||||
</Suspense>
|
</Suspense>
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
}
|
}
|
||||||
/* 셀 클래스가 있으면 위 기본색보다 우선 (같은 specificity + 나중 규칙) */
|
/* 셀 클래스가 있으면 위 기본색보다 우선 (같은 specificity + 나중 규칙) */
|
||||||
.rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell.rg-cell-readonly {
|
.rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell.rg-cell-readonly {
|
||||||
@apply !bg-[#f9f8f8] !text-[#666];
|
@apply !bg-[#f0f0f0] !text-[#666];
|
||||||
}
|
}
|
||||||
.rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell.rg-cell-verify-error {
|
.rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell.rg-cell-verify-error {
|
||||||
@apply !bg-[#ffe6e6] !text-[#c00];
|
@apply !bg-[#ffe6e6] !text-[#c00];
|
||||||
|
|||||||
@@ -43,8 +43,10 @@ function buildFieldsFromColumns(columns: { fieldName: string; valueType?: ValueT
|
|||||||
const hasNumeratorDenominator = "numeratorFields" in col.computed && col.computed.numeratorFields.length > 0 && col.computed.denominatorFields.length > 0;
|
const hasNumeratorDenominator = "numeratorFields" in col.computed && col.computed.numeratorFields.length > 0 && col.computed.denominatorFields.length > 0;
|
||||||
const hasMaxOfFieldAndSum = "baseField" in col.computed && "sumFields" in col.computed && col.computed.sumFields.length > 0;
|
const hasMaxOfFieldAndSum = "baseField" in col.computed && "sumFields" in col.computed && col.computed.sumFields.length > 0;
|
||||||
const hasDifferenceOfSums = "minuendFields" in col.computed && "subtrahendFields" in col.computed && col.computed.minuendFields.length > 0;
|
const hasDifferenceOfSums = "minuendFields" in col.computed && "subtrahendFields" in col.computed && col.computed.minuendFields.length > 0;
|
||||||
|
const hasHalfSumOfSums = col.computed.type === "halfSumOfSums" && "firstSumFields" in col.computed && "secondSumFields" in col.computed && col.computed.firstSumFields.length > 0 && col.computed.secondSumFields.length > 0;
|
||||||
|
const hasSumOfTwoHalfSumOfSums = col.computed.type === "sumOfTwoHalfSumOfSums" && "firstHalfSum" in col.computed && "secondHalfSum" in col.computed && col.computed.firstHalfSum.firstSumFields.length > 0 && col.computed.firstHalfSum.secondSumFields.length > 0 && col.computed.secondHalfSum.firstSumFields.length > 0 && col.computed.secondHalfSum.secondSumFields.length > 0;
|
||||||
const hasSumOfMaxGroups = "groups" in col.computed && Array.isArray(col.computed.groups) && col.computed.groups.length > 0;
|
const hasSumOfMaxGroups = "groups" in col.computed && Array.isArray(col.computed.groups) && col.computed.groups.length > 0;
|
||||||
if (hasFields || hasNumeratorDenominator || hasMaxOfFieldAndSum || hasDifferenceOfSums || hasSumOfMaxGroups) {
|
if (hasFields || hasNumeratorDenominator || hasMaxOfFieldAndSum || hasDifferenceOfSums || hasHalfSumOfSums || hasSumOfTwoHalfSumOfSums || hasSumOfMaxGroups) {
|
||||||
field.valueCallback = getComputedValueCallback(col.computed) as (prod: unknown, dataRow: number, fieldName: string, fieldNames: string[], values: unknown[]) => number;
|
field.valueCallback = getComputedValueCallback(col.computed) as (prod: unknown, dataRow: number, fieldName: string, fieldNames: string[], values: unknown[]) => number;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import type {
|
|||||||
|
|
||||||
import { getComputedValueCallback } from "@/components/util/grid/computedFieldCallbacks";
|
import { getComputedValueCallback } from "@/components/util/grid/computedFieldCallbacks";
|
||||||
import {
|
import {
|
||||||
|
getExcelImportColumnFieldNames,
|
||||||
prepareGridColumnsForExcelExport,
|
prepareGridColumnsForExcelExport,
|
||||||
restoreGridColumnsAfterExcelExport,
|
restoreGridColumnsAfterExcelExport,
|
||||||
shouldPrepareColumnsForExcelExport,
|
shouldPrepareColumnsForExcelExport,
|
||||||
@@ -33,7 +34,7 @@ declare module "realgrid" {
|
|||||||
setOptions(options: {
|
setOptions(options: {
|
||||||
footer?: { visible?: boolean };
|
footer?: { visible?: boolean };
|
||||||
summaryMode?: "aggregate" | "statistical" | "none";
|
summaryMode?: "aggregate" | "statistical" | "none";
|
||||||
checkBar?: { visible?: boolean };
|
checkBar?: { visible?: boolean; exclusive?: boolean };
|
||||||
}): void;
|
}): void;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -457,10 +458,31 @@ function sortRowsGroupPreserving(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** columnInfo → RealGrid DataField 배열 (computed → valueCallback 포함, setFields용) */
|
/** columnInfo → RealGrid DataField 배열 (computed → valueCallback 포함, setFields용) */
|
||||||
|
function getDecimalPlacesFromDataFormat(dataFormat?: string): number | null {
|
||||||
|
if (!dataFormat) return null;
|
||||||
|
const match = dataFormat.match(/\.(0+|#+)/);
|
||||||
|
const decimalToken = match?.[1];
|
||||||
|
if (decimalToken) return decimalToken.length;
|
||||||
|
// #,##0 등 정수 포맷 — 소수부 없음 → 0자리 절삭(내림)
|
||||||
|
if (/[#0]/.test(dataFormat)) return 0;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
function truncateByDecimalPlaces(value: number, decimalPlaces: number): number {
|
||||||
|
if (!Number.isFinite(value)) return 0;
|
||||||
|
if (decimalPlaces < 0) return value;
|
||||||
|
const factor = 10 ** decimalPlaces;
|
||||||
|
const scaled = value * factor;
|
||||||
|
// 절삭(truncate): 반올림 없이 소수점 이하를 버린다.
|
||||||
|
const truncated = scaled >= 0 ? Math.floor(scaled) : Math.ceil(scaled);
|
||||||
|
return truncated / factor;
|
||||||
|
}
|
||||||
|
|
||||||
function buildFieldsFromColumns(
|
function buildFieldsFromColumns(
|
||||||
columns: {
|
columns: {
|
||||||
fieldName: string;
|
fieldName: string;
|
||||||
valueType?: ValueType;
|
valueType?: ValueType;
|
||||||
|
dataFormat?: string;
|
||||||
datetimeFormat?: string;
|
datetimeFormat?: string;
|
||||||
editor?: { type?: string; datetimeFormat?: string };
|
editor?: { type?: string; datetimeFormat?: string };
|
||||||
computed?: import("../type/DataGrid.type").ComputedFieldConfig;
|
computed?: import("../type/DataGrid.type").ComputedFieldConfig;
|
||||||
@@ -508,18 +530,52 @@ function buildFieldsFromColumns(
|
|||||||
"minuendFields" in col.computed &&
|
"minuendFields" in col.computed &&
|
||||||
"subtrahendFields" in col.computed &&
|
"subtrahendFields" in col.computed &&
|
||||||
col.computed.minuendFields.length > 0;
|
col.computed.minuendFields.length > 0;
|
||||||
|
const hasHalfSumOfSums =
|
||||||
|
col.computed.type === "halfSumOfSums" &&
|
||||||
|
"firstSumFields" in col.computed &&
|
||||||
|
"secondSumFields" in col.computed &&
|
||||||
|
col.computed.firstSumFields.length > 0 &&
|
||||||
|
col.computed.secondSumFields.length > 0;
|
||||||
|
const hasSumOfTwoHalfSumOfSums =
|
||||||
|
col.computed.type === "sumOfTwoHalfSumOfSums" &&
|
||||||
|
"firstHalfSum" in col.computed &&
|
||||||
|
"secondHalfSum" in col.computed &&
|
||||||
|
col.computed.firstHalfSum.firstSumFields.length > 0 &&
|
||||||
|
col.computed.firstHalfSum.secondSumFields.length > 0 &&
|
||||||
|
col.computed.secondHalfSum.firstSumFields.length > 0 &&
|
||||||
|
col.computed.secondHalfSum.secondSumFields.length > 0;
|
||||||
const hasSumOfMaxGroups =
|
const hasSumOfMaxGroups =
|
||||||
|
col.computed.type === "sumOfMaxOfFieldAndSumGroups" &&
|
||||||
"groups" in col.computed &&
|
"groups" in col.computed &&
|
||||||
Array.isArray(col.computed.groups) &&
|
Array.isArray(col.computed.groups) &&
|
||||||
col.computed.groups.length > 0;
|
col.computed.groups.length > 0;
|
||||||
|
const hasPumpGrossPpqty =
|
||||||
|
col.computed.type === "pumpGrossPpqty" &&
|
||||||
|
"pumpGroups" in col.computed &&
|
||||||
|
col.computed.pumpGroups.length > 0;
|
||||||
|
const hasBodPrcsRt =
|
||||||
|
col.computed.type === "bodPrcsRt" &&
|
||||||
|
"inflwField" in col.computed &&
|
||||||
|
"dschgField" in col.computed;
|
||||||
|
const hasQuotientRatioPercent =
|
||||||
|
col.computed.type === "quotientRatioPercent" &&
|
||||||
|
"numeratorQuotient" in col.computed &&
|
||||||
|
"denominatorQuotient" in col.computed &&
|
||||||
|
col.computed.numeratorQuotient.length === 2 &&
|
||||||
|
col.computed.denominatorQuotient.length === 2;
|
||||||
if (
|
if (
|
||||||
hasFields ||
|
hasFields ||
|
||||||
hasNumeratorDenominator ||
|
hasNumeratorDenominator ||
|
||||||
hasMaxOfFieldAndSum ||
|
hasMaxOfFieldAndSum ||
|
||||||
hasDifferenceOfSums ||
|
hasDifferenceOfSums ||
|
||||||
hasSumOfMaxGroups
|
hasHalfSumOfSums ||
|
||||||
|
hasSumOfTwoHalfSumOfSums ||
|
||||||
|
hasSumOfMaxGroups ||
|
||||||
|
hasPumpGrossPpqty ||
|
||||||
|
hasBodPrcsRt ||
|
||||||
|
hasQuotientRatioPercent
|
||||||
) {
|
) {
|
||||||
field.valueCallback = getComputedValueCallback(
|
const computedCallback = getComputedValueCallback(
|
||||||
col.computed,
|
col.computed,
|
||||||
) as (
|
) as (
|
||||||
prod: unknown,
|
prod: unknown,
|
||||||
@@ -528,6 +584,24 @@ function buildFieldsFromColumns(
|
|||||||
fieldNames: string[],
|
fieldNames: string[],
|
||||||
values: unknown[],
|
values: unknown[],
|
||||||
) => number;
|
) => number;
|
||||||
|
const decimalPlaces = getDecimalPlacesFromDataFormat(col.dataFormat);
|
||||||
|
field.valueCallback = (
|
||||||
|
prod: unknown,
|
||||||
|
dataRow: number,
|
||||||
|
fieldName: string,
|
||||||
|
fieldNames: string[],
|
||||||
|
values: unknown[],
|
||||||
|
) => {
|
||||||
|
const computedValue = computedCallback(
|
||||||
|
prod,
|
||||||
|
dataRow,
|
||||||
|
fieldName,
|
||||||
|
fieldNames,
|
||||||
|
values,
|
||||||
|
);
|
||||||
|
if (decimalPlaces == null) return computedValue;
|
||||||
|
return truncateByDecimalPlaces(computedValue, decimalPlaces);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return field;
|
return field;
|
||||||
@@ -586,6 +660,7 @@ const DataGrid = ({
|
|||||||
const onItemAllCheckedRef =
|
const onItemAllCheckedRef =
|
||||||
useRef<typeof onItemAllChecked>(onItemAllChecked);
|
useRef<typeof onItemAllChecked>(onItemAllChecked);
|
||||||
const isSyncingChecksFromRowDataRef = useRef(false);
|
const isSyncingChecksFromRowDataRef = useRef(false);
|
||||||
|
const columnsFieldsSigRef = useRef("");
|
||||||
columnsRef.current = columns;
|
columnsRef.current = columns;
|
||||||
rowDataRef.current = rowData;
|
rowDataRef.current = rowData;
|
||||||
cellStyleCallbackRef.current = cellStyleCallback;
|
cellStyleCallbackRef.current = cellStyleCallback;
|
||||||
@@ -638,20 +713,6 @@ const DataGrid = ({
|
|||||||
.find((s) => s.menuEngNm === activeTabId)?.menuKornNm ||
|
.find((s) => s.menuEngNm === activeTabId)?.menuKornNm ||
|
||||||
"export";
|
"export";
|
||||||
|
|
||||||
// 엑셀 import 시 매칭을 위해 헤더에 fieldName 포함 (예: "합계 (swgeProcZoneInnerSm)")
|
|
||||||
const originalHeaders: Map<string, string> = new Map();
|
|
||||||
columns.forEach((col) => {
|
|
||||||
if (col.fieldName && gridView.columnByName) {
|
|
||||||
const gridCol = gridView.columnByName(col.name);
|
|
||||||
if (gridCol && gridCol.header) {
|
|
||||||
const originalText = gridCol.header.text || "";
|
|
||||||
originalHeaders.set(col.name, originalText);
|
|
||||||
const headerWithFieldName = `${originalText} (${col.fieldName})`;
|
|
||||||
gridCol.header.text = headerWithFieldName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// exportGrid 호출 전에 columnLayout 정규화 (col 속성 추가)
|
// exportGrid 호출 전에 columnLayout 정규화 (col 속성 추가)
|
||||||
const normalizeLayoutForExport = (
|
const normalizeLayoutForExport = (
|
||||||
layout: ColumnLayoutItem[],
|
layout: ColumnLayoutItem[],
|
||||||
@@ -745,20 +806,6 @@ const DataGrid = ({
|
|||||||
excelExportVisibilitySnapshot,
|
excelExportVisibilitySnapshot,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// 헤더 원복
|
|
||||||
columns.forEach((col) => {
|
|
||||||
if (col.fieldName && gridView.columnByName) {
|
|
||||||
const gridCol = gridView.columnByName(col.name);
|
|
||||||
if (
|
|
||||||
gridCol &&
|
|
||||||
gridCol.header &&
|
|
||||||
originalHeaders.has(col.name)
|
|
||||||
) {
|
|
||||||
gridCol.header.text =
|
|
||||||
originalHeaders.get(col.name) || "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// columnLayout 원복 (footerUserSpans 유지)
|
// columnLayout 원복 (footerUserSpans 유지)
|
||||||
if (normalizedLayout && !layoutRestored) {
|
if (normalizedLayout && !layoutRestored) {
|
||||||
layoutRestored = true;
|
layoutRestored = true;
|
||||||
@@ -860,36 +907,11 @@ const DataGrid = ({
|
|||||||
: headerStartRow;
|
: headerStartRow;
|
||||||
const dataStartRow = maxHeaderRowIndex + 1;
|
const dataStartRow = maxHeaderRowIndex + 1;
|
||||||
|
|
||||||
// 엑셀 컬럼 인덱스 → 그리드 fieldName 매핑
|
// 엑셀 N번째 열 → 그리드 N번째 fieldName (보내기 컬럼 순서 기준)
|
||||||
const headerToFieldNameMap = new Map<string, string>();
|
const excelColumnFieldNames = getExcelImportColumnFieldNames(
|
||||||
headers.forEach((headerText, colIndex) => {
|
columns,
|
||||||
let fieldName: string | null = null;
|
columnLayout,
|
||||||
|
);
|
||||||
// 헤더에 fieldName이 포함된 경우 (예: "합계 (swgeProcZoneInnerSm)")
|
|
||||||
const fieldNameMatch = headerText.match(
|
|
||||||
/\(([a-zA-Z_][a-zA-Z0-9_]*)\)$/,
|
|
||||||
);
|
|
||||||
if (fieldNameMatch && fieldNameMatch[1]) {
|
|
||||||
const extractedFieldName = fieldNameMatch[1];
|
|
||||||
if (
|
|
||||||
columns.find(
|
|
||||||
(c) => c.fieldName === extractedFieldName,
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
fieldName = extractedFieldName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 매칭 실패 시 원본 헤더 텍스트 사용
|
|
||||||
if (!fieldName) {
|
|
||||||
console.warn(
|
|
||||||
`엑셀 컬럼 ${colIndex + 1} (헤더: "${headerText}") 매칭 실패 → 헤더 텍스트를 fieldName으로 사용`,
|
|
||||||
);
|
|
||||||
fieldName = headerText;
|
|
||||||
}
|
|
||||||
|
|
||||||
headerToFieldNameMap.set(headerText, fieldName);
|
|
||||||
});
|
|
||||||
|
|
||||||
// 데이터 행 읽기
|
// 데이터 행 읽기
|
||||||
const dataRows: Record<string, string | number>[] = [];
|
const dataRows: Record<string, string | number>[] = [];
|
||||||
@@ -907,12 +929,8 @@ const DataGrid = ({
|
|||||||
worksheet[
|
worksheet[
|
||||||
XLSX.utils.encode_cell({ r: row, c: col })
|
XLSX.utils.encode_cell({ r: row, c: col })
|
||||||
];
|
];
|
||||||
const headerName =
|
const fieldName = excelColumnFieldNames[colIndex];
|
||||||
headers[colIndex] || `Column${colIndex + 1}`;
|
if (!fieldName) continue;
|
||||||
// 헤더 텍스트를 fieldName으로 변환
|
|
||||||
const fieldName =
|
|
||||||
headerToFieldNameMap.get(headerName) ||
|
|
||||||
headerName;
|
|
||||||
|
|
||||||
let cellValue: string | number = "";
|
let cellValue: string | number = "";
|
||||||
if (
|
if (
|
||||||
@@ -996,6 +1014,21 @@ const DataGrid = ({
|
|||||||
const dataProvider = gridRef.current.dataProvider;
|
const dataProvider = gridRef.current.dataProvider;
|
||||||
applyDefaultGridEditOptions(gridView as GridViewWithEditOptions);
|
applyDefaultGridEditOptions(gridView as GridViewWithEditOptions);
|
||||||
|
|
||||||
|
const columnsFieldsSig = columns.map((c) => c.fieldName).join("\u0001");
|
||||||
|
if (columnsFieldsSig !== columnsFieldsSigRef.current) {
|
||||||
|
columnsFieldsSigRef.current = columnsFieldsSig;
|
||||||
|
const dpForFields = dataProvider as {
|
||||||
|
setFields?: (f: unknown[]) => void;
|
||||||
|
setRows?: (r: Record<string, string | number>[]) => void;
|
||||||
|
};
|
||||||
|
try {
|
||||||
|
dpForFields.setFields?.(buildFieldsFromColumns(columns));
|
||||||
|
dpForFields.setRows?.(rowDataRef.current);
|
||||||
|
} catch (e) {
|
||||||
|
console.warn("setFields sync:", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// mergeCells: true인 컬럼이 있으면 onSorting에서 클라이언트 정렬로 처리
|
// mergeCells: true인 컬럼이 있으면 onSorting에서 클라이언트 정렬로 처리
|
||||||
const hasMergeCells = columns.some((col) => col.mergeCells === true);
|
const hasMergeCells = columns.some((col) => col.mergeCells === true);
|
||||||
|
|
||||||
@@ -1046,6 +1079,14 @@ const DataGrid = ({
|
|||||||
}
|
}
|
||||||
columns.forEach((column) => {
|
columns.forEach((column) => {
|
||||||
const gv = gridView as GridViewWithSetColumnProperty;
|
const gv = gridView as GridViewWithSetColumnProperty;
|
||||||
|
const exists =
|
||||||
|
typeof (
|
||||||
|
gridView as { columnByName?: (name: string) => unknown }
|
||||||
|
).columnByName === "function" &&
|
||||||
|
(gridView as { columnByName: (name: string) => unknown }).columnByName(
|
||||||
|
column.name,
|
||||||
|
) != null;
|
||||||
|
if (!exists) return;
|
||||||
gv.setColumnProperty?.(
|
gv.setColumnProperty?.(
|
||||||
column.name,
|
column.name,
|
||||||
"header",
|
"header",
|
||||||
@@ -1054,6 +1095,11 @@ const DataGrid = ({
|
|||||||
tooltip: resolveColumnTooltip(column),
|
tooltip: resolveColumnTooltip(column),
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
gv.setColumnProperty?.(
|
||||||
|
column.name,
|
||||||
|
"editable",
|
||||||
|
column.editable !== false,
|
||||||
|
);
|
||||||
applyColumnListEditorProperties(gv, column);
|
applyColumnListEditorProperties(gv, column);
|
||||||
});
|
});
|
||||||
if (columns.some((c) => isDropDownEditorColumn(c))) {
|
if (columns.some((c) => isDropDownEditorColumn(c))) {
|
||||||
@@ -1101,7 +1147,7 @@ const DataGrid = ({
|
|||||||
|
|
||||||
// 헤더 체크박스 표시 여부 설정
|
// 헤더 체크박스 표시 여부 설정
|
||||||
gridView.setOptions({
|
gridView.setOptions({
|
||||||
checkBar: { visible: showHeaderCheckbox },
|
checkBar: { visible: showHeaderCheckbox, exclusive: false },
|
||||||
rowIndicator: { visible: false },
|
rowIndicator: { visible: false },
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1181,10 +1227,63 @@ const DataGrid = ({
|
|||||||
const hasFooterUserSpans = checkFooterUserSpans(columnLayout);
|
const hasFooterUserSpans = checkFooterUserSpans(columnLayout);
|
||||||
|
|
||||||
if (hasFooterUserSpans) {
|
if (hasFooterUserSpans) {
|
||||||
|
const validColumnNames = new Set(columns.map((c) => c.name));
|
||||||
|
const sanitizeColumnLayout = (
|
||||||
|
layout: unknown[],
|
||||||
|
): unknown[] => {
|
||||||
|
const result: unknown[] = [];
|
||||||
|
for (const item of layout) {
|
||||||
|
if (typeof item === "string") {
|
||||||
|
if (validColumnNames.has(item)) {
|
||||||
|
result.push(item);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!item || typeof item !== "object") continue;
|
||||||
|
|
||||||
|
if ("column" in item) {
|
||||||
|
const columnName = (item as { column?: unknown }).column;
|
||||||
|
if (
|
||||||
|
typeof columnName === "string" &&
|
||||||
|
validColumnNames.has(columnName)
|
||||||
|
) {
|
||||||
|
result.push(item);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ("items" in item && Array.isArray((item as { items?: unknown[] }).items)) {
|
||||||
|
const nextItems = sanitizeColumnLayout(
|
||||||
|
(item as { items: unknown[] }).items,
|
||||||
|
);
|
||||||
|
if (nextItems.length > 0) {
|
||||||
|
result.push({
|
||||||
|
...(item as Record<string, unknown>),
|
||||||
|
items: nextItems,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
result.push(item);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
|
||||||
// setColumnLayout은 그리드가 완전히 렌더링된 후 호출해야 함
|
// setColumnLayout은 그리드가 완전히 렌더링된 후 호출해야 함
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (gridRef.current?.gridView && columnLayout) {
|
if (gridRef.current?.gridView && columnLayout) {
|
||||||
gridRef.current.gridView.setColumnLayout?.(columnLayout);
|
const safeLayout = sanitizeColumnLayout(columnLayout as unknown[]);
|
||||||
|
if (safeLayout.length === 0) return;
|
||||||
|
try {
|
||||||
|
(
|
||||||
|
gridRef.current.gridView.setColumnLayout as
|
||||||
|
| ((layout: unknown) => void)
|
||||||
|
| undefined
|
||||||
|
)?.(safeLayout);
|
||||||
|
} catch (e) {
|
||||||
|
console.warn("setColumnLayout skipped due to invalid columns:", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
@@ -1654,6 +1753,22 @@ const DataGrid = ({
|
|||||||
layout={columnLayout}
|
layout={columnLayout}
|
||||||
rows={rowData}
|
rows={rowData}
|
||||||
onRGDataColumnsChanged={(grid) => {
|
onRGDataColumnsChanged={(grid) => {
|
||||||
|
const dp = gridRef.current?.dataProvider as
|
||||||
|
| {
|
||||||
|
setFields?: (f: unknown[]) => void;
|
||||||
|
setRows?: (
|
||||||
|
r: Record<string, string | number>[],
|
||||||
|
) => void;
|
||||||
|
}
|
||||||
|
| undefined;
|
||||||
|
try {
|
||||||
|
dp?.setFields?.(
|
||||||
|
buildFieldsFromColumns(columnsRef.current),
|
||||||
|
);
|
||||||
|
dp?.setRows?.(rowDataRef.current);
|
||||||
|
} catch (e) {
|
||||||
|
console.warn("onRGDataColumnsChanged setFields:", e);
|
||||||
|
}
|
||||||
reapplyListEditorsOnGrid(
|
reapplyListEditorsOnGrid(
|
||||||
grid as GridViewWithSetColumnProperty,
|
grid as GridViewWithSetColumnProperty,
|
||||||
columnsRef.current,
|
columnsRef.current,
|
||||||
@@ -1693,6 +1808,9 @@ const DataGrid = ({
|
|||||||
dataProvider.setFields(
|
dataProvider.setFields(
|
||||||
buildFieldsFromColumns(columns),
|
buildFieldsFromColumns(columns),
|
||||||
);
|
);
|
||||||
|
columnsFieldsSigRef.current = columns
|
||||||
|
.map((c) => c.fieldName)
|
||||||
|
.join("\u0001");
|
||||||
}
|
}
|
||||||
if (dataProvider?.setRows)
|
if (dataProvider?.setRows)
|
||||||
dataProvider.setRows(rowData);
|
dataProvider.setRows(rowData);
|
||||||
@@ -1874,15 +1992,9 @@ const DataGrid = ({
|
|||||||
{columns.map((column) => {
|
{columns.map((column) => {
|
||||||
const baseStyleName = column.styleName;
|
const baseStyleName = column.styleName;
|
||||||
|
|
||||||
const columnReactKey =
|
|
||||||
column.values?.length &&
|
|
||||||
isDropDownEditorColumn(column)
|
|
||||||
? `${column.name}-dropdown-${column.values.length}`
|
|
||||||
: column.name;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<RGDataColumn
|
<RGDataColumn
|
||||||
key={columnReactKey}
|
key={column.name}
|
||||||
name={column.name}
|
name={column.name}
|
||||||
fieldName={column.fieldName}
|
fieldName={column.fieldName}
|
||||||
valueType={
|
valueType={
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import DataGrid from "@/components/module/DataGrid";
|
|||||||
import { VerificationResultHistoryPagination } from "@/components/module/VerificationResultHistoryPagination";
|
import { VerificationResultHistoryPagination } from "@/components/module/VerificationResultHistoryPagination";
|
||||||
import type { CellStyleCallbackParams, ColumnInfo } from "@/components/type/DataGrid.type";
|
import type { CellStyleCallbackParams, ColumnInfo } from "@/components/type/DataGrid.type";
|
||||||
|
|
||||||
/** 통계 입력 현황 > 행 클릭 시 예외처리(prcsYn=3) 내역만 조회 */
|
/** 통계 입력 현황 > 행 클릭 시 사용자예외처리(prcsYn=2) 내역만 조회 */
|
||||||
export interface ExceptionProcessingHistoryQueryContext {
|
export interface ExceptionProcessingHistoryQueryContext {
|
||||||
sewerBzmnCd: string;
|
sewerBzmnCd: string;
|
||||||
ctpvNm: string;
|
ctpvNm: string;
|
||||||
@@ -92,13 +92,15 @@ function exceptionPrcsYnNmCellStyle({ fieldName, row }: CellStyleCallbackParams)
|
|||||||
const exceptionHistoryColumnInfo: ColumnInfo = {
|
const exceptionHistoryColumnInfo: ColumnInfo = {
|
||||||
columns: [
|
columns: [
|
||||||
{ name: "ctpvNm", fieldName: "ctpvNm", header: { text: "시도" }, editable: false },
|
{ name: "ctpvNm", fieldName: "ctpvNm", header: { text: "시도" }, editable: false },
|
||||||
{ name: "sggNm", fieldName: "sggNm", header: { text: "시군구" }, editable: false },
|
{ name: "admdstNm", fieldName: "admdstNm", header: { text: "행정구역" }, editable: false },
|
||||||
{ name: "vrfcTrgtNm", fieldName: "vrfcTrgtNm", header: { text: "검증대상" }, editable: false },
|
{ name: "vrfcTrgtNm", fieldName: "vrfcTrgtNm", header: { text: "검증대상" }, editable: false },
|
||||||
{ name: "rsnExpln", fieldName: "rsnExpln", header: { text: "사유" }, editable: false },
|
{ name: "rsnExpln", fieldName: "rsnExpln", header: { text: "사유" }, editable: false },
|
||||||
{ name: "nowVlCn", fieldName: "nowVlCn", header: { text: "입력값" }, editable: false },
|
{ name: "nowVlCn", fieldName: "nowVlCn", header: { text: "입력값" }, editable: false },
|
||||||
{ name: "compVlCn", fieldName: "compVlCn", header: { text: "기준값" }, editable: false },
|
{ name: "compVlCn", fieldName: "compVlCn", header: { text: "기준값" }, editable: false },
|
||||||
{ name: "prcsYnNm", fieldName: "prcsYnNm", header: { text: "처리여부" }, editable: false },
|
{ name: "prcsYnNm", fieldName: "prcsYnNm", header: { text: "처리여부" }, editable: false },
|
||||||
{ name: "pbcpAprvYn", fieldName: "pbcpAprvYn", header: { text: "공단승인여부" }, editable: false },
|
{ name: "stVrfRjtComNm", fieldName: "stVrfRjtComNm", header: { text: "반려상태" }, editable: false },
|
||||||
|
{ name: "prcsOpnnExpln", fieldName: "prcsOpnnExpln", header: { text: "처리의견" }, editable: false },
|
||||||
|
{ name: "rjctOpnnCn", fieldName: "rjctOpnnCn", header: { text: "반려의견" }, editable: false },
|
||||||
{ name: "regDt", fieldName: "regDt", header: { text: "등록일시" }, editable: false },
|
{ name: "regDt", fieldName: "regDt", header: { text: "등록일시" }, editable: false },
|
||||||
{ name: "mdfcnDt", fieldName: "mdfcnDt", header: { text: "갱신일시" }, editable: false },
|
{ name: "mdfcnDt", fieldName: "mdfcnDt", header: { text: "갱신일시" }, editable: false },
|
||||||
{
|
{
|
||||||
@@ -114,13 +116,15 @@ const exceptionHistoryColumnInfo: ColumnInfo = {
|
|||||||
],
|
],
|
||||||
columnLayout: [
|
columnLayout: [
|
||||||
"ctpvNm",
|
"ctpvNm",
|
||||||
"sggNm",
|
"admdstNm",
|
||||||
"vrfcTrgtNm",
|
"vrfcTrgtNm",
|
||||||
"rsnExpln",
|
"rsnExpln",
|
||||||
"nowVlCn",
|
"nowVlCn",
|
||||||
"compVlCn",
|
"compVlCn",
|
||||||
"prcsYnNm",
|
"prcsYnNm",
|
||||||
"pbcpAprvYn",
|
"stVrfRjtComNm",
|
||||||
|
"prcsOpnnExpln",
|
||||||
|
"rjctOpnnCn",
|
||||||
"regDt",
|
"regDt",
|
||||||
"mdfcnDt",
|
"mdfcnDt",
|
||||||
"individualReject",
|
"individualReject",
|
||||||
@@ -190,9 +194,9 @@ export function ExceptionProcessingHistoryDialog({
|
|||||||
sggNm: queryContext.sggNm,
|
sggNm: queryContext.sggNm,
|
||||||
statsYr: queryContext.statsYr,
|
statsYr: queryContext.statsYr,
|
||||||
statsCd: queryContext.statsCd,
|
statsCd: queryContext.statsCd,
|
||||||
pbcpAprvYn: "N",
|
|
||||||
vrfcMthdCd,
|
vrfcMthdCd,
|
||||||
prcsYnList: PRCS_YN_LIST,
|
prcsYnList: PRCS_YN_LIST,
|
||||||
|
rejectCodeList: "0,1,2",
|
||||||
page: pageIndex + 1,
|
page: pageIndex + 1,
|
||||||
size: 30,
|
size: 30,
|
||||||
};
|
};
|
||||||
@@ -308,14 +312,16 @@ export function ExceptionProcessingHistoryDialog({
|
|||||||
const mapRows = (entries: VerificationResultReportItem[]): ExceptionHistoryGridRow[] =>
|
const mapRows = (entries: VerificationResultReportItem[]): ExceptionHistoryGridRow[] =>
|
||||||
entries.map((item) => ({
|
entries.map((item) => ({
|
||||||
ctpvNm: item.ctpvNm,
|
ctpvNm: item.ctpvNm,
|
||||||
sggNm: item.sggNm,
|
admdstNm: item.admdstNm ?? item.sggNm ?? "-",
|
||||||
vrfcTrgtNm: item.vrfcTrgtNm,
|
vrfcTrgtNm: item.vrfcTrgtNm,
|
||||||
rsnExpln: item.rsnExpln,
|
rsnExpln: item.rsnExpln,
|
||||||
nowVlCn: item.nowVlCn ?? "-",
|
nowVlCn: item.nowVlCn ?? "-",
|
||||||
compVlCn: item.compVlCn ?? "-",
|
compVlCn: item.compVlCn ?? "-",
|
||||||
prcsYnNm: item.prcsYnNm ?? "-",
|
prcsYnNm: item.prcsYnNm ?? "-",
|
||||||
|
stVrfRjtComNm: item.stVrfRjtComNm ?? "-",
|
||||||
|
prcsOpnnExpln: item.prcsOpnnExpln ?? "-",
|
||||||
|
rjctOpnnCn: item.rjctOpnnCn ?? "-",
|
||||||
prcsYn: item.prcsYn ?? "",
|
prcsYn: item.prcsYn ?? "",
|
||||||
pbcpAprvYn: item.pbcpAprvYn,
|
|
||||||
regDt: (item.regDt ?? "").slice(0, 16),
|
regDt: (item.regDt ?? "").slice(0, 16),
|
||||||
mdfcnDt: (item.mdfcnDt ?? "").slice(0, 16),
|
mdfcnDt: (item.mdfcnDt ?? "").slice(0, 16),
|
||||||
individualReject: "개별 반려",
|
individualReject: "개별 반려",
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ const getSggListFetcher = async (
|
|||||||
key: [string, string, string, string],
|
key: [string, string, string, string],
|
||||||
): Promise<ApiResponse<Sgg[]>> => {
|
): Promise<ApiResponse<Sgg[]>> => {
|
||||||
const gugunSkipYn = doList.includes(key[3]) ? "N" : "Y";
|
const gugunSkipYn = doList.includes(key[3]) ? "N" : "Y";
|
||||||
return statisticsApi.getSggAllList(key[1], {
|
return statisticsApi.getSggList(key[1], {
|
||||||
instSeCd: key[2],
|
instSeCd: key[2],
|
||||||
gugunSkipYn,
|
gugunSkipYn,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ const getSidoListFetcher = async (): Promise<ApiResponse<SearchCondition>> => {
|
|||||||
const getSggAllListFetcher = async (
|
const getSggAllListFetcher = async (
|
||||||
key: [string, string],
|
key: [string, string],
|
||||||
): Promise<ApiResponse<Sgg[]>> => {
|
): Promise<ApiResponse<Sgg[]>> => {
|
||||||
return statisticsApi.getSggAllList(key[1]);
|
return statisticsApi.getSggList(key[1]);
|
||||||
};
|
};
|
||||||
|
|
||||||
type SidoSggFacilityNameSearchFormProps = {
|
type SidoSggFacilityNameSearchFormProps = {
|
||||||
@@ -292,17 +292,12 @@ const SidoSggFacilityNameSearchForm = ({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ctpvNm = String(row.ctpvNm ?? sido);
|
|
||||||
const sggNm = String(
|
|
||||||
row.sggNm ?? (gugun !== "ALL" && gugun ? gugun : ""),
|
|
||||||
);
|
|
||||||
|
|
||||||
const params: SeweragePipeFacilityAdminAreaListRequest = {
|
const params: SeweragePipeFacilityAdminAreaListRequest = {
|
||||||
statsYr: statsYr.trim(),
|
statsYr: statsYr.trim(),
|
||||||
swtrmtFcltCd,
|
swtrmtFcltCd,
|
||||||
sewerBzmnCd: initialSearchValues?.bsnmCd || '',
|
sewerBzmnCd: initialSearchValues?.bsnmCd || '',
|
||||||
ctpvNm,
|
ctpvNm: initialSidoValue || '',
|
||||||
...(doNameList.includes(ctpvNm) ? { sggNm } : {}),
|
...(doNameList.includes(initialSidoValue) ? { sggNm: initialGugunValue } : {}),
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import SplitDataGrid from "./SplitDataGrid";
|
|||||||
|
|
||||||
import { getComputedValueCallback } from "@/components/util/grid/computedFieldCallbacks"
|
import { getComputedValueCallback } from "@/components/util/grid/computedFieldCallbacks"
|
||||||
import {
|
import {
|
||||||
|
getExcelImportColumnFieldNames,
|
||||||
prepareGridColumnsForExcelExport,
|
prepareGridColumnsForExcelExport,
|
||||||
restoreGridColumnsAfterExcelExport,
|
restoreGridColumnsAfterExcelExport,
|
||||||
shouldPrepareColumnsForExcelExport,
|
shouldPrepareColumnsForExcelExport,
|
||||||
@@ -222,8 +223,10 @@ function buildFieldsFromColumns(columns: { fieldName: string; valueType?: ValueT
|
|||||||
const hasNumeratorDenominator = "numeratorFields" in col.computed && col.computed.numeratorFields.length > 0 && col.computed.denominatorFields.length > 0;
|
const hasNumeratorDenominator = "numeratorFields" in col.computed && col.computed.numeratorFields.length > 0 && col.computed.denominatorFields.length > 0;
|
||||||
const hasMaxOfFieldAndSum = "baseField" in col.computed && "sumFields" in col.computed && col.computed.sumFields.length > 0;
|
const hasMaxOfFieldAndSum = "baseField" in col.computed && "sumFields" in col.computed && col.computed.sumFields.length > 0;
|
||||||
const hasDifferenceOfSums = "minuendFields" in col.computed && "subtrahendFields" in col.computed && col.computed.minuendFields.length > 0;
|
const hasDifferenceOfSums = "minuendFields" in col.computed && "subtrahendFields" in col.computed && col.computed.minuendFields.length > 0;
|
||||||
|
const hasHalfSumOfSums = col.computed.type === "halfSumOfSums" && "firstSumFields" in col.computed && "secondSumFields" in col.computed && col.computed.firstSumFields.length > 0 && col.computed.secondSumFields.length > 0;
|
||||||
|
const hasSumOfTwoHalfSumOfSums = col.computed.type === "sumOfTwoHalfSumOfSums" && "firstHalfSum" in col.computed && "secondHalfSum" in col.computed && col.computed.firstHalfSum.firstSumFields.length > 0 && col.computed.firstHalfSum.secondSumFields.length > 0 && col.computed.secondHalfSum.firstSumFields.length > 0 && col.computed.secondHalfSum.secondSumFields.length > 0;
|
||||||
const hasSumOfMaxGroups = "groups" in col.computed && Array.isArray(col.computed.groups) && col.computed.groups.length > 0;
|
const hasSumOfMaxGroups = "groups" in col.computed && Array.isArray(col.computed.groups) && col.computed.groups.length > 0;
|
||||||
if (hasFields || hasNumeratorDenominator || hasMaxOfFieldAndSum || hasDifferenceOfSums || hasSumOfMaxGroups) {
|
if (hasFields || hasNumeratorDenominator || hasMaxOfFieldAndSum || hasDifferenceOfSums || hasHalfSumOfSums || hasSumOfTwoHalfSumOfSums || hasSumOfMaxGroups) {
|
||||||
field.valueCallback = getComputedValueCallback(col.computed) as (prod: unknown, dataRow: number, fieldName: string, fieldNames: string[], values: unknown[]) => number;
|
field.valueCallback = getComputedValueCallback(col.computed) as (prod: unknown, dataRow: number, fieldName: string, fieldNames: string[], values: unknown[]) => number;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -373,20 +376,6 @@ const TabDataGrid = ({
|
|||||||
const columns = columnInfoItem.columns || [];
|
const columns = columnInfoItem.columns || [];
|
||||||
const columnLayout = columnInfoItem.columnLayout || [];
|
const columnLayout = columnInfoItem.columnLayout || [];
|
||||||
|
|
||||||
// 엑셀 import 시 매칭을 위해 헤더에 fieldName 포함 (예: "합계 (swgeProcZoneInnerSm)")
|
|
||||||
const originalHeaders: Map<string, string> = new Map();
|
|
||||||
columns.forEach((col) => {
|
|
||||||
if (col.fieldName && gridView.columnByName) {
|
|
||||||
const gridCol = gridView.columnByName(col.name);
|
|
||||||
if (gridCol && gridCol.header) {
|
|
||||||
const originalText = gridCol.header.text || '';
|
|
||||||
originalHeaders.set(col.name, originalText);
|
|
||||||
const headerWithFieldName = `${originalText} (${col.fieldName})`;
|
|
||||||
gridCol.header.text = headerWithFieldName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// exportGrid 호출 전에 columnLayout 정규화 (col 속성 추가)
|
// exportGrid 호출 전에 columnLayout 정규화 (col 속성 추가)
|
||||||
const normalizeLayoutForExport = (layout: ColumnLayoutItem[]): ColumnLayoutItem[] => {
|
const normalizeLayoutForExport = (layout: ColumnLayoutItem[]): ColumnLayoutItem[] => {
|
||||||
return layout.map(item => {
|
return layout.map(item => {
|
||||||
@@ -452,15 +441,6 @@ const TabDataGrid = ({
|
|||||||
if (excelExportVisibilitySnapshot) {
|
if (excelExportVisibilitySnapshot) {
|
||||||
restoreGridColumnsAfterExcelExport(gridView, excelExportVisibilitySnapshot);
|
restoreGridColumnsAfterExcelExport(gridView, excelExportVisibilitySnapshot);
|
||||||
}
|
}
|
||||||
// 헤더 원복
|
|
||||||
columns.forEach((col) => {
|
|
||||||
if (col.fieldName && gridView.columnByName) {
|
|
||||||
const gridCol = gridView.columnByName(col.name);
|
|
||||||
if (gridCol && gridCol.header && originalHeaders.has(col.name)) {
|
|
||||||
gridCol.header.text = originalHeaders.get(col.name) || '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// columnLayout 원복 (footerUserSpans 유지)
|
// columnLayout 원복 (footerUserSpans 유지)
|
||||||
if (normalizedLayout && !layoutRestored) {
|
if (normalizedLayout && !layoutRestored) {
|
||||||
layoutRestored = true;
|
layoutRestored = true;
|
||||||
@@ -546,29 +526,12 @@ const TabDataGrid = ({
|
|||||||
const maxHeaderRowIndex = headerRowIndexes.length > 0 ? Math.max(...headerRowIndexes) : headerStartRow;
|
const maxHeaderRowIndex = headerRowIndexes.length > 0 ? Math.max(...headerRowIndexes) : headerStartRow;
|
||||||
const dataStartRow = maxHeaderRowIndex + 1;
|
const dataStartRow = maxHeaderRowIndex + 1;
|
||||||
|
|
||||||
// 엑셀 컬럼 인덱스 → 그리드 fieldName 매핑
|
|
||||||
const headerToFieldNameMap = new Map<string, string>();
|
|
||||||
const columns = columnInfoItem.columns || [];
|
const columns = columnInfoItem.columns || [];
|
||||||
headers.forEach((headerText, colIndex) => {
|
const columnLayout = columnInfoItem.columnLayout || [];
|
||||||
let fieldName: string | null = null;
|
const excelColumnFieldNames = getExcelImportColumnFieldNames(
|
||||||
|
columns,
|
||||||
// 헤더에 fieldName이 포함된 경우 (예: "합계 (swgeProcZoneInnerSm)")
|
columnLayout,
|
||||||
const fieldNameMatch = headerText.match(/\(([a-zA-Z_][a-zA-Z0-9_]*)\)$/);
|
);
|
||||||
if (fieldNameMatch && fieldNameMatch[1]) {
|
|
||||||
const extractedFieldName = fieldNameMatch[1];
|
|
||||||
if (columns.find(c => c.fieldName === extractedFieldName)) {
|
|
||||||
fieldName = extractedFieldName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 매칭 실패 시 원본 헤더 텍스트 사용
|
|
||||||
if (!fieldName) {
|
|
||||||
console.warn(`엑셀 컬럼 ${colIndex + 1} (헤더: "${headerText}") 매칭 실패 → 헤더 텍스트를 fieldName으로 사용`);
|
|
||||||
fieldName = headerText;
|
|
||||||
}
|
|
||||||
|
|
||||||
headerToFieldNameMap.set(headerText, fieldName);
|
|
||||||
});
|
|
||||||
|
|
||||||
// 데이터 행 읽기
|
// 데이터 행 읽기
|
||||||
const dataRows: Record<string, string | number>[] = [];
|
const dataRows: Record<string, string | number>[] = [];
|
||||||
@@ -579,9 +542,8 @@ const TabDataGrid = ({
|
|||||||
for (let colIndex = 0; colIndex < headers.length; colIndex++) {
|
for (let colIndex = 0; colIndex < headers.length; colIndex++) {
|
||||||
const col = range.s.c + colIndex;
|
const col = range.s.c + colIndex;
|
||||||
const cell = worksheet[XLSX.utils.encode_cell({ r: row, c: col })];
|
const cell = worksheet[XLSX.utils.encode_cell({ r: row, c: col })];
|
||||||
const headerName = headers[colIndex] || `Column${colIndex + 1}`;
|
const fieldName = excelColumnFieldNames[colIndex];
|
||||||
// 헤더 텍스트를 fieldName으로 변환
|
if (!fieldName) continue;
|
||||||
const fieldName = headerToFieldNameMap.get(headerName) || headerName;
|
|
||||||
|
|
||||||
let cellValue: string | number = '';
|
let cellValue: string | number = '';
|
||||||
if (cell && cell.v !== undefined && cell.v !== null) {
|
if (cell && cell.v !== undefined && cell.v !== null) {
|
||||||
|
|||||||
@@ -92,13 +92,12 @@ const verificationSubmitResultColumnInfo: ColumnInfo = {
|
|||||||
{ name: "vrfcMthdNm", fieldName: "vrfcMthdNm", header: { text: "구분" }, editable: false },
|
{ name: "vrfcMthdNm", fieldName: "vrfcMthdNm", header: { text: "구분" }, editable: false },
|
||||||
{ name: "vrfcMthdCd", fieldName: "vrfcMthdCd", header: { text: "검증유형코드" }, editable: false, visible: false },
|
{ name: "vrfcMthdCd", fieldName: "vrfcMthdCd", header: { text: "검증유형코드" }, editable: false, visible: false },
|
||||||
{ name: "ctpvNm", fieldName: "ctpvNm", header: { text: "시도" }, editable: false },
|
{ name: "ctpvNm", fieldName: "ctpvNm", header: { text: "시도" }, editable: false },
|
||||||
{ name: "sggNm", fieldName: "sggNm", header: { text: "시군구" }, editable: false },
|
{ name: "admdstNm", fieldName: "admdstNm", header: { text: "행정구역" }, editable: false },
|
||||||
{ name: "vrfcTrgtNm", fieldName: "vrfcTrgtNm", header: { text: "검증대상" }, editable: false },
|
{ name: "vrfcTrgtNm", fieldName: "vrfcTrgtNm", header: { text: "검증대상" }, editable: false },
|
||||||
{ name: "rsnExpln", fieldName: "rsnExpln", header: { text: "사유" }, editable: false },
|
{ name: "rsnExpln", fieldName: "rsnExpln", header: { text: "사유" }, editable: false },
|
||||||
{ name: "nowVlCn", fieldName: "nowVlCn", header: { text: "입력값" }, editable: false },
|
{ name: "nowVlCn", fieldName: "nowVlCn", header: { text: "입력값" }, editable: false },
|
||||||
{ name: "compVlCn", fieldName: "compVlCn", header: { text: "기준값" }, editable: false },
|
{ name: "compVlCn", fieldName: "compVlCn", header: { text: "기준값" }, editable: false },
|
||||||
{ name: "prcsYn", fieldName: "prcsYn", header: { text: "처리여부" }, editable: false },
|
{ name: "prcsYn", fieldName: "prcsYn", header: { text: "처리여부" }, editable: false },
|
||||||
{ name: "pbcpAprvYn", fieldName: "pbcpAprvYn", header: { text: "공단승인여부" }, editable: false },
|
|
||||||
{ name: "regDt", fieldName: "regDt", header: { text: "등록일시" }, editable: false },
|
{ name: "regDt", fieldName: "regDt", header: { text: "등록일시" }, editable: false },
|
||||||
{ name: "mdfcnDt", fieldName: "mdfcnDt", header: { text: "갱신일시" }, editable: false },
|
{ name: "mdfcnDt", fieldName: "mdfcnDt", header: { text: "갱신일시" }, editable: false },
|
||||||
{
|
{
|
||||||
@@ -111,13 +110,12 @@ const verificationSubmitResultColumnInfo: ColumnInfo = {
|
|||||||
columnLayout: [
|
columnLayout: [
|
||||||
"vrfcMthdNm",
|
"vrfcMthdNm",
|
||||||
"ctpvNm",
|
"ctpvNm",
|
||||||
"sggNm",
|
"admdstNm",
|
||||||
"vrfcTrgtNm",
|
"vrfcTrgtNm",
|
||||||
"rsnExpln",
|
"rsnExpln",
|
||||||
"nowVlCn",
|
"nowVlCn",
|
||||||
"compVlCn",
|
"compVlCn",
|
||||||
"prcsYn",
|
"prcsYn",
|
||||||
"pbcpAprvYn",
|
|
||||||
"regDt",
|
"regDt",
|
||||||
"mdfcnDt",
|
"mdfcnDt",
|
||||||
"prcsOpnnExpln",
|
"prcsOpnnExpln",
|
||||||
@@ -202,13 +200,12 @@ export function VerificationResultDialog({
|
|||||||
vrfcMthdCd,
|
vrfcMthdCd,
|
||||||
vrfcMthdNm: VRFC_MTHD_NAME_MAP[vrfcMthdCd] ?? item.vrfcMthdNm,
|
vrfcMthdNm: VRFC_MTHD_NAME_MAP[vrfcMthdCd] ?? item.vrfcMthdNm,
|
||||||
ctpvNm: item.ctpvNm,
|
ctpvNm: item.ctpvNm,
|
||||||
sggNm: item.sggNm,
|
admdstNm: item.admdstNm ?? item.sggNm ?? "-",
|
||||||
vrfcTrgtNm: item.vrfcTrgtNm,
|
vrfcTrgtNm: item.vrfcTrgtNm,
|
||||||
rsnExpln: item.rsnExpln,
|
rsnExpln: item.rsnExpln,
|
||||||
nowVlCn: item.nowVlCn ?? "-",
|
nowVlCn: item.nowVlCn ?? "-",
|
||||||
compVlCn: item.compVlCn ?? "-",
|
compVlCn: item.compVlCn ?? "-",
|
||||||
prcsYn: PRCS_YN_LABEL[item.prcsYn] ?? item.prcsYn,
|
prcsYn: item.prcsYnNm ?? PRCS_YN_LABEL[item.prcsYn] ?? item.prcsYn,
|
||||||
pbcpAprvYn: item.pbcpAprvYn,
|
|
||||||
regDt: (item.regDt ?? "").slice(0, 16),
|
regDt: (item.regDt ?? "").slice(0, 16),
|
||||||
mdfcnDt: (item.mdfcnDt ?? "").slice(0, 16),
|
mdfcnDt: (item.mdfcnDt ?? "").slice(0, 16),
|
||||||
prcsOpnnExpln: item.prcsOpnnExpln ?? "",
|
prcsOpnnExpln: item.prcsOpnnExpln ?? "",
|
||||||
@@ -226,9 +223,9 @@ export function VerificationResultDialog({
|
|||||||
sggNm: stableQueryContext.sggNm,
|
sggNm: stableQueryContext.sggNm,
|
||||||
statsYr: stableQueryContext.statsYr,
|
statsYr: stableQueryContext.statsYr,
|
||||||
statsCd: stableQueryContext.statsCd,
|
statsCd: stableQueryContext.statsCd,
|
||||||
pbcpAprvYn: "N",
|
|
||||||
vrfcMthdCd,
|
vrfcMthdCd,
|
||||||
prcsYnList: "0",
|
prcsYnList: "0",
|
||||||
|
rejectCodeList: "0,1,2",
|
||||||
page: page + 1,
|
page: page + 1,
|
||||||
size: 10000,
|
size: 10000,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -137,12 +137,15 @@ function verificationPrcsYnNmCellStyle({ fieldName, row }: CellStyleCallbackPara
|
|||||||
const verificationResultColumnInfo: ColumnInfo = {
|
const verificationResultColumnInfo: ColumnInfo = {
|
||||||
columns: [
|
columns: [
|
||||||
{ name: "ctpvNm", fieldName: "ctpvNm", header: { text: "시도" }, editable: false },
|
{ name: "ctpvNm", fieldName: "ctpvNm", header: { text: "시도" }, editable: false },
|
||||||
{ name: "sggNm", fieldName: "sggNm", header: { text: "시군구" }, editable: false },
|
{ name: "admdstNm", fieldName: "admdstNm", header: { text: "행정구역" }, editable: false },
|
||||||
{ name: "vrfcTrgtNm", fieldName: "vrfcTrgtNm", header: { text: "검증대상" }, editable: false },
|
{ name: "vrfcTrgtNm", fieldName: "vrfcTrgtNm", header: { text: "검증대상" }, editable: false },
|
||||||
{ name: "rsnExpln", fieldName: "rsnExpln", header: { text: "사유" }, editable: false },
|
{ name: "rsnExpln", fieldName: "rsnExpln", header: { text: "사유" }, editable: false },
|
||||||
{ name: "nowVlCn", fieldName: "nowVlCn", header: { text: "입력값" }, editable: false },
|
{ name: "nowVlCn", fieldName: "nowVlCn", header: { text: "입력값" }, editable: false },
|
||||||
{ name: "compVlCn", fieldName: "compVlCn", header: { text: "기준값" }, editable: false },
|
{ name: "compVlCn", fieldName: "compVlCn", header: { text: "기준값" }, editable: false },
|
||||||
{ name: "prcsYnNm", fieldName: "prcsYnNm", header: { text: "처리여부" }, editable: false },
|
{ name: "prcsYnNm", fieldName: "prcsYnNm", header: { text: "처리여부" }, editable: false },
|
||||||
|
{ name: "stVrfRjtComNm", fieldName: "stVrfRjtComNm", header: { text: "반려상태" }, editable: false },
|
||||||
|
{ name: "prcsOpnnExpln", fieldName: "prcsOpnnExpln", header: { text: "처리의견" }, editable: false },
|
||||||
|
{ name: "rjctOpnnCn", fieldName: "rjctOpnnCn", header: { text: "반려의견" }, editable: false },
|
||||||
{ name: "regDt", fieldName: "regDt", header: { text: "등록일시" }, editable: false },
|
{ name: "regDt", fieldName: "regDt", header: { text: "등록일시" }, editable: false },
|
||||||
{ name: "mdfcnDt", fieldName: "mdfcnDt", header: { text: "갱신일시" }, editable: false },
|
{ name: "mdfcnDt", fieldName: "mdfcnDt", header: { text: "갱신일시" }, editable: false },
|
||||||
{ name: "prcsYn", fieldName: "prcsYn", header: { text: "검증결과상태코드" }, editable: false, visible: false },
|
{ name: "prcsYn", fieldName: "prcsYn", header: { text: "검증결과상태코드" }, editable: false, visible: false },
|
||||||
@@ -150,12 +153,15 @@ const verificationResultColumnInfo: ColumnInfo = {
|
|||||||
],
|
],
|
||||||
columnLayout: [
|
columnLayout: [
|
||||||
"ctpvNm",
|
"ctpvNm",
|
||||||
"sggNm",
|
"admdstNm",
|
||||||
"vrfcTrgtNm",
|
"vrfcTrgtNm",
|
||||||
"rsnExpln",
|
"rsnExpln",
|
||||||
"nowVlCn",
|
"nowVlCn",
|
||||||
"compVlCn",
|
"compVlCn",
|
||||||
"prcsYnNm",
|
"prcsYnNm",
|
||||||
|
"stVrfRjtComNm",
|
||||||
|
"prcsOpnnExpln",
|
||||||
|
"rjctOpnnCn",
|
||||||
"regDt",
|
"regDt",
|
||||||
"mdfcnDt",
|
"mdfcnDt",
|
||||||
"prcsYn",
|
"prcsYn",
|
||||||
@@ -175,6 +181,8 @@ export interface VerificationResultHistoryDialogProps {
|
|||||||
} | null;
|
} | null;
|
||||||
title?: string;
|
title?: string;
|
||||||
emptyMessage?: string;
|
emptyMessage?: string;
|
||||||
|
/** 예외 제출 취소 API 성공 후 부모(입력 화면)에서 메인 데이터를 다시 조회할 때 사용 */
|
||||||
|
onExceptionResetSubmitted?: () => void | Promise<void>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function VerificationResultHistoryDialog({
|
export function VerificationResultHistoryDialog({
|
||||||
@@ -183,6 +191,7 @@ export function VerificationResultHistoryDialog({
|
|||||||
queryContext,
|
queryContext,
|
||||||
title = "검증 결과 내역",
|
title = "검증 결과 내역",
|
||||||
emptyMessage = "표시할 검증 결과가 없습니다.",
|
emptyMessage = "표시할 검증 결과가 없습니다.",
|
||||||
|
onExceptionResetSubmitted,
|
||||||
}: VerificationResultHistoryDialogProps) {
|
}: VerificationResultHistoryDialogProps) {
|
||||||
const stableQueryContext = useMemo(() => {
|
const stableQueryContext = useMemo(() => {
|
||||||
if (!queryContext) return null;
|
if (!queryContext) return null;
|
||||||
@@ -245,9 +254,9 @@ export function VerificationResultHistoryDialog({
|
|||||||
sggNm: stableQueryContext.sggNm,
|
sggNm: stableQueryContext.sggNm,
|
||||||
statsYr: stableQueryContext.statsYr,
|
statsYr: stableQueryContext.statsYr,
|
||||||
statsCd: stableQueryContext.statsCd,
|
statsCd: stableQueryContext.statsCd,
|
||||||
pbcpAprvYn: "N",
|
|
||||||
vrfcMthdCd,
|
vrfcMthdCd,
|
||||||
prcsYnList: "0,2,3",
|
prcsYnList: "0,2",
|
||||||
|
rejectCodeList: "0,1,2",
|
||||||
page: pageIndex + 1,
|
page: pageIndex + 1,
|
||||||
size: PAGE_SIZE,
|
size: PAGE_SIZE,
|
||||||
};
|
};
|
||||||
@@ -376,14 +385,16 @@ export function VerificationResultHistoryDialog({
|
|||||||
vrfcSn: item.vrfcSn,
|
vrfcSn: item.vrfcSn,
|
||||||
__checked: isChecked ? 1 : 0,
|
__checked: isChecked ? 1 : 0,
|
||||||
ctpvNm: item.ctpvNm,
|
ctpvNm: item.ctpvNm,
|
||||||
sggNm: item.sggNm,
|
admdstNm: item.admdstNm ?? item.sggNm ?? "-",
|
||||||
vrfcTrgtNm: item.vrfcTrgtNm,
|
vrfcTrgtNm: item.vrfcTrgtNm,
|
||||||
rsnExpln: item.rsnExpln,
|
rsnExpln: item.rsnExpln,
|
||||||
nowVlCn: item.nowVlCn ?? "-",
|
nowVlCn: item.nowVlCn ?? "-",
|
||||||
compVlCn: item.compVlCn ?? "-",
|
compVlCn: item.compVlCn ?? "-",
|
||||||
prcsYnNm: item.prcsYnNm ?? "-",
|
prcsYnNm: item.prcsYnNm ?? "-",
|
||||||
|
stVrfRjtComNm: item.stVrfRjtComNm ?? "-",
|
||||||
|
prcsOpnnExpln: item.prcsOpnnExpln ?? "-",
|
||||||
|
rjctOpnnCn: item.rjctOpnnCn ?? "-",
|
||||||
prcsYn: item.prcsYn ?? "",
|
prcsYn: item.prcsYn ?? "",
|
||||||
pbcpAprvYn: item.pbcpAprvYn,
|
|
||||||
regDt: (item.regDt ?? "").slice(0, 16),
|
regDt: (item.regDt ?? "").slice(0, 16),
|
||||||
mdfcnDt: (item.mdfcnDt ?? "").slice(0, 16),
|
mdfcnDt: (item.mdfcnDt ?? "").slice(0, 16),
|
||||||
};
|
};
|
||||||
@@ -451,12 +462,28 @@ export function VerificationResultHistoryDialog({
|
|||||||
alert("예외 제출 취소 처리되었습니다.");
|
alert("예외 제출 취소 처리되었습니다.");
|
||||||
setCheckedVrfcByTab((prev) => ({ ...prev, [tab]: new Map() }));
|
setCheckedVrfcByTab((prev) => ({ ...prev, [tab]: new Map() }));
|
||||||
await loadTabPage(tab, tabPages[tab].pageIndex);
|
await loadTabPage(tab, tabPages[tab].pageIndex);
|
||||||
|
try {
|
||||||
|
await onExceptionResetSubmitted?.();
|
||||||
|
} catch {
|
||||||
|
alert(
|
||||||
|
"예외 제출 취소는 완료되었으나 화면 데이터를 다시 불러오지 못했습니다. 조회로 새로고침 해주세요.",
|
||||||
|
);
|
||||||
|
}
|
||||||
} catch {
|
} catch {
|
||||||
alert("예외 제출 취소 처리 중 오류가 발생했습니다.");
|
alert("예외 제출 취소 처리 중 오류가 발생했습니다.");
|
||||||
} finally {
|
} finally {
|
||||||
setResetSubmitting(false);
|
setResetSubmitting(false);
|
||||||
}
|
}
|
||||||
}, [activeTab, alert, checkedVrfcByTab, entriesByTab, loadTabPage, stableQueryContext, tabPages]);
|
}, [
|
||||||
|
activeTab,
|
||||||
|
alert,
|
||||||
|
checkedVrfcByTab,
|
||||||
|
entriesByTab,
|
||||||
|
loadTabPage,
|
||||||
|
onExceptionResetSubmitted,
|
||||||
|
stableQueryContext,
|
||||||
|
tabPages,
|
||||||
|
]);
|
||||||
|
|
||||||
const renderActiveTabPanel = (tab: VerificationHistoryTabKey) => {
|
const renderActiveTabPanel = (tab: VerificationHistoryTabKey) => {
|
||||||
const entries = entriesByTab[tab];
|
const entries = entriesByTab[tab];
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ export async function hasAnyPostSubmitVerificationResult(
|
|||||||
sggNm: ctx.sggNm,
|
sggNm: ctx.sggNm,
|
||||||
statsYr: ctx.statsYr,
|
statsYr: ctx.statsYr,
|
||||||
statsCd: ctx.statsCd,
|
statsCd: ctx.statsCd,
|
||||||
pbcpAprvYn: "N" as const,
|
|
||||||
prcsYnList: "0",
|
prcsYnList: "0",
|
||||||
|
rejectCodeList: "0,1,2",
|
||||||
page: 1,
|
page: 1,
|
||||||
size: 1,
|
size: 1,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useCallback, useState } from "react";
|
import { useCallback, useEffect, useState } from "react";
|
||||||
import {
|
import {
|
||||||
type InfiniteData,
|
type InfiniteData,
|
||||||
keepPreviousData,
|
keepPreviousData,
|
||||||
@@ -9,12 +9,12 @@ import {
|
|||||||
} from "@tanstack/react-query";
|
} from "@tanstack/react-query";
|
||||||
import { useTabStore as useGridTabStore } from "@rsone/components";
|
import { useTabStore as useGridTabStore } from "@rsone/components";
|
||||||
|
|
||||||
import { statisticsApi } from "@/entities/statistics/api/statistics-service";
|
import { verificationInputReportApi } from "@/entities/statistics/api/verification-input-report-service";
|
||||||
import type {
|
import type {
|
||||||
VerificationResultListRequest,
|
VerificationInputReportItem,
|
||||||
VerificationResultListResponse,
|
VerificationInputReportResponse,
|
||||||
VerificationResultReportItem,
|
VerificationInputReportTypeCountingInfo,
|
||||||
} from "@/entities/statistics/model/statistics-interface";
|
} from "@/entities/statistics/model/verification-input-report-interface";
|
||||||
import { useAlertStore, useMenuStore } from "@/shared/lib";
|
import { useAlertStore, useMenuStore } from "@/shared/lib";
|
||||||
import {
|
import {
|
||||||
findMenuItemByUrlPath,
|
findMenuItemByUrlPath,
|
||||||
@@ -59,8 +59,8 @@ const TYPE_CODE_NAME_MAP: Record<string, string> = {
|
|||||||
const PAGE_SIZE = 100;
|
const PAGE_SIZE = 100;
|
||||||
const SCROLL_LOAD_THRESHOLD_PX = 120;
|
const SCROLL_LOAD_THRESHOLD_PX = 120;
|
||||||
|
|
||||||
function getNextVerificationResultPage(
|
function getNextVerificationInputReportPage(
|
||||||
lastPage: VerificationResultListResponse,
|
lastPage: VerificationInputReportResponse,
|
||||||
): number | undefined {
|
): number | undefined {
|
||||||
const pageInfo = lastPage?.data?.pageInfo;
|
const pageInfo = lastPage?.data?.pageInfo;
|
||||||
if (!pageInfo) return undefined;
|
if (!pageInfo) return undefined;
|
||||||
@@ -69,19 +69,29 @@ function getNextVerificationResultPage(
|
|||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
function flattenVerificationResults(
|
function flattenVerificationInputReportResults(
|
||||||
data: InfiniteData<VerificationResultListResponse> | undefined,
|
data: InfiniteData<VerificationInputReportResponse> | undefined,
|
||||||
): VerificationResultReportItem[] {
|
): VerificationInputReportItem[] {
|
||||||
return (
|
return (
|
||||||
data?.pages.flatMap((page) => page?.data?.verifyResultList ?? []) ?? []
|
data?.pages.flatMap((page) => page?.data?.verifyResultList ?? []) ?? []
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getVerificationResultTotalCount(
|
function getVerifyTypeCountingInfo(
|
||||||
data: InfiniteData<VerificationResultListResponse> | undefined,
|
data: InfiniteData<VerificationInputReportResponse> | undefined,
|
||||||
loadedCount: number,
|
): VerificationInputReportTypeCountingInfo | null {
|
||||||
): number {
|
return data?.pages[0]?.data?.verifyTypeCountingInfo ?? null;
|
||||||
return data?.pages[0]?.data?.pageInfo?.totalElements ?? loadedCount;
|
}
|
||||||
|
|
||||||
|
function formatReportItemTitle(item: VerificationInputReportItem): string {
|
||||||
|
return item.statsNm?.trim() || item.vrfcTrgtNm?.trim() || item.statsCd;
|
||||||
|
}
|
||||||
|
|
||||||
|
function formatReportItemRegion(item: VerificationInputReportItem): string {
|
||||||
|
const parts = [item.ctpvNm, item.sggNm].filter(
|
||||||
|
(v): v is string => Boolean(v?.trim()),
|
||||||
|
);
|
||||||
|
return parts.length > 0 ? parts.join(" ") : "-";
|
||||||
}
|
}
|
||||||
|
|
||||||
function useVerificationReportList(
|
function useVerificationReportList(
|
||||||
@@ -89,28 +99,31 @@ function useVerificationReportList(
|
|||||||
statsCdQueryKey: string,
|
statsCdQueryKey: string,
|
||||||
vrfcMthdCd: VerificationReportTabKey,
|
vrfcMthdCd: VerificationReportTabKey,
|
||||||
statsCd: string,
|
statsCd: string,
|
||||||
|
enabled: boolean,
|
||||||
) {
|
) {
|
||||||
return useInfiniteQuery({
|
return useInfiniteQuery({
|
||||||
queryKey: [
|
queryKey: [
|
||||||
"verificationResultList",
|
"verificationInputReport",
|
||||||
statsYr,
|
statsYr,
|
||||||
vrfcMthdCd,
|
vrfcMthdCd,
|
||||||
statsCdQueryKey,
|
statsCdQueryKey,
|
||||||
],
|
],
|
||||||
initialPageParam: 1,
|
initialPageParam: 1,
|
||||||
queryFn: ({ pageParam }) =>
|
queryFn: ({ pageParam }) =>
|
||||||
statisticsApi.getVerificationResultList({
|
verificationInputReportApi.getVerificationInputReport({
|
||||||
statsYr,
|
statsYr,
|
||||||
pbcpAprvYn: "N",
|
vrfcMthdCd,
|
||||||
page: pageParam,
|
page: pageParam,
|
||||||
size: PAGE_SIZE,
|
size: PAGE_SIZE,
|
||||||
prcsYnList: "0",
|
|
||||||
vrfcMthdCd,
|
|
||||||
...(!(statsCd === "" || statsCd === "ALL") && { statsCd }),
|
...(!(statsCd === "" || statsCd === "ALL") && { statsCd }),
|
||||||
} satisfies VerificationResultListRequest),
|
}),
|
||||||
getNextPageParam: getNextVerificationResultPage,
|
getNextPageParam: getNextVerificationInputReportPage,
|
||||||
placeholderData: keepPreviousData,
|
placeholderData: keepPreviousData,
|
||||||
refetchOnWindowFocus: false,
|
refetchOnWindowFocus: false,
|
||||||
|
// 탭 전환만으로는 재조회하지 않음(명시적 새로고침/조건 변경 시만 조회)
|
||||||
|
staleTime: Infinity,
|
||||||
|
refetchOnMount: false,
|
||||||
|
enabled,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -132,28 +145,46 @@ const VerificationSelectionReport = ({
|
|||||||
const alert = useAlertStore((s) => s.setMessage);
|
const alert = useAlertStore((s) => s.setMessage);
|
||||||
const [activeTab, setActiveTab] = useState<VerificationReportTabKey>("NV");
|
const [activeTab, setActiveTab] = useState<VerificationReportTabKey>("NV");
|
||||||
const [statsCd, setStatsCd] = useState<string>("ALL");
|
const [statsCd, setStatsCd] = useState<string>("ALL");
|
||||||
|
const [isFullReloading, setIsFullReloading] = useState(false);
|
||||||
|
|
||||||
const statsYr = String(dayjs().year() - 1);
|
const statsYr = String(dayjs().year() - 1);
|
||||||
const statsCdQueryKey =
|
const statsCdQueryKey =
|
||||||
statsCd === "" || statsCd === "ALL" ? "" : statsCd;
|
statsCd === "" || statsCd === "ALL" ? "" : statsCd;
|
||||||
|
|
||||||
|
const handleStatsCdChange = useCallback(
|
||||||
|
(nextStatsCd: string) => {
|
||||||
|
setStatsCd(nextStatsCd);
|
||||||
|
setActiveTab("NV");
|
||||||
|
setIsFullReloading(true);
|
||||||
|
|
||||||
|
// 통계항목 변경 시 모든 탭 캐시 제거 후 NV부터 다시 조회
|
||||||
|
void queryClient.removeQueries({
|
||||||
|
queryKey: ["verificationInputReport", statsYr],
|
||||||
|
});
|
||||||
|
},
|
||||||
|
[queryClient, statsYr],
|
||||||
|
);
|
||||||
|
|
||||||
const nvQuery = useVerificationReportList(
|
const nvQuery = useVerificationReportList(
|
||||||
statsYr,
|
statsYr,
|
||||||
statsCdQueryKey,
|
statsCdQueryKey,
|
||||||
"NV",
|
"NV",
|
||||||
statsCd,
|
statsCd,
|
||||||
|
activeTab === "NV",
|
||||||
);
|
);
|
||||||
const imrQuery = useVerificationReportList(
|
const imrQuery = useVerificationReportList(
|
||||||
statsYr,
|
statsYr,
|
||||||
statsCdQueryKey,
|
statsCdQueryKey,
|
||||||
"IMR",
|
"IMR",
|
||||||
statsCd,
|
statsCd,
|
||||||
|
activeTab === "IMR",
|
||||||
);
|
);
|
||||||
const hbQuery = useVerificationReportList(
|
const hbQuery = useVerificationReportList(
|
||||||
statsYr,
|
statsYr,
|
||||||
statsCdQueryKey,
|
statsCdQueryKey,
|
||||||
"HB",
|
"HB",
|
||||||
statsCd,
|
statsCd,
|
||||||
|
activeTab === "HB",
|
||||||
);
|
);
|
||||||
|
|
||||||
const queryByTab = {
|
const queryByTab = {
|
||||||
@@ -162,44 +193,51 @@ const VerificationSelectionReport = ({
|
|||||||
HB: hbQuery,
|
HB: hbQuery,
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
const isInitialLoading =
|
const activeQuery = queryByTab[activeTab];
|
||||||
nvQuery.isPending || imrQuery.isPending || hbQuery.isPending;
|
const isRefreshing = activeQuery.isFetching && !activeQuery.isPending;
|
||||||
const isRefreshing =
|
const error = activeQuery.error;
|
||||||
(nvQuery.isFetching && !nvQuery.isPending) ||
|
|
||||||
(imrQuery.isFetching && !imrQuery.isPending) ||
|
/** 통계항목 변경·최초 진입: 탭 영역 숨기고 카드 전체 로딩만 표시 */
|
||||||
(hbQuery.isFetching && !hbQuery.isPending);
|
const hideTabsSection =
|
||||||
const error = nvQuery.error ?? imrQuery.error ?? hbQuery.error;
|
isFullReloading ||
|
||||||
|
(activeTab === "NV" && !nvQuery.data && (nvQuery.isPending || nvQuery.isFetching));
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!isFullReloading) return;
|
||||||
|
if (nvQuery.isFetching) return;
|
||||||
|
if (nvQuery.isSuccess || nvQuery.isError) {
|
||||||
|
setIsFullReloading(false);
|
||||||
|
}
|
||||||
|
}, [isFullReloading, nvQuery.isFetching, nvQuery.isSuccess, nvQuery.isError]);
|
||||||
|
|
||||||
const handleRefresh = useCallback(() => {
|
const handleRefresh = useCallback(() => {
|
||||||
const tabCodes: VerificationReportTabKey[] = ["NV", "IMR", "HB"];
|
setStatsCd("ALL");
|
||||||
void Promise.all(
|
setActiveTab("NV");
|
||||||
tabCodes.map((code) =>
|
setIsFullReloading(true);
|
||||||
queryClient.resetQueries({
|
void queryClient.removeQueries({
|
||||||
queryKey: [
|
queryKey: ["verificationInputReport", statsYr],
|
||||||
"verificationResultList",
|
});
|
||||||
statsYr,
|
}, [queryClient, statsYr]);
|
||||||
code,
|
|
||||||
statsCdQueryKey,
|
|
||||||
],
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}, [queryClient, statsYr, statsCdQueryKey]);
|
|
||||||
|
|
||||||
const listsByTab: Record<VerificationReportTabKey, VerificationResultReportItem[]> = {
|
const listsByTab: Record<VerificationReportTabKey, VerificationInputReportItem[]> = {
|
||||||
NV: flattenVerificationResults(nvQuery.data),
|
NV: flattenVerificationInputReportResults(nvQuery.data),
|
||||||
IMR: flattenVerificationResults(imrQuery.data),
|
IMR: flattenVerificationInputReportResults(imrQuery.data),
|
||||||
HB: flattenVerificationResults(hbQuery.data),
|
HB: flattenVerificationInputReportResults(hbQuery.data),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const typeCountingInfo =
|
||||||
|
getVerifyTypeCountingInfo(nvQuery.data) ??
|
||||||
|
getVerifyTypeCountingInfo(imrQuery.data) ??
|
||||||
|
getVerifyTypeCountingInfo(hbQuery.data);
|
||||||
|
|
||||||
const totalCountByTab: Record<VerificationReportTabKey, number> = {
|
const totalCountByTab: Record<VerificationReportTabKey, number> = {
|
||||||
NV: getVerificationResultTotalCount(nvQuery.data, listsByTab.NV.length),
|
NV: typeCountingInfo?.nvCount ?? listsByTab.NV.length,
|
||||||
IMR: getVerificationResultTotalCount(imrQuery.data, listsByTab.IMR.length),
|
IMR: typeCountingInfo?.imrCount ?? listsByTab.IMR.length,
|
||||||
HB: getVerificationResultTotalCount(hbQuery.data, listsByTab.HB.length),
|
HB: typeCountingInfo?.hbCount ?? listsByTab.HB.length,
|
||||||
};
|
};
|
||||||
|
|
||||||
const openInputFromStatsCd = useCallback(
|
const openInputFromStatsCd = useCallback(
|
||||||
(item: VerificationResultReportItem) => {
|
(item: VerificationInputReportItem) => {
|
||||||
const nav = resolveInputPageNavigationFromStatsCd(item.statsCd);
|
const nav = resolveInputPageNavigationFromStatsCd(item.statsCd);
|
||||||
if (!nav) {
|
if (!nav) {
|
||||||
alert(
|
alert(
|
||||||
@@ -263,9 +301,21 @@ const VerificationSelectionReport = ({
|
|||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const isTabContentLoading = (tab: VerificationReportTabKey) => {
|
||||||
|
const query = queryByTab[tab];
|
||||||
|
return (
|
||||||
|
activeTab === tab &&
|
||||||
|
!hideTabsSection &&
|
||||||
|
(query.isPending ||
|
||||||
|
(query.isFetching && !query.isFetchingNextPage) ||
|
||||||
|
(!query.data && !query.error))
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const renderResultList = (
|
const renderResultList = (
|
||||||
typeCode: VerificationReportTabKey,
|
typeCode: VerificationReportTabKey,
|
||||||
items: VerificationResultReportItem[],
|
items: VerificationInputReportItem[],
|
||||||
|
isTabLoading: boolean,
|
||||||
hasNextPage: boolean,
|
hasNextPage: boolean,
|
||||||
isFetchingNextPage: boolean,
|
isFetchingNextPage: boolean,
|
||||||
fetchNextPage: () => void,
|
fetchNextPage: () => void,
|
||||||
@@ -281,7 +331,13 @@ const VerificationSelectionReport = ({
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{items.length === 0 && !isFetchingNextPage ? (
|
{isTabLoading ? (
|
||||||
|
<div className="flex h-full min-h-[8rem] items-center justify-center">
|
||||||
|
<div className="relative size-[5rem]">
|
||||||
|
<LoadingWithAnimation color="primary" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
) : items.length === 0 && !isFetchingNextPage ? (
|
||||||
<div className="flex h-full min-h-[8rem] items-center justify-center text-lg text-muted-foreground">
|
<div className="flex h-full min-h-[8rem] items-center justify-center text-lg text-muted-foreground">
|
||||||
항목이 없습니다.
|
항목이 없습니다.
|
||||||
</div>
|
</div>
|
||||||
@@ -303,7 +359,7 @@ const VerificationSelectionReport = ({
|
|||||||
>
|
>
|
||||||
<div className="mb-2 flex items-center justify-between">
|
<div className="mb-2 flex items-center justify-between">
|
||||||
<span className="font-medium">
|
<span className="font-medium">
|
||||||
{item.statsNm}
|
{formatReportItemTitle(item)}
|
||||||
</span>
|
</span>
|
||||||
<Badge
|
<Badge
|
||||||
color={
|
color={
|
||||||
@@ -320,7 +376,7 @@ const VerificationSelectionReport = ({
|
|||||||
{item.rsnExpln}
|
{item.rsnExpln}
|
||||||
</p>
|
</p>
|
||||||
<div className="flex justify-between text-lg text-muted-foreground">
|
<div className="flex justify-between text-lg text-muted-foreground">
|
||||||
<span>{item.admdstNm}</span>
|
<span>{formatReportItemRegion(item)}</span>
|
||||||
<span>
|
<span>
|
||||||
현재: {item.nowVlCn ?? "-"} / 비교:{" "}
|
현재: {item.nowVlCn ?? "-"} / 비교:{" "}
|
||||||
{item.compVlCn ?? "-"}
|
{item.compVlCn ?? "-"}
|
||||||
@@ -383,25 +439,25 @@ const VerificationSelectionReport = ({
|
|||||||
<CodeSelectWithAll
|
<CodeSelectWithAll
|
||||||
upCd="STITEM"
|
upCd="STITEM"
|
||||||
value={statsCd}
|
value={statsCd}
|
||||||
onValueChange={setStatsCd}
|
onValueChange={handleStatsCdChange}
|
||||||
placeholder="전체"
|
placeholder="전체"
|
||||||
className="w-full"
|
className="w-full"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="card-body p-2.5 flex-1 flex flex-col overflow-hidden relative min-h-0">
|
<div className="card-body p-2.5 flex-1 flex flex-col overflow-hidden relative min-h-0">
|
||||||
{isInitialLoading && (
|
{hideTabsSection && (
|
||||||
<div className="absolute inset-0 z-50 [data-theme='black']:bg-transparent rounded-lg p-10 flex justify-center items-center">
|
<div className="absolute inset-0 z-50 [data-theme='black']:bg-transparent rounded-lg p-10 flex justify-center items-center">
|
||||||
<div className="relative size-[5rem]">
|
<div className="relative size-[5rem]">
|
||||||
<LoadingWithAnimation color="primary" />
|
<LoadingWithAnimation color="primary" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{error && (
|
{!hideTabsSection && error && (
|
||||||
<div className="absolute inset-0 z-50 [data-theme='black']:bg-transparent rounded-lg p-10 flex justify-center items-center">
|
<div className="absolute inset-0 z-50 [data-theme='black']:bg-transparent rounded-lg p-10 flex justify-center items-center">
|
||||||
데이터를 불러올 수 없습니다.
|
데이터를 불러올 수 없습니다.
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{!isInitialLoading && !error && (
|
{!hideTabsSection && !error && (
|
||||||
<section className="flex min-h-0 flex-1 flex-col">
|
<section className="flex min-h-0 flex-1 flex-col">
|
||||||
<Tabs
|
<Tabs
|
||||||
value={activeTab}
|
value={activeTab}
|
||||||
@@ -428,18 +484,14 @@ const VerificationSelectionReport = ({
|
|||||||
value={tab.value}
|
value={tab.value}
|
||||||
className="mt-0 flex min-h-0 flex-1 flex-col p-0 data-[state=inactive]:hidden"
|
className="mt-0 flex min-h-0 flex-1 flex-col p-0 data-[state=inactive]:hidden"
|
||||||
>
|
>
|
||||||
{activeTab === tab.value
|
{renderResultList(
|
||||||
? renderResultList(
|
tab.value,
|
||||||
tab.value,
|
listsByTab[tab.value],
|
||||||
listsByTab[tab.value],
|
isTabContentLoading(tab.value),
|
||||||
queryByTab[tab.value]
|
queryByTab[tab.value].hasNextPage ?? false,
|
||||||
.hasNextPage ?? false,
|
queryByTab[tab.value].isFetchingNextPage,
|
||||||
queryByTab[tab.value]
|
queryByTab[tab.value].fetchNextPage,
|
||||||
.isFetchingNextPage,
|
)}
|
||||||
queryByTab[tab.value]
|
|
||||||
.fetchNextPage,
|
|
||||||
)
|
|
||||||
: null}
|
|
||||||
</TabsContent>
|
</TabsContent>
|
||||||
))}
|
))}
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
|||||||
import { useEffect, useRef, useState } from 'react';
|
import { useEffect, useRef, useState, type Dispatch, type SetStateAction } from 'react';
|
||||||
|
|
||||||
import { useConfirm } from '@frontend-opensource/use-react-hooks';
|
import { useConfirm } from '@frontend-opensource/use-react-hooks';
|
||||||
|
|
||||||
@@ -157,7 +157,9 @@ const PublicSewageFacilityInp = () => {
|
|||||||
const globalProgressVisible = useGlobalProgressStore((state) => state.visible);
|
const globalProgressVisible = useGlobalProgressStore((state) => state.visible);
|
||||||
const [isLoading, setIsLoading] = useState<boolean>(false);
|
const [isLoading, setIsLoading] = useState<boolean>(false);
|
||||||
const [hasSearched, setHasSearched] = useState(false);
|
const [hasSearched, setHasSearched] = useState(false);
|
||||||
const [isNotApplicable, setIsNotApplicable] = useState(false);
|
const [isNotApplicableByTab, setIsNotApplicableByTab] = useState<Map<string, boolean>>(
|
||||||
|
() => new Map(),
|
||||||
|
);
|
||||||
const [showIsNotApplicable, setShowIsNotApplicable] = useState(false);
|
const [showIsNotApplicable, setShowIsNotApplicable] = useState(false);
|
||||||
const [searchValues, setSearchValues] = useState<SearchFormValues | null>(null);
|
const [searchValues, setSearchValues] = useState<SearchFormValues | null>(null);
|
||||||
const [lastSearchedValues, setLastSearchedValues] = useState<SearchFormValues | null>(null);
|
const [lastSearchedValues, setLastSearchedValues] = useState<SearchFormValues | null>(null);
|
||||||
@@ -175,6 +177,19 @@ const PublicSewageFacilityInp = () => {
|
|||||||
const [mainFacilityMappingSaveDialogKey, setMainFacilityMappingSaveDialogKey] = useState(0);
|
const [mainFacilityMappingSaveDialogKey, setMainFacilityMappingSaveDialogKey] = useState(0);
|
||||||
const [verificationResultDialogOpen, setVerificationResultDialogOpen] = useState(false);
|
const [verificationResultDialogOpen, setVerificationResultDialogOpen] = useState(false);
|
||||||
const [verificationHistoryOpen, setVerificationHistoryOpen] = useState(false);
|
const [verificationHistoryOpen, setVerificationHistoryOpen] = useState(false);
|
||||||
|
const isNotApplicable = isNotApplicableByTab.get('ST00060001') ?? false;
|
||||||
|
const setIsNotApplicable: Dispatch<SetStateAction<boolean>> = (next) => {
|
||||||
|
setIsNotApplicableByTab((prev) => {
|
||||||
|
const current = prev.get('ST00060001') ?? false;
|
||||||
|
const resolved =
|
||||||
|
typeof next === 'function'
|
||||||
|
? (next as (prevState: boolean) => boolean)(current)
|
||||||
|
: next;
|
||||||
|
const nextMap = new Map(prev);
|
||||||
|
nextMap.set('ST00060001', resolved);
|
||||||
|
return nextMap;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const periodEnterableRef = useRef(true);
|
const periodEnterableRef = useRef(true);
|
||||||
const searchDoneRef = useRef(false);
|
const searchDoneRef = useRef(false);
|
||||||
@@ -195,7 +210,7 @@ const PublicSewageFacilityInp = () => {
|
|||||||
const currentData =
|
const currentData =
|
||||||
st60001GridGetRowsRef.current?.() ?? rowDataMap.get('ST00060001') ?? [];
|
st60001GridGetRowsRef.current?.() ?? rowDataMap.get('ST00060001') ?? [];
|
||||||
if (!treatAsNoApplicable && (!currentData || currentData.length === 0)) {
|
if (!treatAsNoApplicable && (!currentData || currentData.length === 0)) {
|
||||||
alert('제출할 데이터가 없습니다.');
|
alert('해당사항 없음을 체크해주세요.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const verificationBlocked = getVerificationPeriodActionBlockedMessage(periodCheckList);
|
const verificationBlocked = getVerificationPeriodActionBlockedMessage(periodCheckList);
|
||||||
@@ -276,15 +291,15 @@ const PublicSewageFacilityInp = () => {
|
|||||||
const currentData =
|
const currentData =
|
||||||
st60001GridGetRowsRef.current?.() ?? rowDataMap.get('ST00060001') ?? [];
|
st60001GridGetRowsRef.current?.() ?? rowDataMap.get('ST00060001') ?? [];
|
||||||
|
|
||||||
if (!treatAsNoApplicable && (!currentData || currentData.length === 0)) {
|
const submitList = treatAsNoApplicable ? [] : buildFacilitySaveList(currentData);
|
||||||
alert('제출할 데이터가 없습니다.');
|
if (!treatAsNoApplicable && submitList.length === 0) {
|
||||||
|
alert('해당사항 없음을 체크해주세요.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
showGlobalProgress({ label: '서버에 요청 중...', progress: 0 });
|
showGlobalProgress({ label: '서버에 요청 중...', progress: 0 });
|
||||||
const userInfo = await getUserInfo();
|
const userInfo = await getUserInfo();
|
||||||
const submitList = treatAsNoApplicable ? [] : buildFacilitySaveList(currentData);
|
|
||||||
const activeTabStatus = tabStatusInfoMap.get(activeTab) ?? null;
|
const activeTabStatus = tabStatusInfoMap.get(activeTab) ?? null;
|
||||||
const statsCdForTab = tabStatsCdMap.get(activeTab) ?? activeTab;
|
const statsCdForTab = tabStatsCdMap.get(activeTab) ?? activeTab;
|
||||||
const requestData = {
|
const requestData = {
|
||||||
@@ -515,19 +530,19 @@ const PublicSewageFacilityInp = () => {
|
|||||||
if (!(await confirm('저장 하시겠습니까?'))) return;
|
if (!(await confirm('저장 하시겠습니까?'))) return;
|
||||||
|
|
||||||
if (activeTab === 'ST00060001') {
|
if (activeTab === 'ST00060001') {
|
||||||
|
const noApplicable = getNoApplicableForRequest();
|
||||||
|
const treatAsNoApplicable = noApplicable || isNotApplicable;
|
||||||
|
const currentData =
|
||||||
|
st60001GridGetRowsRef.current?.() ?? rowDataMap.get('ST00060001') ?? [];
|
||||||
|
const saveList = treatAsNoApplicable ? [] : buildFacilitySaveList(currentData);
|
||||||
|
if (!treatAsNoApplicable && saveList.length === 0) {
|
||||||
|
alert('해당사항 없음을 체크해주세요.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
showGlobalProgress({ label: '저장 진행 중...', progress: 0 });
|
showGlobalProgress({ label: '저장 진행 중...', progress: 0 });
|
||||||
const userInfo = await getUserInfo();
|
const userInfo = await getUserInfo();
|
||||||
const noApplicable = getNoApplicableForRequest();
|
|
||||||
const treatAsNoApplicable = noApplicable || isNotApplicable;
|
|
||||||
const currentData =
|
|
||||||
st60001GridGetRowsRef.current?.() ?? rowDataMap.get('ST00060001') ?? [];
|
|
||||||
if (!treatAsNoApplicable && (!currentData || currentData.length === 0)) {
|
|
||||||
alert('저장할 데이터가 없습니다.');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const saveList = treatAsNoApplicable ? [] : buildFacilitySaveList(currentData);
|
|
||||||
const param: PublicSewageFacilitySaveRequest = {
|
const param: PublicSewageFacilitySaveRequest = {
|
||||||
statsYr: lastSearchedValues.year ?? '',
|
statsYr: lastSearchedValues.year ?? '',
|
||||||
ctpvNm: lastSearchedValues.sido ?? '',
|
ctpvNm: lastSearchedValues.sido ?? '',
|
||||||
@@ -655,8 +670,6 @@ const PublicSewageFacilityInp = () => {
|
|||||||
param: PublicSewageFacilityRequestParams,
|
param: PublicSewageFacilityRequestParams,
|
||||||
searchContext: SearchFormValues | null,
|
searchContext: SearchFormValues | null,
|
||||||
): Promise<boolean> => {
|
): Promise<boolean> => {
|
||||||
// 서버 데이터로 새로 불러오는 시점이므로 "해당없음" 체크는 항상 초기화
|
|
||||||
setIsNotApplicable(false);
|
|
||||||
try {
|
try {
|
||||||
if (tabKey === 'ST00060001') {
|
if (tabKey === 'ST00060001') {
|
||||||
const response = await statisticsInputPublicSewageFacilityApiService.getPublicSewageFacility(param);
|
const response = await statisticsInputPublicSewageFacilityApiService.getPublicSewageFacility(param);
|
||||||
@@ -856,6 +869,11 @@ const PublicSewageFacilityInp = () => {
|
|||||||
setLastSearchedValues(values);
|
setLastSearchedValues(values);
|
||||||
searchDoneRef.current = true;
|
searchDoneRef.current = true;
|
||||||
setHasSearched(true);
|
setHasSearched(true);
|
||||||
|
setIsNotApplicableByTab((prev) => {
|
||||||
|
const next = new Map(prev);
|
||||||
|
next.set('ST00060001', false);
|
||||||
|
return next;
|
||||||
|
});
|
||||||
|
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
const param = buildPublicSewageFacilityParams(values);
|
const param = buildPublicSewageFacilityParams(values);
|
||||||
@@ -870,6 +888,19 @@ const PublicSewageFacilityInp = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleActiveTabChange = async (tabKey: string) => {
|
const handleActiveTabChange = async (tabKey: string) => {
|
||||||
|
const prevTabKey = activeTabRef.current;
|
||||||
|
if (prevTabKey === 'ST00060001') {
|
||||||
|
const latestRowsInPrevTab =
|
||||||
|
st60001GridGetRowsRef.current?.() ?? rowDataMap.get('ST00060001') ?? [];
|
||||||
|
if (latestRowsInPrevTab.length > 0 || rowDataMap.has('ST00060001')) {
|
||||||
|
setRowDataMap((prev) => {
|
||||||
|
const next = new Map(prev);
|
||||||
|
next.set('ST00060001', latestRowsInPrevTab);
|
||||||
|
return next;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
activeTabRef.current = tabKey;
|
activeTabRef.current = tabKey;
|
||||||
setActiveTab(tabKey);
|
setActiveTab(tabKey);
|
||||||
|
|
||||||
@@ -885,7 +916,7 @@ const PublicSewageFacilityInp = () => {
|
|||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
setHasSearched(false);
|
setHasSearched(false);
|
||||||
setIsNotApplicable(false);
|
setIsNotApplicableByTab(new Map());
|
||||||
setShowIsNotApplicable(false);
|
setShowIsNotApplicable(false);
|
||||||
|
|
||||||
setRowDataMap(new Map());
|
setRowDataMap(new Map());
|
||||||
@@ -1215,7 +1246,7 @@ const PublicSewageFacilityInp = () => {
|
|||||||
return (
|
return (
|
||||||
<TabsContent key={tab.tabKey} value={tab.tabKey}>
|
<TabsContent key={tab.tabKey} value={tab.tabKey}>
|
||||||
<DataGrid
|
<DataGrid
|
||||||
key={(tabEnterableForGrid || isAdminInfo) ? 'enterable' : 'readonly'}
|
key={tab.tabKey}
|
||||||
columnInfo={gridColumnInfo}
|
columnInfo={gridColumnInfo}
|
||||||
rowStartNum={tab.rowStartNum}
|
rowStartNum={tab.rowStartNum}
|
||||||
excelExportFileSuffix={tab.tabLabel || tab.tabKey}
|
excelExportFileSuffix={tab.tabLabel || tab.tabKey}
|
||||||
@@ -1278,6 +1309,11 @@ const PublicSewageFacilityInp = () => {
|
|||||||
open={verificationHistoryOpen}
|
open={verificationHistoryOpen}
|
||||||
onOpenChange={setVerificationHistoryOpen}
|
onOpenChange={setVerificationHistoryOpen}
|
||||||
queryContext={verificationQueryContext}
|
queryContext={verificationQueryContext}
|
||||||
|
onExceptionResetSubmitted={async () => {
|
||||||
|
const ctx = lastSearchedValues ?? searchValues;
|
||||||
|
if (!ctx || !searchParamRef.current) return;
|
||||||
|
await loadPublicSewageFacilityActiveTabData(activeTab, searchParamRef.current, ctx);
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<SubmitDailog
|
<SubmitDailog
|
||||||
open={showDailog}
|
open={showDailog}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -396,6 +396,8 @@ const SewagePipeInp = () => {
|
|||||||
values: SearchFormValues;
|
values: SearchFormValues;
|
||||||
tabKey: string;
|
tabKey: string;
|
||||||
} | null>(null);
|
} | null>(null);
|
||||||
|
/** ST00020002 무데이터 안내/자동이동은 동일 조회조건에서 1회만 수행 */
|
||||||
|
const factInstallNoDataHandledKeyRef = useRef<string | null>(null);
|
||||||
|
|
||||||
const [verificationSearchDefaults, setVerificationSearchDefaults] =
|
const [verificationSearchDefaults, setVerificationSearchDefaults] =
|
||||||
useState<SearchFormValues | null>(null);
|
useState<SearchFormValues | null>(null);
|
||||||
@@ -549,6 +551,12 @@ const SewagePipeInp = () => {
|
|||||||
mergeIntoExistingMap: boolean,
|
mergeIntoExistingMap: boolean,
|
||||||
updateLastSearchedValues: boolean,
|
updateLastSearchedValues: boolean,
|
||||||
): Promise<boolean> => {
|
): Promise<boolean> => {
|
||||||
|
const searchConditionKey = JSON.stringify({
|
||||||
|
statsYr: searchParam.statsYr ?? "",
|
||||||
|
ctpvNm: searchParam.ctpvNm ?? "",
|
||||||
|
sggNm: searchParam.sggNm ?? "",
|
||||||
|
sewerBzmnCd: searchParam.sewerBzmnCd ?? "",
|
||||||
|
});
|
||||||
const applyRowMap = (apply: (m: Map<string, Record<string, string | number>[]>) => void) => {
|
const applyRowMap = (apply: (m: Map<string, Record<string, string | number>[]>) => void) => {
|
||||||
if (mergeIntoExistingMap) {
|
if (mergeIntoExistingMap) {
|
||||||
setRowDataMap((prev) => {
|
setRowDataMap((prev) => {
|
||||||
@@ -595,6 +603,23 @@ const SewagePipeInp = () => {
|
|||||||
ctpvNm: commonInfo.ctpvNm,
|
ctpvNm: commonInfo.ctpvNm,
|
||||||
...d,
|
...d,
|
||||||
}));
|
}));
|
||||||
|
if (convertedData.length === 0) {
|
||||||
|
const alreadyHandledForSameSearch =
|
||||||
|
factInstallNoDataHandledKeyRef.current === searchConditionKey;
|
||||||
|
if (!alreadyHandledForSameSearch) {
|
||||||
|
factInstallNoDataHandledKeyRef.current = searchConditionKey;
|
||||||
|
alert("시설별 설치 현황에 조회된 데이터가 없습니다.\n시설별 현황 관리에서 설정해주세요");
|
||||||
|
activeTabRef.current = "ST00020006";
|
||||||
|
setActiveTab("ST00020006");
|
||||||
|
return await loadSewagePipeActiveTabData(
|
||||||
|
"ST00020006",
|
||||||
|
searchParam,
|
||||||
|
values,
|
||||||
|
true,
|
||||||
|
updateLastSearchedValues,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
applyRowMap((m) => m.set('ST00020002', toGridRows(convertedData)));
|
applyRowMap((m) => m.set('ST00020002', toGridRows(convertedData)));
|
||||||
setTabStatusInfoMap((prev) => new Map(prev).set(tabKey, response.data.statusInfo));
|
setTabStatusInfoMap((prev) => new Map(prev).set(tabKey, response.data.statusInfo));
|
||||||
setTabStatsCdMap((prev) => new Map(prev).set(tabKey, commonInfo.statsCd));
|
setTabStatsCdMap((prev) => new Map(prev).set(tabKey, commonInfo.statsCd));
|
||||||
@@ -795,7 +820,39 @@ const SewagePipeInp = () => {
|
|||||||
|
|
||||||
}, [searchFormRemountKey]);
|
}, [searchFormRemountKey]);
|
||||||
|
|
||||||
|
const getCurrentRowsForTab = (tabKey: string): Record<string, string | number>[] => {
|
||||||
|
switch (tabKey) {
|
||||||
|
case REGIONAL_FACT_TAB_KEY:
|
||||||
|
return getGridDataRef.current?.() ?? [];
|
||||||
|
case "ST00020002":
|
||||||
|
return getFactInstallGridDataRef.current?.() ?? [];
|
||||||
|
case "ST00020003":
|
||||||
|
return getPipeTypeGridDataRef.current?.() ?? [];
|
||||||
|
case "ST00020004":
|
||||||
|
return getPipeDiameterGridDataRef.current?.() ?? [];
|
||||||
|
case "ST00020005":
|
||||||
|
return getManholeGridDataRef.current?.() ?? [];
|
||||||
|
case "ST00020006":
|
||||||
|
return [
|
||||||
|
...(rowDataMap.get("treatmentPlantConnectionInp") ?? []),
|
||||||
|
...(rowDataMap.get("adminAreaConnectionInp") ?? []),
|
||||||
|
];
|
||||||
|
default:
|
||||||
|
return rowDataMap.get(tabKey) ?? [];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const handleActiveTabChange = async (tabKey: string) => {
|
const handleActiveTabChange = async (tabKey: string) => {
|
||||||
|
const prevTabKey = activeTabRef.current;
|
||||||
|
const latestRowsInPrevTab = getCurrentRowsForTab(prevTabKey);
|
||||||
|
if (latestRowsInPrevTab.length > 0 || rowDataMap.has(prevTabKey)) {
|
||||||
|
setRowDataMap((prev) => {
|
||||||
|
const next = new Map(prev);
|
||||||
|
next.set(prevTabKey, latestRowsInPrevTab);
|
||||||
|
return next;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
activeTabRef.current = tabKey;
|
activeTabRef.current = tabKey;
|
||||||
setActiveTab(tabKey);
|
setActiveTab(tabKey);
|
||||||
setStatsCd(tabStatsCdMap.get(tabKey) ?? "");
|
setStatsCd(tabStatsCdMap.get(tabKey) ?? "");
|
||||||
@@ -1735,7 +1792,7 @@ const SewagePipeInp = () => {
|
|||||||
const maxYy = getManholeLastDataYear() % 100;
|
const maxYy = getManholeLastDataYear() % 100;
|
||||||
|
|
||||||
const saveList = currentData.map((d) => {
|
const saveList = currentData.map((d) => {
|
||||||
const yearlyStats = [];
|
const yearlyStats: SeweragePipeInputManholeStatusSaveYearlyStatItem[] = [];
|
||||||
for (let yy = minYy; yy <= maxYy; yy++) {
|
for (let yy = minYy; yy <= maxYy; yy++) {
|
||||||
const year = 2000 + yy;
|
const year = 2000 + yy;
|
||||||
const wholKey = `yy${yy}WholMnhlCnt`;
|
const wholKey = `yy${yy}WholMnhlCnt`;
|
||||||
@@ -1978,7 +2035,7 @@ const SewagePipeInp = () => {
|
|||||||
return (
|
return (
|
||||||
<TabsContent key={tabKey} value={tabKey}>
|
<TabsContent key={tabKey} value={tabKey}>
|
||||||
<DataGrid
|
<DataGrid
|
||||||
key={(tabEnterableForGrid || isAdminInfo) ? "enterable" : "readonly"}
|
key={tabKey}
|
||||||
columnInfo={gridColumnInfo}
|
columnInfo={gridColumnInfo}
|
||||||
rowStartNum={info.rowStartNum}
|
rowStartNum={info.rowStartNum}
|
||||||
excelExportFileSuffix={info.tabLabel || tabKey}
|
excelExportFileSuffix={info.tabLabel || tabKey}
|
||||||
@@ -2062,6 +2119,12 @@ const SewagePipeInp = () => {
|
|||||||
}
|
}
|
||||||
: null
|
: null
|
||||||
}
|
}
|
||||||
|
onExceptionResetSubmitted={async () => {
|
||||||
|
const values = lastSearchedValues ?? searchValues;
|
||||||
|
if (!values?.year || !values?.sido || !values?.bsnmCd) return;
|
||||||
|
const refreshedParam = buildSewagePipeSearchParam(values);
|
||||||
|
await loadSewagePipeActiveTabData(activeTab, refreshedParam, values, true, false);
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<SubmitDailog
|
<SubmitDailog
|
||||||
open={showDailog}
|
open={showDailog}
|
||||||
|
|||||||
@@ -80,6 +80,12 @@ const SewagePipeMaintainInpTabList = [
|
|||||||
|
|
||||||
const firstTabKey = RepairStatusInpColumn.tabKey;
|
const firstTabKey = RepairStatusInpColumn.tabKey;
|
||||||
|
|
||||||
|
const SEWAGE_PIPE_MAINTAIN_COLUMN_GUIDE_TAB_KEYS = Array.from(
|
||||||
|
new Set(
|
||||||
|
SewagePipeMaintainInpTabList.map((tab) => tab.tabKey).filter(Boolean),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
const toGridColumnInfo = (tab: (typeof SewagePipeMaintainInpTabList)[number]): ColumnInfo => ({
|
const toGridColumnInfo = (tab: (typeof SewagePipeMaintainInpTabList)[number]): ColumnInfo => ({
|
||||||
columns: tab.columns ?? [],
|
columns: tab.columns ?? [],
|
||||||
columnLayout: tab.columnLayout ?? [],
|
columnLayout: tab.columnLayout ?? [],
|
||||||
@@ -302,6 +308,9 @@ const SewagePipeMaintainInp = () => {
|
|||||||
const [rowDataMap, setRowDataMap] = useState<
|
const [rowDataMap, setRowDataMap] = useState<
|
||||||
Map<string, Record<string, string | number>[]>
|
Map<string, Record<string, string | number>[]>
|
||||||
>(new Map());
|
>(new Map());
|
||||||
|
const [columnGuidesByTab, setColumnGuidesByTab] = useState<
|
||||||
|
Record<string, Record<string, string>>
|
||||||
|
>({});
|
||||||
|
|
||||||
const searchDoneRef = useRef(false);
|
const searchDoneRef = useRef(false);
|
||||||
const periodEnterableRef = useRef(true);
|
const periodEnterableRef = useRef(true);
|
||||||
@@ -328,6 +337,37 @@ const SewagePipeMaintainInp = () => {
|
|||||||
}
|
}
|
||||||
}, [activeTabId, inputFocusNonce]);
|
}, [activeTabId, inputFocusNonce]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (activeTabId !== STATISTICS_INPUT_URL_PATH.SEWAGE_PIPE_MAINTAIN) return;
|
||||||
|
let cancelled = false;
|
||||||
|
void (async () => {
|
||||||
|
const entries = await Promise.all(
|
||||||
|
SEWAGE_PIPE_MAINTAIN_COLUMN_GUIDE_TAB_KEYS.map(async (tabKey) => {
|
||||||
|
try {
|
||||||
|
const res = await statisticsApi.getColumnGuides(tabKey);
|
||||||
|
if (res.status !== "success" || !Array.isArray(res.data)) {
|
||||||
|
return [tabKey, {}] as const;
|
||||||
|
}
|
||||||
|
const next: Record<string, string> = {};
|
||||||
|
for (const item of res.data) {
|
||||||
|
const key = item.engColNm?.trim();
|
||||||
|
const guide = item.columnGuide?.trim();
|
||||||
|
if (key && guide) next[key] = guide;
|
||||||
|
}
|
||||||
|
return [tabKey, next] as const;
|
||||||
|
} catch {
|
||||||
|
return [tabKey, {}] as const;
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
if (cancelled) return;
|
||||||
|
setColumnGuidesByTab(Object.fromEntries(entries));
|
||||||
|
})();
|
||||||
|
return () => {
|
||||||
|
cancelled = true;
|
||||||
|
};
|
||||||
|
}, [activeTabId]);
|
||||||
|
|
||||||
const commitToolbarSnapshotForLoadedTab = (
|
const commitToolbarSnapshotForLoadedTab = (
|
||||||
tabKey: string,
|
tabKey: string,
|
||||||
statusInfo: SewerageStatusInfo | null,
|
statusInfo: SewerageStatusInfo | null,
|
||||||
@@ -912,6 +952,16 @@ const SewagePipeMaintainInp = () => {
|
|||||||
}, [searchFormRemountKey]);
|
}, [searchFormRemountKey]);
|
||||||
|
|
||||||
const handleActiveTabChange = async (tabKey: string) => {
|
const handleActiveTabChange = async (tabKey: string) => {
|
||||||
|
const prevTabKey = activeTabRef.current;
|
||||||
|
const latestRowsInPrevTab = getTabGridRows(prevTabKey);
|
||||||
|
if (latestRowsInPrevTab.length > 0 || rowDataMap.has(prevTabKey)) {
|
||||||
|
setRowDataMap((prev) => {
|
||||||
|
const next = new Map(prev);
|
||||||
|
next.set(prevTabKey, latestRowsInPrevTab);
|
||||||
|
return next;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
activeTabRef.current = tabKey;
|
activeTabRef.current = tabKey;
|
||||||
setActiveTab(tabKey);
|
setActiveTab(tabKey);
|
||||||
if (!hasSearched || !lastSearchedValues || !searchParamRef.current) return;
|
if (!hasSearched || !lastSearchedValues || !searchParamRef.current) return;
|
||||||
@@ -941,22 +991,22 @@ const SewagePipeMaintainInp = () => {
|
|||||||
tabStatusInfoMap.get(tabKey) ?? null,
|
tabStatusInfoMap.get(tabKey) ?? null,
|
||||||
inputPeriodEnterable,
|
inputPeriodEnterable,
|
||||||
) || isAdminInfo;
|
) || isAdminInfo;
|
||||||
const columns = (tab.columns ?? []).map((col: ColumnConfig) =>
|
const rawColumns = tab.columns ?? [];
|
||||||
canEdit
|
const base = canEdit
|
||||||
? col
|
? rawColumns
|
||||||
: {
|
: rawColumns.map((col) => ({ ...col, editable: false as const }));
|
||||||
...col,
|
const columns = base
|
||||||
editable: false as const,
|
.map((col) => {
|
||||||
styleName: col.styleName ?? "rg-cell-readonly",
|
const guide = columnGuidesByTab[tabKey]?.[col.fieldName]?.trim();
|
||||||
},
|
return guide ? { ...col, tooltip: guide } : col;
|
||||||
);
|
});
|
||||||
map.set(tabKey, {
|
map.set(tabKey, {
|
||||||
columns,
|
columns,
|
||||||
columnLayout: tab.columnLayout ?? [],
|
columnLayout: tab.columnLayout ?? [],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return map;
|
return map;
|
||||||
}, [tabStatusInfoMap, inputPeriodEnterable, isAdminInfo]);
|
}, [tabStatusInfoMap, inputPeriodEnterable, isAdminInfo, columnGuidesByTab]);
|
||||||
|
|
||||||
const searchContextForToolbar = lastSearchedValues ?? searchValues;
|
const searchContextForToolbar = lastSearchedValues ?? searchValues;
|
||||||
const activeTabStatus = tabStatusInfoMap.get(activeTab) ?? null;
|
const activeTabStatus = tabStatusInfoMap.get(activeTab) ?? null;
|
||||||
@@ -1110,11 +1160,7 @@ const SewagePipeMaintainInp = () => {
|
|||||||
return (
|
return (
|
||||||
<TabsContent key={tabKey} value={tabKey}>
|
<TabsContent key={tabKey} value={tabKey}>
|
||||||
<DataGrid
|
<DataGrid
|
||||||
key={
|
key={`${tabKey}-${tabEnterableForGrid ? "enterable" : "readonly"}`}
|
||||||
tabEnterableForGrid || isAdminInfo
|
|
||||||
? `${tabKey}-enterable`
|
|
||||||
: `${tabKey}-readonly`
|
|
||||||
}
|
|
||||||
columnInfo={
|
columnInfo={
|
||||||
columnInfoByTab.get(tabKey) ??
|
columnInfoByTab.get(tabKey) ??
|
||||||
toGridColumnInfo(info)
|
toGridColumnInfo(info)
|
||||||
@@ -1157,6 +1203,17 @@ const SewagePipeMaintainInp = () => {
|
|||||||
open={verificationHistoryOpen}
|
open={verificationHistoryOpen}
|
||||||
onOpenChange={setVerificationHistoryOpen}
|
onOpenChange={setVerificationHistoryOpen}
|
||||||
queryContext={verificationQueryContext}
|
queryContext={verificationQueryContext}
|
||||||
|
onExceptionResetSubmitted={async () => {
|
||||||
|
const values = lastSearchedValues ?? searchValues;
|
||||||
|
if (!values || !searchParamRef.current) return;
|
||||||
|
await loadActiveTabData(
|
||||||
|
activeTabRef.current,
|
||||||
|
searchParamRef.current,
|
||||||
|
values,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
);
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<ConfirmDialog isOpen={false} />
|
<ConfirmDialog isOpen={false} />
|
||||||
<SubmitDailog
|
<SubmitDailog
|
||||||
@@ -1170,6 +1227,17 @@ const SewagePipeMaintainInp = () => {
|
|||||||
open={verificationResultDialogOpen}
|
open={verificationResultDialogOpen}
|
||||||
onOpenChange={setVerificationResultDialogOpen}
|
onOpenChange={setVerificationResultDialogOpen}
|
||||||
queryContext={verificationQueryContext}
|
queryContext={verificationQueryContext}
|
||||||
|
onExceptionSubmitted={async () => {
|
||||||
|
const values = lastSearchedValues ?? searchValues;
|
||||||
|
if (!values || !searchParamRef.current) return;
|
||||||
|
await loadActiveTabData(
|
||||||
|
activeTabRef.current,
|
||||||
|
searchParamRef.current,
|
||||||
|
values,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
);
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -288,7 +288,8 @@ const SeweragePenetrationRateInp = () => {
|
|||||||
} else {
|
} else {
|
||||||
alert(response.message);
|
alert(response.message);
|
||||||
}
|
}
|
||||||
} catch {
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
alert('데이터 조회 중 오류가 발생했습니다.');
|
alert('데이터 조회 중 오류가 발생했습니다.');
|
||||||
setRowData([]);
|
setRowData([]);
|
||||||
setStatusInfo(null);
|
setStatusInfo(null);
|
||||||
@@ -790,11 +791,13 @@ const SeweragePenetrationRateInp = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{isLoading && !globalProgressVisible && <div className="absolute inset-0 z-50 [data-theme='black']:bg-transparent rounded-lg p-10 flex justify-center items-center">
|
{isLoading && !globalProgressVisible &&
|
||||||
<div className="relative size-[5rem]">
|
<div className="absolute inset-0 z-50 [data-theme='black']:bg-transparent rounded-lg p-10 flex justify-center items-center">
|
||||||
<LoadingWithAnimation color="primary" />
|
<div className="relative size-[5rem]">
|
||||||
|
<LoadingWithAnimation color="primary" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>}
|
}
|
||||||
<DataGrid
|
<DataGrid
|
||||||
key={(isEnterable || isAdminInfo) ? 'enterable' : 'readonly'}
|
key={(isEnterable || isAdminInfo) ? 'enterable' : 'readonly'}
|
||||||
columnInfo={columnInfo}
|
columnInfo={columnInfo}
|
||||||
@@ -859,6 +862,11 @@ const SeweragePenetrationRateInp = () => {
|
|||||||
}
|
}
|
||||||
: null
|
: null
|
||||||
}
|
}
|
||||||
|
onExceptionResetSubmitted={async () => {
|
||||||
|
const values = lastSearchedValues ?? searchValues;
|
||||||
|
if (!values) return;
|
||||||
|
await handleSearch(values);
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<VerificationResultDialog
|
<VerificationResultDialog
|
||||||
open={verificationResultDialogOpen}
|
open={verificationResultDialogOpen}
|
||||||
|
|||||||
@@ -196,6 +196,20 @@ const LogHistory = () => {
|
|||||||
|
|
||||||
const handleSearch = async (e: React.FormEvent<HTMLFormElement>) => {
|
const handleSearch = async (e: React.FormEvent<HTMLFormElement>) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
if (startDate && endDate) {
|
||||||
|
const start = dayjs(startDate);
|
||||||
|
const end = dayjs(endDate);
|
||||||
|
if (start.isAfter(end, "day")) {
|
||||||
|
alert("시작일은 종료일보다 늦을 수 없습니다.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (end.isBefore(start, "day")) {
|
||||||
|
alert("종료일은 시작일보다 빠를 수 없습니다.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
await loadLogs(1);
|
await loadLogs(1);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -213,6 +213,7 @@ function buildRowsFromStatusList(
|
|||||||
statKeys: string[],
|
statKeys: string[],
|
||||||
): Record<string, string | number>[] {
|
): Record<string, string | number>[] {
|
||||||
const rowMap = new Map<string, Record<string, string | number>>();
|
const rowMap = new Map<string, Record<string, string | number>>();
|
||||||
|
const rowOrder: string[] = [];
|
||||||
|
|
||||||
for (const item of statusList) {
|
for (const item of statusList) {
|
||||||
const { sido, sgg } = splitSidoSggNm(item.sidoSggNm);
|
const { sido, sgg } = splitSidoSggNm(item.sidoSggNm);
|
||||||
@@ -228,6 +229,7 @@ function buildRowsFromStatusList(
|
|||||||
row[key] = "";
|
row[key] = "";
|
||||||
}
|
}
|
||||||
rowMap.set(rowKey, row);
|
rowMap.set(rowKey, row);
|
||||||
|
rowOrder.push(rowKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
const row = rowMap.get(rowKey)!;
|
const row = rowMap.get(rowKey)!;
|
||||||
@@ -236,11 +238,7 @@ function buildRowsFromStatusList(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return Array.from(rowMap.values()).sort((a, b) => {
|
return rowOrder.map((key) => rowMap.get(key)!);
|
||||||
const sidoCmp = String(a[SIDO_FIELD]).localeCompare(String(b[SIDO_FIELD]), "ko");
|
|
||||||
if (sidoCmp !== 0) return sidoCmp;
|
|
||||||
return String(a[SGG_FIELD]).localeCompare(String(b[SGG_FIELD]), "ko");
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildUnSubmitDataRequest(
|
function buildUnSubmitDataRequest(
|
||||||
|
|||||||
@@ -1,10 +1,123 @@
|
|||||||
|
import { useRef, useState } from "react";
|
||||||
|
|
||||||
|
import { useAlertStore } from "@/shared/lib";
|
||||||
|
import { LoadingWithAnimation } from "@common/components";
|
||||||
|
|
||||||
import SearchForm from "@/components/module/SearchForm";
|
import SearchForm from "@/components/module/SearchForm";
|
||||||
|
import DataGrid from "@/components/module/DataGrid";
|
||||||
|
import type { ColumnInfo } from "@/components/type/DataGrid.type";
|
||||||
|
import type { SearchFormValues } from "@/components/type/SearchForm.type";
|
||||||
|
import { toGridRows } from "@/components/util/grid/gridFunction";
|
||||||
|
|
||||||
|
// 분리된 분뇨처리시설용 컬럼 구성 임포트
|
||||||
|
import { ExcretaTreatmentStatusColumnConfig } from "@/components/util/column/total/SewerExcretaTreatmentStatusColumn";
|
||||||
|
|
||||||
|
// 집계표(TOTAL) API 및 인터페이스 명세 호출
|
||||||
|
import { statisticsTotalStatusApi } from "@/entities/statistics/api/statistics-total-service";
|
||||||
|
import type {
|
||||||
|
ExcretaTreatmentMaintainTotalRequest
|
||||||
|
} from "@/entities/statistics/model/statistics-total/statistics-excreta-treatment-total-interface";
|
||||||
|
import CellColorInfo from "./CellColorInfo";
|
||||||
|
|
||||||
const ExcretaTreatmentFacilityTot = () => {
|
const ExcretaTreatmentFacilityTot = () => {
|
||||||
|
const { setMessage: alert } = useAlertStore((state) => state);
|
||||||
|
|
||||||
|
// null 타입 컴파일 에러를 방지하기 위해 엄격하게 정의한 데이터 상태
|
||||||
|
const [rowData, setRowData] = useState<Record<string, string | number>[]>([]);
|
||||||
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
const lastSearchedValuesRef = useRef<SearchFormValues | null>(null);
|
||||||
|
|
||||||
|
const config = ExcretaTreatmentStatusColumnConfig;
|
||||||
|
|
||||||
|
const handleReset = () => {
|
||||||
|
setRowData([]);
|
||||||
|
lastSearchedValuesRef.current = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
const loadGridData = async (values: SearchFormValues): Promise<boolean> => {
|
||||||
|
const param: ExcretaTreatmentMaintainTotalRequest = {
|
||||||
|
ctpvNm: values.sido === "ALL" ? "" : values.sido,
|
||||||
|
sggNm: values.gugun === "ALL" ? "" : values.gugun,
|
||||||
|
sewerBzmnCd: values.bsnmCd,
|
||||||
|
statsYr: values.year,
|
||||||
|
rowDataYn: values.isDetail,
|
||||||
|
summaryYn: values.isSummary !== 'ALL',
|
||||||
|
summaryYearCnt: values.isSummary !== 'ALL' ? Number(values.isSummary) : undefined
|
||||||
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
|
const response = await statisticsTotalStatusApi.getExcretaTreatmentStatusTotalList(param);
|
||||||
|
if (response && response.status === "success" && response.data) {
|
||||||
|
// object[]로 변환하여 주입함으로써 상위 컴포넌트 간 null 에러 완벽 차단
|
||||||
|
setRowData(toGridRows(response.data as object[]));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
alert(response?.message || "데이터 조회 중 오류가 발생했습니다.");
|
||||||
|
return false;
|
||||||
|
} catch {
|
||||||
|
alert("서버 연결 중 오류가 발생했습니다.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSearch = async (values: SearchFormValues) => {
|
||||||
|
try {
|
||||||
|
setIsLoading(true);
|
||||||
|
const ok = await loadGridData(values);
|
||||||
|
if (ok) {
|
||||||
|
lastSearchedValuesRef.current = values;
|
||||||
|
} else {
|
||||||
|
lastSearchedValuesRef.current = null;
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
alert("데이터 조회 중 오류가 발생했습니다.");
|
||||||
|
lastSearchedValuesRef.current = null;
|
||||||
|
} finally {
|
||||||
|
setIsLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const gridColumnInfo: ColumnInfo = {
|
||||||
|
columns: config.columns,
|
||||||
|
columnLayout: config.columnLayout,
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<div className="relative">
|
||||||
<SearchForm />
|
<SearchForm isDetail={true} isSummary={true} onSubmit={handleSearch} onReset={handleReset} sidoSelectText="전체" />
|
||||||
</>
|
|
||||||
|
{isLoading && (
|
||||||
|
<div className="absolute inset-0 z-50 [data-theme='black']:bg-transparent rounded-lg p-10 flex justify-center items-center">
|
||||||
|
<div className="relative size-[5rem]">
|
||||||
|
<LoadingWithAnimation color="primary" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<CellColorInfo />
|
||||||
|
|
||||||
|
<div className="flex flex-col gap-[0.6rem] mx-[0.6rem] mt-[0.6rem]">
|
||||||
|
<DataGrid
|
||||||
|
columnInfo={gridColumnInfo}
|
||||||
|
rowStartNum={config.rowStartNum}
|
||||||
|
excelExportFileSuffix={config.tabLabel}
|
||||||
|
rowData={rowData}
|
||||||
|
setRowData={setRowData} // 필수 프로퍼티 에러 해결
|
||||||
|
isExcelImport={false}
|
||||||
|
isExcelExport={true}
|
||||||
|
showHeaderCheckbox={false}
|
||||||
|
fixedColumns={config.fixedColumns}
|
||||||
|
enableSort={false}
|
||||||
|
cellStyleCallback={({ row }) => {
|
||||||
|
const rowType = String(row.rowType ?? '');
|
||||||
|
if (rowType === 'DETAIL') return undefined;
|
||||||
|
if (rowType === 'BIZ_SUM') return 'rg-cell-rowtype-biz-sum';
|
||||||
|
if (rowType === 'SUMMARY') return 'rg-cell-rowtype-summary';
|
||||||
|
return 'rg-cell-rowtype-other';
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,206 @@
|
|||||||
|
import { useRef, useState } from "react";
|
||||||
|
|
||||||
|
import { useAlertStore } from "@/shared/lib";
|
||||||
|
import { LoadingWithAnimation, Tabs, TabsContent, TabsList, TabsTrigger } from "@common/components";
|
||||||
|
|
||||||
import SearchForm from "@/components/module/SearchForm";
|
import SearchForm from "@/components/module/SearchForm";
|
||||||
|
import DataGrid from "@/components/module/DataGrid";
|
||||||
|
import type { ColumnInfo } from "@/components/type/DataGrid.type";
|
||||||
|
import type { SearchFormValues } from "@/components/type/SearchForm.type";
|
||||||
|
import { toGridRows } from "@/components/util/grid/gridFunction";
|
||||||
|
|
||||||
|
// 분리된 개별 3개 컬럼 스펙 파일 로드
|
||||||
|
import { PrivateSewageTab1ColumnConfig } from "@/components/util/column/total/sewerPrivateSewageColumn/SewerPrivateSewageTab1Column";
|
||||||
|
import { PrivateSewageTab2ColumnConfig } from "@/components/util/column/total/sewerPrivateSewageColumn/SewerPrivateSewageTab2Column";
|
||||||
|
import { PrivateSewageTab3ColumnConfig } from "@/components/util/column/total/sewerPrivateSewageColumn/SewerPrivateSewageTab3Column";
|
||||||
|
|
||||||
|
// 통계 API 서비스 및 통합 DTO 명세 임포트
|
||||||
|
import { statisticsTotalStatusApi } from "@/entities/statistics/api/statistics-total-service";
|
||||||
|
import type {
|
||||||
|
PrivateSewageFacilitySummaryRequest
|
||||||
|
} from "@/entities/statistics/model/statistics-total/statistics-private-sewage-total-interface";
|
||||||
|
import CellColorInfo from "./CellColorInfo";
|
||||||
|
|
||||||
|
const PrivateSewageColumnListTot = [
|
||||||
|
PrivateSewageTab1ColumnConfig,
|
||||||
|
PrivateSewageTab2ColumnConfig,
|
||||||
|
PrivateSewageTab3ColumnConfig
|
||||||
|
];
|
||||||
|
|
||||||
|
const firstTabKey = PrivateSewageColumnListTot[0]?.tabKey ?? "ST00040005_1";
|
||||||
|
|
||||||
const PrivateSewageFacilityTot = () => {
|
const PrivateSewageFacilityTot = () => {
|
||||||
|
const { setMessage: alert } = useAlertStore((state) => state);
|
||||||
|
|
||||||
|
// null 컴파일 예러를 사전에 원천 차단한 안전 상태 맵 선언
|
||||||
|
const [rowDataMap, setRowDataMap] = useState<Map<string, Record<string, string | number>[]>>(new Map());
|
||||||
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
const [activeTab, setActiveTab] = useState(firstTabKey);
|
||||||
|
const lastSearchedValuesRef = useRef<SearchFormValues | null>(null);
|
||||||
|
|
||||||
|
const columnInfo = PrivateSewageColumnListTot;
|
||||||
|
|
||||||
|
const handleReset = () => {
|
||||||
|
setRowDataMap(new Map());
|
||||||
|
setActiveTab(firstTabKey);
|
||||||
|
lastSearchedValuesRef.current = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 각 탭별 엔드포인트 비동기 디스패치 및 연동 */
|
||||||
|
const loadGridData = async (tabKey: string, values: SearchFormValues): Promise<boolean> => {
|
||||||
|
const param: PrivateSewageFacilitySummaryRequest = {
|
||||||
|
ctpvNm: values.sido === "ALL" ? "" : values.sido,
|
||||||
|
sggNm: values.gugun === "ALL" ? "" : values.gugun,
|
||||||
|
sewerBzmnCd: values.bsnmCd,
|
||||||
|
statsYr: values.year,
|
||||||
|
rowDataYn: values.isDetail,
|
||||||
|
summaryYn: values.isSummary !== 'ALL',
|
||||||
|
summaryYearCnt: values.isSummary !== 'ALL' ? Number(values.isSummary) : undefined
|
||||||
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
|
// [Tab1] 처리용량별 오수처리시설
|
||||||
|
if (tabKey === "ST00080001") {
|
||||||
|
const response = await statisticsTotalStatusApi.getPrivateSewageTab1List(param);
|
||||||
|
if (response && response.status === "success" && response.data) {
|
||||||
|
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
alert(response?.message || "데이터 조회 중 오류가 발생했습니다.");
|
||||||
|
}
|
||||||
|
|
||||||
|
// [Tab2] 정화조현황
|
||||||
|
if (tabKey === "ST00080002") {
|
||||||
|
const response = await statisticsTotalStatusApi.getPrivateSewageTab2List(param);
|
||||||
|
if (response && response.status === "success" && response.data) {
|
||||||
|
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
alert(response?.message || "데이터 조회 중 오류가 발생했습니다.");
|
||||||
|
}
|
||||||
|
|
||||||
|
// [Tab3] 개인하수도 관리지역 지정공고 현황
|
||||||
|
if (tabKey === "ST00080003") {
|
||||||
|
const response = await statisticsTotalStatusApi.getPrivatePrivateMgmtAreaList(param);
|
||||||
|
if (response && response.status === "success" && response.data) {
|
||||||
|
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
alert(response?.message || "데이터 조회 중 오류가 발생했습니다.");
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
} catch {
|
||||||
|
alert("서버 연결 중 오류가 발생했습니다.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSearch = async (values: SearchFormValues) => {
|
||||||
|
try {
|
||||||
|
setIsLoading(true);
|
||||||
|
const ok = await loadGridData(activeTab, values);
|
||||||
|
if (ok) {
|
||||||
|
lastSearchedValuesRef.current = values;
|
||||||
|
} else {
|
||||||
|
lastSearchedValuesRef.current = null;
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
alert("데이터 조회 중 오류가 발생했습니다.");
|
||||||
|
lastSearchedValuesRef.current = null;
|
||||||
|
} finally {
|
||||||
|
setIsLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleActiveTabChange = async (tabKey: string) => {
|
||||||
|
setActiveTab(tabKey);
|
||||||
|
const values = lastSearchedValuesRef.current;
|
||||||
|
if (!values) return;
|
||||||
|
|
||||||
|
const existing = rowDataMap.get(tabKey);
|
||||||
|
if (existing && existing.length > 0) return; // 캐싱 검증 스킵
|
||||||
|
|
||||||
|
try {
|
||||||
|
setIsLoading(true);
|
||||||
|
await loadGridData(tabKey, values);
|
||||||
|
} catch {
|
||||||
|
alert("데이터 조회 중 오류가 발생했습니다.");
|
||||||
|
} finally {
|
||||||
|
setIsLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<div className="relative">
|
||||||
<SearchForm />
|
<SearchForm isDetail={true} isSummary={true} onSubmit={handleSearch} onReset={handleReset} sidoSelectText="전체" />
|
||||||
</>
|
|
||||||
|
{/* 하수관로 규칙과 100% 싱크 맞춘 중앙 정렬 소형 팝업 로딩 바 고정 */}
|
||||||
|
{isLoading && (
|
||||||
|
<div className="absolute inset-0 z-50 [data-theme='black']:bg-transparent rounded-lg p-10 flex justify-center items-center">
|
||||||
|
<div className="relative size-[5rem]">
|
||||||
|
<LoadingWithAnimation color="primary" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<CellColorInfo />
|
||||||
|
|
||||||
|
<div className="flex flex-col gap-[0.6rem] mx-[0.6rem]">
|
||||||
|
<Tabs value={activeTab} onValueChange={(v) => void handleActiveTabChange(v)} className="w-full" variant="default">
|
||||||
|
<TabsList>
|
||||||
|
{columnInfo.map((info) => (
|
||||||
|
<TabsTrigger key={info.tabKey} value={info.tabKey}>
|
||||||
|
{info.tabLabel}
|
||||||
|
</TabsTrigger>
|
||||||
|
))}
|
||||||
|
</TabsList>
|
||||||
|
|
||||||
|
{columnInfo.map((info) => {
|
||||||
|
const tabKey = info.tabKey;
|
||||||
|
|
||||||
|
// 단언 연산자(as) 배제 형태 완벽 적용
|
||||||
|
const rowData = rowDataMap.get(tabKey) ?? [];
|
||||||
|
|
||||||
|
const gridColumnInfo: ColumnInfo = {
|
||||||
|
columns: info.columns,
|
||||||
|
columnLayout: info.columnLayout,
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<TabsContent key={tabKey} value={tabKey}>
|
||||||
|
<DataGrid
|
||||||
|
columnInfo={gridColumnInfo}
|
||||||
|
rowStartNum={info.rowStartNum}
|
||||||
|
excelExportFileSuffix={info.tabLabel}
|
||||||
|
rowData={rowData}
|
||||||
|
setRowData={(updater) => {
|
||||||
|
setRowDataMap((prev) => {
|
||||||
|
const next = new Map(prev);
|
||||||
|
const cur = next.get(tabKey) ?? [];
|
||||||
|
const n = typeof updater === "function" ? updater(cur) : updater;
|
||||||
|
next.set(tabKey, n);
|
||||||
|
return next;
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
isExcelImport={false}
|
||||||
|
isExcelExport={true}
|
||||||
|
showHeaderCheckbox={false}
|
||||||
|
fixedColumns={info.fixedColumns}
|
||||||
|
enableSort={false}
|
||||||
|
cellStyleCallback={({ row }) => {
|
||||||
|
const rowType = String(row.rowType ?? '');
|
||||||
|
if (rowType === 'DETAIL') return undefined;
|
||||||
|
if (rowType === 'BIZ_SUM') return 'rg-cell-rowtype-biz-sum';
|
||||||
|
if (rowType === 'SUMMARY') return 'rg-cell-rowtype-summary';
|
||||||
|
return 'rg-cell-rowtype-other';
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</TabsContent>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</Tabs>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,123 @@
|
|||||||
|
import { useRef, useState } from "react";
|
||||||
|
|
||||||
|
import { useAlertStore } from "@/shared/lib";
|
||||||
|
import { LoadingWithAnimation } from "@common/components";
|
||||||
|
|
||||||
import SearchForm from "@/components/module/SearchForm";
|
import SearchForm from "@/components/module/SearchForm";
|
||||||
|
import DataGrid from "@/components/module/DataGrid";
|
||||||
|
import type { ColumnInfo } from "@/components/type/DataGrid.type";
|
||||||
|
import type { SearchFormValues } from "@/components/type/SearchForm.type";
|
||||||
|
import { toGridRows } from "@/components/util/grid/gridFunction";
|
||||||
|
|
||||||
|
// 분리된 중계펌프장용 컬럼 구성 임포트
|
||||||
|
import { MediationPumpStatusColumnConfig } from "@/components/util/column/total/SewerMediationPumpStatusColumn";
|
||||||
|
|
||||||
|
// 집계표(TOTAL) API 및 인터페이스 명세 호출
|
||||||
|
import { statisticsTotalStatusApi } from "@/entities/statistics/api/statistics-total-service";
|
||||||
|
import type {
|
||||||
|
MediationPumpMaintainTotalRequest
|
||||||
|
} from "@/entities/statistics/model/statistics-total/statistics-mediation-pump-total-interface";
|
||||||
|
import CellColorInfo from "./CellColorInfo";
|
||||||
|
|
||||||
const PumpingStationTot = () => {
|
const PumpingStationTot = () => {
|
||||||
|
const { setMessage: alert } = useAlertStore((state) => state);
|
||||||
|
|
||||||
|
// null 타입 컴파일 에러가 발생하지 않도록 엄격하게 정의한 데이터 상태
|
||||||
|
const [rowData, setRowData] = useState<Record<string, string | number>[]>([]);
|
||||||
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
const lastSearchedValuesRef = useRef<SearchFormValues | null>(null);
|
||||||
|
|
||||||
|
const config = MediationPumpStatusColumnConfig;
|
||||||
|
|
||||||
|
const handleReset = () => {
|
||||||
|
setRowData([]);
|
||||||
|
lastSearchedValuesRef.current = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
const loadGridData = async (values: SearchFormValues): Promise<boolean> => {
|
||||||
|
const param: MediationPumpMaintainTotalRequest = {
|
||||||
|
ctpvNm: values.sido === "ALL" ? "" : values.sido,
|
||||||
|
sggNm: values.gugun === "ALL" ? "" : values.gugun,
|
||||||
|
sewerBzmnCd: values.bsnmCd,
|
||||||
|
statsYr: values.year,
|
||||||
|
rowDataYn: values.isDetail,
|
||||||
|
summaryYn: values.isSummary !== 'ALL',
|
||||||
|
summaryYearCnt: values.isSummary !== 'ALL' ? Number(values.isSummary) : undefined
|
||||||
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
|
const response = await statisticsTotalStatusApi.getMediationPumpStationStatusTotalList(param);
|
||||||
|
if (response && response.status === "success" && response.data) {
|
||||||
|
// object[]로 변환하여 주입함으로써 null 에러 전면 방지
|
||||||
|
setRowData(toGridRows(response.data as object[]));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
alert(response?.message || "데이터 조회 중 오류가 발생했습니다.");
|
||||||
|
return false;
|
||||||
|
} catch {
|
||||||
|
alert("서버 연결 중 오류가 발생했습니다.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSearch = async (values: SearchFormValues) => {
|
||||||
|
try {
|
||||||
|
setIsLoading(true);
|
||||||
|
const ok = await loadGridData(values);
|
||||||
|
if (ok) {
|
||||||
|
lastSearchedValuesRef.current = values;
|
||||||
|
} else {
|
||||||
|
lastSearchedValuesRef.current = null;
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
alert("데이터 조회 중 오류가 발생했습니다.");
|
||||||
|
lastSearchedValuesRef.current = null;
|
||||||
|
} finally {
|
||||||
|
setIsLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const gridColumnInfo: ColumnInfo = {
|
||||||
|
columns: config.columns,
|
||||||
|
columnLayout: config.columnLayout,
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<div className="relative">
|
||||||
<SearchForm />
|
<SearchForm isDetail={true} isSummary={true} onSubmit={handleSearch} onReset={handleReset} sidoSelectText="전체" />
|
||||||
</>
|
|
||||||
|
{isLoading && (
|
||||||
|
<div className="absolute inset-0 z-50 [data-theme='black']:bg-transparent rounded-lg p-10 flex justify-center items-center">
|
||||||
|
<div className="relative size-[5rem]">
|
||||||
|
<LoadingWithAnimation color="primary" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<CellColorInfo />
|
||||||
|
|
||||||
|
<div className="flex flex-col gap-[0.6rem] mx-[0.6rem] mt-[0.6rem]">
|
||||||
|
<DataGrid
|
||||||
|
columnInfo={gridColumnInfo}
|
||||||
|
rowStartNum={config.rowStartNum}
|
||||||
|
excelExportFileSuffix={config.tabLabel}
|
||||||
|
rowData={rowData}
|
||||||
|
setRowData={setRowData}
|
||||||
|
isExcelImport={false}
|
||||||
|
isExcelExport={true}
|
||||||
|
showHeaderCheckbox={false}
|
||||||
|
fixedColumns={config.fixedColumns}
|
||||||
|
enableSort={false}
|
||||||
|
cellStyleCallback={({ row }) => {
|
||||||
|
const rowType = String(row.rowType ?? '');
|
||||||
|
if (rowType === 'DETAIL') return undefined;
|
||||||
|
if (rowType === 'BIZ_SUM') return 'rg-cell-rowtype-biz-sum';
|
||||||
|
if (rowType === 'SUMMARY') return 'rg-cell-rowtype-summary';
|
||||||
|
return 'rg-cell-rowtype-other';
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,162 @@
|
|||||||
|
import { useRef, useState } from "react";
|
||||||
|
import { useAlertStore } from "@/shared/lib";
|
||||||
|
import { LoadingWithAnimation, Tabs, TabsContent, TabsList, TabsTrigger } from "@common/components";
|
||||||
import SearchForm from "@/components/module/SearchForm";
|
import SearchForm from "@/components/module/SearchForm";
|
||||||
|
import DataGrid from "@/components/module/DataGrid";
|
||||||
|
import type { ColumnInfo } from "@/components/type/DataGrid.type";
|
||||||
|
import type { SearchFormValues } from "@/components/type/SearchForm.type";
|
||||||
|
import { toGridRows } from "@/components/util/grid/gridFunction";
|
||||||
|
import CellColorInfo from "./CellColorInfo";
|
||||||
|
|
||||||
|
// 12. 하수 및 분뇨 관리 산업 탭 설정 (경로 확인 필수)
|
||||||
|
import { PublicSewageStaffTab1ColumnConfig } from "@/components/util/column/total/sewageExcretaIndustry/PublicSewageStaffTab1Column";
|
||||||
|
import { PublicHumanWasteStaffTab2ColumnConfig } from "@/components/util/column/total/sewageExcretaIndustry/PublicHumanWasteStaffTab2Column";
|
||||||
|
import { HumanWasteCollectionTab3ColumnConfig } from "@/components/util/column/total/sewageExcretaIndustry/HumanWasteCollectionTab3Column";
|
||||||
|
import { IndividualSewageTab4ColumnConfig } from "@/components/util/column/total/sewageExcretaIndustry/IndividualSewageTab4Column";
|
||||||
|
import { statisticsTotalStatusApi } from "@/entities/statistics/api/statistics-total-service";
|
||||||
|
import type {
|
||||||
|
SewerageIndustry,
|
||||||
|
PublicSewageStaffTab1Response,
|
||||||
|
PublicHumanWasteStaffTab2Response,
|
||||||
|
HumanWasteCollectionTab3Response,
|
||||||
|
IndividualSewageTab4Response
|
||||||
|
} from "@/entities/statistics/model/statistics-total/statistics-sewerage-industry-interface";
|
||||||
|
|
||||||
|
const SewageExcretaIndustryColumnListTot = [PublicSewageStaffTab1ColumnConfig,PublicHumanWasteStaffTab2ColumnConfig,HumanWasteCollectionTab3ColumnConfig,IndividualSewageTab4ColumnConfig].filter(Boolean);
|
||||||
|
const firstTabKey = SewageExcretaIndustryColumnListTot[0]?.tabKey ?? "ST00120001";
|
||||||
|
|
||||||
const SewageExcretaRelatedTot = () => {
|
const SewageExcretaRelatedTot = () => {
|
||||||
|
const { setMessage: alert } = useAlertStore((state) => state);
|
||||||
|
const [rowDataMap, setRowDataMap] = useState<Map<string, Record<string, string | number>[]>>(new Map());
|
||||||
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
const [activeTab, setActiveTab] = useState(firstTabKey);
|
||||||
|
const lastSearchedValuesRef = useRef<SearchFormValues | null>(null);
|
||||||
|
|
||||||
|
const handleReset = () => {
|
||||||
|
setRowDataMap(new Map());
|
||||||
|
setActiveTab(firstTabKey);
|
||||||
|
lastSearchedValuesRef.current = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
const loadGridData = async (tabKey: string, values: SearchFormValues): Promise<boolean> => {
|
||||||
|
setIsLoading(true);
|
||||||
|
const param: SewerageIndustry = {
|
||||||
|
ctpvNm: values.sido === "ALL" ? "" : values.sido,
|
||||||
|
sggNm: values.gugun === "ALL" ? "" : values.gugun,
|
||||||
|
sewerBzmnCd: values.bsnmCd,
|
||||||
|
statsYr: values.year,
|
||||||
|
rowDataYn: values.isDetail,
|
||||||
|
summaryYn: values.isSummary !== 'ALL',
|
||||||
|
summaryYearCnt: values.isSummary !== 'ALL' ? Number(values.isSummary) : undefined
|
||||||
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (tabKey === "ST00120001") {
|
||||||
|
const response: PublicSewageStaffTab1Response = await statisticsTotalStatusApi.getPublicSewageStaffTab1List(param);
|
||||||
|
if (response?.status === "success") {
|
||||||
|
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (tabKey === "ST00120002") {
|
||||||
|
const response: PublicHumanWasteStaffTab2Response = await statisticsTotalStatusApi.getPublicHumanWasteStaffTab2List(param);
|
||||||
|
if (response?.status === "success") {
|
||||||
|
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (tabKey === "ST00120003") {
|
||||||
|
const response: HumanWasteCollectionTab3Response = await statisticsTotalStatusApi.getHumanWasteCollectionTab3List(param);
|
||||||
|
if (response?.status === "success") {
|
||||||
|
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// [TAB4] 개인하수처리관련업
|
||||||
|
else if (tabKey === "ST00120004") {
|
||||||
|
const response: IndividualSewageTab4Response = await statisticsTotalStatusApi.getIndividualSewageTab4List(param);
|
||||||
|
if (response?.status === "success") {
|
||||||
|
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
} catch {
|
||||||
|
alert("서버 연결 중 오류가 발생했습니다.");
|
||||||
|
return false;
|
||||||
|
} finally {
|
||||||
|
setIsLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSearch = async (values: SearchFormValues) => {
|
||||||
|
lastSearchedValuesRef.current = values;
|
||||||
|
await loadGridData(activeTab, values);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleActiveTabChange = async (tabKey: string) => {
|
||||||
|
setActiveTab(tabKey);
|
||||||
|
const values = lastSearchedValuesRef.current;
|
||||||
|
if (!values || rowDataMap.has(tabKey)) return;
|
||||||
|
await loadGridData(tabKey, values);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<div className="relative">
|
||||||
<SearchForm />
|
<SearchForm isDetail={true} isSummary={true} onSubmit={handleSearch} onReset={handleReset} sidoSelectText="전체" />
|
||||||
</>
|
|
||||||
|
{isLoading && (
|
||||||
|
<div className="absolute inset-0 z-50 [data-theme='black']:bg-transparent rounded-lg p-10 flex justify-center items-center">
|
||||||
|
<div className="relative size-[5rem]">
|
||||||
|
<LoadingWithAnimation color="primary" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<CellColorInfo />
|
||||||
|
|
||||||
|
<div className="flex flex-col gap-[0.6rem] mx-[0.6rem]">
|
||||||
|
<Tabs value={activeTab} onValueChange={(v) => void handleActiveTabChange(v)} className="w-full" variant="default">
|
||||||
|
<TabsList>
|
||||||
|
{SewageExcretaIndustryColumnListTot.map((info) => (
|
||||||
|
<TabsTrigger key={info.tabKey} value={info.tabKey}>{info.tabLabel}</TabsTrigger>
|
||||||
|
))}
|
||||||
|
</TabsList>
|
||||||
|
|
||||||
|
{SewageExcretaIndustryColumnListTot.map((info) => (
|
||||||
|
<TabsContent key={info.tabKey} value={info.tabKey}>
|
||||||
|
<DataGrid
|
||||||
|
columnInfo={{ columns: info.columns, columnLayout: info.columnLayout }}
|
||||||
|
rowStartNum={info.rowStartNum}
|
||||||
|
rowData={rowDataMap.get(info.tabKey) ?? []}
|
||||||
|
excelExportFileSuffix={info.tabLabel}
|
||||||
|
setRowData={(updater) => {
|
||||||
|
setRowDataMap((prev) => {
|
||||||
|
const next = new Map(prev);
|
||||||
|
const cur = next.get(info.tabKey) ?? [];
|
||||||
|
const n = typeof updater === "function" ? updater(cur) : updater;
|
||||||
|
next.set(info.tabKey, n);
|
||||||
|
return next;
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
isExcelImport={false}
|
||||||
|
isExcelExport={true}
|
||||||
|
showHeaderCheckbox={false}
|
||||||
|
fixedColumns={info.fixedColumns}
|
||||||
|
enableSort={false}
|
||||||
|
cellStyleCallback={({ row }) => {
|
||||||
|
const rowType = String(row.rowType ?? '');
|
||||||
|
if (rowType === 'DETAIL') return undefined;
|
||||||
|
if (rowType === 'BIZ_SUM') return 'rg-cell-rowtype-biz-sum';
|
||||||
|
if (rowType === 'SUMMARY') return 'rg-cell-rowtype-summary';
|
||||||
|
return 'rg-cell-rowtype-other';
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</TabsContent>
|
||||||
|
))}
|
||||||
|
</Tabs>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,210 @@
|
|||||||
|
import { useRef, useState } from "react";
|
||||||
|
|
||||||
|
import { useAlertStore } from "@/shared/lib";
|
||||||
|
import { LoadingWithAnimation, Tabs, TabsContent, TabsList, TabsTrigger } from "@common/components";
|
||||||
|
|
||||||
import SearchForm from "@/components/module/SearchForm";
|
import SearchForm from "@/components/module/SearchForm";
|
||||||
|
import DataGrid from "@/components/module/DataGrid";
|
||||||
|
import type { SearchFormValues } from "@/components/type/SearchForm.type";
|
||||||
|
import { toGridRows } from "@/components/util/grid/gridFunction";
|
||||||
|
|
||||||
|
// 4개 탭 컬럼 설정 임포트
|
||||||
|
import { SludgeProcessingTab1ColumnConfig } from "@/components/util/column/total/sludgeProcessing/SludgeProcessingTab1Column";
|
||||||
|
import { DigestionTankTab2ColumnConfig } from "@/components/util/column/total/sludgeProcessing/DigestionTankTab2Column";
|
||||||
|
import { SewageSludgeOperTab3ColumnConfig } from "@/components/util/column/total/sludgeProcessing/SewageSludgeOperTab3Column";
|
||||||
|
import { HumanWasteSludgeTab4ColumnConfig } from "@/components/util/column/total/sludgeProcessing/HumanWasteSludgeTab4Column";
|
||||||
|
|
||||||
|
// API 인스턴스 및 인터페이스 임포트 (타입 안전성 확보)
|
||||||
|
import { statisticsTotalStatusApi } from "@/entities/statistics/api/statistics-total-service";
|
||||||
|
import type {
|
||||||
|
SludgeSummaryRequest,
|
||||||
|
SludgeProcessingTab1Response,
|
||||||
|
DigestionTankOperTab2Response,
|
||||||
|
SewageSludgeOperTab3Response,
|
||||||
|
HumanWasteSludgeTab4Response
|
||||||
|
} from "@/entities/statistics/model/statistics-total/statistics-sludge-total-interface";
|
||||||
|
import CellColorInfo from "./CellColorInfo";
|
||||||
|
|
||||||
|
// 탭 순회 설정
|
||||||
|
const SludgeColumnListTot = [
|
||||||
|
SludgeProcessingTab1ColumnConfig,
|
||||||
|
DigestionTankTab2ColumnConfig,
|
||||||
|
SewageSludgeOperTab3ColumnConfig,
|
||||||
|
HumanWasteSludgeTab4ColumnConfig
|
||||||
|
].filter(Boolean);
|
||||||
|
|
||||||
|
const firstTabKey = SludgeColumnListTot[0]?.tabKey ?? "ST00110001";
|
||||||
|
|
||||||
const SewageExcretaSlurgeTot = () => {
|
const SewageExcretaSlurgeTot = () => {
|
||||||
|
const { setMessage: alert } = useAlertStore((state) => state);
|
||||||
|
|
||||||
|
const [rowDataMap, setRowDataMap] = useState<Map<string, Record<string, string | number>[]>>(new Map());
|
||||||
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
const [activeTab, setActiveTab] = useState(firstTabKey);
|
||||||
|
const lastSearchedValuesRef = useRef<SearchFormValues | null>(null);
|
||||||
|
|
||||||
|
const columnInfo = SludgeColumnListTot;
|
||||||
|
|
||||||
|
const handleReset = () => {
|
||||||
|
setRowDataMap(new Map());
|
||||||
|
setActiveTab(firstTabKey);
|
||||||
|
lastSearchedValuesRef.current = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
const loadGridData = async (tabKey: string, values: SearchFormValues): Promise<boolean> => {
|
||||||
|
setIsLoading(true);
|
||||||
|
const param: SludgeSummaryRequest = {
|
||||||
|
ctpvNm: values.sido === "ALL" ? "" : values.sido,
|
||||||
|
sggNm: values.gugun === "ALL" ? "" : values.gugun,
|
||||||
|
sewerBzmnCd: values.bsnmCd,
|
||||||
|
statsYr: values.year,
|
||||||
|
rowDataYn: values.isDetail,
|
||||||
|
summaryYn: values.isSummary !== 'ALL',
|
||||||
|
summaryYearCnt: values.isSummary !== 'ALL' ? Number(values.isSummary) : undefined
|
||||||
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
|
// [TAB1] 하수및분뇨찌꺼기 > 찌꺼기처리시설현황
|
||||||
|
if (tabKey === "ST00110001") {
|
||||||
|
const response: SludgeProcessingTab1Response = await statisticsTotalStatusApi.getSludgeProcessingTab1List(param);
|
||||||
|
if (response?.status === "success") {
|
||||||
|
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// [TAB2] 소화조 운영현황
|
||||||
|
else if (tabKey === "ST00110002") {
|
||||||
|
const response: DigestionTankOperTab2Response = await statisticsTotalStatusApi.getSludgeTab2List(param);
|
||||||
|
if (response?.status === "success") {
|
||||||
|
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// [TAB3] 하수찌꺼기 처리시설 운영현황
|
||||||
|
else if (tabKey === "ST00110003") {
|
||||||
|
const response: SewageSludgeOperTab3Response = await statisticsTotalStatusApi.getSludgeTab3List(param);
|
||||||
|
if (response?.status === "success") {
|
||||||
|
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// [TAB4] 분뇨찌꺼기 처리현황
|
||||||
|
else if (tabKey === "ST00110004") {
|
||||||
|
const response: HumanWasteSludgeTab4Response = await statisticsTotalStatusApi.getSludgeTab4List(param);
|
||||||
|
if (response?.status === "success") {
|
||||||
|
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
alert("데이터 조회 중 오류가 발생했습니다.");
|
||||||
|
return false;
|
||||||
|
} catch {
|
||||||
|
alert("서버 연결 중 오류가 발생했습니다.");
|
||||||
|
return false;
|
||||||
|
} finally {
|
||||||
|
setIsLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 검색 버튼 이벤트: SearchForm의 Values 타입을 기반으로 호출 */
|
||||||
|
const handleSearch = async (values: SearchFormValues) => {
|
||||||
|
try {
|
||||||
|
setIsLoading(true);
|
||||||
|
// 탭 변경 없이 현재 탭(activeTab)에 대해서만 명시적 타입 호출
|
||||||
|
const ok = await loadGridData(activeTab, values);
|
||||||
|
if (ok) {
|
||||||
|
lastSearchedValuesRef.current = values;
|
||||||
|
} else {
|
||||||
|
lastSearchedValuesRef.current = null;
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
alert("데이터 조회 중 오류가 발생했습니다.");
|
||||||
|
lastSearchedValuesRef.current = null;
|
||||||
|
} finally {
|
||||||
|
setIsLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 탭 변경 이벤트: 현재 탭 상태와 SearchForm의 마지막 값을 동기화 */
|
||||||
|
const handleActiveTabChange = async (tabKey: string) => {
|
||||||
|
setActiveTab(tabKey);
|
||||||
|
|
||||||
|
// 마지막 검색 값이 있으면 해당 탭만 새로 로드
|
||||||
|
const values = lastSearchedValuesRef.current;
|
||||||
|
if (!values || rowDataMap.has(tabKey)) return;
|
||||||
|
|
||||||
|
try {
|
||||||
|
setIsLoading(true);
|
||||||
|
await loadGridData(tabKey, values);
|
||||||
|
} catch (error) {
|
||||||
|
alert("데이터 조회 중 오류가 발생했습니다.");
|
||||||
|
} finally {
|
||||||
|
setIsLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<div className="relative">
|
||||||
<SearchForm />
|
<SearchForm isDetail={true} isSummary={true} onSubmit={handleSearch} onReset={handleReset} sidoSelectText="전체" />
|
||||||
</>
|
|
||||||
|
{isLoading && (
|
||||||
|
<div className="absolute inset-0 z-50 [data-theme='black']:bg-transparent rounded-lg p-10 flex justify-center items-center">
|
||||||
|
<div className="relative size-[5rem]">
|
||||||
|
<LoadingWithAnimation color="primary" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<CellColorInfo />
|
||||||
|
|
||||||
|
<div className="flex flex-col gap-[0.6rem] mx-[0.6rem]">
|
||||||
|
<Tabs value={activeTab} onValueChange={(v) => void handleActiveTabChange(v)} className="w-full" variant="default">
|
||||||
|
<TabsList>
|
||||||
|
{columnInfo.map((info) => (
|
||||||
|
<TabsTrigger key={info.tabKey} value={info.tabKey}>{info.tabLabel}</TabsTrigger>
|
||||||
|
))}
|
||||||
|
</TabsList>
|
||||||
|
|
||||||
|
{columnInfo.map((info) => {
|
||||||
|
const tabKey = info.tabKey;
|
||||||
|
const rowData = rowDataMap.get(tabKey) ?? [];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<TabsContent key={tabKey} value={tabKey}>
|
||||||
|
<DataGrid
|
||||||
|
columnInfo={{ columns: info.columns, columnLayout: info.columnLayout }}
|
||||||
|
rowStartNum={info.rowStartNum}
|
||||||
|
rowData={rowData}
|
||||||
|
excelExportFileSuffix={info.tabLabel}
|
||||||
|
setRowData={(updater) => {
|
||||||
|
setRowDataMap((prev) => {
|
||||||
|
const next = new Map(prev);
|
||||||
|
const cur = next.get(tabKey) ?? [];
|
||||||
|
const n = typeof updater === "function" ? updater(cur) : updater;
|
||||||
|
next.set(tabKey, n);
|
||||||
|
return next;
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
isExcelImport={false}
|
||||||
|
isExcelExport={true}
|
||||||
|
showHeaderCheckbox={false}
|
||||||
|
fixedColumns={info.fixedColumns}
|
||||||
|
enableSort={false}
|
||||||
|
cellStyleCallback={({ row }) => {
|
||||||
|
const rowType = String(row.rowType ?? '');
|
||||||
|
if (rowType === 'DETAIL') return undefined;
|
||||||
|
if (rowType === 'BIZ_SUM') return 'rg-cell-rowtype-biz-sum';
|
||||||
|
if (rowType === 'SUMMARY') return 'rg-cell-rowtype-summary';
|
||||||
|
return 'rg-cell-rowtype-other';
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</TabsContent>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</Tabs>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -15,12 +15,17 @@ import type { SewagePipeMaintainTotalRequest } from "@/entities/statistics/model
|
|||||||
const firstTabKey = SewagePipeMaintainColumnListTot[0]?.tabKey ?? "ST00030001";
|
const firstTabKey = SewagePipeMaintainColumnListTot[0]?.tabKey ?? "ST00030001";
|
||||||
|
|
||||||
function buildSewagePipeMaintainTotSearchParam(values: SearchFormValues): SewagePipeMaintainTotalRequest {
|
function buildSewagePipeMaintainTotSearchParam(values: SearchFormValues): SewagePipeMaintainTotalRequest {
|
||||||
|
const isSummaryEnabled = values.isSummary !== 'ALL';
|
||||||
|
const summaryYearCnt = isSummaryEnabled ? Number(values.isSummary) : undefined;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
ctpvNm: values.sido === "ALL" ? "" : values.sido,
|
ctpvNm: values.sido === "ALL" ? "" : values.sido,
|
||||||
sggNm: values.gugun === "ALL" ? "" : values.gugun,
|
sggNm: values.gugun === "ALL" ? "" : values.gugun,
|
||||||
sewerBzmnCd: values.bsnmCd,
|
sewerBzmnCd: values.bsnmCd,
|
||||||
statsYr: values.year,
|
statsYr: values.year,
|
||||||
rowDataYn: values.isDetail,
|
rowDataYn: values.isDetail,
|
||||||
|
summaryYn: isSummaryEnabled,
|
||||||
|
...(isSummaryEnabled ? { summaryYearCnt } : {}),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,7 +133,7 @@ const SewagePipeMaintainTot = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="relative">
|
<div className="relative">
|
||||||
<SearchForm isDetail={true} onSubmit={handleSearch} onReset={handleReset} sidoSelectText="전체" />
|
<SearchForm isDetail={true} isSummary={true} onSubmit={handleSearch} onReset={handleReset} sidoSelectText="전체" />
|
||||||
{isLoading && (
|
{isLoading && (
|
||||||
<div className="absolute inset-0 z-50 [data-theme='black']:bg-transparent rounded-lg p-10 flex justify-center items-center">
|
<div className="absolute inset-0 z-50 [data-theme='black']:bg-transparent rounded-lg p-10 flex justify-center items-center">
|
||||||
<div className="relative size-[5rem]">
|
<div className="relative size-[5rem]">
|
||||||
|
|||||||
@@ -1,10 +1,190 @@
|
|||||||
|
import { useRef, useState } from "react";
|
||||||
|
|
||||||
|
import { useAlertStore } from "@/shared/lib";
|
||||||
|
import { LoadingWithAnimation, Tabs, TabsContent, TabsList, TabsTrigger } from "@common/components";
|
||||||
|
|
||||||
import SearchForm from "@/components/module/SearchForm";
|
import SearchForm from "@/components/module/SearchForm";
|
||||||
|
import DataGrid from "@/components/module/DataGrid";
|
||||||
|
import type { ColumnInfo } from "@/components/type/DataGrid.type";
|
||||||
|
import type { SearchFormValues } from "@/components/type/SearchForm.type";
|
||||||
|
import { toGridRows } from "@/components/util/grid/gridFunction";
|
||||||
|
|
||||||
|
// 분리된 개별 컬럼 구성 임포트 경로 유지
|
||||||
|
import { ReservoirStatusColumnConfig } from "@/components/util/column/total/sewerReservoir/SewerReservoirStatusColumn";
|
||||||
|
import { PumpStationStatusColumnConfig } from "@/components/util/column/total/sewerReservoir/SewerPumpStationStatusColumn";
|
||||||
|
|
||||||
|
// 수정 적용한 API 및 인터페이스 명세 호출 유지
|
||||||
|
import { statisticsTotalStatusApi } from "@/entities/statistics/api/statistics-total-service";
|
||||||
|
import type {
|
||||||
|
SewerReservoirMaintainTotalRequest
|
||||||
|
} from "@/entities/statistics/model/statistics-total/statistics-sewage-reservoir-total-interface";
|
||||||
|
import CellColorInfo from "./CellColorInfo";
|
||||||
|
|
||||||
|
const SewerReservoirColumnListTot = [
|
||||||
|
ReservoirStatusColumnConfig,
|
||||||
|
PumpStationStatusColumnConfig
|
||||||
|
];
|
||||||
|
|
||||||
|
const firstTabKey = SewerReservoirColumnListTot[0]?.tabKey ?? "ST00040001";
|
||||||
|
|
||||||
const SewageReservoirPumpTot = () => {
|
const SewageReservoirPumpTot = () => {
|
||||||
|
const { setMessage: alert } = useAlertStore((state) => state);
|
||||||
|
|
||||||
|
// 상태 정의에서 null을 제외하여 DataGrid와 타입을 일치시킵니다.
|
||||||
|
const [rowDataMap, setRowDataMap] = useState<Map<string, Record<string, string | number>[]>>(new Map());
|
||||||
|
|
||||||
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
const [activeTab, setActiveTab] = useState(firstTabKey);
|
||||||
|
const lastSearchedValuesRef = useRef<SearchFormValues | null>(null);
|
||||||
|
|
||||||
|
const columnInfo = SewerReservoirColumnListTot;
|
||||||
|
|
||||||
|
const handleReset = () => {
|
||||||
|
setRowDataMap(new Map());
|
||||||
|
setActiveTab(firstTabKey);
|
||||||
|
lastSearchedValuesRef.current = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
const loadGridData = async (tabKey: string, values: SearchFormValues): Promise<boolean> => {
|
||||||
|
const param: SewerReservoirMaintainTotalRequest = {
|
||||||
|
ctpvNm: values.sido === "ALL" ? "" : values.sido,
|
||||||
|
sggNm: values.gugun === "ALL" ? "" : values.gugun,
|
||||||
|
sewerBzmnCd: values.bsnmCd,
|
||||||
|
statsYr: values.year,
|
||||||
|
rowDataYn: values.isDetail,
|
||||||
|
summaryYn: values.isSummary !== 'ALL',
|
||||||
|
summaryYearCnt: values.isSummary !== 'ALL' ? Number(values.isSummary) : undefined
|
||||||
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (tabKey === "ST00040001") {
|
||||||
|
const response = await statisticsTotalStatusApi.getSewerReservoirStatusTotalList(param);
|
||||||
|
if (response && response.status === "success" && response.data) {
|
||||||
|
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
alert(response?.message || "데이터 조회 중 오류가 발생했습니다.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tabKey === "ST00040002") {
|
||||||
|
const response = await statisticsTotalStatusApi.getSewerPumpStationStatusTotalList(param);
|
||||||
|
if (response && response.status === "success" && response.data) {
|
||||||
|
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
alert(response?.message || "데이터 조회 중 오류가 발생했습니다.");
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
} catch {
|
||||||
|
alert("서버 연결 중 오류가 발생했습니다.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSearch = async (values: SearchFormValues) => {
|
||||||
|
try {
|
||||||
|
setIsLoading(true);
|
||||||
|
const ok = await loadGridData(activeTab, values);
|
||||||
|
if (ok) {
|
||||||
|
lastSearchedValuesRef.current = values;
|
||||||
|
} else {
|
||||||
|
lastSearchedValuesRef.current = null;
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
alert("데이터 조회 중 오류가 발생했습니다.");
|
||||||
|
lastSearchedValuesRef.current = null;
|
||||||
|
} finally {
|
||||||
|
setIsLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleActiveTabChange = async (tabKey: string) => {
|
||||||
|
setActiveTab(tabKey);
|
||||||
|
const values = lastSearchedValuesRef.current;
|
||||||
|
if (!values) return;
|
||||||
|
|
||||||
|
const existing = rowDataMap.get(tabKey);
|
||||||
|
if (existing && existing.length > 0) return;
|
||||||
|
|
||||||
|
try {
|
||||||
|
setIsLoading(true);
|
||||||
|
await loadGridData(tabKey, values);
|
||||||
|
} catch {
|
||||||
|
alert("데이터 조회 중 오류가 발생했습니다.");
|
||||||
|
} finally {
|
||||||
|
setIsLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<div className="relative">
|
||||||
<SearchForm />
|
<SearchForm isDetail={true} isSummary={true} onSubmit={handleSearch} onReset={handleReset} sidoSelectText="전체" />
|
||||||
</>
|
|
||||||
|
{isLoading && (
|
||||||
|
<div className="absolute inset-0 z-50 [data-theme='black']:bg-transparent rounded-lg p-10 flex justify-center items-center">
|
||||||
|
<div className="relative size-[5rem]">
|
||||||
|
<LoadingWithAnimation color="primary" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<CellColorInfo />
|
||||||
|
|
||||||
|
<div className="flex flex-col gap-[0.6rem] mx-[0.6rem]">
|
||||||
|
<Tabs value={activeTab} onValueChange={(v) => void handleActiveTabChange(v)} className="w-full" variant="default">
|
||||||
|
<TabsList>
|
||||||
|
{columnInfo.map((info) => (
|
||||||
|
<TabsTrigger key={info.tabKey} value={info.tabKey}>
|
||||||
|
{info.tabLabel}
|
||||||
|
</TabsTrigger>
|
||||||
|
))}
|
||||||
|
</TabsList>
|
||||||
|
|
||||||
|
{columnInfo.map((info) => {
|
||||||
|
const tabKey = info.tabKey;
|
||||||
|
const rowData = rowDataMap.get(tabKey) ?? [];
|
||||||
|
|
||||||
|
const gridColumnInfo: ColumnInfo = {
|
||||||
|
columns: info.columns,
|
||||||
|
columnLayout: info.columnLayout,
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<TabsContent key={tabKey} value={tabKey}>
|
||||||
|
<DataGrid
|
||||||
|
columnInfo={gridColumnInfo}
|
||||||
|
rowStartNum={info.rowStartNum}
|
||||||
|
excelExportFileSuffix={info.tabLabel}
|
||||||
|
rowData={rowData}
|
||||||
|
setRowData={(updater) => {
|
||||||
|
setRowDataMap((prev) => {
|
||||||
|
const next = new Map(prev);
|
||||||
|
const cur = next.get(tabKey) ?? [];
|
||||||
|
const n =
|
||||||
|
typeof updater === "function" ? updater(cur) : updater;
|
||||||
|
next.set(tabKey, n);
|
||||||
|
return next;
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
isExcelImport={false}
|
||||||
|
isExcelExport={true}
|
||||||
|
showHeaderCheckbox={false}
|
||||||
|
fixedColumns={info.fixedColumns}
|
||||||
|
enableSort={false}
|
||||||
|
cellStyleCallback={({ row }) => {
|
||||||
|
const rowType = String(row.rowType ?? '');
|
||||||
|
if (rowType === 'DETAIL') return undefined;
|
||||||
|
if (rowType === 'BIZ_SUM') return 'rg-cell-rowtype-biz-sum';
|
||||||
|
if (rowType === 'SUMMARY') return 'rg-cell-rowtype-summary';
|
||||||
|
return 'rg-cell-rowtype-other';
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</TabsContent>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</Tabs>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,217 @@
|
|||||||
|
import { useRef, useState } from "react";
|
||||||
|
|
||||||
|
import { useAlertStore } from "@/shared/lib";
|
||||||
|
import { LoadingWithAnimation, Tabs, TabsContent, TabsList, TabsTrigger } from "@common/components";
|
||||||
|
|
||||||
import SearchForm from "@/components/module/SearchForm";
|
import SearchForm from "@/components/module/SearchForm";
|
||||||
|
import DataGrid from "@/components/module/DataGrid";
|
||||||
|
import type { ColumnInfo } from "@/components/type/DataGrid.type";
|
||||||
|
import type { SearchFormValues } from "@/components/type/SearchForm.type";
|
||||||
|
import { toGridRows } from "@/components/util/grid/gridFunction";
|
||||||
|
|
||||||
|
// 분리된 4개 개별 탭 컬럼 파일 바인딩
|
||||||
|
import { SewerageFinancialTab1ColumnConfig } from "@/components/util/column/total/sewerageFinancial/SewerageFinancialTab1Column";
|
||||||
|
import { SewerageFeeTab2ColumnConfig } from "@/components/util/column/total/sewerageFinancial/SewerageFeeTab2Column";
|
||||||
|
import { SewerageUsageFeeTab3ColumnConfig } from "@/components/util/column/total/sewerageFinancial/SewerageUsageFeeTab3Column";
|
||||||
|
import { SewerageOrgCauseTab4ColumnConfig } from "@/components/util/column/total/sewerageFinancial/SewerageOrgCauseTab4Column";
|
||||||
|
|
||||||
|
// API 인스턴스 및 인터페이스 호출
|
||||||
|
import { statisticsTotalStatusApi } from "@/entities/statistics/api/statistics-total-service";
|
||||||
|
import type {
|
||||||
|
SewerageFinanceSummaryRequest
|
||||||
|
} from "@/entities/statistics/model/statistics-total/statistics-sewerage-finance-total-interface";
|
||||||
|
import CellColorInfo from "./CellColorInfo";
|
||||||
|
|
||||||
|
const SewerageFinanceColumnListTot = [
|
||||||
|
SewerageFinancialTab1ColumnConfig,
|
||||||
|
SewerageFeeTab2ColumnConfig,
|
||||||
|
SewerageUsageFeeTab3ColumnConfig,
|
||||||
|
SewerageOrgCauseTab4ColumnConfig
|
||||||
|
];
|
||||||
|
|
||||||
|
const firstTabKey = SewerageFinanceColumnListTot[0]?.tabKey ?? "ST00040006_1";
|
||||||
|
|
||||||
const SewerageFinanceTot = () => {
|
const SewerageFinanceTot = () => {
|
||||||
|
const { setMessage: alert } = useAlertStore((state) => state);
|
||||||
|
|
||||||
|
// 컴파일 에러가 발생하지 않도록 원천 가공 처리형 맵 적용
|
||||||
|
const [rowDataMap, setRowDataMap] = useState<Map<string, Record<string, string | number>[]>>(new Map());
|
||||||
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
const [activeTab, setActiveTab] = useState(firstTabKey);
|
||||||
|
const lastSearchedValuesRef = useRef<SearchFormValues | null>(null);
|
||||||
|
|
||||||
|
const columnInfo = SewerageFinanceColumnListTot;
|
||||||
|
|
||||||
|
const handleReset = () => {
|
||||||
|
setRowDataMap(new Map());
|
||||||
|
setActiveTab(firstTabKey);
|
||||||
|
lastSearchedValuesRef.current = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 개별 조건별 데이터 동적 라우팅 디스패치 */
|
||||||
|
const loadGridData = async (tabKey: string, values: SearchFormValues): Promise<boolean> => {
|
||||||
|
const param: SewerageFinanceSummaryRequest = {
|
||||||
|
ctpvNm: values.sido === "ALL" ? "" : values.sido,
|
||||||
|
sggNm: values.gugun === "ALL" ? "" : values.gugun,
|
||||||
|
sewerBzmnCd: values.bsnmCd,
|
||||||
|
statsYr: values.year,
|
||||||
|
rowDataYn: values.isDetail,
|
||||||
|
summaryYn: values.isSummary !== 'ALL',
|
||||||
|
summaryYearCnt: values.isSummary !== 'ALL' ? Number(values.isSummary) : undefined
|
||||||
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
|
// [Tab1] 하수도재정 결산
|
||||||
|
if (tabKey === "ST00090001") {
|
||||||
|
const response = await statisticsTotalStatusApi.getSewerageFinancialList(param); // 엔드포인트 바인딩
|
||||||
|
if (response && response.status === "success" && response.data) {
|
||||||
|
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
alert(response?.message || "데이터 조회 중 오류가 발생했습니다.");
|
||||||
|
}
|
||||||
|
|
||||||
|
// [Tab2] 하수도 요금
|
||||||
|
if (tabKey === "ST00090002") {
|
||||||
|
const response = await statisticsTotalStatusApi.getSewerageFeeList(param);
|
||||||
|
if (response && response.status === "success" && response.data) {
|
||||||
|
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
alert(response?.message || "데이터 조회 중 오류가 발생했습니다.");
|
||||||
|
}
|
||||||
|
|
||||||
|
// [Tab3] 하수도 사용료
|
||||||
|
if (tabKey === "ST00090003") {
|
||||||
|
const response = await statisticsTotalStatusApi.getSewerageUsageList(param);
|
||||||
|
if (response && response.status === "success" && response.data) {
|
||||||
|
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
alert(response?.message || "데이터 조회 중 오류가 발생했습니다.");
|
||||||
|
}
|
||||||
|
|
||||||
|
// [Tab4] 원인자 부담금
|
||||||
|
if (tabKey === "ST00090004") {
|
||||||
|
const response = await statisticsTotalStatusApi.getSewerageOrgCauseList(param);
|
||||||
|
if (response && response.status === "success" && response.data) {
|
||||||
|
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
alert(response?.message || "데이터 조회 중 오류가 발생했습니다.");
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
} catch {
|
||||||
|
alert("서버 연결 중 오류가 발생했습니다.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSearch = async (values: SearchFormValues) => {
|
||||||
|
try {
|
||||||
|
setIsLoading(true);
|
||||||
|
const ok = await loadGridData(activeTab, values);
|
||||||
|
if (ok) {
|
||||||
|
lastSearchedValuesRef.current = values;
|
||||||
|
} else {
|
||||||
|
lastSearchedValuesRef.current = null;
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
alert("데이터 조회 중 오류가 발생했습니다.");
|
||||||
|
lastSearchedValuesRef.current = null;
|
||||||
|
} finally {
|
||||||
|
setIsLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleActiveTabChange = async (tabKey: string) => {
|
||||||
|
setActiveTab(tabKey);
|
||||||
|
const values = lastSearchedValuesRef.current;
|
||||||
|
if (!values) return;
|
||||||
|
|
||||||
|
const existing = rowDataMap.get(tabKey);
|
||||||
|
if (existing && existing.length > 0) return;
|
||||||
|
|
||||||
|
try {
|
||||||
|
setIsLoading(true);
|
||||||
|
await loadGridData(tabKey, values);
|
||||||
|
} catch {
|
||||||
|
alert("데이터 조회 중 오류가 발생했습니다.");
|
||||||
|
} finally {
|
||||||
|
setIsLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<div className="relative">
|
||||||
<SearchForm />
|
<SearchForm isDetail={true} isSummary={true} onSubmit={handleSearch} onReset={handleReset} sidoSelectText="전체" />
|
||||||
</>
|
|
||||||
|
{isLoading && (
|
||||||
|
<div className="absolute inset-0 z-50 [data-theme='black']:bg-transparent rounded-lg p-10 flex justify-center items-center">
|
||||||
|
<div className="relative size-[5rem]">
|
||||||
|
<LoadingWithAnimation color="primary" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<CellColorInfo />
|
||||||
|
|
||||||
|
<div className="flex flex-col gap-[0.6rem] mx-[0.6rem]">
|
||||||
|
<Tabs value={activeTab} onValueChange={(v) => void handleActiveTabChange(v)} className="w-full" variant="default">
|
||||||
|
<TabsList>
|
||||||
|
{columnInfo.map((info) => (
|
||||||
|
<TabsTrigger key={info.tabKey} value={info.tabKey}>
|
||||||
|
{info.tabLabel}
|
||||||
|
</TabsTrigger>
|
||||||
|
))}
|
||||||
|
</TabsList>
|
||||||
|
|
||||||
|
{columnInfo.map((info) => {
|
||||||
|
const tabKey = info.tabKey;
|
||||||
|
|
||||||
|
// 요청하신 타입 단언 제거 형태 유지
|
||||||
|
const rowData = rowDataMap.get(tabKey) ?? [];
|
||||||
|
|
||||||
|
const gridColumnInfo: ColumnInfo = {
|
||||||
|
columns: info.columns,
|
||||||
|
columnLayout: info.columnLayout,
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<TabsContent key={tabKey} value={tabKey}>
|
||||||
|
<DataGrid
|
||||||
|
columnInfo={gridColumnInfo}
|
||||||
|
rowStartNum={info.rowStartNum}
|
||||||
|
excelExportFileSuffix={info.tabLabel}
|
||||||
|
rowData={rowData}
|
||||||
|
setRowData={(updater) => {
|
||||||
|
setRowDataMap((prev) => {
|
||||||
|
const next = new Map(prev);
|
||||||
|
const cur = next.get(tabKey) ?? [];
|
||||||
|
const n = typeof updater === "function" ? updater(cur) : updater;
|
||||||
|
next.set(tabKey, n);
|
||||||
|
return next;
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
isExcelImport={false}
|
||||||
|
isExcelExport={true}
|
||||||
|
showHeaderCheckbox={false}
|
||||||
|
fixedColumns={info.fixedColumns}
|
||||||
|
enableSort={false}
|
||||||
|
cellStyleCallback={({ row }) => {
|
||||||
|
const rowType = String(row.rowType ?? '');
|
||||||
|
if (rowType === 'DETAIL') return undefined;
|
||||||
|
if (rowType === 'BIZ_SUM') return 'rg-cell-rowtype-biz-sum';
|
||||||
|
if (rowType === 'SUMMARY') return 'rg-cell-rowtype-summary';
|
||||||
|
return 'rg-cell-rowtype-other';
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</TabsContent>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</Tabs>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,131 +1,99 @@
|
|||||||
import { useRef, useState } from "react";
|
import { useRef, useState } from "react";
|
||||||
|
|
||||||
import { useAlertStore } from "@/shared/lib";
|
import { useAlertStore } from "@/shared/lib";
|
||||||
import { statisticsTotalStatusApi } from "@/entities/statistics/api/statistics-total-service";
|
import { LoadingWithAnimation, Tabs, TabsContent, TabsList, TabsTrigger } from "@common/components";
|
||||||
import { toGridRows } from "@/components/util/grid/gridFunction";
|
|
||||||
|
|
||||||
import SearchForm from "@/components/module/SearchForm";
|
import SearchForm from "@/components/module/SearchForm";
|
||||||
import DataGrid from "@/components/module/DataGrid";
|
import DataGrid from "@/components/module/DataGrid";
|
||||||
import { LoadingWithAnimation, Tabs, TabsContent, TabsList, TabsTrigger } from "@common/components";
|
|
||||||
|
|
||||||
import type { ColumnInfo } from "@/components/type/DataGrid.type";
|
import type { ColumnInfo } from "@/components/type/DataGrid.type";
|
||||||
import type { SearchFormValues } from "@/components/type/SearchForm.type";
|
import type { SearchFormValues } from "@/components/type/SearchForm.type";
|
||||||
import { ComplaintInpColumn } from "@/components/util/column/total/sewerageServiceLevel/ComplaintTotColumn";
|
import { toGridRows } from "@/components/util/grid/gridFunction";
|
||||||
import { ResidentFriendlyFactTotColumn } from "@/components/util/column/total/sewerageServiceLevel/ResidentFriendlyFactTotColumn";
|
import CellColorInfo from "./CellColorInfo";
|
||||||
|
|
||||||
const SewerageServiceLevelInpTabList = [
|
// 13. 하수도서비스수준 컬럼 설정
|
||||||
ComplaintInpColumn,
|
import { SewageComplaintTab1ColumnConfig } from "@/components/util/column/total/sewerageServiceLevel/ComplaintTotColumn";
|
||||||
ResidentFriendlyFactTotColumn,
|
import { ResidentFriendlyFacilityTab2ColumnConfig } from "@/components/util/column/total/sewerageServiceLevel/ResidentFriendlyFactTotColumn";
|
||||||
];
|
|
||||||
const SUPPORTED_TAB_KEYS = [ComplaintInpColumn.tabKey, ResidentFriendlyFactTotColumn.tabKey] as const;
|
import { statisticsTotalStatusApi } from "@/entities/statistics/api/statistics-total-service";
|
||||||
|
import type {
|
||||||
|
SewerageServiceLevelRequest,
|
||||||
|
SewerageServiceLevelComplaintResponse,
|
||||||
|
SewerageServiceLevelResidentFriendlyFactResponse
|
||||||
|
} from "@/entities/statistics/model/statistics-total/statistics-service-level-total-interface";
|
||||||
|
|
||||||
|
const SewageServiceLevelColumnListTot = [
|
||||||
|
SewageComplaintTab1ColumnConfig,
|
||||||
|
ResidentFriendlyFacilityTab2ColumnConfig
|
||||||
|
].filter(Boolean);
|
||||||
|
|
||||||
|
const firstTabKey = SewageServiceLevelColumnListTot[0]?.tabKey ?? "ST00130001";
|
||||||
|
|
||||||
const SewerageServiceLevelTot = () => {
|
const SewerageServiceLevelTot = () => {
|
||||||
const { setMessage: alert } = useAlertStore((state) => state);
|
const { setMessage: alert } = useAlertStore((state) => state);
|
||||||
|
|
||||||
const [rowDataMap, setRowDataMap] = useState<Map<string, Record<string, string | number>[]>>(new Map());
|
const [rowDataMap, setRowDataMap] = useState<Map<string, Record<string, string | number>[]>>(new Map());
|
||||||
const [isLoading, setIsLoading] = useState<boolean>(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
const [activeTab, setActiveTab] = useState(ComplaintInpColumn.tabKey);
|
const [activeTab, setActiveTab] = useState(firstTabKey);
|
||||||
const lastSearchValuesRef = useRef<SearchFormValues | null>(null);
|
const lastSearchedValuesRef = useRef<SearchFormValues | null>(null);
|
||||||
|
|
||||||
const columnInfo = SewerageServiceLevelInpTabList;
|
|
||||||
|
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
setRowDataMap(new Map());
|
setRowDataMap(new Map());
|
||||||
setActiveTab(ComplaintInpColumn.tabKey);
|
setActiveTab(firstTabKey);
|
||||||
lastSearchValuesRef.current = null;
|
lastSearchedValuesRef.current = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
const loadSewerageServiceLevelTotTabData = async (
|
const loadGridData = async (tabKey: string, values: SearchFormValues): Promise<boolean> => {
|
||||||
tabKey: string,
|
setIsLoading(true);
|
||||||
values: SearchFormValues,
|
const param: SewerageServiceLevelRequest = {
|
||||||
mergeIntoExistingMap: boolean,
|
|
||||||
) => {
|
|
||||||
const param = {
|
|
||||||
ctpvNm: values.sido === "ALL" ? "" : values.sido,
|
ctpvNm: values.sido === "ALL" ? "" : values.sido,
|
||||||
sggNm: values.gugun === "ALL" ? "" : values.gugun,
|
sggNm: values.gugun === "ALL" ? "" : values.gugun,
|
||||||
sewerBzmnCd: values.bsnmCd,
|
sewerBzmnCd: values.bsnmCd,
|
||||||
statsYr: values.year,
|
statsYr: values.year,
|
||||||
rowDataYn: values.isDetail,
|
rowDataYn: values.isDetail,
|
||||||
|
summaryYn: values.isSummary !== 'ALL',
|
||||||
|
summaryYearCnt: values.isSummary !== 'ALL' ? Number(values.isSummary) : undefined
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetcherMap = {
|
|
||||||
[ComplaintInpColumn.tabKey]: statisticsTotalStatusApi.getSewerageServiceLevelComplaint.bind(
|
|
||||||
statisticsTotalStatusApi,
|
|
||||||
),
|
|
||||||
[ResidentFriendlyFactTotColumn.tabKey]:
|
|
||||||
statisticsTotalStatusApi.getSewerageServiceLevelResidentFriendlyFact.bind(
|
|
||||||
statisticsTotalStatusApi,
|
|
||||||
),
|
|
||||||
};
|
|
||||||
const fetcher = fetcherMap[tabKey];
|
|
||||||
if (!fetcher) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
const response = await fetcher(param);
|
|
||||||
|
|
||||||
if (response.status === "success" && response.data) {
|
|
||||||
const rows = toGridRows(response.data as object[]);
|
|
||||||
if (mergeIntoExistingMap) {
|
|
||||||
setRowDataMap((prev) => {
|
|
||||||
const next = new Map(prev);
|
|
||||||
next.set(tabKey, rows);
|
|
||||||
return next;
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
const next = new Map<string, Record<string, string | number>[]>();
|
|
||||||
next.set(tabKey, rows);
|
|
||||||
setRowDataMap(next);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
alert(response.message || "데이터 조회 중 오류가 발생했습니다.");
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleSearch = async (values: SearchFormValues) => {
|
|
||||||
try {
|
try {
|
||||||
setIsLoading(true);
|
// [TAB1] 민원
|
||||||
let ok = false;
|
if (tabKey === "ST00130001") {
|
||||||
if (SUPPORTED_TAB_KEYS.includes(activeTab)) {
|
const response: SewerageServiceLevelComplaintResponse = await statisticsTotalStatusApi.getSewerageServiceLevelComplaint(param);
|
||||||
ok = await loadSewerageServiceLevelTotTabData(activeTab, values, true);
|
if (response?.status === "success") {
|
||||||
}
|
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
|
||||||
if (ok) {
|
return true;
|
||||||
lastSearchValuesRef.current = values;
|
}
|
||||||
} else {
|
}
|
||||||
lastSearchValuesRef.current = null;
|
// [TAB2] 주민친화시설
|
||||||
|
else if (tabKey === "ST00130002") {
|
||||||
|
const response: SewerageServiceLevelResidentFriendlyFactResponse = await statisticsTotalStatusApi.getSewerageServiceLevelResidentFriendlyFact(param);
|
||||||
|
if (response?.status === "success") {
|
||||||
|
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
} catch {
|
} catch {
|
||||||
alert("데이터 조회 중 오류가 발생했습니다.");
|
alert("서버 연결 중 오류가 발생했습니다.");
|
||||||
lastSearchValuesRef.current = null;
|
return false;
|
||||||
} finally {
|
} finally {
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleSearch = async (values: SearchFormValues) => {
|
||||||
|
lastSearchedValuesRef.current = values;
|
||||||
|
await loadGridData(activeTab, values);
|
||||||
|
};
|
||||||
|
|
||||||
const handleActiveTabChange = async (tabKey: string) => {
|
const handleActiveTabChange = async (tabKey: string) => {
|
||||||
setActiveTab(tabKey);
|
setActiveTab(tabKey);
|
||||||
|
const values = lastSearchedValuesRef.current;
|
||||||
const values = lastSearchValuesRef.current;
|
if (!values || rowDataMap.has(tabKey)) return;
|
||||||
if (!values) return;
|
await loadGridData(tabKey, values);
|
||||||
|
|
||||||
const existing = rowDataMap.get(tabKey);
|
|
||||||
const hasData = Array.isArray(existing) && existing.length > 0;
|
|
||||||
if (hasData) return;
|
|
||||||
|
|
||||||
if (SUPPORTED_TAB_KEYS.includes(tabKey)) {
|
|
||||||
try {
|
|
||||||
setIsLoading(true);
|
|
||||||
await loadSewerageServiceLevelTotTabData(tabKey, values, true);
|
|
||||||
} catch {
|
|
||||||
alert("데이터 조회 중 오류가 발생했습니다.");
|
|
||||||
} finally {
|
|
||||||
setIsLoading(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="relative">
|
<div className="relative">
|
||||||
<SearchForm isDetail={true} onSubmit={handleSearch} onReset={handleReset} sidoSelectText="전체" />
|
<SearchForm isDetail={true} isSummary={true} onSubmit={handleSearch} onReset={handleReset} sidoSelectText="전체" />
|
||||||
|
|
||||||
{isLoading && (
|
{isLoading && (
|
||||||
<div className="absolute inset-0 z-50 [data-theme='black']:bg-transparent rounded-lg p-10 flex justify-center items-center">
|
<div className="absolute inset-0 z-50 [data-theme='black']:bg-transparent rounded-lg p-10 flex justify-center items-center">
|
||||||
<div className="relative size-[5rem]">
|
<div className="relative size-[5rem]">
|
||||||
@@ -133,58 +101,48 @@ const SewerageServiceLevelTot = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
<CellColorInfo />
|
||||||
|
|
||||||
<div className="flex flex-col gap-[0.6rem] mx-[0.6rem]">
|
<div className="flex flex-col gap-[0.6rem] mx-[0.6rem]">
|
||||||
<Tabs value={activeTab} onValueChange={(v) => void handleActiveTabChange(v)} className="w-full" variant="default">
|
<Tabs value={activeTab} onValueChange={(v) => void handleActiveTabChange(v)} className="w-full" variant="default">
|
||||||
<TabsList>
|
<TabsList>
|
||||||
{columnInfo.map((info) => (
|
{SewageServiceLevelColumnListTot.map((info) => (
|
||||||
<TabsTrigger key={info.tabKey} value={info.tabKey}>
|
<TabsTrigger key={info.tabKey} value={info.tabKey}>{info.tabLabel}</TabsTrigger>
|
||||||
{info.tabLabel || info.tabKey}
|
|
||||||
</TabsTrigger>
|
|
||||||
))}
|
))}
|
||||||
</TabsList>
|
</TabsList>
|
||||||
{columnInfo.map((info) => {
|
|
||||||
const tabKey = info.tabKey;
|
{SewageServiceLevelColumnListTot.map((info) => (
|
||||||
if (!info.columns || !info.columnLayout) {
|
<TabsContent key={info.tabKey} value={info.tabKey}>
|
||||||
return null;
|
<DataGrid
|
||||||
}
|
columnInfo={{ columns: info.columns, columnLayout: info.columnLayout }}
|
||||||
|
rowStartNum={info.rowStartNum}
|
||||||
const rowData = rowDataMap.get(tabKey) ?? [];
|
rowData={rowDataMap.get(info.tabKey) ?? []}
|
||||||
const gridColumnInfo: ColumnInfo = {
|
excelExportFileSuffix={info.tabLabel}
|
||||||
columns: info.columns,
|
setRowData={(updater) => {
|
||||||
columnLayout: info.columnLayout,
|
setRowDataMap((prev) => {
|
||||||
};
|
const next = new Map(prev);
|
||||||
|
const cur = next.get(info.tabKey) ?? [];
|
||||||
return (
|
const n = typeof updater === "function" ? updater(cur) : updater;
|
||||||
<TabsContent key={tabKey} value={tabKey}>
|
next.set(info.tabKey, n);
|
||||||
<DataGrid
|
return next;
|
||||||
columnInfo={gridColumnInfo}
|
});
|
||||||
rowStartNum={info.rowStartNum}
|
}}
|
||||||
excelExportFileSuffix={info.tabLabel || tabKey}
|
isExcelImport={false}
|
||||||
rowData={rowData}
|
isExcelExport={true}
|
||||||
setRowData={(updater) => {
|
showHeaderCheckbox={false}
|
||||||
setRowDataMap((prev) => {
|
fixedColumns={info.fixedColumns}
|
||||||
const next = new Map(prev);
|
enableSort={false}
|
||||||
const cur = next.get(tabKey) ?? [];
|
cellStyleCallback={({ row }) => {
|
||||||
const n = typeof updater === "function" ? updater(cur) : updater;
|
const rowType = String(row.rowType ?? '');
|
||||||
next.set(tabKey, n);
|
if (rowType === 'DETAIL') return undefined;
|
||||||
return next;
|
if (rowType === 'BIZ_SUM') return 'rg-cell-rowtype-biz-sum';
|
||||||
});
|
if (rowType === 'SUMMARY') return 'rg-cell-rowtype-summary';
|
||||||
}}
|
return 'rg-cell-rowtype-other';
|
||||||
isExcelImport={false}
|
}}
|
||||||
isExcelExport
|
/>
|
||||||
showHeaderCheckbox={false}
|
</TabsContent>
|
||||||
fixedColumns={info.fixedColumns}
|
))}
|
||||||
enableSort={false}
|
|
||||||
cellStyleCallback={({ row }) => {
|
|
||||||
const rowType = String(row.rowType ?? "");
|
|
||||||
if (rowType === "DETAIL") return undefined;
|
|
||||||
if (rowType === "BIZ_SUM") return "rg-cell-rowtype-biz-sum";
|
|
||||||
return "rg-cell-rowtype-other";
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</TabsContent>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,10 +1,229 @@
|
|||||||
|
import { useRef, useState } from "react";
|
||||||
|
|
||||||
|
import { useAlertStore } from "@/shared/lib";
|
||||||
|
import { LoadingWithAnimation, Tabs, TabsContent, TabsList, TabsTrigger } from "@common/components";
|
||||||
|
|
||||||
import SearchForm from "../../module/SearchForm";
|
import SearchForm from "../../module/SearchForm";
|
||||||
|
import DataGrid from "@/components/module/DataGrid";
|
||||||
|
import type { ColumnInfo } from "@/components/type/DataGrid.type";
|
||||||
|
import type { SearchFormValues } from "@/components/type/SearchForm.type";
|
||||||
|
import { toGridRows } from "@/components/util/grid/gridFunction";
|
||||||
|
|
||||||
|
// [폴더 정밀 정비 완료] 프로젝트 트리 구조 5개 컬럼 스펙 패키지 호출
|
||||||
|
import { SewerageReuseTab1ColumnConfig } from "@/components/util/column/total/sewerageReuse/SewerageReuseTab1Column";
|
||||||
|
import { SewerageGrayWaterTab2ColumnConfig } from "@/components/util/column/total/sewerageReuse/SewerageGrayWaterTab2Column";
|
||||||
|
import { SewerageRainwaterTab3ColumnConfig } from "@/components/util/column/total/sewerageReuse/SewerageRainwaterTab3Column";
|
||||||
|
import { SewerageWwtRtlztnRegTab4ColumnConfig } from "@/components/util/column/total/sewerageReuse/SewerageWwtRtlztnRegTab4Column";
|
||||||
|
import { SewerageWwtRtlztnSncnTab5ColumnConfig } from "@/components/util/column/total/sewerageReuse/SewerageWwtRtlztnSncnTab5Column";
|
||||||
|
|
||||||
|
// 집계표(TOTAL) API 서비스 및 인터페이스 명세 임포트
|
||||||
|
import { statisticsTotalStatusApi } from "@/entities/statistics/api/statistics-total-service";
|
||||||
|
import type {
|
||||||
|
WaterReuseSummaryRequest
|
||||||
|
} from "@/entities/statistics/model/statistics-total/statistics-sewerage-reuse-total-interface";
|
||||||
|
import CellColorInfo from "./CellColorInfo";
|
||||||
|
|
||||||
|
// 5개 멀티 탭 매핑을 위한 설정 취합 배열
|
||||||
|
const WaterReuseColumnListTot = [
|
||||||
|
SewerageReuseTab1ColumnConfig,
|
||||||
|
SewerageGrayWaterTab2ColumnConfig,
|
||||||
|
SewerageRainwaterTab3ColumnConfig,
|
||||||
|
SewerageWwtRtlztnRegTab4ColumnConfig,
|
||||||
|
SewerageWwtRtlztnSncnTab5ColumnConfig // 👈 5번째 탭 풀장착 완료
|
||||||
|
];
|
||||||
|
|
||||||
|
const firstTabKey = WaterReuseColumnListTot[0]?.tabKey ?? "ST00040007_1";
|
||||||
|
|
||||||
const WaterReuseTot = () => {
|
const WaterReuseTot = () => {
|
||||||
|
const { setMessage: alert } = useAlertStore((state) => state);
|
||||||
|
|
||||||
|
// Map 데이터 구조를 사용하여 완벽하게 안전한 멀티 탭 데이터 상태 유지
|
||||||
|
const [rowDataMap, setRowDataMap] = useState<Map<string, Record<string, string | number>[]>>(new Map());
|
||||||
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
const [activeTab, setActiveTab] = useState(firstTabKey);
|
||||||
|
const lastSearchedValuesRef = useRef<SearchFormValues | null>(null);
|
||||||
|
|
||||||
|
const columnInfo = WaterReuseColumnListTot;
|
||||||
|
|
||||||
|
const handleReset = () => {
|
||||||
|
setRowDataMap(new Map());
|
||||||
|
setActiveTab(firstTabKey);
|
||||||
|
lastSearchedValuesRef.current = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
const loadGridData = async (tabKey: string, values: SearchFormValues): Promise<boolean> => {
|
||||||
|
const param: WaterReuseSummaryRequest = {
|
||||||
|
ctpvNm: values.sido === "ALL" ? "" : values.sido,
|
||||||
|
sggNm: values.gugun === "ALL" ? "" : values.gugun,
|
||||||
|
sewerBzmnCd: values.bsnmCd,
|
||||||
|
statsYr: values.year,
|
||||||
|
rowDataYn: values.isDetail,
|
||||||
|
summaryYn: values.isSummary !== 'ALL',
|
||||||
|
summaryYearCnt: values.isSummary !== 'ALL' ? Number(values.isSummary) : undefined
|
||||||
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
|
// [TAB1] 공공하수처리수 재이용 현황 조회
|
||||||
|
if (tabKey === "ST00100001") {
|
||||||
|
const response = await statisticsTotalStatusApi.getSewerageReuseTab1List(param);
|
||||||
|
if (response && response.status === "success" && response.data) {
|
||||||
|
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
alert(response?.message || "데이터 조회 중 오류가 발생했습니다.");
|
||||||
|
}
|
||||||
|
|
||||||
|
// [TAB2] 중수도 현황 조회
|
||||||
|
if (tabKey === "ST00100002") {
|
||||||
|
const response = await statisticsTotalStatusApi.getGrayWaterStatusTab2List(param);
|
||||||
|
if (response && response.status === "success" && response.data) {
|
||||||
|
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
alert(response?.message || "데이터 조회 중 오류가 발생했습니다.");
|
||||||
|
}
|
||||||
|
|
||||||
|
// [TAB3] 빗물이용시설현황 조회
|
||||||
|
if (tabKey === "ST00100003") {
|
||||||
|
const response = await statisticsTotalStatusApi.getRainwaterStatusTab3List(param);
|
||||||
|
if (response && response.status === "success" && response.data) {
|
||||||
|
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
alert(response?.message || "데이터 조회 중 오류가 발생했습니다.");
|
||||||
|
}
|
||||||
|
|
||||||
|
// [TAB4] 하·폐수처리수 재이용시설 시공업 등록현황 조회
|
||||||
|
if (tabKey === "ST00100004") {
|
||||||
|
const response = await statisticsTotalStatusApi.getWwtRtlztnRegStatusTab4List(param);
|
||||||
|
if (response && response.status === "success" && response.data) {
|
||||||
|
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
alert(response?.message || "데이터 조회 중 오류가 발생했습니다.");
|
||||||
|
}
|
||||||
|
|
||||||
|
// [TAB5] 하·폐수처리수 재이용시설 시공업 인가현황 조회
|
||||||
|
if (tabKey === "ST00100005") {
|
||||||
|
const response = await statisticsTotalStatusApi.getWwtRtlztnSncnStatusTab5List(param);
|
||||||
|
if (response && response.status === "success" && response.data) {
|
||||||
|
setRowDataMap((prev) => new Map(prev).set(tabKey, toGridRows(response.data as object[])));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
alert(response?.message || "데이터 조회 중 오류가 발생했습니다.");
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
} catch {
|
||||||
|
alert("서버 연결 중 오류가 발생했습니다.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSearch = async (values: SearchFormValues) => {
|
||||||
|
try {
|
||||||
|
setIsLoading(true);
|
||||||
|
const ok = await loadGridData(activeTab, values);
|
||||||
|
if (ok) {
|
||||||
|
lastSearchedValuesRef.current = values;
|
||||||
|
} else {
|
||||||
|
lastSearchedValuesRef.current = null;
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
alert("데이터 조회 중 오류가 발생했습니다.");
|
||||||
|
lastSearchedValuesRef.current = null;
|
||||||
|
} finally {
|
||||||
|
setIsLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleActiveTabChange = async (tabKey: string) => {
|
||||||
|
setActiveTab(tabKey);
|
||||||
|
const values = lastSearchedValuesRef.current;
|
||||||
|
if (!values) return;
|
||||||
|
|
||||||
|
// 중복 API 통신 방지 필터 캐싱 디스패치
|
||||||
|
const existing = rowDataMap.get(tabKey);
|
||||||
|
if (existing && existing.length > 0) return;
|
||||||
|
|
||||||
|
try {
|
||||||
|
setIsLoading(true);
|
||||||
|
await loadGridData(tabKey, values);
|
||||||
|
} catch {
|
||||||
|
alert("데이터 조회 중 오류가 발생했습니다.");
|
||||||
|
} finally {
|
||||||
|
setIsLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<div className="relative">
|
||||||
<SearchForm />
|
<SearchForm isDetail={true} isSummary={true} onSubmit={handleSearch} onReset={handleReset} sidoSelectText="전체" />
|
||||||
</>
|
|
||||||
|
{/* 정중앙 5rem 크기 고정 격리형 로딩 애니메이션 */}
|
||||||
|
{isLoading && (
|
||||||
|
<div className="absolute inset-0 z-50 [data-theme='black']:bg-transparent rounded-lg p-10 flex justify-center items-center">
|
||||||
|
<div className="relative size-[5rem]">
|
||||||
|
<LoadingWithAnimation color="primary" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<CellColorInfo />
|
||||||
|
|
||||||
|
<div className="flex flex-col gap-[0.6rem] mx-[0.6rem]">
|
||||||
|
<Tabs value={activeTab} onValueChange={(v) => void handleActiveTabChange(v)} className="w-full" variant="default">
|
||||||
|
<TabsList>
|
||||||
|
{columnInfo.map((info) => (
|
||||||
|
<TabsTrigger key={info.tabKey} value={info.tabKey}>
|
||||||
|
{info.tabLabel}
|
||||||
|
</TabsTrigger>
|
||||||
|
))}
|
||||||
|
</TabsList>
|
||||||
|
|
||||||
|
{columnInfo.map((info) => {
|
||||||
|
const tabKey = info.tabKey;
|
||||||
|
const rowData = rowDataMap.get(tabKey) ?? [];
|
||||||
|
|
||||||
|
const gridColumnInfo: ColumnInfo = {
|
||||||
|
columns: info.columns,
|
||||||
|
columnLayout: info.columnLayout,
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<TabsContent key={tabKey} value={tabKey}>
|
||||||
|
<DataGrid
|
||||||
|
columnInfo={gridColumnInfo}
|
||||||
|
rowStartNum={info.rowStartNum}
|
||||||
|
excelExportFileSuffix={info.tabLabel}
|
||||||
|
rowData={rowData}
|
||||||
|
setRowData={(updater) => {
|
||||||
|
setRowDataMap((prev) => {
|
||||||
|
const next = new Map(prev);
|
||||||
|
const cur = next.get(tabKey) ?? [];
|
||||||
|
const n = typeof updater === "function" ? updater(cur) : updater;
|
||||||
|
next.set(tabKey, n);
|
||||||
|
return next;
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
isExcelImport={false}
|
||||||
|
isExcelExport={true}
|
||||||
|
showHeaderCheckbox={false}
|
||||||
|
fixedColumns={info.fixedColumns}
|
||||||
|
enableSort={false}
|
||||||
|
cellStyleCallback={({ row }) => {
|
||||||
|
const rowType = String(row.rowType ?? '');
|
||||||
|
if (rowType === 'DETAIL') return undefined;
|
||||||
|
if (rowType === 'BIZ_SUM') return 'rg-cell-rowtype-biz-sum';
|
||||||
|
if (rowType === 'SUMMARY') return 'rg-cell-rowtype-summary';
|
||||||
|
return 'rg-cell-rowtype-other';
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</TabsContent>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</Tabs>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -116,12 +116,22 @@ export type DataFieldValueCallback = (
|
|||||||
|
|
||||||
/** 계산 필드 설정 (computedFieldCallbacks.ts 참고) */
|
/** 계산 필드 설정 (computedFieldCallbacks.ts 참고) */
|
||||||
export type ComputedFieldConfig =
|
export type ComputedFieldConfig =
|
||||||
| { fields: string[]; type: "sum" | "avg" | "max" | "difference" }
|
| { fields: string[]; type: "sum" | "avg" | "max" | "difference" | "quotient" }
|
||||||
| {
|
| {
|
||||||
minuendFields: string[];
|
minuendFields: string[];
|
||||||
subtrahendFields: string[];
|
subtrahendFields: string[];
|
||||||
type: "differenceOfSums";
|
type: "differenceOfSums";
|
||||||
}
|
}
|
||||||
|
| {
|
||||||
|
firstSumFields: string[];
|
||||||
|
secondSumFields: string[];
|
||||||
|
type: "halfSumOfSums";
|
||||||
|
}
|
||||||
|
| {
|
||||||
|
firstHalfSum: { firstSumFields: string[]; secondSumFields: string[] };
|
||||||
|
secondHalfSum: { firstSumFields: string[]; secondSumFields: string[] };
|
||||||
|
type: "sumOfTwoHalfSumOfSums";
|
||||||
|
}
|
||||||
| {
|
| {
|
||||||
baseField: string;
|
baseField: string;
|
||||||
sumFields: string[];
|
sumFields: string[];
|
||||||
@@ -149,6 +159,25 @@ export type ComputedFieldConfig =
|
|||||||
denominatorFields: string[];
|
denominatorFields: string[];
|
||||||
thirdFields: string[];
|
thirdFields: string[];
|
||||||
type: "swrgInstlrtRate";
|
type: "swrgInstlrtRate";
|
||||||
|
}
|
||||||
|
| {
|
||||||
|
pumpGroups: Array<{
|
||||||
|
pumpCntField: string;
|
||||||
|
rsrvPumpCntField: string;
|
||||||
|
perPpqtyField: string;
|
||||||
|
}>;
|
||||||
|
type: "pumpGrossPpqty";
|
||||||
|
}
|
||||||
|
| {
|
||||||
|
inflwField: string;
|
||||||
|
dschgField: string;
|
||||||
|
type: "bodPrcsRt";
|
||||||
|
}
|
||||||
|
| {
|
||||||
|
/** (quotient[0]/quotient[1]) / (denominatorQuotient[0]/denominatorQuotient[1]) × 100 */
|
||||||
|
numeratorQuotient: [string, string];
|
||||||
|
denominatorQuotient: [string, string];
|
||||||
|
type: "quotientRatioPercent";
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ColumnConfig = {
|
export type ColumnConfig = {
|
||||||
|
|||||||
@@ -8,58 +8,83 @@ import { ValueType } from "realgrid";
|
|||||||
export const ExcretaTreatFactInpColumn = {
|
export const ExcretaTreatFactInpColumn = {
|
||||||
columns: [
|
columns: [
|
||||||
// 행정구역
|
// 행정구역
|
||||||
{ name: 'sido', fieldName: '시도', header: { text: '시도' }, editable: false },
|
{ name: 'ctpvNm', fieldName: 'ctpvNm', header: { text: '시도' }, footer: { text: '합계' }, editable: false },
|
||||||
{ name: 'gugun', fieldName: '시군구', header: { text: '시군구' }, footer: { text: '합계' } },
|
{ name: 'sggNm', fieldName: 'sggNm', header: { text: '시군구' } },
|
||||||
|
|
||||||
// 기본 정보
|
// 기본 정보
|
||||||
{ name: 'ecscs_nm', fieldName: '시설명', header: { text: '시설명' } },
|
{ name: 'fcltNm', fieldName: 'fcltNm', header: { text: '시설명' } },
|
||||||
{ name: 'locplcs', fieldName: '소재지', header: { text: '소재지' } },
|
{ name: 'fcltPstnCn', fieldName: 'fcltPstnCn', header: { text: '소재지' } },
|
||||||
{ name: 'telno', fieldName: '전화번호', header: { text: '전화번호' } },
|
{ name: 'telNo', fieldName: 'telNo', header: { text: '전화번호' } },
|
||||||
|
|
||||||
// 날짜 정보
|
// 날짜 정보
|
||||||
{ name: 'comp_dt', fieldName: '준공일 yyyy-mm-dd', header: { text: '준공일 yyyy-mm-dd' } },
|
{
|
||||||
{ name: 'rn_dt', fieldName: '가동개시일 yyyy-mm-dd', header: { text: '가동개시일 yyyy-mm-dd' } },
|
name: 'cmptnStrtYmd',
|
||||||
|
fieldName: 'cmptnStrtYmd',
|
||||||
|
header: { text: '준공일 yyyy-mm-dd' },
|
||||||
|
datetimeFormat: 'yyyy-MM-dd',
|
||||||
|
editor: {
|
||||||
|
type: 'date' as const,
|
||||||
|
dropDownWhenClick: true,
|
||||||
|
datetimeFormat: 'yyyy-MM-dd',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'oprtngStrtYmd',
|
||||||
|
fieldName: 'oprtngStrtYmd',
|
||||||
|
header: { text: '가동개시일 yyyy-mm-dd' },
|
||||||
|
datetimeFormat: 'yyyy-MM-dd',
|
||||||
|
editor: {
|
||||||
|
type: 'date' as const,
|
||||||
|
dropDownWhenClick: true,
|
||||||
|
datetimeFormat: 'yyyy-MM-dd',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
// 사업비/용량 정보
|
// 사업비/용량 정보
|
||||||
{ name: 'wct', fieldName: '사업비(백만원)', header: { text: '사업비(백만원)' }, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
|
{ name: 'wholPjtcoAmt', fieldName: 'wholPjtcoAmt', header: { text: '사업비(백만원)' }, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
|
||||||
{ name: 'ecscs_cpcty', fieldName: '시설용량(m³/일)', header: { text: '시설용량(m³/일)' }, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
|
{ name: 'prcsFcltCpct', fieldName: 'prcsFcltCpct', header: { text: '시설용량(m³/일)' }, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
|
||||||
{ name: 'process_cpcty', fieldName: '처리량(m³/일)', header: { text: '처리량(m³/일)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
|
{ name: 'cpct', fieldName: 'cpct', header: { text: '처리량(m³/일)' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
|
||||||
{ name: 'opr_daycnt', fieldName: '가동일수(일/년)', header: { text: '가동일수(일/년)' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
|
{ name: 'oprtngDayCnt', fieldName: 'oprtngDayCnt', header: { text: '가동일수(일/년)' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
|
||||||
|
|
||||||
// 처리 공법 및 연계
|
// 처리 공법 및 연계
|
||||||
{ name: 'trt_msrc', fieldName: '처리공법', header: { text: '처리공법' } },
|
{ name: 'prcsMthdExpln', fieldName: 'prcsMthdExpln', header: { text: '처리공법' } },
|
||||||
{ name: 'cntc_prcplt', fieldName: '연계처리장명', header: { text: '연계처리장명' } },
|
{ name: 'linkTmplntCn', fieldName: 'linkTmplntCn', header: { text: '연계처리장명' } },
|
||||||
{ name: 'assct_trt_cpc', fieldName: '연계처리량(m³/일)', header: { text: '연계처리량(m³/일)' }, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
|
{ name: 'linkPrcsQnt', fieldName: 'linkPrcsQnt', header: { text: '연계처리량(m³/일)' }, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
|
||||||
|
|
||||||
// 유입수질
|
// 유입수질
|
||||||
{ name: 'infl_wqlt_bod', fieldName: 'BOD', header: { text: 'BOD' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
|
{ name: 'inflwBodWqVl', fieldName: 'inflwBodWqVl', header: { text: 'BOD' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
|
||||||
{ name: 'infl_wqlt_toc', fieldName: 'TOC', header: { text: 'TOC' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
|
{ name: 'inflwTocWqVl', fieldName: 'inflwTocWqVl', header: { text: 'TOC' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
|
||||||
{ name: 'infl_wqlt_ss', fieldName: 'SS', header: { text: 'SS' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
|
{ name: 'inflwSsWqVl', fieldName: 'inflwSsWqVl', header: { text: 'SS' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
|
||||||
{ name: 'infl_wqlt_tn', fieldName: 'T-N', header: { text: 'T-N' }, footer: footerDecimal3, valueType: ValueType.NUMBER, dataFormat: '#,##0.000' },
|
{ name: 'inflwTnWqVl', fieldName: 'inflwTnWqVl', header: { text: 'T-N' }, footer: footerDecimal3, valueType: ValueType.NUMBER, dataFormat: '#,##0.000' },
|
||||||
{ name: 'infl_wqlt_tp', fieldName: 'T-P', header: { text: 'T-P' }, footer: footerDecimal3, valueType: ValueType.NUMBER, dataFormat: '#,##0.000' },
|
{ name: 'inflwTpWqVl', fieldName: 'inflwTpWqVl', header: { text: 'T-P' }, footer: footerDecimal3, valueType: ValueType.NUMBER, dataFormat: '#,##0.000' },
|
||||||
{ name: 'infl_wqlt_clfgrpcnt', fieldName: '대장균군수', header: { text: '대장균군수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
|
{ name: 'inflwClfgCnt', fieldName: 'inflwClfgCnt', header: { text: '대장균군수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
|
||||||
|
|
||||||
// 방류수질
|
// 방류수질
|
||||||
{ name: 'effl_wqlt_bod', fieldName: 'BOD', header: { text: 'BOD' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
|
{ name: 'dschgBodWqVl', fieldName: 'dschgBodWqVl', header: { text: 'BOD' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
|
||||||
{ name: 'effl_wqlt_toc', fieldName: 'TOC', header: { text: 'TOC' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
|
{ name: 'dschgTocWqVl', fieldName: 'dschgTocWqVl', header: { text: 'TOC' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
|
||||||
{ name: 'effl_wqlt_ss', fieldName: 'SS', header: { text: 'SS' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
|
{ name: 'dschgSsWqVl', fieldName: 'dschgSsWqVl', header: { text: 'SS' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
|
||||||
{ name: 'effl_wqlt_tn', fieldName: 'T-N', header: { text: 'T-N' }, footer: footerDecimal3, valueType: ValueType.NUMBER, dataFormat: '#,##0.000' },
|
{ name: 'dschgTnWqVl', fieldName: 'dschgTnWqVl', header: { text: 'T-N' }, footer: footerDecimal3, valueType: ValueType.NUMBER, dataFormat: '#,##0.000' },
|
||||||
{ name: 'effl_wqlt_tp', fieldName: 'T-P', header: { text: 'T-P' }, footer: footerDecimal3, valueType: ValueType.NUMBER, dataFormat: '#,##0.000' },
|
{ name: 'dschgTpWqVl', fieldName: 'dschgTpWqVl', header: { text: 'T-P' }, footer: footerDecimal3, valueType: ValueType.NUMBER, dataFormat: '#,##0.000' },
|
||||||
{ name: 'effl_wqlt_clfgrpcnt', fieldName: '대장균군수', header: { text: '대장균군수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
|
{ name: 'dschgClfgCnt', fieldName: 'dschgClfgCnt', header: { text: '대장균군수' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
|
||||||
|
|
||||||
// 방류수역
|
// 방류수역
|
||||||
{ name: 'rvbsn', fieldName: '수계', header: { text: '수계' } },
|
{ name: 'wtsysNm', fieldName: 'wtsysNm', header: { text: '수계' } },
|
||||||
{ name: 'bstrm', fieldName: '지류', header: { text: '지류' } },
|
{ name: 'trbtrNm', fieldName: 'trbtrNm', header: { text: '지류' } },
|
||||||
{ name: 'lgbsn', fieldName: '중권역', header: { text: '중권역' } },
|
{ name: 'msirbCn', fieldName: 'msirbCn', header: { text: '중권역' } },
|
||||||
{ name: 'mdmbsn', fieldName: '소권역', header: { text: '소권역' } },
|
{ name: 'ssirbCn', fieldName: 'ssirbCn', header: { text: '소권역' } },
|
||||||
|
|
||||||
// 운영 정보
|
// 운영 정보
|
||||||
{ name: 'oper_mth', fieldName: '운영주체(자체/공기업/민간위탁)', header: { text: '운영주체(자체/공기업/민간위탁)' } },
|
{ name: 'operMthdCdCn', fieldName: 'operMthdCdCn', header: { text: '운영주체(자체/공기업/민간위탁)' } },
|
||||||
{ name: 'cntc_prcplt_cpc', fieldName: '직원총수(명)', header: { text: '직원총수(명)' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
|
{ name: 'wholNope', fieldName: 'wholNope', header: { text: '직원총수(명)' }, footer: footerInt, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
|
||||||
{ name: 'safe_acdnt_co', fieldName: '안전사고건수(건/인/년)', header: { text: '안전사고건수(건/인/년)' }, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
|
{ name: 'sftyAcdntEvntcsCnt', fieldName: 'sftyAcdntEvntcsCnt', header: { text: '안전사고건수(건/인/년)' }, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
|
||||||
|
|
||||||
// 비고
|
// 비고
|
||||||
{ name: 'rmk', fieldName: '비고', header: { text: '비고' } },
|
{ name: 'rmrk', fieldName: 'rmrk', header: { text: '비고' } },
|
||||||
|
|
||||||
|
// Hidden Columns : 시스템 관리를 위한 값
|
||||||
|
{ name: 'admdstCd', fieldName: 'admdstCd', header: { text: '행정구역코드' }, visible: false, },
|
||||||
|
{ name: 'fcltSn', fieldName: 'fcltSn', header: { text: '시설일련번호' }, visible: false, },
|
||||||
|
{ name: 'admdstNm', fieldName: 'admdstNm', header: { text: '행정구역명' }, visible: false },
|
||||||
],
|
],
|
||||||
|
|
||||||
columnLayout: [
|
columnLayout: [
|
||||||
@@ -67,41 +92,51 @@ export const ExcretaTreatFactInpColumn = {
|
|||||||
name: 'adminGroup',
|
name: 'adminGroup',
|
||||||
hideChildHeaders: false,
|
hideChildHeaders: false,
|
||||||
header: { text: '행정구역' },
|
header: { text: '행정구역' },
|
||||||
items: ['sido', 'gugun'],
|
items: [
|
||||||
|
{ column: 'ctpvNm', footerUserSpans: [{ colspan: 2 }] },
|
||||||
|
'sggNm',
|
||||||
|
],
|
||||||
},
|
},
|
||||||
'ecscs_nm',
|
'fcltNm',
|
||||||
'locplcs',
|
'fcltPstnCn',
|
||||||
'telno',
|
'telNo',
|
||||||
'comp_dt',
|
'cmptnStrtYmd',
|
||||||
'rn_dt',
|
'oprtngStrtYmd',
|
||||||
'wct',
|
'wholPjtcoAmt',
|
||||||
'ecscs_cpcty',
|
'prcsFcltCpct',
|
||||||
'process_cpcty',
|
'cpct',
|
||||||
'opr_daycnt',
|
'oprtngDayCnt',
|
||||||
'trt_msrc',
|
'prcsMthdExpln',
|
||||||
'cntc_prcplt',
|
'linkTmplntCn',
|
||||||
'assct_trt_cpc',
|
'linkPrcsQnt',
|
||||||
{
|
{
|
||||||
name: 'influenceGroup',
|
name: 'influenceGroup',
|
||||||
hideChildHeaders: false,
|
hideChildHeaders: false,
|
||||||
header: { text: '유입수질(mg/L, 개/mL)' },
|
header: { text: '유입수질(mg/L, 개/mL)' },
|
||||||
items: ['infl_wqlt_bod', 'infl_wqlt_toc', 'infl_wqlt_ss', 'infl_wqlt_tn', 'infl_wqlt_tp', 'infl_wqlt_clfgrpcnt'],
|
items: ['inflwBodWqVl', 'inflwTocWqVl', 'inflwSsWqVl', 'inflwTnWqVl', 'inflwTpWqVl', 'inflwClfgCnt'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'effluentGroup',
|
name: 'effluentGroup',
|
||||||
hideChildHeaders: false,
|
hideChildHeaders: false,
|
||||||
header: { text: '방류수질(mg/L, 개/mL)' },
|
header: { text: '방류수질(mg/L, 개/mL)' },
|
||||||
items: ['effl_wqlt_bod', 'effl_wqlt_toc', 'effl_wqlt_ss', 'effl_wqlt_tn', 'effl_wqlt_tp', 'effl_wqlt_clfgrpcnt'],
|
items: ['dschgBodWqVl', 'dschgTocWqVl', 'dschgSsWqVl', 'dschgTnWqVl', 'dschgTpWqVl', 'dschgClfgCnt'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'dischargeGroup',
|
name: 'dischargeGroup',
|
||||||
hideChildHeaders: false,
|
hideChildHeaders: false,
|
||||||
header: { text: '방류수역' },
|
header: { text: '방류수역' },
|
||||||
items: ['rvbsn', 'bstrm', 'lgbsn', 'mdmbsn'],
|
items: ['wtsysNm', 'trbtrNm', 'msirbCn', 'ssirbCn'],
|
||||||
},
|
},
|
||||||
'oper_mth',
|
'operMthdCdCn',
|
||||||
'cntc_prcplt_cpc',
|
'wholNope',
|
||||||
'safe_acdnt_co',
|
'sftyAcdntEvntcsCnt',
|
||||||
'rmk',
|
'rmrk',
|
||||||
]
|
'admdstCd',
|
||||||
|
'fcltSn',
|
||||||
|
'admdstNm'
|
||||||
|
],
|
||||||
|
|
||||||
|
rowStartNum: 2,
|
||||||
|
fixedColumns: 2,
|
||||||
|
tabKey: 'ST00070001',
|
||||||
};
|
};
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user