diff --git a/src/components/common/MenuTab.tsx b/src/components/common/MenuTab.tsx index 33518e8..256f5e2 100644 --- a/src/components/common/MenuTab.tsx +++ b/src/components/common/MenuTab.tsx @@ -234,43 +234,39 @@ const MenuTab = ({ groups, drones, type }: MenuTabProps) => { /* 대시보드 내 드론 리스트 탭 */ const renderDroneListTab = () => { return ( - <> - - - 전체 드론 - - - - {drones?.map((item) => ( - - handleTabMenu( - isEstimatePage - ? `/drone-group/drone/${item.id}/estimate` - : isTestDetailPage - ? `/drone-group/drone/${item.id}/dashboard/test` - : `/drone-group/drone/${item.id}/dashboard`, - String(item.id) - ) - } - > - - {item.name} - - - ))} - - - + + + 전체 드론 + + + + {drones?.map((item) => ( + + handleTabMenu( + isEstimatePage + ? `/drone-group/drone/${item.id}/estimate` + : isTestDetailPage + ? `/drone-group/drone/${item.id}/dashboard/test` + : `/drone-group/drone/${item.id}/dashboard`, + String(item.id) + ) + } + > + + {item.name} + + + ))} + + ); }; diff --git a/src/components/dashboard/ResultRecord.tsx b/src/components/dashboard/ResultRecord.tsx index 4e71a80..3de2a88 100644 --- a/src/components/dashboard/ResultRecord.tsx +++ b/src/components/dashboard/ResultRecord.tsx @@ -69,7 +69,7 @@ function ResultRecord({ droneId, data }: ResultRecordProp) { buttonType='accentLight' onClick={(e) => { e.stopPropagation(); - goToDashboard(location.state); // data.id 필요 + goToDashboard(droneId); // data.id 필요 }} style={{ width: '95px', height: '32px', fontSize: '14px' }} /> diff --git a/src/pages/TestDetailPage.tsx b/src/pages/TestDetailPage.tsx index 73902f0..d1b059b 100644 --- a/src/pages/TestDetailPage.tsx +++ b/src/pages/TestDetailPage.tsx @@ -123,20 +123,18 @@ const TestDetailPage = () => { // 메뉴탭 이동시 id 변경 // 첫번째 날짜값으로 조회 React.useEffect(() => { - if (!testDate) { - getTestDateList(Number(id)).then((res) => { - setDateList(res.data.data); - if (res.data.data.length > 0) { - const { year, month, day } = res.data.data[0]; - console.log('탭이동', year, month, day); - setSelectedDate(`${year}-${month}-${day}`); - getTestDetail(Number(id), year, month, day).then((res) => { - console.log(res.data.data); - setTestData(res.data.data); - }); - } - }); - } + getTestDateList(Number(id)).then((res) => { + setDateList(res.data.data); + if (res.data.data.length > 0) { + const { year, month, day } = res.data.data[0]; + console.log('탭이동', year, month, day); + setSelectedDate(`${year}-${month}-${day}`); + getTestDetail(Number(id), year, month, day).then((res) => { + console.log(res.data.data); + setTestData(res.data.data); + }); + } + }); }, [id]); // id는 고정인채 날짜만 변경시 @@ -329,12 +327,12 @@ const TestDetailPage = () => { - {testData?.warningList.map((item) => ( + {testData?.warningList.map((item, index) => ( ))}