st: 기본 셋팅
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
const Dashboard = () => {
|
||||
return (
|
||||
<div>
|
||||
Dashboard
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Dashboard;
|
||||
@@ -0,0 +1,16 @@
|
||||
import { Button } from "@common/components";
|
||||
|
||||
interface ApproveButtonProps {
|
||||
approveFunc: () => void;
|
||||
}
|
||||
|
||||
const ApproveButton = ({ approveFunc }: ApproveButtonProps) => {
|
||||
return (
|
||||
<Button color="emerald" className="px-6" onClick={approveFunc}>
|
||||
<i className="diveicon di-check-circle translate-y-[1px]" />
|
||||
<span className="translate-y-[-1px]">승인</span>
|
||||
</Button>
|
||||
);
|
||||
};
|
||||
|
||||
export default ApproveButton;
|
||||
@@ -0,0 +1,16 @@
|
||||
import { Button } from "@common/components";
|
||||
|
||||
interface RejectButtonProps {
|
||||
rejectFunc: () => void;
|
||||
}
|
||||
|
||||
const RejectButton = ({ rejectFunc }: RejectButtonProps) => {
|
||||
return (
|
||||
<Button color="red" className="px-6" onClick={rejectFunc}>
|
||||
<i className="diveicon di-exclamation-circle translate-y-[1px]" />
|
||||
<span className="translate-y-[-1px]">보완 요청</span>
|
||||
</Button>
|
||||
);
|
||||
};
|
||||
|
||||
export default RejectButton;
|
||||
@@ -0,0 +1,105 @@
|
||||
/* RealGrid2 폰트 설정 - 루트 폰트와 일치 */
|
||||
.rg-root,
|
||||
.rg-grid,
|
||||
.rg-body,
|
||||
.rg-cell,
|
||||
.rg-header,
|
||||
.rg-head,
|
||||
.rg-rowbarcontainer {
|
||||
font-family: "Noto Sans KR", sans-serif !important;
|
||||
font-size: 12px !important;
|
||||
font-weight: 500;
|
||||
color: #333 !important;
|
||||
}
|
||||
|
||||
/* RealGrid2 컨테이너 스타일 */
|
||||
.rg-root {
|
||||
border-radius: 0.5rem !important;
|
||||
overflow: hidden !important;
|
||||
border: 1px solid #dbe2e6 !important;
|
||||
}
|
||||
|
||||
.rg-grid {
|
||||
border-radius: 0.5rem !important;
|
||||
/* box-shadow: 0 0 10px -1px rgba(0, 0, 0, 0.06); */
|
||||
}
|
||||
|
||||
/* 헤더 스타일 */
|
||||
.rg-header,
|
||||
.rg-head,
|
||||
.rg-foot,
|
||||
.rg-footer,
|
||||
.rg-fixed-footer {
|
||||
background-color: #f5f7fa !important;
|
||||
color: #333 !important;
|
||||
}
|
||||
|
||||
/* 헤더 셀 스타일 */
|
||||
.rg-header .rg-cell,
|
||||
.rg-head .rg-cell {
|
||||
background-color: #f5f7fa !important;
|
||||
}
|
||||
|
||||
/* 헤더 필터링 영역 위치 조정 - 오른쪽 여백 추가 */
|
||||
.rg-header-filtering {
|
||||
left: auto !important;
|
||||
right: 8px !important;
|
||||
}
|
||||
|
||||
/* 그룹 헤더 스타일 */
|
||||
.rg-header-group,
|
||||
.rg-header-group-cell {
|
||||
background-color: #f5f7fa !important;
|
||||
}
|
||||
|
||||
/* 첫 번째 헤더 셀 - 왼쪽 상단 모서리 */
|
||||
.rg-header .rg-cell:first-child,
|
||||
.rg-head .rg-cell:first-child {
|
||||
border-top-left-radius: 8px !important;
|
||||
}
|
||||
|
||||
/* 마지막 헤더 셀 - 오른쪽 상단 모서리 */
|
||||
.rg-header .rg-cell:last-child,
|
||||
.rg-head .rg-cell:last-child {
|
||||
border-top-right-radius: 8px !important;
|
||||
}
|
||||
|
||||
/* border color 통일 */
|
||||
.rg-header .rg-table tr td,
|
||||
.rg-head .rg-table tr td:not(:first-child),
|
||||
.rg-body .rg-table tr td,
|
||||
.rg-rowbarcontainer .rg-table tr td:not(:first-child) {
|
||||
border-left: 1px solid #dbe2e6 !important;
|
||||
border-bottom: 1px solid #dbe2e6 !important;
|
||||
border-right: none !important;
|
||||
}
|
||||
.rg-rowindicator-head,
|
||||
.rg-rowbarcontainer .rg-table tr td:first-child {
|
||||
border-right: none !important;
|
||||
border-bottom: 1px solid #dbe2e6 !important;
|
||||
border-left: none !important;
|
||||
}
|
||||
.rg-footer .rg-table tr td,
|
||||
.rg-fixed-footer .rg-table tr td,
|
||||
.rg-foot .rg-table tr td {
|
||||
border-right: 1px solid #dbe2e6 !important;
|
||||
border-top: 1px solid #dbe2e6 !important;
|
||||
}
|
||||
|
||||
.rg-rowbarcontainer .rg-table tr td {
|
||||
background-color: #f5f7fa !important;
|
||||
}
|
||||
|
||||
/* 푸터 마지막 요소 - 오른쪽 border 제거 */
|
||||
.rg-footer .rg-table tr td:last-child {
|
||||
border-right: none !important;
|
||||
}
|
||||
|
||||
/* 고정 컬럼 바 */
|
||||
.rg-fixed-column-bar {
|
||||
background-color: #ccc !important;
|
||||
border-right: 1px solid #ccc !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,245 @@
|
||||
import { useRef, useEffect, useState } from "react"
|
||||
|
||||
import RealGrid, { GridFitStyle, type DisplayOptions } from "realgrid"
|
||||
import { RealGridReact, RGDataColumn } from "realgrid-react"
|
||||
import type { DataGridProps } from "../type/DataGrid.type"
|
||||
import JSZip from "jszip"
|
||||
import * as XLSX from "xlsx"
|
||||
import { useAlertStore } from "@/shared/lib";
|
||||
|
||||
import { Button } from "@common/components";
|
||||
import { useTabStore } from "@/store/tab-store"
|
||||
|
||||
// Window 인터페이스 확장
|
||||
declare global {
|
||||
interface Window {
|
||||
JSZip: typeof JSZip;
|
||||
}
|
||||
}
|
||||
|
||||
// RealGrid가 jszip을 사용할 수 있도록 전역에 등록
|
||||
if (typeof window !== "undefined") {
|
||||
window.JSZip = JSZip;
|
||||
}
|
||||
|
||||
RealGrid.setLicenseKey('upVcPE+wPOmtLjqyBIh9RkM/nBOseBrflwxYpzGZyYm9cY8amGDkiPSoO0A3bI0LS1+jeXPBr4vmDWGWN+mYwx6C1EI62/mceibHCCl3OrbDYCIvknJkCQqgn3X6yKqZI9h9wRtIvbtWMBMOPHCENQuxnxtVqI2reHIsW5fXYGA=');
|
||||
|
||||
const DataGrid = ({ columnInfo, rows = [], rowStartNum, isExcelImport = true, fixedColumns }: DataGridProps) => {
|
||||
const { columns, columnLayout } = columnInfo;
|
||||
const gridRef = useRef<RealGridReact>(null);
|
||||
const fileInputRef = useRef<HTMLInputElement>(null);
|
||||
const { setMessage: alert } = useAlertStore((state) => state);
|
||||
const activeTabId = useTabStore((state) => state.activeTabId);
|
||||
const menuList = useTabStore((state) => state.menuList);
|
||||
|
||||
const [rowData, setRowData] = useState<Record<string, string>[]>([]);
|
||||
|
||||
const exportExcel = () => {
|
||||
if (rowData.length === 0) {
|
||||
alert('데이터가 없습니다.');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!gridRef.current?.gridView) return;
|
||||
|
||||
const gridView = gridRef.current.gridView;
|
||||
|
||||
const menuName = menuList
|
||||
?.flatMap((m) => m.children || [])
|
||||
.flatMap((subM) => subM || [])
|
||||
.find((s) => s.menuEngNm === activeTabId)
|
||||
?.menuKornNm || 'export';
|
||||
|
||||
gridView.exportGrid({
|
||||
type: 'excel',
|
||||
target: 'local',
|
||||
fileName: `${menuName}.xlsx`,
|
||||
footer: 'hidden',
|
||||
done: () => {
|
||||
alert('내보내기가 완료되었습니다.');
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const importExcel = () => {
|
||||
fileInputRef.current?.click();
|
||||
};
|
||||
|
||||
const handleFileChange = async (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
const file = e.target.files?.[0];
|
||||
if (!file) return;
|
||||
|
||||
try {
|
||||
const reader = new FileReader();
|
||||
reader.onload = (event) => {
|
||||
try {
|
||||
const data = event.target?.result;
|
||||
if (!data) {
|
||||
alert('파일을 읽을 수 없습니다.');
|
||||
return;
|
||||
}
|
||||
|
||||
// SheetJS로 엑셀 파일을 JSON으로 변환
|
||||
const workbook = XLSX.read(data, { type: 'array', cellDates: true });
|
||||
const firstSheetName = workbook.SheetNames[0];
|
||||
const worksheet = workbook.Sheets[firstSheetName || ''];
|
||||
|
||||
if (!worksheet || !worksheet['!ref']) {
|
||||
alert('워크시트를 읽을 수 없습니다.');
|
||||
return;
|
||||
}
|
||||
|
||||
const range = XLSX.utils.decode_range(worksheet['!ref']);
|
||||
const headerRowCount = rowStartNum || 1; // 기본값 1
|
||||
const headerStartRow = Math.max(0, headerRowCount - 1); // 0-based index
|
||||
|
||||
// 각 컬럼별로 헤더 찾기 (rowStartNum 행부터 위로 올라가면서)
|
||||
const headers: string[] = [];
|
||||
const headerRowIndexes: number[] = [];
|
||||
|
||||
for (let col = range.s.c; col <= range.e.c; col++) {
|
||||
let headerValue = '';
|
||||
let headerRowIndex = headerStartRow;
|
||||
|
||||
// rowStartNum 행부터 시작해서 위로 올라가면서 헤더 찾기
|
||||
for (let rowIndex = headerStartRow; rowIndex >= 0; rowIndex--) {
|
||||
const cell = worksheet[XLSX.utils.encode_cell({ r: rowIndex, c: col })];
|
||||
if (cell && cell.v !== undefined && cell.v !== null && cell.v !== '') {
|
||||
headerValue = String(cell.v);
|
||||
headerRowIndex = rowIndex;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 헤더를 찾지 못한 경우 기본값 사용
|
||||
if (!headerValue) {
|
||||
headerValue = `Column${col + 1}`;
|
||||
headerRowIndex = headerStartRow;
|
||||
}
|
||||
|
||||
headers.push(headerValue);
|
||||
headerRowIndexes.push(headerRowIndex);
|
||||
}
|
||||
|
||||
// 실제 데이터가 시작하는 행 찾기 (헤더가 있는 최대 행 번호 + 1)
|
||||
const maxHeaderRowIndex = headerRowIndexes.length > 0 ? Math.max(...headerRowIndexes) : headerStartRow;
|
||||
const dataStartRow = maxHeaderRowIndex + 1;
|
||||
|
||||
// 데이터 행 읽기
|
||||
const dataRows: Record<string, string>[] = [];
|
||||
for (let row = dataStartRow; row <= range.e.r; row++) {
|
||||
const rowData: Record<string, string> = {};
|
||||
let hasData = false;
|
||||
|
||||
for (let colIndex = 0; colIndex < headers.length; colIndex++) {
|
||||
const col = range.s.c + colIndex;
|
||||
const cell = worksheet[XLSX.utils.encode_cell({ r: row, c: col })];
|
||||
const headerName = headers[colIndex] || `Column${colIndex + 1}`;
|
||||
const cellValue = cell && cell.v !== undefined && cell.v !== null
|
||||
? String(cell.v)
|
||||
: '';
|
||||
|
||||
if (cellValue !== '') {
|
||||
hasData = true;
|
||||
}
|
||||
|
||||
rowData[headerName] = cellValue;
|
||||
}
|
||||
|
||||
// 데이터가 하나라도 있는 행만 추가
|
||||
if (hasData) {
|
||||
dataRows.push(rowData);
|
||||
}
|
||||
}
|
||||
|
||||
setRowData(dataRows);
|
||||
} catch (error) {
|
||||
console.error('엑셀 파일 파싱 오류:', error);
|
||||
alert('엑셀 파일 파싱 중 오류가 발생했습니다.');
|
||||
} finally {
|
||||
if (fileInputRef.current) {
|
||||
fileInputRef.current.value = '';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
reader.onerror = () => {
|
||||
alert('파일 읽기 중 오류가 발생했습니다.');
|
||||
if (fileInputRef.current) {
|
||||
fileInputRef.current.value = '';
|
||||
}
|
||||
};
|
||||
|
||||
reader.readAsArrayBuffer(file);
|
||||
} catch (error) {
|
||||
console.error('엑셀 파일 가져오기 오류:', error);
|
||||
alert('엑셀 파일 가져오기 중 오류가 발생했습니다.');
|
||||
if (fileInputRef.current) {
|
||||
fileInputRef.current.value = '';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (!gridRef.current?.gridView) return;
|
||||
|
||||
const gridView = gridRef.current.gridView;
|
||||
|
||||
(gridView.displayOptions as DisplayOptions).fitStyle = GridFitStyle.EVEN;
|
||||
gridView.header.height = 60;
|
||||
if (rows.length > 0) {
|
||||
setRowData(rows);
|
||||
}
|
||||
|
||||
// 고정 컬럼 설정
|
||||
if (fixedColumns !== undefined && fixedColumns > 0) {
|
||||
gridView.setFixedOptions({
|
||||
colCount: fixedColumns,
|
||||
});
|
||||
}
|
||||
}, [rows, columns, columnLayout, fixedColumns]);
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-[0.6rem] mx-[0.6rem]">
|
||||
<input
|
||||
ref={fileInputRef}
|
||||
type="file"
|
||||
accept=".xlsx,.xls,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
|
||||
style={{ display: 'none' }}
|
||||
onChange={handleFileChange}
|
||||
/>
|
||||
<div className="flex justify-end items-center gap-[0.6rem]">
|
||||
{isExcelImport &&
|
||||
<Button className="h-[3.2rem] px-6 bg-gradient-green hover:bg-gradient-green-hover" type="button" onClick={importExcel}>
|
||||
<i className="diveicon di-file-excel translate-y-[1px]" />
|
||||
<span className="translate-y-[-1px]">가져오기</span>
|
||||
</Button>
|
||||
}
|
||||
<Button className="h-[3.2rem] px-6 bg-gradient-green hover:bg-gradient-green-hover" type="button" onClick={exportExcel}>
|
||||
<i className="diveicon di-file-excel translate-y-[1px]" />
|
||||
<span className="translate-y-[-1px]">내보내기</span>
|
||||
</Button>
|
||||
</div>
|
||||
<div className="h-[65vh]">
|
||||
<RealGridReact
|
||||
ref={gridRef}
|
||||
autoGenerateField={true}
|
||||
layout={columnLayout}
|
||||
rows={rowData}
|
||||
>
|
||||
{columns.map((column) => (
|
||||
<RGDataColumn
|
||||
key={column.name}
|
||||
name={column.name}
|
||||
fieldName={column.fieldName}
|
||||
header={column.header}
|
||||
// autoFilter={true}
|
||||
/>
|
||||
))}
|
||||
</RealGridReact>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default DataGrid;
|
||||
@@ -0,0 +1,218 @@
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import useSWR from 'swr';
|
||||
|
||||
import {
|
||||
Button,
|
||||
Input,
|
||||
Label,
|
||||
Select,
|
||||
SelectTrigger,
|
||||
SelectContent,
|
||||
SelectItem,
|
||||
SelectValue
|
||||
}
|
||||
from "@common/components";
|
||||
|
||||
import { useAlertStore } from "@/shared/lib";
|
||||
import { type SearchFormProps, type SearchFormValues, defaultSearchFormProps } from "../type/SearchForm.type";
|
||||
import { statisticsAPi } from "@/entities/statistics/api/statistics-service";
|
||||
import type { ApiResponse, Sido, Sgg } from "@/entities/statistics/model/statistics-interface";
|
||||
|
||||
const getSidoListFetcher = async (): Promise<ApiResponse<Sido[]>> => {
|
||||
return statisticsAPi.getSidoList();
|
||||
};
|
||||
|
||||
const getSggListFetcher = async ([_key, sidoName]: [string, string]): Promise<ApiResponse<Sgg[]>> => {
|
||||
return statisticsAPi.getSggList(sidoName);
|
||||
};
|
||||
|
||||
const SearchForm = (props: SearchFormProps = {}) => {
|
||||
const { setMessage: alert } = useAlertStore((state) => state);
|
||||
const mergedProps = { ...defaultSearchFormProps, ...props };
|
||||
const [values, setValues] = useState<SearchFormValues>({
|
||||
sido: props.defaultValues?.sido || "",
|
||||
sgg: props.defaultValues?.sgg || "",
|
||||
year: props.defaultValues?.year || "",
|
||||
order: props.defaultValues?.order || "",
|
||||
fctName: props.defaultValues?.fctName || "",
|
||||
});
|
||||
|
||||
const { data: sidoList } = useSWR<ApiResponse<Sido[]>>(
|
||||
"sido-list",
|
||||
getSidoListFetcher,
|
||||
{
|
||||
revalidateOnFocus: false,
|
||||
revalidateOnReconnect: false,
|
||||
revalidateIfStale: false,
|
||||
dedupingInterval: 2000,
|
||||
shouldRetryOnError: false,
|
||||
onSuccess: (data) => {
|
||||
if (data.status !== 'success') {
|
||||
alert(`시도 목록을 불러오는데 실패했습니다.
|
||||
새로고침 후 다시 시도해주세요.`);
|
||||
}
|
||||
},
|
||||
onError: () => {
|
||||
alert(`시도 목록을 불러오는데 실패했습니다.
|
||||
새로고침 후 다시 시도해주세요.`);
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
const { data: sggList } = useSWR<ApiResponse<Sgg[]>>(
|
||||
values.sido && values.sido !== "ALL" ? ["sgg-list", values.sido] : null,
|
||||
getSggListFetcher,
|
||||
{
|
||||
revalidateOnFocus: false,
|
||||
revalidateOnReconnect: false,
|
||||
revalidateIfStale: false,
|
||||
dedupingInterval: 2000,
|
||||
shouldRetryOnError: false,
|
||||
onSuccess: (data) => {
|
||||
if (data.status !== 'success') {
|
||||
alert(`시군구 목록을 불러오는데 실패했습니다.
|
||||
새로고침 후 다시 시도해주세요.`);
|
||||
}
|
||||
},
|
||||
onError: () => {
|
||||
alert(`시군구 목록을 불러오는데 실패했습니다.
|
||||
새로고침 후 다시 시도해주세요.`);
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
|
||||
e.preventDefault();
|
||||
props.onSubmit?.(values);
|
||||
};
|
||||
|
||||
const handleReset = () => {
|
||||
const resetValues: SearchFormValues = {
|
||||
sido: "",
|
||||
sgg: "",
|
||||
year: "",
|
||||
order: "",
|
||||
fctName: "",
|
||||
};
|
||||
setValues(resetValues);
|
||||
props.onReset?.();
|
||||
props.onSubmit?.(resetValues);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="card card-border">
|
||||
<form onSubmit={handleSubmit}>
|
||||
<div className="flex items-center gap-8 p-2">
|
||||
{mergedProps.sido &&
|
||||
<div className="flex items-center gap-2">
|
||||
<Label className="text-label">
|
||||
시도
|
||||
</Label>
|
||||
<Select value={values.sido} onValueChange={(value) => setValues((prev) => ({ ...prev, sido: value, sgg: 'ALL' }))}>
|
||||
<SelectTrigger className="w-[12rem]">
|
||||
<SelectValue placeholder="전체"></SelectValue>
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="ALL">전체</SelectItem>
|
||||
{sidoList?.data?.map((sido) => (
|
||||
<SelectItem key={sido.adstDstrCd} value={sido.sido}>
|
||||
{sido.sido}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
}
|
||||
{mergedProps.sgg &&
|
||||
<div className="flex items-center gap-2">
|
||||
<Label className="text-label">
|
||||
시군구
|
||||
</Label>
|
||||
<Select value={values.sgg} onValueChange={(value) => setValues({ ...values, sgg: value })}>
|
||||
<SelectTrigger className="w-[12rem]">
|
||||
<SelectValue placeholder="전체"></SelectValue>
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="ALL">전체</SelectItem>
|
||||
{sggList?.data?.map((sgg) => (
|
||||
<SelectItem key={sgg.adstDstrCd} value={sgg.gugun}>
|
||||
{sgg.gugun}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
}
|
||||
{mergedProps.year &&
|
||||
<div className="flex items-center gap-2">
|
||||
<Label className="text-label">
|
||||
년도
|
||||
</Label>
|
||||
<Select value={values.year} onValueChange={(value) => setValues({ ...values, year: value })}>
|
||||
<SelectTrigger className="w-[10rem]">
|
||||
<SelectValue placeholder="전체"></SelectValue>
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="ALL">전체</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
}
|
||||
{mergedProps.order &&
|
||||
<div className="flex items-center gap-2">
|
||||
<Label className="text-label">
|
||||
차수
|
||||
</Label>
|
||||
<Select value={values.order} onValueChange={(value) => setValues({ ...values, order: value })}>
|
||||
<SelectTrigger className="w-[10rem]">
|
||||
<SelectValue placeholder="전체"></SelectValue>
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="ALL">전체</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
}
|
||||
<div className="flex items-center gap-2 ml-auto">
|
||||
<Button color="green" className="h-[3.2rem]" type="button" onClick={handleReset}>
|
||||
초기화
|
||||
</Button>
|
||||
<Button className="h-[3.2rem]" type="submit">
|
||||
조회
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
{(mergedProps.fctName || mergedProps.userMenual) &&
|
||||
<div className="flex items-center p-2">
|
||||
{mergedProps.fctName &&
|
||||
<div className="flex items-center gap-2">
|
||||
<Label htmlFor="liSnSearchInput" className="mr-2 text-label">
|
||||
시설명
|
||||
</Label>
|
||||
<Input
|
||||
className="h-[3.2rem] w-[14rem] rounded-sm !text-[1.3rem] mr-4"
|
||||
id="liSnSearchInput"
|
||||
value={values.fctName}
|
||||
onChange={(e) => setValues({ ...values, fctName: e.target.value })}
|
||||
autoComplete="off"
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
{mergedProps.userMenual &&
|
||||
<div className="flex items-center gap-2 ml-auto">
|
||||
<Button className="h-[3.2rem]" type="button">
|
||||
<i className="diveicon di-person-fill" />
|
||||
사용자 메뉴얼
|
||||
</Button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</form>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default SearchForm;
|
||||
@@ -0,0 +1,11 @@
|
||||
import SearchForm from "@/components/module/SearchForm";
|
||||
|
||||
const ExcretaTreatmentFacilityMng = () => {
|
||||
return (
|
||||
<>
|
||||
<SearchForm userMenual={true} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default ExcretaTreatmentFacilityMng;
|
||||
@@ -0,0 +1,11 @@
|
||||
import SearchForm from "@/components/module/SearchForm";
|
||||
|
||||
const PrivateSewageFacilityMng = () => {
|
||||
return (
|
||||
<>
|
||||
<SearchForm userMenual={true} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default PrivateSewageFacilityMng;
|
||||
@@ -0,0 +1,11 @@
|
||||
import SearchForm from "@/components/module/SearchForm";
|
||||
|
||||
const PublicSewageFacilityMng = () => {
|
||||
return (
|
||||
<>
|
||||
<SearchForm userMenual={true} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default PublicSewageFacilityMng;
|
||||
@@ -0,0 +1,11 @@
|
||||
import SearchForm from "@/components/module/SearchForm";
|
||||
|
||||
const PumpingStationMng = () => {
|
||||
return (
|
||||
<>
|
||||
<SearchForm userMenual={true} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default PumpingStationMng;
|
||||
@@ -0,0 +1,11 @@
|
||||
import SearchForm from "@/components/module/SearchForm";
|
||||
|
||||
const SewageExcretaRelatedMng = () => {
|
||||
return (
|
||||
<>
|
||||
<SearchForm userMenual={true} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default SewageExcretaRelatedMng;
|
||||
@@ -0,0 +1,11 @@
|
||||
import SearchForm from "@/components/module/SearchForm";
|
||||
|
||||
const SewageExcretaSlurgeMng = () => {
|
||||
return (
|
||||
<>
|
||||
<SearchForm userMenual={true} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default SewageExcretaSlurgeMng;
|
||||
@@ -0,0 +1,11 @@
|
||||
import SearchForm from "@/components/module/SearchForm";
|
||||
|
||||
const SewagePipeMaintainMng = () => {
|
||||
return (
|
||||
<>
|
||||
<SearchForm userMenual={true} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default SewagePipeMaintainMng;
|
||||
@@ -0,0 +1,11 @@
|
||||
import SearchForm from "@/components/module/SearchForm";
|
||||
|
||||
const SewagePipeMng = () => {
|
||||
return (
|
||||
<>
|
||||
<SearchForm userMenual={true} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default SewagePipeMng;
|
||||
@@ -0,0 +1,11 @@
|
||||
import SearchForm from "@/components/module/SearchForm";
|
||||
|
||||
const SewageReservoirPumpMng = () => {
|
||||
return (
|
||||
<>
|
||||
<SearchForm userMenual={true} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default SewageReservoirPumpMng;
|
||||
@@ -0,0 +1,11 @@
|
||||
import SearchForm from "@/components/module/SearchForm";
|
||||
|
||||
const SewerageFinanceMng = () => {
|
||||
return (
|
||||
<>
|
||||
<SearchForm userMenual={true} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default SewerageFinanceMng;
|
||||
@@ -0,0 +1,109 @@
|
||||
import SearchForm from "@/components/module/SearchForm";
|
||||
import DataGrid from "@/components/module/DataGrid";
|
||||
|
||||
const SeweragePenetrationRate = () => {
|
||||
const columns = [
|
||||
{ name: 'sido', fieldName: '시도', header: { text: '시도' } },
|
||||
{ name: 'sgg', fieldName: '구군', header: { text: '구군' } },
|
||||
{ name: 'rvbsn', fieldName: '수계', header: { text: '수계' } },
|
||||
{ name: 'bstrm', fieldName: '지류', header: { text: '지류' } },
|
||||
{ name: 'mdbsn', fieldName: '세부단위유역', header: { text: '세부단위유역' } },
|
||||
{ name: 'lgbsn', fieldName: '중권역', header: { text: '중권역' } },
|
||||
{ name: 'mdmbsn', fieldName: '소권역', header: { text: '소권역' } },
|
||||
{ name: 'specl_cntrpln_ar', fieldName: '특별대책지역', header: { text: '특별대책지역' } },
|
||||
{ name: 'total_popl', fieldName: '총인구', header: { text: '총인구' } },
|
||||
{ name: 'popl_sm', fieldName: '내국인', header: { text: '내국인' } },
|
||||
{ name: 'frgnr_popl_sm', fieldName: '외국인', header: { text: '외국인' } },
|
||||
{ name: 'area', fieldName: '행정참고자료면적(㎢)', header: { text: '행정참고자료면적(㎢)' } },
|
||||
{ name: 'popltn_sm', fieldName: '총인구(명)', header: { text: '총인구(명)' } },
|
||||
{ name: 'ar_sm', fieldName: '총면적(㎢)', header: { text: '총면적(㎢)' } },
|
||||
{ name: 'swge_proc_zone_inner_sm', fieldName: '합계', header: { text: '합계' } },
|
||||
{ name: 'pblswrg_popltn_sm', fieldName: '소계', header: { text: '소계' } },
|
||||
{ name: 'pblswrg_prm_trt', fieldName: '물리적처리', header: { text: '물리적처리' } },
|
||||
{ name: 'pblswrg_scd_trt', fieldName: '생물학적처리', header: { text: '생물학적처리' } },
|
||||
{ name: 'pblswrg_tert_trt', fieldName: '고도처리', header: { text: '고도처리' } },
|
||||
{ name: 'wstr_popltn_sm', fieldName: '소계', header: { text: '소계' } },
|
||||
{ name: 'wstr_prm_trt', fieldName: '물리적처리', header: { text: '물리적처리' } },
|
||||
{ name: 'wstr_scd_trt', fieldName: '생물학적처리', header: { text: '생물학적처리' } },
|
||||
{ name: 'wstr_tert_trt', fieldName: '고도처리', header: { text: '고도처리' } },
|
||||
{ name: 'not_conect_popltn', fieldName: '미접속인구', header: { text: '미접속인구' } },
|
||||
{ name: 'swge_proc_zone_inner_ar', fieldName: '면적(㎢)', header: { text: '면적(㎢)' } },
|
||||
{ name: 'swge_proc_zone_outer_sm', fieldName: '합계', header: { text: '합계' } },
|
||||
{ name: 'town_unproc_popltn', fieldName: '미처리인구', header: { text: '미처리인구' } },
|
||||
{ name: 'town_swtt_popltn', fieldName: '오수처리인구', header: { text: '오수처리인구' } },
|
||||
{ name: 'town_wrrtn_popltn', fieldName: '정화조인구', header: { text: '정화조인구' } },
|
||||
{ name: 'swge_proc_zone_outer_ar', fieldName: '면적(㎢)', header: { text: '면적(㎢)' } },
|
||||
{ name: 'pblswrg_popltn_suprt', fieldName: '공공하수처리구역인구보급율(%)', header: { text: '공공하수처리구역인구보급율(%)' } },
|
||||
{ name: 'adtrt_popltn_suprt', fieldName: '고도처리인구보급율(%)', header: { text: `고도처리인구보급율(%)` } },
|
||||
{ name: 'swrg_instlrt', fieldName: '하수도설치율(%)', header: { text: '하수도설치율(%)' } },
|
||||
{ name: 'rmk', fieldName: '비고', header: { text: '비고' } },
|
||||
];
|
||||
|
||||
const columnLayout = [
|
||||
{
|
||||
name: 'groupA',
|
||||
hideChildHeaders: false,
|
||||
header: { text: '행정구역' },
|
||||
items: ['sido', 'sgg'],
|
||||
},
|
||||
'rvbsn',
|
||||
'bstrm',
|
||||
{
|
||||
name: 'groupB',
|
||||
hideChildHeaders: false,
|
||||
header: { text: '수계영향권별분류류' },
|
||||
items: ['mdbsn', 'lgbsn', 'mdmbsn'],
|
||||
},
|
||||
'specl_cntrpln_ar',
|
||||
{
|
||||
name: 'groupC',
|
||||
hideChildHeaders: false,
|
||||
header: { text: '행정참고자료인구' },
|
||||
items: ['total_popl', 'popl_sm', 'frgnr_popl_sm'],
|
||||
},
|
||||
'area',
|
||||
'popltn_sm',
|
||||
'ar_sm',
|
||||
{
|
||||
name: 'groupD',
|
||||
hideChildHeaders: false,
|
||||
header: { text: '하수처리구역내' },
|
||||
items: [
|
||||
'swge_proc_zone_inner_sm',
|
||||
{
|
||||
name: 'pblswrgGroup',
|
||||
hideChildHeaders: false,
|
||||
header: { text: '공공하수처리인구(명)' },
|
||||
items: ['pblswrg_popltn_sm', 'pblswrg_prm_trt', 'pblswrg_scd_trt', 'pblswrg_tert_trt'],
|
||||
},
|
||||
{
|
||||
name: 'wstrGroup',
|
||||
hideChildHeaders: false,
|
||||
header: { text: '폐수처리인구(명)' },
|
||||
items: ['wstr_popltn_sm', 'wstr_prm_trt', 'wstr_scd_trt', 'wstr_tert_trt'],
|
||||
},
|
||||
'not_conect_popltn',
|
||||
'swge_proc_zone_inner_ar'
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'groupE',
|
||||
hideChildHeaders: false,
|
||||
header: { text: '하수처리구역외' },
|
||||
items: ['swge_proc_zone_outer_sm', 'town_swtt_popltn', 'town_unproc_popltn', 'town_wrrtn_popltn', 'swge_proc_zone_outer_ar'],
|
||||
},
|
||||
'pblswrg_popltn_suprt',
|
||||
'adtrt_popltn_suprt',
|
||||
'swrg_instlrt',
|
||||
'rmk',
|
||||
];
|
||||
|
||||
return (
|
||||
<>
|
||||
<SearchForm userMenual={true} />
|
||||
<DataGrid columnInfo={{columns, columnLayout}} rowStartNum={2} isExcelImport={true} fixedColumns={1} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default SeweragePenetrationRate;
|
||||
@@ -0,0 +1,11 @@
|
||||
import SearchForm from "../../module/SearchForm";
|
||||
|
||||
const SewerageServiceLevelMng = () => {
|
||||
return (
|
||||
<>
|
||||
<SearchForm userMenual={true} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default SewerageServiceLevelMng;
|
||||
@@ -0,0 +1,55 @@
|
||||
import SearchForm from "@/components/module/SearchForm";
|
||||
import DataGrid from "@/components/module/DataGrid";
|
||||
import ApproveButton from "@/components/button/ApproveButton";
|
||||
import RejectButton from "@/components/button/RejectButton";
|
||||
|
||||
const StatsInputSatusMng = () => {
|
||||
const columns = [
|
||||
{ name: 'sido', fieldName: '시도', header: { text: '시도' } },
|
||||
{ name: 'sgg', fieldName: '구군', header: { text: '구군' } },
|
||||
{ name: 'menu_nm', fieldName: '구분', header: { text: '구분' } },
|
||||
{ name: 'locg_status_nm', fieldName: '진행상황', header: { text: '진행상황' } },
|
||||
{ name: 'locg_status', fieldName: '작성률', header: { text: '작성률' } },
|
||||
{ name: 'locg_charger', fieldName: '작성자', header: { text: '작성자' } },
|
||||
{ name: 'locg_cttpc', fieldName: '작성자 연락처', header: { text: '작성자 연락처' } },
|
||||
{ name: 'locg_dept', fieldName: '작성자 부서', header: { text: '작성자 부서' } },
|
||||
{ name: 'locg_job', fieldName: '작성자 직제', header: { text: '작성자 직제' } },
|
||||
{ name: 'locg_cnfirm_nm', fieldName: '승인자', header: { text: '승인자' } },
|
||||
{ name: 'locg_cnfirm_dept', fieldName: '승인자 부서', header: { text: '승인자 부서' } },
|
||||
{ name: 'locg_cnfirm_job', fieldName: '승인자 직제', header: { text: '승인자 직제' } },
|
||||
{ name: 'return_opinion_sm', fieldName: '반려 사유', header: { text: '반려 사유' } },
|
||||
];
|
||||
|
||||
const columnLayout = [
|
||||
'sido',
|
||||
'sgg',
|
||||
'menu_nm',
|
||||
{
|
||||
name: 'groupA',
|
||||
hideChildHeaders: false,
|
||||
header: { text: '하수도사업자' },
|
||||
items: columns.filter((c) => ['sido', 'sgg', 'menu_nm'].includes(c.name) === false).map((m) => m.name),
|
||||
},
|
||||
];
|
||||
|
||||
const approveFunc = () => {
|
||||
console.log('appoved');
|
||||
};
|
||||
|
||||
const rejectFunc = () => {
|
||||
console.log('reject');
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<SearchForm />
|
||||
<div className="flex justify-end items-center gap-[0.6rem] m-[0.6rem]">
|
||||
<RejectButton rejectFunc={rejectFunc} />
|
||||
<ApproveButton approveFunc={approveFunc} />
|
||||
</div>
|
||||
<DataGrid columnInfo={{columns, columnLayout}} rowStartNum={2} isExcelImport={true} fixedColumns={3} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default StatsInputSatusMng;
|
||||
@@ -0,0 +1,11 @@
|
||||
import SearchForm from "../../module/SearchForm";
|
||||
|
||||
const WaterReuseMng = () => {
|
||||
return (
|
||||
<>
|
||||
<SearchForm userMenual={true} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default WaterReuseMng;
|
||||
@@ -0,0 +1,12 @@
|
||||
import SearchForm from "@/components/module/SearchForm";
|
||||
|
||||
const PumpingStationRvw = () => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<SearchForm userMenual={true} fctName={true} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default PumpingStationRvw;
|
||||
@@ -0,0 +1,11 @@
|
||||
import SearchForm from "@/components/module/SearchForm";
|
||||
|
||||
const SewagePipeMaintainRvw = () => {
|
||||
return (
|
||||
<>
|
||||
<SearchForm userMenual={true} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default SewagePipeMaintainRvw;
|
||||
@@ -0,0 +1,11 @@
|
||||
import SearchForm from "@/components/module/SearchForm";
|
||||
|
||||
const SewagePipeRvw = () => {
|
||||
return (
|
||||
<>
|
||||
<SearchForm userMenual={true} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default SewagePipeRvw;
|
||||
@@ -0,0 +1,11 @@
|
||||
import SearchForm from "@/components/module/SearchForm";
|
||||
|
||||
const SewageReservoirPumpRvw = () => {
|
||||
return (
|
||||
<>
|
||||
<SearchForm userMenual={true} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default SewageReservoirPumpRvw;
|
||||
@@ -0,0 +1,11 @@
|
||||
import SearchForm from "@/components/module/SearchForm";
|
||||
|
||||
const SeweragePenetrationRateRvw = () => {
|
||||
return (
|
||||
<>
|
||||
<SearchForm userMenual={true} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default SeweragePenetrationRateRvw;
|
||||
@@ -0,0 +1,11 @@
|
||||
import SearchForm from "@/components/module/SearchForm";
|
||||
|
||||
const StatsInputSatusRvw = () => {
|
||||
return (
|
||||
<>
|
||||
<SearchForm userMenual={true} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default StatsInputSatusRvw;
|
||||
@@ -0,0 +1,26 @@
|
||||
export type ColumnConfig = {
|
||||
name: string;
|
||||
fieldName: string;
|
||||
header: { text: string };
|
||||
};
|
||||
|
||||
export type ColumnLayoutItem = string | {
|
||||
name: string;
|
||||
hideChildHeaders?: boolean;
|
||||
header: { text: string };
|
||||
items: (string | ColumnLayoutItem)[];
|
||||
};
|
||||
|
||||
export type ColumnInfo = {
|
||||
columns: ColumnConfig[];
|
||||
columnLayout: ColumnLayoutItem[];
|
||||
};
|
||||
|
||||
export type DataGridProps = {
|
||||
columnInfo: ColumnInfo;
|
||||
rows?: Record<string, string>[];
|
||||
rowStartNum?: number; // 헤더 행 개수 (1부터 시작, 예: 2면 1행과 2행까지 헤더로 간주)
|
||||
isExcelImport?: boolean; // 엑셀 가져오기 유무무
|
||||
onRowsChange?: (rows: Record<string, string>[]) => void;
|
||||
fixedColumns?: number; // 고정할 컬럼 개수 (좌측부터)
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
export type SearchFormValues = {
|
||||
sido?: string;
|
||||
sgg?: string;
|
||||
year?: string;
|
||||
order?: string;
|
||||
fctName?: string;
|
||||
};
|
||||
|
||||
export type SearchFormProps = {
|
||||
sido?: boolean;
|
||||
sgg?: boolean;
|
||||
year?: boolean;
|
||||
order?: boolean;
|
||||
fctName?: boolean;
|
||||
userMenual?: boolean;
|
||||
onSubmit?: (values: SearchFormValues) => void;
|
||||
onReset?: () => void;
|
||||
defaultValues?: SearchFormValues;
|
||||
};
|
||||
|
||||
export const defaultSearchFormProps: Required<Omit<SearchFormProps, 'onSubmit' | 'onReset' | 'defaultValues'>> = {
|
||||
sido: true,
|
||||
sgg: true,
|
||||
year: true,
|
||||
order: false,
|
||||
fctName: false,
|
||||
userMenual: false,
|
||||
};
|
||||
Reference in New Issue
Block a user