Merge branch 'iipbs/st/dev' of https://www.onasys.co.kr:3000/ONAANDALL/frontend into iipbs/st/dev

This commit is contained in:
2026-02-19 11:43:28 +09:00
20 changed files with 2200 additions and 481 deletions
@@ -1,3 +1,3 @@
import { statisticsPage } from "@/pages/statistics";
import { StatisticsPage } from "@/pages/statistics";
export default statisticsPage;
export default StatisticsPage;
+52
View File
@@ -1 +1,53 @@
@tailwind components;
@layer components {
.rg-grid .rg-header .rg-table .rg-header-group-cell {
@apply !bg-[#466995] !text-[#fff];
}
.rg-grid .rg-header .rg-table .rg-header-cell {
@apply !bg-[#5987bf] !text-[#fff];
}
.rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell {
@apply !bg-white;
}
/* 셀 클래스가 있으면 위 기본색보다 우선 (같은 specificity + 나중 규칙) */
.rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell.rg-cell-readonly {
@apply !bg-[#f0f0f0] !text-[#666];
}
.rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell.rg-cell-verify-error {
@apply !bg-[#ffe6e6] !text-[#c00];
}
.rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell.rg-cell-total {
@apply !bg-[#e3eaf2];
}
[data-theme="black"] {
.rg-grid .rg-header .rg-table .rg-header-group-cell {
@apply !bg-[#3C4043] !text-[#fff];
}
.rg-grid .rg-header .rg-table .rg-header-cell {
@apply !bg-[#62686d] !text-[#fff];
}
.rg-grid .rg-body .rg-table .rg-data-row .rg-data-cell {
@apply !bg-[#545556] !text-[#fff];
}
}
[data-theme="red"] {
.rg-grid .rg-header .rg-table .rg-header-group-cell {
@apply !bg-[#646469] !text-[#fff];
}
.rg-grid .rg-header .rg-table .rg-header-cell {
@apply !bg-[#8d8d94] !text-[#fff];
}
}
[data-theme="green"] {
.rg-grid .rg-header .rg-table .rg-header-group-cell {
@apply !bg-[#518585] !text-[#fff];
}
.rg-grid .rg-header .rg-table .rg-header-cell {
@apply !bg-[#6bafae] !text-[#fff];
}
}
}
File diff suppressed because it is too large Load Diff
@@ -40,7 +40,7 @@ interface VerificationFormValues {
};
}
const ManagementVerificationRule = () => {
const HbStatisticsVerification = () => {
const [verificationHistoryRowData, setVerificationHistoryRowData] =
useState<Record<string, string | number>[]>(
verificationHistoryMockData,
@@ -103,7 +103,7 @@ const ManagementVerificationRule = () => {
<div className="p-2">
{/* 통계 검증 섹션 */}
<div className="mb-6">
<h3 className="px-2 text-[1.5rem] font-semibold">
<h3 className="px-2 text-[1.5rem] font-semibold text-title">
통계 검증
</h3>
@@ -462,8 +462,8 @@ const ManagementVerificationRule = () => {
</div>
{/* 검증 이력 섹션 */}
<div className="mt-8 border-t pt-6">
<h3 className="mb-4 px-2 text-[1.5rem] font-semibold">
<div className="mt-8 border-t border-border pt-6">
<h3 className="mb-4 px-2 text-[1.5rem] font-semibold text-title">
검증 이력
</h3>
<DataGrid
@@ -480,4 +480,4 @@ const ManagementVerificationRule = () => {
);
};
export default ManagementVerificationRule;
export default HbStatisticsVerification;
@@ -0,0 +1,261 @@
"use client";
import DataGrid from "@/components/module/DataGrid";
import {
hbArticleColumnInfo,
imrArticleColumnInfo,
validationArticleColumnInfo,
} from "@/entities/statistics/model/verification-article-column";
import {
Button,
Input,
Label,
Tabs,
TabsContent,
TabsList,
TabsTrigger,
} from "@common/components";
import { CodeSelect } from "@/entities/code/ui/code-select";
import { verificationTargetManagementApi } from "@/entities/statistics/api/verification-target-management-service";
import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
import { useState } from "react";
import { ENDPOINT } from "@/shared/config";
import type {
VerificationTargetManagementSearchParams,
VerificationTargetManagementResponse,
} from "@/entities/statistics/model/verification-target-management-interface";
import { VerificationTargetDialog } from "./VerificationTargetDialog";
import { useConfirm } from "@frontend-opensource/use-react-hooks";
const TAB_CONFIG = {
HB: { value: "HB", label: "H-B", columnInfo: hbArticleColumnInfo },
IMR: { value: "IMR", label: "I-MR", columnInfo: imrArticleColumnInfo },
VV: {
value: "VV",
label: "Validation",
columnInfo: validationArticleColumnInfo,
},
} as const;
type TabValue = keyof typeof TAB_CONFIG;
function VerificationArticleManagement() {
const queryClient = useQueryClient();
const { confirm } = useConfirm();
const [activeTab, setActiveTab] = useState<TabValue>("HB");
const [statsCd, setStatsCd] = useState("");
const [vrfcTrgtNm, setVrfcTrgtNm] = useState("");
const [searchParams, setSearchParams] =
useState<VerificationTargetManagementSearchParams>({
vrfcMthdCd: activeTab,
statsCd,
vrfcTrgtNm,
});
const [dialogOpen, setDialogOpen] = useState(false);
const [selectedData, setSelectedData] =
useState<VerificationTargetManagementResponse | null>(null);
const { data: verificationData } = useQuery({
queryKey: [ENDPOINT.STATVERIFY_SERVICE.VRFCTGT_MNG, searchParams],
queryFn: async () => {
const response =
await verificationTargetManagementApi.getVerificationTargetManagementList(
{
vrfcMthdCd: searchParams.vrfcMthdCd,
statsCd: searchParams.statsCd || undefined,
vrfcTrgtNm: searchParams.vrfcTrgtNm || undefined,
},
);
return response;
},
});
const rowData = (verificationData?.content || []) as unknown as Record<
string,
string | number
>[];
const columnInfo = TAB_CONFIG[activeTab].columnInfo;
function handleSearch() {
setSearchParams({
vrfcMthdCd: activeTab,
statsCd,
vrfcTrgtNm,
});
}
function handleInitialize() {
setStatsCd("");
setVrfcTrgtNm("");
setSearchParams({
vrfcMthdCd: activeTab,
statsCd: "",
vrfcTrgtNm: "",
});
}
function handleTabChange(value: string) {
const newTab = value as TabValue;
setActiveTab(newTab);
setSearchParams({
vrfcMthdCd: newTab,
statsCd,
vrfcTrgtNm,
});
}
const updateMutation = useMutation({
mutationFn: (data: VerificationTargetManagementResponse) =>
verificationTargetManagementApi.updateVerificationTargetManagement(
data.vrfcTrgtSn,
{
vrfcMthdCd: data.vrfcMthdCd,
statsCd: data.statsCd,
schmNm: data.schmNm,
tblNm: data.tblNm,
colNm: data.colNm,
pkColNm: data.pkColNm,
ipcrCntVl: data.ipcrCntVl,
pctlCrtrVl: data.pctlCrtrVl,
scopCntCntVl: data.scopCntCntVl,
thrsCntVl: data.thrsCntVl,
useYn: data.useYn,
vrfcTrgtNm: data.vrfcTrgtNm,
},
),
onSuccess: () => {
queryClient.invalidateQueries({
queryKey: [ENDPOINT.STATVERIFY_SERVICE.VRFCTGT_MNG],
});
setDialogOpen(false);
},
});
const deleteMutation = useMutation({
mutationFn: (vrfcTrgtSn: number) =>
verificationTargetManagementApi.deleteVerificationTargetManagement(
vrfcTrgtSn,
),
onSuccess: () => {
queryClient.invalidateQueries({
queryKey: [ENDPOINT.STATVERIFY_SERVICE.VRFCTGT_MNG],
});
setDialogOpen(false);
},
});
function handleRowClick(rowData: Record<string, string | number>) {
setSelectedData(
rowData as unknown as VerificationTargetManagementResponse,
);
setDialogOpen(true);
}
function handleSubmit(e: React.FormEvent) {
e.preventDefault();
handleSearch();
}
async function handleSave(data: VerificationTargetManagementResponse) {
if (await confirm("저장하시겠습니까?")) {
updateMutation.mutate(data);
}
}
async function handleDelete(vrfcTrgtSn: number) {
if (await confirm("정말 삭제하시겠습니까?")) {
deleteMutation.mutate(vrfcTrgtSn);
}
}
return (
<Tabs
defaultValue="HB"
value={activeTab}
onValueChange={handleTabChange}
>
<TabsList>
{Object.entries(TAB_CONFIG).map(([key, config]) => (
<TabsTrigger
key={key}
value={config.value}
className="!px-[2rem] !py-[0.8rem] !text-[1.2rem]"
>
{config.label}
</TabsTrigger>
))}
</TabsList>
<div className="card card-border !mx-0">
<form onSubmit={handleSubmit}>
<div className="flex items-center gap-4">
<div className="flex items-center gap-4">
<Label className="whitespace-nowrap px-4 text-label">
통계항목
</Label>
<CodeSelect
upCd="STITEM"
value={statsCd}
onValueChange={setStatsCd}
placeholder="선택"
className="w-[16rem]"
/>
</div>
<div className="flex items-center gap-4">
<Label className="whitespace-nowrap px-4 text-label">
검증명
</Label>
<Input
value={vrfcTrgtNm}
onChange={(e) => setVrfcTrgtNm(e.target.value)}
placeholder="검증명"
className="w-[20rem]"
/>
</div>
<div className="ml-auto flex gap-2">
<Button
type="submit"
color="green"
className="h-[3.6rem] w-[80px]"
>
조회
</Button>
<Button
type="button"
color="gray"
className="h-[3.6rem] w-[80px]"
onClick={handleInitialize}
>
초기화
</Button>
</div>
</div>
</form>
</div>
{Object.entries(TAB_CONFIG).map(([key, config]) => (
<TabsContent key={key} value={config.value}>
<DataGrid
columnInfo={columnInfo}
rowData={rowData}
setRowData={() => {}}
onRowClick={handleRowClick}
isExcelImport={false}
/>
</TabsContent>
))}
<VerificationTargetDialog
open={dialogOpen}
onOpenChange={setDialogOpen}
data={selectedData}
onSave={handleSave}
onDelete={handleDelete}
/>
</Tabs>
);
}
export default VerificationArticleManagement;
@@ -0,0 +1,380 @@
"use client";
import {
Button,
Dialog,
DialogContent,
DialogFooter,
DialogHeader,
DialogTitle,
Input,
Table,
TableBody,
TableCell,
TableHead,
TableRow,
} from "@common/components";
import { CodeSelect } from "@/entities/code/ui/code-select";
import type { VerificationTargetManagementResponse } from "@/entities/statistics/model/verification-target-management-interface";
import {
verificationTargetManagementSchema,
type VerificationTargetManagementFormData,
} from "@/entities/statistics/model/verification-target-management-schema";
import { useEffect } from "react";
import { useForm, Controller } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
interface VerificationTargetDialogProps {
open: boolean;
onOpenChange: (open: boolean) => void;
data: VerificationTargetManagementResponse | null;
onSave: (data: VerificationTargetManagementResponse) => void;
onDelete: (vrfcTrgtSn: number) => void;
}
export function VerificationTargetDialog({
open,
onOpenChange,
data,
onSave,
onDelete,
}: VerificationTargetDialogProps) {
const {
control,
handleSubmit,
reset,
formState: { errors },
} = useForm<VerificationTargetManagementFormData>({
resolver: zodResolver(verificationTargetManagementSchema),
defaultValues: data || undefined,
});
useEffect(() => {
if (data && open) reset(data);
}, [data, open]);
function onSubmit(formData: VerificationTargetManagementFormData) {
if (!data) return;
onSave({
...data,
...formData,
} as VerificationTargetManagementResponse);
}
function handleDelete() {
if (data?.vrfcTrgtSn) {
onDelete(data.vrfcTrgtSn);
}
}
if (!data) return null;
return (
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent className="max-w-[800px]">
<DialogHeader>
<DialogTitle>검증 항목 상세</DialogTitle>
</DialogHeader>
<form onSubmit={handleSubmit(onSubmit)}>
<Table variant="secondary">
<TableBody>
<TableRow>
<TableHead
className="w-[150px] bg-muted font-medium"
data-required
>
통계항목
</TableHead>
<TableCell>
<Controller
name="statsCd"
control={control}
render={({ field }) => (
<div className="space-y-1">
<CodeSelect
upCd="STITEM"
value={field.value}
onValueChange={
field.onChange
}
placeholder="선택"
/>
{errors.statsCd && (
<p className="text-xs text-red-500">
{errors.statsCd.message}
</p>
)}
</div>
)}
/>
</TableCell>
<TableHead
className="w-[150px] bg-muted font-medium"
data-required
>
검증명
</TableHead>
<TableCell>
<Controller
name="vrfcTrgtNm"
control={control}
render={({ field }) => (
<Input
{...field}
value={field.value || ""}
placeholder="검증명"
/>
)}
/>
</TableCell>
</TableRow>
<TableRow>
<TableHead
className="bg-muted font-medium"
data-required
>
스키마명
</TableHead>
<TableCell>
<Controller
name="schmNm"
control={control}
render={({ field }) => (
<div className="space-y-1">
<Input
{...field}
placeholder="스키마명"
/>
{errors.schmNm && (
<p className="text-xs text-red-500">
{errors.schmNm.message}
</p>
)}
</div>
)}
/>
</TableCell>
<TableHead
className="bg-muted font-medium"
data-required
>
테이블명
</TableHead>
<TableCell>
<Controller
name="tblNm"
control={control}
render={({ field }) => (
<div className="space-y-1">
<Input
{...field}
placeholder="테이블명"
/>
{errors.tblNm && (
<p className="text-xs text-red-500">
{errors.tblNm.message}
</p>
)}
</div>
)}
/>
</TableCell>
</TableRow>
<TableRow>
<TableHead
className="bg-muted font-medium"
data-required
>
컬럼명
</TableHead>
<TableCell>
<Controller
name="colNm"
control={control}
render={({ field }) => (
<div className="space-y-1">
<Input
{...field}
placeholder="컬럼명"
/>
{errors.colNm && (
<p className="text-xs text-red-500">
{errors.colNm.message}
</p>
)}
</div>
)}
/>
</TableCell>
<TableHead
className="bg-muted font-medium"
data-required
>
PK 키
</TableHead>
<TableCell>
<Controller
name="pkColNm"
control={control}
render={({ field }) => (
<div className="space-y-1">
<Input
{...field}
placeholder="PK 키"
/>
{errors.pkColNm && (
<p className="text-xs text-red-500">
{errors.pkColNm.message}
</p>
)}
</div>
)}
/>
</TableCell>
</TableRow>
<TableRow>
<TableHead className="bg-muted font-medium">
중요도 계수(μ)
</TableHead>
<TableCell>
<Controller
name="ipcrCntVl"
control={control}
render={({ field }) => (
<div className="space-y-1">
<Input
type="number"
step="0.1"
value={field.value ?? ""}
onChange={(e) =>
field.onChange(
e.target.value
? Number(
e.target
.value,
)
: null,
)
}
placeholder="(0 ~ 1)"
/>
</div>
)}
/>
</TableCell>
<TableHead className="bg-muted font-medium">
백분위수 기준값(pct)
</TableHead>
<TableCell>
<Controller
name="pctlCrtrVl"
control={control}
render={({ field }) => (
<div className="space-y-1">
<Input
type="number"
step="0.1"
value={field.value ?? ""}
onChange={(e) =>
field.onChange(
e.target.value
? Number(
e.target
.value,
)
: null,
)
}
placeholder="(0 ~ 0.5)"
/>
</div>
)}
/>
</TableCell>
</TableRow>
<TableRow>
<TableHead className="bg-muted font-medium">
스케일 조정 계수(A)
</TableHead>
<TableCell>
<Controller
name="scopCntCntVl"
control={control}
render={({ field }) => (
<Input
type="number"
step="0.05"
value={field.value ?? ""}
onChange={(e) =>
field.onChange(
e.target.value
? Number(
e.target
.value,
)
: null,
)
}
/>
)}
/>
</TableCell>
<TableHead className="bg-muted font-medium">
임계 계수(c)
</TableHead>
<TableCell>
<Controller
name="thrsCntVl"
control={control}
render={({ field }) => (
<Input
type="number"
step="1"
value={field.value ?? ""}
onChange={(e) =>
field.onChange(
e.target.value
? Number(
e.target
.value,
)
: null,
)
}
/>
)}
/>
</TableCell>
</TableRow>
</TableBody>
</Table>
<DialogFooter className="mt-6">
<Button
type="button"
color="gray"
onClick={() => onOpenChange(false)}
>
취소
</Button>
<Button
type="button"
color="red"
onClick={handleDelete}
>
삭제
</Button>
<Button type="submit" color="green">
저장
</Button>
</DialogFooter>
</form>
</DialogContent>
</Dialog>
);
}
+113 -40
View File
@@ -11,28 +11,55 @@ export type RealGridColumnInfo = {
valueType?: import("realgrid").ValueType;
dataFormat?: string;
styleName?: string;
mergeRule?: { criteria: 'value' };
footer?: {
mergeRule?: { criteria: "value" };
footer?:
| {
text?: string;
expression?: 'sum' | 'avg' | 'count' | 'max' | 'min';
expression?: "sum" | "avg" | "count" | "max" | "min";
numberFormat?: string;
valueCallback?: (grid: GridView, column: DataColumn, footerIndex: number, columnFooter: ColumnFooter, value: number | string | undefined) => number | string;
} | Array<{
valueCallback?: (
grid: GridView,
column: DataColumn,
footerIndex: number,
columnFooter: ColumnFooter,
value: number | string | undefined,
) => number | string;
}
| Array<{
text?: string;
expression?: 'sum' | 'avg' | 'count' | 'max' | 'min';
expression?: "sum" | "avg" | "count" | "max" | "min";
numberFormat?: string;
valueCallback?: (grid: GridView, column: DataColumn, footerIndex: number, columnFooter: ColumnFooter, value: number | string | undefined) => number | string;
valueCallback?: (
grid: GridView,
column: DataColumn,
footerIndex: number,
columnFooter: ColumnFooter,
value: number | string | undefined,
) => number | string;
}>;
};
/** setColumns 메서드가 있는 GridView */
export type GridViewWithSetColumns = GridView & { setColumns?: (columns: RealGridColumnInfo[]) => void };
export type GridViewWithSetColumns = GridView & {
setColumns?: (columns: RealGridColumnInfo[]) => void;
};
/** footer 배열 요소에 valueCallback 할당용 */
export type FooterItemWithCallback = { valueCallback?: (grid: GridView, column: DataColumn, footerIndex: number, columnFooter: ColumnFooter, value: number | string | undefined) => number | string };
export type FooterItemWithCallback = {
valueCallback?: (
grid: GridView,
column: DataColumn,
footerIndex: number,
columnFooter: ColumnFooter,
value: number | string | undefined,
) => number | string;
};
export type GridView = {
getSummary(field: string, summary: 'sum' | 'avg' | 'count' | 'max' | 'min'): number | undefined;
getSummary(
field: string,
summary: "sum" | "avg" | "count" | "max" | "min",
): number | undefined;
getDataSource(): {
getRowCount(): number;
getValue(rowIndex: number, field: string): number | string;
@@ -41,7 +68,12 @@ export type GridView = {
getDataRow(itemIndex: number): number;
};
export type MergeCallback = (grid: GridView, column: DataColumn, itemIndex: number, value: number | string | null | undefined) => number | null;
export type MergeCallback = (
grid: GridView,
column: DataColumn,
itemIndex: number,
value: number | string | null | undefined,
) => number | null;
export type DataColumn = {
name: string;
@@ -66,15 +98,28 @@ export type DataFieldValueCallback = (
dataRow: number,
fieldName: string,
fieldNames: string[],
values: unknown[]
values: unknown[],
) => number | string | undefined;
/** 계산 필드 설정 (computedFieldCallbacks.ts 참고) */
export type ComputedFieldConfig =
| { fields: string[]; type: "sum" | "avg" }
| { numeratorFields: string[]; denominatorFields: string[]; type: "pblswrgPopltnSuprtRate" }
| { numeratorFields: string[]; denominatorFields: string[]; type: "adtrtPopltnSuprtRate" }
| { numeratorFields: string[]; denominatorFields: string[]; thirdFields: string[], type: "swrgInstlrtRate" };
| {
numeratorFields: string[];
denominatorFields: string[];
type: "pblswrgPopltnSuprtRate";
}
| {
numeratorFields: string[];
denominatorFields: string[];
type: "adtrtPopltnSuprtRate";
}
| {
numeratorFields: string[];
denominatorFields: string[];
thirdFields: string[];
type: "swrgInstlrtRate";
};
export type ColumnConfig = {
name: string;
@@ -92,18 +137,32 @@ export type ColumnConfig = {
sortPreserveGroupOrder?: SortPreserveGroupOrder;
valueType?: ValueType;
dataFormat?: string;
footer?: {
footer?:
| {
text?: string;
expression?: 'sum' | 'avg' | 'count' | 'max' | 'min';
expression?: "sum" | "avg" | "count" | "max" | "min";
numberFormat?: string;
valueCallback?: (grid: GridView, column: DataColumn, footerIndex: number, columnFooter: ColumnFooter, value: number | string | undefined) => number | string;
valueCallback?: (
grid: GridView,
column: DataColumn,
footerIndex: number,
columnFooter: ColumnFooter,
value: number | string | undefined,
) => number | string;
multiRow?: boolean; // 여러 행 footer 사용 여부
} | Array<{
}
| Array<{
text?: string;
expression?: 'sum' | 'avg' | 'count' | 'max' | 'min';
expression?: "sum" | "avg" | "count" | "max" | "min";
numberFormat?: string;
valueCallback?: (grid: GridView, column: DataColumn, footerIndex: number, columnFooter: ColumnFooter, value: number | string | undefined) => number | string;
}>, // RealGrid에서 footer를 배열로 설정할 수 있음
valueCallback?: (
grid: GridView,
column: DataColumn,
footerIndex: number,
columnFooter: ColumnFooter,
value: number | string | undefined,
) => number | string;
}>; // RealGrid에서 footer를 배열로 설정할 수 있음
};
export type FooterUserSpan = {
@@ -112,16 +171,19 @@ export type FooterUserSpan = {
text?: string; // 표시할 텍스트
};
export type ColumnLayoutItem = string | {
name: string;
hideChildHeaders?: boolean;
header: { text: string };
items: (string | ColumnLayoutItem)[];
footerUserSpans?: FooterUserSpan[]; // footer 병합 설정
} | {
column: string; // 컬럼 이름 (footerUserSpans 사용 시)
footerUserSpans?: FooterUserSpan[]; // footer 병합 설정
};
export type ColumnLayoutItem =
| string
| {
name: string;
hideChildHeaders?: boolean;
header: { text: string };
items: (string | ColumnLayoutItem)[];
footerUserSpans?: FooterUserSpan[]; // footer 병합 설정
}
| {
column: string; // 컬럼 이름 (footerUserSpans 사용 시)
footerUserSpans?: FooterUserSpan[]; // footer 병합 설정
};
export type ColumnInfo = {
columns: ColumnConfig[];
@@ -138,7 +200,7 @@ export type ColumnInfoList = {
isSplitGrid?: boolean; // 5:5 분리형 그리드 유무
left?: ColumnInfoList; // SplitDataGrid용 왼쪽 그리드 정보
right?: ColumnInfoList; // SplitDataGrid용 오른쪽 그리드 정보
}
};
// 개별 셀 스타일을 동적으로 결정하기 위한 콜백 (예: 검증 오류 셀 강조)
export type CellStyleCallbackParams = {
@@ -158,11 +220,16 @@ export type DataGridProps = {
fixedColumns?: number; // 고정할 컬럼 개수 (좌측부터)
showHeaderCheckbox?: boolean; // 헤더 체크박스 표시 여부 (기본값: true)
rowData: Record<string, string | number>[];
setRowData: React.Dispatch<React.SetStateAction<Record<string, string | number>[]>>;
/** 저장 등 시점에 그리드 현재 데이터를 가져올 수 있도록 할당 (편집 반영된 값) */
getGridDataRef?: { current: (() => Record<string, string | number>[]) | null };
setRowData: React.Dispatch<
React.SetStateAction<Record<string, string | number>[]>
>;
/** 셀 단위로 styleName을 동적으로 결정 (예: 검증 오류 셀) */
cellStyleCallback?: CellStyleCallback;
/** 저장 등 시점에 그리드 현재 데이터를 가져올 수 있도록 할당 (편집 반영된 값) */
getGridDataRef?: {
current: (() => Record<string, string | number>[]) | null;
};
onRowClick?: (rowData: Record<string, string | number>) => void; // 행 클릭 이벤트
};
export type TabDataGridProps = {
@@ -173,7 +240,9 @@ export type TabDataGridProps = {
onRowsChange?: (rows: Record<string, string | number>[]) => void;
showHeaderCheckbox?: boolean; // 헤더 체크박스 표시 여부 (기본값: true)
rowDataMap: Map<string, Record<string, string | number>[]>;
setRowDataMap: React.Dispatch<React.SetStateAction<Map<string, Record<string, string | number>[]>>>;
setRowDataMap: React.Dispatch<
React.SetStateAction<Map<string, Record<string, string | number>[]>>
>;
isSplitGrid?: boolean; // 5:5 분리형 그리드 유무
/** 활성 탭 키 (제어 모드). 부모에서 넘기면 해당 탭이 선택됨 */
activeTab?: string;
@@ -189,6 +258,10 @@ export type SplitDataGridProps = {
showHeaderCheckbox?: boolean;
leftRowData: Record<string, string | number>[];
rightRowData: Record<string, string | number>[];
setLeftRowData: React.Dispatch<React.SetStateAction<Record<string, string | number>[]>>;
setRightRowData: React.Dispatch<React.SetStateAction<Record<string, string | number>[]>>;
};
setLeftRowData: React.Dispatch<
React.SetStateAction<Record<string, string | number>[]>
>;
setRightRowData: React.Dispatch<
React.SetStateAction<Record<string, string | number>[]>
>;
};
@@ -0,0 +1,95 @@
import { client } from "@/shared/api";
import { ENDPOINT } from "@/shared/config";
import type {
VerificationTargetManagementService,
VerificationTargetManagementSearchParams,
VerificationTargetManagementListApiResponse,
VerificationTargetManagementDetailApiResponse,
VerificationTargetManagementSaveRequest,
VerificationTargetManagementSaveApiResponse,
VerificationTargetManagementUpdateRequest,
VerificationTargetManagementUpdateApiResponse,
VerificationTargetManagementDeleteApiResponse,
} from "../model/verification-target-management-interface";
export class VerificationTargetManagementApiService implements VerificationTargetManagementService {
/**
* 검증 대상 목록 조회
* @param params 검색 조건 (vrfcMthdCd, statsCd, tblNm, colNm, vrfcTrgtNm, useYn, page, size, sort)
*/
public async getVerificationTargetManagementList(
params: VerificationTargetManagementSearchParams,
): Promise<VerificationTargetManagementListApiResponse> {
const response =
await client.get<VerificationTargetManagementListApiResponse>(
`${ENDPOINT.STATVERIFY_SERVICE.VRFCTGT_MNG}`,
{ params },
);
return response.data;
}
/**
* 검증 대상 상세 조회
* @param vrfcTrgtSn 검증 대상 일련번호
*/
public async getVerificationTargetManagementById(
vrfcTrgtSn: number,
): Promise<VerificationTargetManagementDetailApiResponse> {
const response =
await client.get<VerificationTargetManagementDetailApiResponse>(
`${ENDPOINT.STATVERIFY_SERVICE.VRFCTGT_MNG}/${vrfcTrgtSn}`,
);
return response.data;
}
/**
* 검증 대상 등록
* @param request 등록 요청 데이터
*/
public async saveVerificationTargetManagement(
request: VerificationTargetManagementSaveRequest,
): Promise<VerificationTargetManagementSaveApiResponse> {
const response =
await client.post<VerificationTargetManagementSaveApiResponse>(
`${ENDPOINT.STATVERIFY_SERVICE.VRFCTGT_MNG}`,
request,
);
return response.data;
}
/**
* 검증 대상 수정
* @param vrfcTrgtSn 검증 대상 일련번호
* @param request 수정 요청 데이터
*/
public async updateVerificationTargetManagement(
vrfcTrgtSn: number,
request: VerificationTargetManagementUpdateRequest,
): Promise<VerificationTargetManagementUpdateApiResponse> {
const response =
await client.put<VerificationTargetManagementUpdateApiResponse>(
`${ENDPOINT.STATVERIFY_SERVICE.VRFCTGT_MNG}/${vrfcTrgtSn}`,
request,
);
return response.data;
}
/**
* 검증 대상 삭제
* @param vrfcTrgtSn 검증 대상 일련번호
*/
public async deleteVerificationTargetManagement(
vrfcTrgtSn: number,
): Promise<VerificationTargetManagementDeleteApiResponse> {
const response =
await client.delete<VerificationTargetManagementDeleteApiResponse>(
`${ENDPOINT.STATVERIFY_SERVICE.VRFCTGT_MNG}/${vrfcTrgtSn}`,
);
return response.data;
}
}
// 통합 인스턴스 수출
export const verificationTargetManagementApi =
new VerificationTargetManagementApiService();
@@ -0,0 +1,200 @@
import { ValueType } from "realgrid";
import type { ColumnInfo } from "@rsone/components";
export const hbArticleColumnInfo: ColumnInfo = {
columns: [
{
name: "statsNm",
fieldName: "statsNm",
header: { text: "통계항목" },
editable: false,
sortdisable: false,
},
{
name: "vrfcTrgtNm",
fieldName: "vrfcTrgtNm",
header: { text: "검증명" },
editable: false,
sortdisable: false,
},
{
name: "tblNm",
fieldName: "tblNm",
header: { text: "테이블명" },
editable: false,
sortdisable: false,
},
{
name: "colNm",
fieldName: "colNm",
header: { text: "컬럼명" },
editable: false,
sortdisable: false,
},
{
name: "pctlCrtrVl",
fieldName: "pctlCrtrVl",
header: { text: "Percentile" },
editable: false,
sortdisable: false,
valueType: ValueType.NUMBER,
dataFormat: "#,##0.##",
},
{
name: "scopCntCntVl",
fieldName: "scopCntCntVl",
header: { text: "A" },
editable: false,
sortdisable: false,
valueType: ValueType.NUMBER,
dataFormat: "#,##0.###",
},
{
name: "thrsCntVl",
fieldName: "thrsCntVl",
header: { text: "C" },
editable: false,
sortdisable: false,
valueType: ValueType.NUMBER,
dataFormat: "#,##0.###",
},
{
name: "rgtrNm",
fieldName: "rgtrNm",
header: { text: "등록자" },
editable: false,
sortdisable: false,
},
{
name: "regDt",
fieldName: "regDt",
header: { text: "등록일시" },
editable: false,
sortdisable: false,
},
],
columnLayout: [
"statsNm",
"vrfcTrgtNm",
"tblNm",
"colNm",
"pctlCrtrVl",
"scopCntCntVl",
"thrsCntVl",
"rgtrNm",
"regDt",
],
};
export const imrArticleColumnInfo: ColumnInfo = {
columns: [
{
name: "statsNm",
fieldName: "statsNm",
header: { text: "통계항목" },
editable: false,
sortdisable: false,
},
{
name: "vrfcTrgtNm",
fieldName: "vrfcTrgtNm",
header: { text: "검증명" },
editable: false,
sortdisable: false,
},
{
name: "tblNm",
fieldName: "tblNm",
header: { text: "테이블명" },
editable: false,
sortdisable: false,
},
{
name: "colNm",
fieldName: "colNm",
header: { text: "컬럼명" },
editable: false,
sortdisable: false,
},
{
name: "ipcrCntVl",
fieldName: "ipcrCntVl",
header: { text: "μ" },
editable: false,
sortdisable: false,
valueType: ValueType.NUMBER,
dataFormat: "#,##0.###",
},
{
name: "rgtrNm",
fieldName: "rgtrNm",
header: { text: "등록자" },
editable: false,
sortdisable: false,
},
{
name: "regDt",
fieldName: "regDt",
header: { text: "등록일시" },
editable: false,
sortdisable: false,
},
],
columnLayout: [
"statsNm",
"vrfcTrgtNm",
"tblNm",
"colNm",
"ipcrCntVl",
"rgtrNm",
"regDt",
],
};
export const validationArticleColumnInfo: ColumnInfo = {
columns: [
{
name: "statsNm",
fieldName: "statsNm",
header: { text: "통계항목" },
editable: false,
sortdisable: false,
},
{
name: "vrfcTrgtNm",
fieldName: "vrfcTrgtNm",
header: { text: "검증명" },
editable: false,
sortdisable: false,
},
{
name: "tblNm",
fieldName: "tblNm",
header: { text: "테이블명" },
editable: false,
sortdisable: false,
},
{
name: "colNm",
fieldName: "colNm",
header: { text: "컬럼명" },
editable: false,
sortdisable: false,
},
{
name: "rgtrNm",
fieldName: "rgtrNm",
header: { text: "등록자" },
editable: false,
sortdisable: false,
},
{
name: "regDt",
fieldName: "regDt",
header: { text: "등록일시" },
editable: false,
sortdisable: false,
},
],
columnLayout: ["statsNm", "vrfcTrgtNm", "tblNm", "colNm", "rgtrNm", "regDt"],
};
@@ -0,0 +1,57 @@
/** H-B 탭 검증 항목 */
export interface HBArticleItem {
/** 통계 항목명 */
statsItmNm: string;
/** 검증 항목명 */
vrfcItmNm: string;
/** 테이블명 */
tblNm: string;
/** 컬럼명 */
colNm: string;
/** Percentile 값 */
percentileVal: number;
/** A 값 */
aVal: number;
/** C 값 */
cVal: number;
/** 등록자명 */
regNm: string;
/** 등록 일시 */
regDt: string;
}
/** I-MR 탭 검증 항목 */
export interface IMRArticleItem {
/** 통계 항목명 */
statsItmNm: string;
/** 검증명 */
vrfcNm: string;
/** 테이블명 */
tblNm: string;
/** 컬럼명 */
colNm: string;
/** 등록자명 */
regNm: string;
/** 등록 일시 */
regDt: string;
}
/** Validation 탭 검증 항목 */
export interface ValidationArticleItem {
/** 순번 */
no: string;
/** 통계항목명 */
statsItmNm: string;
/** 검증명 */
vrfcNm: string;
/** 테이블명 */
tblNm: string;
/** 컬럼명 */
colNm: string;
/** 비교 테이블명 */
cmpTblNm: string;
/** 비교 컬럼명 */
cmpColNm: string;
/** 기본규칙 */
bscRul: string;
}
@@ -0,0 +1,150 @@
import { fakerKO as faker } from "@faker-js/faker";
import type {
HBArticleItem,
IMRArticleItem,
ValidationArticleItem,
} from "./verification-article-interface";
const HB_STATS_ITEMS = [
"하수도 보급률",
"하수관로",
"하수처리시설 및 방류량보고",
"펌프장",
"공공하수처리시설",
"분뇨처리시설",
"개인하수처리시설",
"하수도재정",
"물 재이용",
];
const HB_VERIFICATION_ITEMS = [
"행정구역 보급률",
"유역환경청별 보급률",
"관로연장",
"처리용량",
"방류량",
"펌프용량",
];
const IMR_STATS_ITEMS = [
"하수도 보급률",
"하수관로",
"하수처리시설 및 방류량보고",
"펌프장",
"공공하수처리시설",
"분뇨처리시설",
"개인하수처리시설",
"하수도재정",
"물 재이용",
];
const VALIDATION_STATS_ITEMS = [
"하수관로 유지관리",
"하수저류시설 및 빗물펌프장",
"공공하수처리시설",
"분뇨처리시설",
"개인하수처리시설",
"하수도재정",
];
const VERIFICATION_NAMES = [
"제정별 사업비",
"관로길이",
"공란검증",
"범위검증",
"논리검증",
"유지보수",
];
const TABLE_NAMES = [
"tb_stats_drng_sys",
"tb_stats_ppline",
"tb_stats_fclt",
"tb_stats_pump_stt",
"tb_stats_sewg_trtm",
];
const COLUMN_NAMES = [
"drng_sys_rate",
"ppline_len",
"fclt_cpct",
"pump_cpct",
"trtm_qty",
"popl_cnt",
];
const BASIC_RULES = [
"값 > 0",
"값 >= 0",
"값 != NULL",
"범위: 0-100",
"A > B",
];
function formatDateTime(date: Date): string {
const y = date.getFullYear();
const m = String(date.getMonth() + 1).padStart(2, "0");
const d = String(date.getDate()).padStart(2, "0");
const h = String(date.getHours()).padStart(2, "0");
const min = String(date.getMinutes()).padStart(2, "0");
return `${y}-${m}-${d} ${h}:${min}`;
}
/** H-B 탭 목데이터 생성 */
export function createHBArticleMock(count = 10): HBArticleItem[] {
faker.seed(100);
return Array.from({ length: count }, (_, index) => ({
statsItmNm: faker.helpers.arrayElement(HB_STATS_ITEMS),
vrfcItmNm: faker.helpers.arrayElement(HB_VERIFICATION_ITEMS),
tblNm: faker.helpers.arrayElement(TABLE_NAMES),
colNm: faker.helpers.arrayElement(COLUMN_NAMES),
percentileVal: faker.number.float({
min: 0,
max: 100,
fractionDigits: 2,
}),
aVal: faker.number.float({ min: 0, max: 10, fractionDigits: 3 }),
cVal: faker.number.float({ min: 0, max: 10, fractionDigits: 3 }),
regNm: faker.person.fullName(),
regDt: formatDateTime(faker.date.recent({ days: 90 })),
}));
}
/** I-MR 탭 목데이터 생성 */
export function createIMRArticleMock(count = 10): IMRArticleItem[] {
faker.seed(200);
return Array.from({ length: count }, (_, index) => ({
statsItmNm: faker.helpers.arrayElement(IMR_STATS_ITEMS),
vrfcNm: faker.helpers.arrayElement(VERIFICATION_NAMES),
tblNm: faker.helpers.arrayElement(TABLE_NAMES),
colNm: faker.helpers.arrayElement(COLUMN_NAMES),
regNm: faker.person.fullName(),
regDt: formatDateTime(faker.date.recent({ days: 90 })),
}));
}
/** Validation 탭 목데이터 생성 */
export function createValidationArticleMock(
count = 6,
): ValidationArticleItem[] {
faker.seed(300);
return Array.from({ length: count }, (_, index) => ({
no: `${index + 1}`,
statsItmNm: faker.helpers.arrayElement(VALIDATION_STATS_ITEMS),
vrfcNm: faker.helpers.arrayElement(VERIFICATION_NAMES),
tblNm: faker.helpers.arrayElement(TABLE_NAMES),
colNm: faker.helpers.arrayElement(COLUMN_NAMES),
cmpTblNm: faker.helpers.arrayElement(TABLE_NAMES),
cmpColNm: faker.helpers.arrayElement(COLUMN_NAMES),
bscRul: faker.helpers.arrayElement(BASIC_RULES),
}));
}
/** H-B 탭 기본 목데이터 */
export const hbArticleMockData = createHBArticleMock(10);
/** I-MR 탭 기본 목데이터 */
export const imrArticleMockData = createIMRArticleMock(10);
/** Validation 탭 기본 목데이터 */
export const validationArticleMockData = createValidationArticleMock(6);
@@ -0,0 +1,105 @@
import type { PageableList } from "@/shared/model";
import type { ApiResponse } from "./statistics-interface";
// 검증 대상 관리 응답 DTO
export interface VerificationTargetManagementResponse {
vrfcTrgtSn: number; // 검증 대상 일련번호
vrfcMthdCd: string; // 검증 방법 코드
vrfcMthdNm: string; // 검증 방법 명
statsCd: string; // 통계 코드
statsNm: string; // 통계 항목 명
schmNm: string; // 스키마 명
tblNm: string; // 테이블 명
colNm: string; // 컬럼 명
pkColNm: string; // pk 컬럼 명
ipcrCntVl: number | null; // 중요도 계수 값 (mu)
pctlCrtrVl: number | null; // 백분위 기준 값 (percentile)
scopCntCntVl: number | null; // 범위 조정 계수 값 (A)
thrsCntVl: number | null; // 임계 계수 값 (C)
useYn: string; // 사용 여부
vrfcTrgtNm: string; // 검증대상명
rgtr: string | null; // 등록자 ID
regDt: string | null; // 등록 일시
mdfr: string | null; // 수정자 ID
rgtrNm: string | null; // 등록자명
mdfrNm: string | null; // 수정자명
mdfcn: string | null; // 수정 일시
}
// 검증 대상 관리 검색 DTO
export interface VerificationTargetManagementSearchParams {
vrfcMthdCd?: string; // 검증 방법 코드
statsCd?: string; // 통계 코드
tblNm?: string; // 테이블 명
colNm?: string; // 컬럼 명
vrfcTrgtNm?: string; // 검증대상명
useYn?: string; // 사용 여부
page?: number; // 페이지 번호 (0부터 시작)
size?: number; // 페이지 크기
sort?: string; // 정렬 조건 (예: "vrfcTrgtSn,desc")
}
// 검증 대상 관리 저장 요청 DTO
export interface VerificationTargetManagementSaveRequest {
vrfcMthdCd: string; // 검증 방법 코드 (필수, 최대 10자)
statsCd: string; // 통계 코드 (필수, 최대 10자)
schmNm: string; // 스키마 명 (필수, 최대 150자)
tblNm: string; // 테이블 명 (필수, 최대 150자)
colNm: string; // 컬럼 명 (필수, 최대 150자)
pkColNm: string; // pk 컬럼 명 (필수, 최대 150자)
ipcrCntVl?: number | null; // 중요도 계수 값 (mu)
pctlCrtrVl?: number | null; // 백분위 기준 값 (percentile)
scopCntCntVl?: number | null; // 범위 조정 계수 값 (A)
thrsCntVl?: number | null; // 임계 계수 값 (C)
useYn?: string; // 사용 여부 (Y/N, 최대 1자)
vrfcTrgtNm?: string; // 검증대상명 (최대 150자)
}
// 검증 대상 관리 수정 요청 DTO
export interface VerificationTargetManagementUpdateRequest {
vrfcMthdCd: string; // 검증 방법 코드 (필수, 최대 10자)
statsCd: string; // 통계 코드 (필수, 최대 10자)
schmNm: string; // 스키마 명 (필수, 최대 150자)
tblNm: string; // 테이블 명 (필수, 최대 150자)
colNm: string; // 컬럼 명 (필수, 최대 150자)
pkColNm: string; // pk 컬럼 명 (필수, 최대 150자)
ipcrCntVl?: number | null; // 중요도 계수 값 (mu)
pctlCrtrVl?: number | null; // 백분위 기준 값 (percentile)
scopCntCntVl?: number | null; // 범위 조정 계수 값 (A)
thrsCntVl?: number | null; // 임계 계수 값 (C)
useYn?: string; // 사용 여부 (Y/N, 최대 1자)
vrfcTrgtNm?: string; // 검증대상명 (최대 150자)
}
// API 응답 타입
export type VerificationTargetManagementListApiResponse =
PageableList<VerificationTargetManagementResponse>;
export type VerificationTargetManagementDetailApiResponse =
ApiResponse<VerificationTargetManagementResponse>;
export type VerificationTargetManagementSaveApiResponse = ApiResponse<number>;
export type VerificationTargetManagementUpdateApiResponse = ApiResponse<number>;
export type VerificationTargetManagementDeleteApiResponse = ApiResponse<number>;
// 서비스 인터페이스
export interface VerificationTargetManagementService {
getVerificationTargetManagementList(
params: VerificationTargetManagementSearchParams,
): Promise<VerificationTargetManagementListApiResponse>;
getVerificationTargetManagementById(
vrfcTrgtSn: number,
): Promise<VerificationTargetManagementDetailApiResponse>;
saveVerificationTargetManagement(
request: VerificationTargetManagementSaveRequest,
): Promise<VerificationTargetManagementSaveApiResponse>;
updateVerificationTargetManagement(
vrfcTrgtSn: number,
request: VerificationTargetManagementUpdateRequest,
): Promise<VerificationTargetManagementUpdateApiResponse>;
deleteVerificationTargetManagement(
vrfcTrgtSn: number,
): Promise<VerificationTargetManagementDeleteApiResponse>;
}
@@ -0,0 +1,29 @@
import { z } from "zod";
export const verificationTargetManagementSchema = z.object({
vrfcTrgtSn: z.number().optional(),
vrfcMthdCd: z.string().optional(),
vrfcMthdNm: z.string().optional().nullable(),
statsCd: z.string().min(1, "통계항목을 선택해주세요"),
statsNm: z.string().optional().nullable(),
schmNm: z.string().min(1, "스키마명을 입력해주세요"),
tblNm: z.string().min(1, "테이블명을 입력해주세요"),
colNm: z.string().min(1, "컬럼명을 입력해주세요"),
pkColNm: z.string().min(1, "PK 키를 입력해주세요"),
ipcrCntVl: z.number().optional().nullable(),
pctlCrtrVl: z.number().optional().nullable(),
scopCntCntVl: z.number().optional().nullable(),
thrsCntVl: z.number().optional().nullable(),
useYn: z.string().optional(),
vrfcTrgtNm: z.string().optional().nullable(),
rgtr: z.string().optional().nullable(),
regDt: z.string().optional().nullable(),
mdfr: z.string().optional().nullable(),
rgtrNm: z.string().optional().nullable(),
mdfrNm: z.string().optional().nullable(),
mdfcn: z.string().optional().nullable(),
});
export type VerificationTargetManagementFormData = z.infer<
typeof verificationTargetManagementSchema
>;
+1 -1
View File
@@ -1 +1 @@
export { default as statisticsPage } from "./ui/statistics-page";
export { default as StatisticsPage } from "./ui/statistics-page";
+70 -67
View File
@@ -3,73 +3,76 @@ import { PROXY_HOST } from "./env";
export const BASE_URL = `${PROXY_HOST}/server`;
export const ENDPOINT = {
ATTACH_SERVICE: {
TUS_UPLOAD: "/attach-service/api/v1/tus/upload",
EDITOR_UPLOAD: "/attach-service/api/v1/upload/editor",
IMAGES: "/attach-service/api/v1/images",
MOVIE_THUMBNAIL: "/attach-service/api/v1/movie/thumbnail",
ATTACHMENTS: "/attach-service/api/v1/atfl/attachments",
DOWNLOAD: "/attach-service/api/v1/atflcd/download",
STREAM_VIDEO: "/attach-service/api/v1/stream/video",
},
USER_SERVICE: {
LOGIN: "/user-service/login",
USERS: "/user-service/api/v1/users",
SILENT_REFRESH: "/user-service/api/v1/users/token/refresh",
AUTHORIZATIONS: "/user-service/api/v1/authorizations",
ROLE_AUTHORIZATIONS: "/user-service/api/v1/role-authorizations",
ROLES: "/user-service/api/v1/roles",
LOGINLOG: "/user-service/api/v1/login-logs",
PRIVACYLOG: "/user-service//api/v1/prvc-inq-logs",
},
CMS_SERVICE: {
DASHBOARD: "/cms-service/api/v1/dashboard",
SITES: "/cms-service/api/v1/sites",
IPS: "/cms-service/api/v1/site-ips",
DOMAINS: "/cms-service/api/v1/site-dmns",
POSTINGS: "/cms-service/api/v1/site-pstgs",
CODE: "/cms-service/api/v1/code/cache",
MENUS: "/cms-service/api/v1/menus",
MENU_ROLES: "/cms-service/api/v1/menu-roles",
MENU_AUTHRTS: "/cms-service/api/v1/menu-authrts",
MENU_TEMPORARY_STORAGE: "/cms-service/api/v1/menu-tmpr-strg",
MENU_HISTORY: "/cms-service/api/v1/menu-hstry",
CONTENTS: "/cms-service/api/v1/contents",
CONTENTS_DETAILS: "/cms-service/api/v1/contents-details",
ORGANIZATIONS: "/cms-service/api/v1/ognzs",
USER_ORGANIZATION: "/cms-service/api/v1/user-ognz",
IMAGES: "/cms-service/api/v1/images",
BANNERS: "/cms-service/api/v1/bnrs",
TEMPLATE: "/cms-service/api/v1/tmplt",
TERMS: "/cms-service/api/v1/trms",
LWPO_CODE: "/cms-service/api/v1/lwpo-cds",
UP_CODE: "/cms-service/api/v1/up-codes",
POPUPS: "/cms-service/api/v1/popups",
SCHEDULES: "/cms-service/api/v1/schdls",
SURVEY: "/cms-service/api/v1/srvy",
SURVEY_QUESTION: "/cms-service/api/v1/srvy-qitem",
SURVEY_ARTICLE: "/cms-service/api/v1/srvy-artcl",
ZIPS: "/cms-service/api/v1/zips",
GROUPS: "/cms-service/api/v1/groups",
GROUP_USERS: "/cms-service/api/v1/group-users",
MANAGER_IP: "/cms-service/api/v1/mgrip",
APILOG: "/cms-service/api/v1/api-logs",
SITE_AUTHORITY: "/cms-service/api/v1/site-authrt",
CONNECTION_LOG: "/cms-service/api/v1/cntnlog",
},
BOARD_SERVICE: {
BBS: "/board-service/api/v1/bbs",
BBS_TEMPLATES: "/board-service/api/v1/bbsTmplt",
POSTS: "/board-service/api/v1/posts",
POSTS_COMMENTS: "/board-service/api/v1/posts-cmnts",
POST_EVALUATION: "/board-service/api/v1/pstEvl",
},
ST_SERVICE: {
COMMON: "/st-management-service/api/v1/common",
INPUT: "/st-input-service/api/v1/input",
REVIEW: "/st-management-service/api/v1/review",
INPUTCOMMON: "/st-input-service/api/v1/common",
}
ATTACH_SERVICE: {
TUS_UPLOAD: "/attach-service/api/v1/tus/upload",
EDITOR_UPLOAD: "/attach-service/api/v1/upload/editor",
IMAGES: "/attach-service/api/v1/images",
MOVIE_THUMBNAIL: "/attach-service/api/v1/movie/thumbnail",
ATTACHMENTS: "/attach-service/api/v1/atfl/attachments",
DOWNLOAD: "/attach-service/api/v1/atflcd/download",
STREAM_VIDEO: "/attach-service/api/v1/stream/video",
},
USER_SERVICE: {
LOGIN: "/user-service/login",
USERS: "/user-service/api/v1/users",
SILENT_REFRESH: "/user-service/api/v1/users/token/refresh",
AUTHORIZATIONS: "/user-service/api/v1/authorizations",
ROLE_AUTHORIZATIONS: "/user-service/api/v1/role-authorizations",
ROLES: "/user-service/api/v1/roles",
LOGINLOG: "/user-service/api/v1/login-logs",
PRIVACYLOG: "/user-service//api/v1/prvc-inq-logs",
},
CMS_SERVICE: {
DASHBOARD: "/cms-service/api/v1/dashboard",
SITES: "/cms-service/api/v1/sites",
IPS: "/cms-service/api/v1/site-ips",
DOMAINS: "/cms-service/api/v1/site-dmns",
POSTINGS: "/cms-service/api/v1/site-pstgs",
CODE: "/cms-service/api/v1/code/cache",
MENUS: "/cms-service/api/v1/menus",
MENU_ROLES: "/cms-service/api/v1/menu-roles",
MENU_AUTHRTS: "/cms-service/api/v1/menu-authrts",
MENU_TEMPORARY_STORAGE: "/cms-service/api/v1/menu-tmpr-strg",
MENU_HISTORY: "/cms-service/api/v1/menu-hstry",
CONTENTS: "/cms-service/api/v1/contents",
CONTENTS_DETAILS: "/cms-service/api/v1/contents-details",
ORGANIZATIONS: "/cms-service/api/v1/ognzs",
USER_ORGANIZATION: "/cms-service/api/v1/user-ognz",
IMAGES: "/cms-service/api/v1/images",
BANNERS: "/cms-service/api/v1/bnrs",
TEMPLATE: "/cms-service/api/v1/tmplt",
TERMS: "/cms-service/api/v1/trms",
LWPO_CODE: "/cms-service/api/v1/lwpo-cds",
UP_CODE: "/cms-service/api/v1/up-codes",
POPUPS: "/cms-service/api/v1/popups",
SCHEDULES: "/cms-service/api/v1/schdls",
SURVEY: "/cms-service/api/v1/srvy",
SURVEY_QUESTION: "/cms-service/api/v1/srvy-qitem",
SURVEY_ARTICLE: "/cms-service/api/v1/srvy-artcl",
ZIPS: "/cms-service/api/v1/zips",
GROUPS: "/cms-service/api/v1/groups",
GROUP_USERS: "/cms-service/api/v1/group-users",
MANAGER_IP: "/cms-service/api/v1/mgrip",
APILOG: "/cms-service/api/v1/api-logs",
SITE_AUTHORITY: "/cms-service/api/v1/site-authrt",
CONNECTION_LOG: "/cms-service/api/v1/cntnlog",
},
BOARD_SERVICE: {
BBS: "/board-service/api/v1/bbs",
BBS_TEMPLATES: "/board-service/api/v1/bbsTmplt",
POSTS: "/board-service/api/v1/posts",
POSTS_COMMENTS: "/board-service/api/v1/posts-cmnts",
POST_EVALUATION: "/board-service/api/v1/pstEvl",
},
ST_SERVICE: {
COMMON: "/st-management-service/api/v1/common",
INPUT: "/st-input-service/api/v1/input",
REVIEW: "/st-management-service/api/v1/review",
INPUTCOMMON: "/st-input-service/api/v1/common",
},
STATVERIFY_SERVICE: {
VRFCTGT_MNG: "/statverify-service/api/v1/vrfc-trgt-mng",
},
};
export const JWT_EXPIRATION_TIME = 1800000;
@@ -7,12 +7,10 @@ function StatisticsPageLayout({ children }: { children: React.ReactNode }) {
const pageTitle = tabs.find((t) => t.menuItem.menuEngNm === activeTabId);
const menuPaths = pageTitle?.path
?.split(">")
.map((path) => path.trim());
const menuPaths = pageTitle?.path?.split(">").map((path) => path.trim());
return (
<div className="h-auto min-h-full pb-2">
<div className="h-auto min-h-full bg-container pb-2">
<TabBar />
<PageTitle
title={pageTitle?.label ?? ""}
+9 -7
View File
@@ -10,7 +10,10 @@ const TabBar = () => {
return null;
}
const handleCloseTab = (e: React.MouseEvent | React.KeyboardEvent, tabId: string) => {
const handleCloseTab = (
e: React.MouseEvent | React.KeyboardEvent,
tabId: string,
) => {
e.stopPropagation();
removeTab(tabId);
};
@@ -22,22 +25,22 @@ const TabBar = () => {
className="w-full"
variant="outline"
>
<TabsList>
<TabsList className="w-full !justify-start !p-4 !pb-0">
{tabs.map((tab) => (
<TabsTrigger
key={tab.id}
value={tab.id}
className="!px-4 !flex !items-center !justify-start !gap-2 !w-[140px]"
className="!flex !w-[140px] !items-center !justify-start !gap-2 !px-4"
title={tab.label}
>
<span className="text-xl flex-1 leading-none truncate">
<span className="flex-1 truncate text-xl leading-none">
{tab.label}
</span>
<span
role="button"
onClick={(e) => handleCloseTab(e, tab.id)}
aria-label={`${tab.label} 탭 닫기`}
className="flex items-center justify-center flex-shrink-0 leading-none hover:text-[#2094fa]"
className="flex flex-shrink-0 items-center justify-center leading-none hover:text-[#2094fa]"
>
<i className="ri-close-line" />
</span>
@@ -46,7 +49,6 @@ const TabBar = () => {
</TabsList>
</Tabs>
);
}
};
export { TabBar };
@@ -20,7 +20,7 @@ type BannerImageProps = {
lnkgUrlAddr: string;
};
const BannerImage = ({ atflCd, bnrSn, lnkgUrlAddr }: BannerImageProps) => {
const BannerImage = ({ atflCd, lnkgUrlAddr }: BannerImageProps) => {
const { data: imageUrl, isLoading } = useQuery({
queryKey: [ENDPOINT.ATTACH_SERVICE.IMAGES, atflCd],
queryFn: () => getImageUrlByAtflCd(atflCd),
@@ -29,13 +29,13 @@ const BannerImage = ({ atflCd, bnrSn, lnkgUrlAddr }: BannerImageProps) => {
const handleClick = () => {
if (lnkgUrlAddr) {
window.open(lnkgUrlAddr, '_blank');
window.open(lnkgUrlAddr, "_blank");
}
};
if (isLoading) {
return (
<div className="relative flex h-24 items-center justify-center bg-accent mx-auto">
<div className="relative mx-auto flex h-24 items-center justify-center bg-accent">
<div className="text-sm text-muted-foreground">로딩 중...</div>
</div>
);
@@ -43,18 +43,22 @@ const BannerImage = ({ atflCd, bnrSn, lnkgUrlAddr }: BannerImageProps) => {
if (!imageUrl) {
return (
<div className="relative flex h-24 items-center justify-center bg-accent mx-auto">
<div className="relative mx-auto flex h-24 items-center justify-center bg-accent">
<div className="text-sm text-muted-foreground">이미지 없음</div>
</div>
);
}
return (
<div
className="relative flex h-24 items-center justify-center cursor-pointer hover:opacity-80 transition-opacity mx-auto"
<div
className="relative mx-auto flex h-24 cursor-pointer items-center justify-center transition-opacity hover:opacity-80"
onClick={handleClick}
>
<img src={imageUrl} className="object-contain w-full h-full" alt="배너 이미지" />
<img
src={imageUrl}
className="h-full w-full object-contain"
alt="배너 이미지"
/>
</div>
);
};
@@ -70,25 +74,33 @@ export function Footer() {
queryFn: () => getBannerList(siteId),
});
// MAIN 타입 배너만 필터링
const mainBanners = bannerList?.filter((banner) => banner.bnrTypeCd === "BNRFTER") ?? [];
// MAIN 타입 배너만 필터링
const mainBanners =
bannerList?.filter((banner) => banner.bnrTypeCd === "BNRFTER") ?? [];
const plugin = useRef(Autoplay({ delay: 2000, stopOnInteraction: true }));
return (
<footer className="flex flex-col sm:flex-row w-full shrink-0 items-start border-t border-solid border-border bg-background px-3 sm:px-6 pt-4 pb-1 text-foreground">
<div className="w-full sm:w-[55%] mb-4 sm:mb-0">
<h6 className="mb-2 sm:mb-4 text-lg sm:text-xl md:text-2xl font-bold">{siteInfo?.siteNm ?? ""}</h6>
<p className="my-1 text-sm sm:text-base md:text-xl opacity-60">{siteInfo?.siteAddr ?? ""}</p>
<p className="my-1 text-sm sm:text-base md:text-xl opacity-60">
<footer className="flex w-full shrink-0 flex-col items-start border-t border-solid border-border bg-background px-3 pb-1 pt-4 text-foreground sm:flex-row sm:px-6">
<div className="mb-4 w-full sm:mb-0 sm:w-[55%]">
<h6 className="mb-2 text-lg font-bold sm:mb-4 sm:text-xl md:text-2xl">
{siteInfo?.siteNm ?? ""}
</h6>
<p className="my-1 text-sm opacity-60 sm:text-base md:text-xl">
{siteInfo?.siteAddr ?? ""}
</p>
<p className="my-1 text-sm opacity-60 sm:text-base md:text-xl">
전화: {siteInfo?.telNo ?? ""} / 팩스: {siteInfo?.faxNumber ?? ""}
</p>
<p className="my-1 text-sm sm:text-base md:text-xl opacity-60">{siteInfo?.lwndCn ?? ""}</p>
<p className="my-1 text-sm opacity-60 sm:text-base md:text-xl">
{siteInfo?.lwndCn ?? ""}
</p>
</div>
<div className="flex w-full sm:w-[45%] flex-col">
<div className="flex flex-wrap justify-start sm:justify-end gap-2 sm:gap-4 mb-4 sm:mb-0">
<span className="text-sm sm:text-base md:text-xl">개인정보처리방침</span>
<div className="flex w-full flex-col sm:w-[45%]">
<div className="mb-4 flex flex-wrap justify-start gap-2 sm:mb-0 sm:justify-end sm:gap-4">
<span className="text-sm sm:text-base md:text-xl">
개인정보처리방침
</span>
<span className="text-sm sm:text-base md:text-xl">이용약관</span>
<span className="text-sm sm:text-base md:text-xl">사이트맵</span>
<span className="text-sm sm:text-base md:text-xl">고객센터</span>
@@ -97,29 +109,34 @@ export function Footer() {
<Carousel
plugins={[plugin.current]}
opts={{ loop: true }}
className="relative my-4 sm:my-8 h-20 sm:h-24"
className="relative my-4 h-20 sm:my-8 sm:h-24"
>
<CarouselContent>
{mainBanners && mainBanners.length > 0 ? (
mainBanners.map((banner) => (
<CarouselItem key={`banner-${banner.bnrSn}`} className="basis-1/2 sm:basis-1/3">
<BannerImage
atflCd={banner.atflCd}
bnrSn={banner.bnrSn}
<CarouselItem
key={`banner-${banner.bnrSn}`}
className="basis-1/2 sm:basis-1/3"
>
<BannerImage
atflCd={banner.atflCd}
bnrSn={banner.bnrSn}
lnkgUrlAddr={banner.lnkgUrlAddr}
/>
</CarouselItem>
))
) : (
<CarouselItem className="basis-1/2 sm:basis-1/3">
<div className="relative flex h-20 sm:h-24 w-full items-center justify-center bg-accent">
<div className="text-sm text-muted-foreground">배너가 없습니다</div>
<div className="relative flex h-20 w-full items-center justify-center bg-accent sm:h-24">
<div className="text-sm text-muted-foreground">
배너가 없습니다
</div>
</div>
</CarouselItem>
)}
</CarouselContent>
<CarouselPrevious className="absolute left-2 top-1/2 !bg-[rgba(255,255,255,0.8)] text-accent-foreground z-10" />
<CarouselNext className="absolute right-2 top-1/2 !bg-[rgba(255,255,255,0.8)] text-accent-foreground z-10" />
<CarouselPrevious className="absolute left-2 top-1/2 z-10 !bg-background text-accent-foreground" />
<CarouselNext className="absolute right-2 top-1/2 z-10 !bg-background text-accent-foreground" />
</Carousel>
</div>
</div>
@@ -1,27 +1,42 @@
@tailwind components;
@layer components {
/* 상단 메뉴 호버 시 하단 라인 - 기본 테마 */
.header-nav-link {
position: relative;
}
.header-nav-link::after {
content: '';
/* .header-nav-link::before {
content: "";
position: absolute;
bottom: -4px;
left: 0;
width: 0;
height: 2px;
background-color: #063A74;
background-color: #063a74;
transition: width 0.3s ease;
}
.header-nav-link:hover::after {
.header-nav-link:hover::before {
width: 100%;
} */
/* 네비게이션 아이템 사이 구분선 */
.header-nav-link::after {
content: "";
position: absolute;
left: -0.75rem;
top: 50%;
transform: translateY(-50%);
width: 1px !important;
height: 1.5rem !important;
background-color: var(--border);
}
.header-nav-link:first-child::after {
display: none;
}
[data-theme="blue"] {
header {
background: #00afe5;
@@ -35,7 +50,7 @@
color: #fff;
}
header button[role="button"].primary {
background-color: #008E8D !important;
background-color: #008e8d !important;
color: #fff !important;
}
nav a,
@@ -45,7 +60,7 @@
.header-nav-link:hover {
color: #fff !important;
}
.header-nav-link::after {
.header-nav-link::before {
background-color: #fff;
}
}
@@ -63,7 +78,7 @@
color: #fff;
}
header button[role="button"].primary {
background-color: #008E8D !important;
background-color: #008e8d !important;
color: #fff !important;
}
nav a,
@@ -73,9 +88,8 @@
.header-nav-link:hover {
color: #fff !important;
}
.header-nav-link::after {
.header-nav-link::before {
background-color: #fff;
}
}
}
@@ -21,6 +21,7 @@ import { SidebarTrigger } from "../sidebar";
import { Popover, PopoverContent, PopoverTrigger } from "../popover";
import { SearchForm } from "./search-form";
import { NoticePopover } from "./notice-popover";
import { ScrollArea, ScrollBar } from "../scroll-area";
const appConfig = getConfig();
const userId = getCookie(appConfig.AUTH_USER_ID ?? "");
@@ -71,7 +72,7 @@ export function Header({ viewOnly }: { viewOnly?: boolean }) {
method: "POST",
credentials: "include", // ⭐ 쿠키 포함 중요!
});
if (!response.ok) {
console.error("Logout API failed");
// API 실패해도 계속 진행
@@ -82,42 +83,42 @@ export function Header({ viewOnly }: { viewOnly?: boolean }) {
} finally {
// 2. 클라이언트 쿠키 삭제 (백업)
clearClientCookies();
// 3. 로컬/세션 스토리지 정리
if (typeof window !== "undefined") {
localStorage.clear();
sessionStorage.clear();
}
// 4. 로그인 페이지로 리다이렉트
window.location.href = "/auth/login";
}
};
// 쿠키 삭제 헬퍼 함수
const clearClientCookies = () => {
const actualHost = window.location.hostname;
// 루트 도메인 추출
const getRootDomain = (hostname: string): string => {
if (hostname === "localhost" || /^\d+\.\d+\.\d+\.\d+$/.test(hostname)) {
return hostname;
}
if (hostname.includes("hasuon.or.kr")) {
return ".hasuon.or.kr";
}
const parts = hostname.split(".");
if (parts.length >= 2) {
return `.${parts.slice(-2).join(".")}`;
}
return hostname;
};
const domain = getRootDomain(actualHost);
// 삭제할 쿠키 목록
const cookiesToDelete = [
appConfig.AUTH_USER_ID,
@@ -127,26 +128,26 @@ export function Header({ viewOnly }: { viewOnly?: boolean }) {
"site-id-key",
"site-theme-key",
].filter(Boolean); // undefined 제거
// 여러 방법으로 쿠키 삭제 시도
cookiesToDelete.forEach((cookieName) => {
if (!cookieName) return;
// 방법 1: removeCookie 함수 사용
if (domain === "localhost") {
removeCookie(cookieName, {});
} else {
removeCookie(cookieName, { domain });
}
// 방법 2: 직접 document.cookie 설정 (도메인 포함)
if (domain !== "localhost") {
document.cookie = `${cookieName}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; domain=${domain}`;
}
// 방법 3: 도메인 없이 삭제 (현재 도메인만)
document.cookie = `${cookieName}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`;
// 방법 4: Secure 속성 포함 삭제
if (window.location.protocol === "https:") {
if (domain !== "localhost") {
@@ -156,66 +157,7 @@ export function Header({ viewOnly }: { viewOnly?: boolean }) {
}
});
};
/*
const logout = async () => {
try {
const response = await fetch("/api/auth/logout", {
method: "POST",
});
if (!response.ok) throw new Error("Failed to logout");
const actualHost = window.location.hostname;
// 서브도메인 쿠키 삭제를 위한 루트 도메인 추출
const getRootDomain = (hostname: string): string => {
// localhost나 IP 주소인 경우
if (hostname === "localhost" || /^\d+\.\d+\.\d+\.\d+$/.test(hostname)) {
return hostname;
}
// hasuon.or.kr 도메인인 경우
if (hostname.includes("hasuon.or.kr")) {
return ".hasuon.or.kr";
}
// 일반적인 도메인의 경우 루트 도메인 추출 (예: sub.example.com → .example.com)
const parts = hostname.split(".");
if (parts.length >= 2) {
// 마지막 두 부분을 사용 (예: example.com)
return `.${parts.slice(-2).join(".")}`;
}
return hostname;
};
const domain = getRootDomain(actualHost);
const cookieOptions = domain.startsWith(".") || domain === "localhost"
? { domain }
: {};
// 쿠키 삭제 (서브도메인 포함)
if (appConfig.AUTH_USER_ID) {
removeCookie(appConfig.AUTH_USER_ID, cookieOptions);
}
if (appConfig.REFRESH_TOKEN) {
removeCookie(appConfig.REFRESH_TOKEN, cookieOptions);
}
if (appConfig.ACCESS_TOKEN) {
removeCookie(appConfig.ACCESS_TOKEN, cookieOptions);
}
if (appConfig.CLAIM_NAME) {
removeCookie(appConfig.CLAIM_NAME, cookieOptions);
}
removeCookie("site-id-key", cookieOptions);
removeCookie("site-theme-key", cookieOptions);
window.location.href = "/auth/login";
} catch (error) {
console.error(error);
}
};
*/
const openPopup = useCallback(async (popup: Popup) => {
try {
const cookieName = `cs-popup-hide-for-day-${popup.popupSn}`;
@@ -268,8 +210,8 @@ export function Header({ viewOnly }: { viewOnly?: boolean }) {
}, []);
return (
<header className="sticky top-0 z-30 box-border flex flex-col sm:flex-row h-[6rem] w-full items-center justify-between border-b border-solid border-border bg-background">
<div className="flex items-center px-2 sm:px-4 md:px-6 w-full sm:w-auto justify-between sm:justify-start">
<header className="sticky top-0 z-30 box-border flex h-[6rem] w-full flex-col items-center justify-between border-b border-solid border-border bg-background sm:flex-row">
<div className="flex w-full items-center justify-between px-2 sm:w-auto sm:justify-start sm:px-4 md:px-6">
<div className="flex items-center gap-2 sm:gap-4">
<SidebarTrigger className="size-12 !bg-transparent p-2 hover:!bg-accent [&>svg]:!size-full [&>svg]:text-foreground" />
<h1 className="flex flex-col items-center gap-2">
@@ -291,7 +233,10 @@ export function Header({ viewOnly }: { viewOnly?: boolean }) {
<span
className="text-[1.2rem] font-semibold text-foreground"
style={{
letterSpacing: logoWidth > 0 ? `${(logoWidth - 120) / (siteInfo?.siteNm?.length || 1)}px` : '0.05em'
letterSpacing:
logoWidth > 0
? `${(logoWidth - 120) / (siteInfo?.siteNm?.length || 1)}px`
: "0.05em",
}}
>
{siteInfo?.siteNm}
@@ -306,7 +251,9 @@ export function Header({ viewOnly }: { viewOnly?: boolean }) {
onClick={() => setIsMobileMenuOpen(!isMobileMenuOpen)}
className="m-0 flex h-[3rem] items-center !bg-background px-3 py-0 text-label"
>
<i className={`diveicon ${isMobileMenuOpen ? 'di-menu-close-fill' : 'di-menu-open-fill'} static text-4xl`} />
<i
className={`diveicon ${isMobileMenuOpen ? "di-menu-close-fill" : "di-menu-open-fill"} static text-4xl`}
/>
</Button>
)}
{mounted && isLoggedIn && (
@@ -314,7 +261,9 @@ export function Header({ viewOnly }: { viewOnly?: boolean }) {
<PopoverTrigger asChild>
<Button className="group m-0 flex h-[3rem] items-center !bg-background px-2 py-0 text-label">
<i className="diveicon di-account-circle static translate-y-0.5 pr-2 text-3xl" />
<span className="text-xs hidden xs:inline">{userInfo?.userName}</span>
<span className="xs:inline hidden text-xs">
{userInfo?.userName}
</span>
<i className="diveicon di-chevron-down static p-0 transition-transform group-data-[state=open]:rotate-180" />
</Button>
</PopoverTrigger>
@@ -337,57 +286,60 @@ export function Header({ viewOnly }: { viewOnly?: boolean }) {
</div>
{/* 모바일에서 네비게이션 (토글 시 표시) */}
{isMobileMenuOpen && (
<div className="w-full sm:hidden border-t border-border bg-background py-2">
{mounted && userSiteList?.content && userSiteList.content.length > 0 && (
<nav className="flex flex-col items-center gap-2 px-4">
<div className="w-full border-t border-border bg-background py-2 sm:hidden">
{mounted &&
userSiteList?.content &&
userSiteList.content.length > 0 && (
<nav className="flex flex-col items-center gap-2 px-4">
{userSiteList.content.map((site) => (
<a
key={site.siteId}
href={site.dmnAddr}
className="w-full py-2 text-center text-xl font-medium text-foreground transition-colors hover:text-primary"
target="_blank"
rel="noopener noreferrer"
onClick={() => setIsMobileMenuOpen(false)}
>
{site.siteNm}
</a>
))}
</nav>
)}
</div>
)}
{/* 데스크톱에서 중간 네비게이션 */}
<ScrollArea className="hidden max-w-[calc(100vw-60rem)] flex-1 items-center justify-center px-2 py-4 sm:flex">
{mounted &&
userSiteList?.content &&
userSiteList.content.length > 0 && (
<nav className="flex w-full flex-nowrap items-center justify-start gap-3 overflow-x-auto whitespace-nowrap md:gap-6">
{userSiteList.content.map((site) => (
<a
key={site.siteId}
href={site.dmnAddr}
className="text-xl font-medium text-foreground hover:text-primary transition-colors w-full text-center py-2"
className="header-nav-link whitespace-nowrap text-sm font-medium text-foreground transition-colors hover:text-primary md:text-lg lg:text-2xl"
target="_blank"
rel="noopener noreferrer"
onClick={() => setIsMobileMenuOpen(false)}
>
{site.siteNm}
</a>
))}
</nav>
)}
</div>
)}
{/* 데스크톱에서 중간 네비게이션 */}
<div className="hidden sm:flex items-center flex-1 justify-center px-2">
{mounted && userSiteList?.content && userSiteList.content.length > 0 && (
<nav className="flex items-center gap-3 md:gap-6 flex-wrap justify-center">
{userSiteList.content.map((site, index) => (
<div key={site.siteId} className="flex items-center">
<a
href={site.dmnAddr}
className="text-sm md:text-lg lg:text-2xl font-medium text-foreground hover:text-primary transition-colors header-nav-link"
target="_blank"
rel="noopener noreferrer"
>
{site.siteNm}
</a>
{index < userSiteList.content.length - 1 && (
<div className="w-px h-4 md:h-6 bg-border ml-3 md:ml-6"></div>
)}
</div>
))}
</nav>
)}
</div>
<ScrollBar orientation="horizontal" />
</ScrollArea>
{/* 데스크톱에서 오른쪽 요소들 */}
<div className="hidden sm:flex items-center gap-2 px-2 md:px-4">
<div className="hidden items-center gap-2 px-2 sm:flex md:px-4">
<SearchForm />
{mounted ? (
isLoggedIn && (
<Popover>
<PopoverTrigger asChild>
<Button className="group m-0 flex h-[3rem] items-center !bg-background px-2 md:px-4 py-0 text-label">
<i className="diveicon di-account-circle static translate-y-0.5 pr-1 md:pr-2 text-2xl md:text-3xl" />
<span className="text-sm md:text-base hidden md:inline">{userInfo?.userName}</span>
<Button className="group m-0 flex h-[3rem] items-center !bg-background px-2 py-0 text-label md:px-4">
<i className="diveicon di-account-circle static translate-y-0.5 pr-1 text-2xl md:pr-2 md:text-3xl" />
<span className="hidden text-sm md:inline md:text-base">
{userInfo?.userName}
</span>
<i className="diveicon di-chevron-down static p-0 transition-transform group-data-[state=open]:rotate-180" />
</Button>
</PopoverTrigger>