칼리움 요청 실패 표시 및 클릭시 페이지 이동 처리

This commit is contained in:
2025-05-23 15:58:04 +09:00
parent 1532793cc1
commit 9d06246aba
8 changed files with 109 additions and 11 deletions

View File

@@ -14,7 +14,7 @@ import { Title, FormWrapper, TableStyle, TableWrapper, PopupMessage } from '../.
import {
StatusWapper,
ChargeBtn,
StatusLabel,
StatusLabel, TitleItemLabel, TitleItemValue, TitleItem,
} from '../../styles/ModuleComponents';
import {Button, ExcelDownButton, Pagination, ViewTableInfo} from '../../components/common';
import { convertKTC, truncateText } from '../../utils';
@@ -22,13 +22,19 @@ import { CaliumRequestRegistModal } from '../../components/UserManage';
import { CaliumCharge, LogHistory } from '../../apis';
import { useModal, withAuth } from '../../hooks/hook';
import { CommonSearchBar, useCommonSearch } from '../../components/ServiceManage';
import { INITIAL_PAGE_LIMIT } from '../../assets/data/adminConstants';
import {
INITIAL_PAGE_LIMIT,
LOG_ACTION_FAIL_CALIUM_ECHO,
STORAGE_BUSINESS_LOG_SEARCH,
} from '../../assets/data/adminConstants';
import { useAlert } from '../../context/AlertProvider';
import { useLoading } from '../../context/LoadingProvider';
import { alertTypes } from '../../assets/data/types';
import useCommonSearchOld from '../../hooks/useCommonSearchOld';
import LogDetailModal from '../../components/common/modal/LogDetailModal';
import { historyTables } from '../../assets/data/data';
import { useNavigate } from 'react-router-dom';
import { logAction } from '../../assets/data/options';
const CaliumRequest = () => {
const token = sessionStorage.getItem('token');
@@ -36,6 +42,7 @@ const CaliumRequest = () => {
const { t } = useTranslation();
const { showModal, showToast } = useAlert();
const {withLoading} = useLoading();
const navigate = useNavigate();
const tableRef = useRef(null);
const [selectCharge, setSelectCharge] = useState({});
@@ -106,6 +113,25 @@ const CaliumRequest = () => {
handleSearch(updateSearchParams);
});
break;
case "logMove":
const searchParams = {
action: LOG_ACTION_FAIL_CALIUM_ECHO,
start_dt: (() => {
const date = new Date();
date.setDate(date.getDate() - 1);
return date;
})(),
end_dt: (() => {
const date = new Date();
date.setDate(date.getDate() - 1);
return date;
})(),
};
// 복사한 데이터를 세션 스토리지에 저장
sessionStorage.setItem(STORAGE_BUSINESS_LOG_SEARCH, JSON.stringify(searchParams));
navigate('/datamanage/businesslogview');
break;
}
}
@@ -126,7 +152,15 @@ const CaliumRequest = () => {
onReset={handleReset}
/>
</FormWrapper>
<ViewTableInfo total={dataList?.total} total_all={dataList?.total_all} handleOrderBy={handleOrderByChange} handlePageSize={handlePageSizeChange} countType={ViewTitleCountType.calium}>
<ViewTableInfo
total={dataList?.total}
total_all={dataList?.total_all}
fail_count={dataList?.failCount}
handleOrderBy={handleOrderByChange}
handlePageSize={handlePageSizeChange}
countType={ViewTitleCountType.calium}
onFailCountClick={() => handleSubmit('logMove')}
>
<ExcelDownButton tableRef={tableRef} fileName={t('FILE_CALIUM_REQUEST')} />
{userInfo.auth_list && userInfo.auth_list.some(auth => auth.id === authType.eventUpdate) && (
<Button