fix: 사업 구분 3개로 바꾸기2
This commit is contained in:
@@ -12,12 +12,9 @@ import React from 'react';
|
||||
// { val: "inspection", text: "점검 및 진단" },
|
||||
// ];
|
||||
export const WORK_TYPES = [
|
||||
{ val: "[200, 201, 204]", text: "보수 및 갱신" },
|
||||
// { val: "200", text: "보수 및 갱신(개대체)" },
|
||||
// { val: "201", text: "보수 및 갱신(유지보수)" },
|
||||
// { val: "204", text: "보수 및 갱신(단순보수)" },
|
||||
{ val: "[100]", text: "점검 및 진단" },
|
||||
{ val: "[203]", text: "청소 및 준설" },
|
||||
{ val: "['200', '201', '204']", text: "보수 및 갱신" },
|
||||
{ val: "['100']", text: "점검 및 진단" },
|
||||
{ val: "['203']", text: "청소 및 준설" },
|
||||
];
|
||||
// const BIZ_SE_CD = useBizByFcltStore(state => state.BIZ_SE_CD);
|
||||
export const BIZ_SE_CD = [
|
||||
|
||||
@@ -106,11 +106,9 @@ const SearchModal: React.FC<SearchModalProps> = ({
|
||||
|
||||
const dynamicHeadlist2: { id: string, title: string }[] = useMemo(() => {
|
||||
if (activeTab === 'operation') {
|
||||
if (workType === '200') return operationMaintenanceTableHeadlist;
|
||||
if (workType === '201') return operationMaintenanceTableHeadlist;
|
||||
if (workType === '204') return operationMaintenanceTableHeadlist;
|
||||
if (workType === '100') return operationCleaningTableHeadlist;
|
||||
if (workType === '203') return operationInspectionTableHeadlist;
|
||||
if (workType === WORK_TYPES[0]?.val) return operationMaintenanceTableHeadlist;
|
||||
if (workType === WORK_TYPES[1]?.val) return operationCleaningTableHeadlist;
|
||||
if (workType === WORK_TYPES[2]?.val) return operationInspectionTableHeadlist;
|
||||
}
|
||||
|
||||
return [];
|
||||
@@ -247,8 +245,8 @@ const SearchModal: React.FC<SearchModalProps> = ({
|
||||
RequestDTO.fromflfmtEndYmd = startDate;
|
||||
RequestDTO.toflfmtEndYmd = endDate;
|
||||
|
||||
|
||||
RequestDTO.workTypes = workType;
|
||||
// JSON.parse 사용으로 문자열 -> 배열 변환
|
||||
RequestDTO.workTypes = JSON.parse(workType.replace(/'/g, '"'));
|
||||
|
||||
const params = new URLSearchParams(RequestDTO).toString();
|
||||
|
||||
@@ -478,8 +476,11 @@ const SearchModal: React.FC<SearchModalProps> = ({
|
||||
bizId: tableData[index % 4].bizId,
|
||||
};
|
||||
|
||||
RequestDTO.workTypes = JSON.parse(workType.replace(/'/g, '"'));
|
||||
|
||||
const res = await getData(`v1/bizInfo/fclts?${new URLSearchParams(RequestDTO).toString()}`);
|
||||
console.log('운영정보 cellClick 데이터:', res);
|
||||
console.log('운영정보 cellClick.data:', res.data);
|
||||
console.log('운영정보 length:', res.data.length);
|
||||
|
||||
const mappedData = (res.data || []).map((item: any, detailIndex: number) => {
|
||||
@@ -495,6 +496,8 @@ const SearchModal: React.FC<SearchModalProps> = ({
|
||||
};
|
||||
});
|
||||
|
||||
console.log('운영정보 cellClick mappedData:', mappedData);
|
||||
|
||||
setDetailTableData(mappedData);
|
||||
setDetailTableCount(res.count || 0);
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user