fix:
- 사업유형 SelectArray에 ‘AAAAA‘ 항목 빼고 '전체' 항목 추가 - 하수관로, 맨홀에도 '전체' 항목 추가 - 맨홀에서 용도 조회 조건이 적용 안되는 에러 수정 - 맨홀 조회 결과 컬럼에서 '재질'을 '용도'로 변경
This commit is contained in:
@@ -43,7 +43,7 @@ export const codeMapper = ({ layerName, data }: CodeMapperProps): any => {
|
||||
// usg_cd 값 변환 (용도코드)
|
||||
if (processedData.usg_cd) {
|
||||
const usageCodeItem = MS_SWAGE_MHL_USE_CODES.find(
|
||||
code => code.val === processedData.usg_cd.trim()
|
||||
code => code.val.trim() === processedData.usg_cd.trim()
|
||||
);
|
||||
if (usageCodeItem) {
|
||||
processedData.usg_cd = usageCodeItem.text;
|
||||
|
||||
@@ -399,11 +399,11 @@ export const MsSwageMhlCol2 = [
|
||||
// { id: 'mngInstCd', title: '관리기관코드' },
|
||||
{ id: 'instlYmd', title: '설치일자' },
|
||||
// { id: 'lastDrdgnYmd', title: '최종준설일자' },
|
||||
// { id: 'usgCd', title: '용도코드' },
|
||||
{ id: 'usgCd', title: '용도' },
|
||||
// { id: 'fcltyShpCd', title: '시설물형태코드' },
|
||||
// { id: 'mhlKndCd', title: '맨홀종류코드' },
|
||||
{ id: 'swageMhlDiamVl', title: '하수맨홀구경(mm)' },
|
||||
{ id: 'mqltCd', title: '재질코드' },
|
||||
// { id: 'mqltCd', title: '재질코드' },
|
||||
{ id: 'wdthLen', title: '가로길이(m)' },
|
||||
{ id: 'vrtcLen', title: '세로길이(m)' },
|
||||
// { id: 'angDir', title: '표고' },
|
||||
@@ -448,31 +448,31 @@ export const MS_SWAGE_MHL_CODES = [
|
||||
];
|
||||
// 하수맨홀 용도 코드표
|
||||
export const MS_SWAGE_MHL_USE_CODES = [
|
||||
{ val: "SMU000", text: "미분류" },
|
||||
{ val: "SMU001", text: "우수" },
|
||||
{ val: "SMU002", text: "오수" },
|
||||
{ val: "SMU003", text: "집수" },
|
||||
{ val: "SMU004", text: "합류" },
|
||||
{ val: "SMU005", text: "차집" },
|
||||
{ val: "SMU999", text: "기타" },
|
||||
{ val: "SMU900", text: "1호" },
|
||||
{ val: "SMU901", text: "2호" },
|
||||
{ val: "SMU902", text: "3호" },
|
||||
{ val: "SMU903", text: "4호" },
|
||||
{ val: "SMU904", text: "5호" },
|
||||
{ val: "SMU905", text: "6호" },
|
||||
{ val: "SMU906", text: "7호" },
|
||||
{ val: "SMU907", text: "8호" },
|
||||
{ val: "SMU908", text: "구거용맨홀" },
|
||||
{ val: "SMU909", text: "부관부착맨홀" },
|
||||
{ val: "SMU910", text: "조립식맨홀" },
|
||||
{ val: "SMU911", text: "특1호" },
|
||||
{ val: "SMU912", text: "특2호" },
|
||||
{ val: "SMU913", text: "특3호" },
|
||||
{ val: "SMU914", text: "특4호" },
|
||||
{ val: "SMU915", text: "특5호" },
|
||||
{ val: "SMU916", text: "하수맨홀용도" },
|
||||
{ val: "SMU917", text: "현장타설관거용" }
|
||||
{ val: "SMU000 ", text: "미분류" },
|
||||
{ val: "SMU001 ", text: "우수" },
|
||||
{ val: "SMU002 ", text: "오수" },
|
||||
{ val: "SMU003 ", text: "집수" },
|
||||
{ val: "SMU004 ", text: "합류" },
|
||||
{ val: "SMU005 ", text: "차집" },
|
||||
{ val: "SMU999 ", text: "기타" },
|
||||
{ val: "SMU900 ", text: "1호" },
|
||||
{ val: "SMU901 ", text: "2호" },
|
||||
{ val: "SMU902 ", text: "3호" },
|
||||
{ val: "SMU903 ", text: "4호" },
|
||||
{ val: "SMU904 ", text: "5호" },
|
||||
{ val: "SMU905 ", text: "6호" },
|
||||
{ val: "SMU906 ", text: "7호" },
|
||||
{ val: "SMU907 ", text: "8호" },
|
||||
{ val: "SMU908 ", text: "구거용맨홀" },
|
||||
{ val: "SMU909 ", text: "부관부착맨홀" },
|
||||
{ val: "SMU910 ", text: "조립식맨홀" },
|
||||
{ val: "SMU911 ", text: "특1호" },
|
||||
{ val: "SMU912 ", text: "특2호" },
|
||||
{ val: "SMU913 ", text: "특3호" },
|
||||
{ val: "SMU914 ", text: "특4호" },
|
||||
{ val: "SMU915 ", text: "특5호" },
|
||||
{ val: "SMU916 ", text: "하수맨홀용도" },
|
||||
{ val: "SMU917 ", text: "현장타설관거용" }
|
||||
];
|
||||
|
||||
// 우수펌프장
|
||||
|
||||
@@ -139,7 +139,7 @@ const OperationTab: React.FC<OperationTabProps> = ({
|
||||
className="w-60 mr-8"
|
||||
selectClass="rounded-lg bg-white text-xl"
|
||||
label=""
|
||||
selectArray={BIZ_TY_CD_SELECT_ARRAY}
|
||||
selectArray={[{ val: "0", text: "전체" }, ...BIZ_TY_CD_SELECT_ARRAY]}
|
||||
value={var2}
|
||||
onSelectValue={(val) => {
|
||||
setVar2(String(val));
|
||||
|
||||
@@ -3,7 +3,7 @@ import { UiModal, UITab, UiTable } from '@common/business_components/ui';
|
||||
import axios from 'axios';
|
||||
import React, { useEffect, useMemo, useState } from 'react';
|
||||
import { ExclnSewagePumpCol2, MsSwageMhlCol2, MsSwagePplCol2, stofcbrCol2, SwtrmtFcltCol2, SwtrmtPrcsZoneCol2 } from '../components/common/table';
|
||||
import { MS_SWAGE_PPL_CODES, MS_SWAGE_PPL_USE_CODES, MS_SWAGE_MHL_CODES } from '../components/common/table';
|
||||
import { MS_SWAGE_PPL_CODES, MS_SWAGE_PPL_USE_CODES, MS_SWAGE_MHL_CODES, MS_SWAGE_MHL_USE_CODES } from '../components/common/table';
|
||||
import { getData } from "@/components/lib/api";
|
||||
import BasicTab, { BASIC_TYPES } from './basicTab';
|
||||
import OperationTab, { operationCleaningTableHeadlist, operationInspectionTableHeadlist, operationMaintenanceTableHeadlist, operationTableHeadlist, WORK_TYPES } from './operationTab';
|
||||
@@ -214,6 +214,7 @@ const SearchModal: React.FC<SearchModalProps> = ({
|
||||
}
|
||||
|
||||
const matchedMhlCode = MS_SWAGE_MHL_CODES.find(code => code.val === item?.mqltCd?.trim());
|
||||
const matchedMhlUsgCode = MS_SWAGE_MHL_USE_CODES.find(code => code.val === item?.usgCd);
|
||||
const ctpvNm = ctpv.find(code => code.val.trim() === ctpvCd)?.text || ctpvCd;
|
||||
const sggNm = sgg.find(code => code.val.trim() === sggCd)?.text || '-';
|
||||
const usgCdObj = MS_SWAGE_PPL_USE_CODES.find(code => code.val === item?.usgCd?.trim());
|
||||
@@ -222,15 +223,16 @@ const SearchModal: React.FC<SearchModalProps> = ({
|
||||
return {
|
||||
...formattedItem,
|
||||
rowNumber: (curPage - 1) * 10 + index + 1, // 1부터 시작하는 일련번호 추가
|
||||
scsYn: item.scsYn === null || item.scsYn === undefined ? 'N' : item.scsYn, // scsYn이 null이면 'N'으로 변경
|
||||
mqltCd: matchedMhlCode ? matchedMhlCode.text : item.mqltCd,
|
||||
usgCd: usgCdObj ? usgCdObj.text : item.usgCd,
|
||||
scsYn: item.scsYn === null || item.scsYn === undefined ? 'N' : item?.scsYn, // scsYn이 null이면 'N'으로 변경
|
||||
mqltCd: matchedMhlCode ? matchedMhlCode.text : item?.mqltCd,
|
||||
usgCd: matchedMhlUsgCode ? matchedMhlUsgCode.text : (usgCdObj ? usgCdObj.text : item?.usgCd),
|
||||
ctpvNm,
|
||||
sggNm,
|
||||
swtrmt_zone_nm: item.swtrmtZoneNm || item.swtrmt_zone_nm || '-',
|
||||
};
|
||||
});
|
||||
|
||||
console.log("dataWithRowNumber: ", dataWithRowNumber)
|
||||
setTableData(dataWithRowNumber);
|
||||
setTableCount(res.data.count || []);
|
||||
|
||||
@@ -295,7 +297,7 @@ const SearchModal: React.FC<SearchModalProps> = ({
|
||||
const pplCqlFilters = () => {
|
||||
const cqlFilters: string[] = [];
|
||||
// 추후 작성 예정
|
||||
if (var1) cqlFilters.push(`usg_cd='${var1}'`);
|
||||
if (var1 !== '0') cqlFilters.push(`usg_cd='${var1}'`);
|
||||
if (var2) cqlFilters.push(`mqlt_cd='${var2}'`);
|
||||
if (ctpvCd !== '0' && sggCd !== '0') cqlFilters.push(`pbadms_emd_cd LIKE '${sggCd}%'`);
|
||||
else if (ctpvCd !== '0') cqlFilters.push(`pbadms_emd_cd LIKE '${ctpvCd.trim()}%'`);
|
||||
@@ -394,7 +396,7 @@ const SearchModal: React.FC<SearchModalProps> = ({
|
||||
cqlFilters.push(
|
||||
`instl_ymd >= '${startDate}' and instl_ymd <= '${endDate}'`,
|
||||
);
|
||||
if (var1) cqlFilters.push(`usg_cd='${var1}'`);
|
||||
if (var1 !== '0') cqlFilters.push(`usg_cd='${var1}'`);
|
||||
// 구경(mm) 범위
|
||||
if (start1 && end1) cqlFilters.push(`swage_mhL_diam_vl BETWEEN ${start1} AND ${end1}`);
|
||||
else if (start1) cqlFilters.push(`swage_mhL_diam_vl >= ${start1}`);
|
||||
|
||||
@@ -72,7 +72,7 @@ const SwageMhl: React.FC<SwageMhlProps> = ({
|
||||
className="w-60 mr-8"
|
||||
selectClass="rounded-lg bg-white text-xl"
|
||||
label=""
|
||||
selectArray={MS_SWAGE_MHL_USE_CODES}
|
||||
selectArray={[{ val: "0", text: "전체" }, ...MS_SWAGE_MHL_USE_CODES]}
|
||||
value={var1}
|
||||
onSelectValue={(val) => {
|
||||
setVar1(String(val));
|
||||
|
||||
@@ -83,7 +83,7 @@ const SwagePpl: React.FC<SwagePplProps> = ({
|
||||
className="w-32 mr-8"
|
||||
selectClass="rounded-lg bg-white text-xl"
|
||||
label=""
|
||||
selectArray={MS_SWAGE_PPL_USE_CODES}
|
||||
selectArray={[{val: "0", text: "전체"}, ...MS_SWAGE_PPL_USE_CODES]}
|
||||
value={var1}
|
||||
onSelectValue={(val) => {
|
||||
setVar1(String(val));
|
||||
|
||||
@@ -72,7 +72,7 @@ export function YearRangeSelectBox({
|
||||
(maxYear - i).toString()
|
||||
).filter(y => !end || parseInt(y) <= parseInt(end));
|
||||
return [
|
||||
{ val: "0", text: "년" },
|
||||
{ val: "0", text: "전체" },
|
||||
...years.map(y => ({ val: y, text: y })),
|
||||
];
|
||||
};
|
||||
@@ -82,7 +82,7 @@ export function YearRangeSelectBox({
|
||||
(maxYear - i).toString()
|
||||
).filter(y => !start || parseInt(y) >= parseInt(start));
|
||||
return [
|
||||
{ val: "9999", text: "년" },
|
||||
{ val: "9999", text: "전체" },
|
||||
...years.map(y => ({ val: y, text: y })),
|
||||
];
|
||||
};
|
||||
|
||||
@@ -38,6 +38,7 @@ type UiHeadProps = {
|
||||
align?: string;
|
||||
type?: string;
|
||||
options?: string[];
|
||||
placeholder?: string;
|
||||
};
|
||||
|
||||
export function VerticalTable({
|
||||
@@ -194,6 +195,7 @@ export function VerticalTable({
|
||||
value={formData[head.id] !== undefined ? String(formData[head.id]) : ""}
|
||||
onChange={(e) => handleInputChange(head.id, e.target.value)}
|
||||
className="w-full text-xl border-radius-0 border border-gray-300 rounded-sm px-2 py-1"
|
||||
placeholder={head.placeholder}
|
||||
/>
|
||||
) : (
|
||||
<span>{formData[head.id] ?? "-"}</span>
|
||||
|
||||
@@ -21,7 +21,7 @@ export const fetchCtpv = async (set: (state: any) => void) => {
|
||||
.sort((a, b) => a.text.localeCompare(b.text, 'ko'));
|
||||
|
||||
console.log('시도 데이터', list);
|
||||
set({ ctpv: list});
|
||||
set({ ctpv: list });
|
||||
};
|
||||
|
||||
export const fetchSgg = async (set: (state: any) => void) => {
|
||||
@@ -52,7 +52,10 @@ export const fetchBIZ_SE_CD = async (set: (state: any) => void) => {
|
||||
export const fetchBIZ_TY_CD = async (set: (state: any) => void) => {
|
||||
try {
|
||||
const res = await getCmsData(`/api/v1/code/cache/BIZTYCD`);
|
||||
set({ BIZ_TY_CD: res });
|
||||
const filtered: BIZ_CD_TYPE[] = Array.isArray(res)
|
||||
? (res as BIZ_CD_TYPE[]).filter(item => item?.lwpoCd !== "AQAAA")
|
||||
: [];
|
||||
set({ BIZ_TY_CD: filtered });
|
||||
} catch (e: any) {
|
||||
// alert("BIZ_TY_CD 데이터 로드 실패: " + e.message);
|
||||
console.error("BIZ_TY_CD 데이터 로드 실패:", e);
|
||||
|
||||
Reference in New Issue
Block a user