import React, { useState, useEffect, useCallback, useRef } from 'react'; import { Link, useLocation } from 'react-router-dom'; import * as EgovNet from 'api/egovFetch'; import URL from 'constants/url'; import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin'; import EgovPaging from 'components/EgovPaging'; import { itemIdxByPage } from 'utils/calc'; function PrivacyConnections(props) { // console.group("EgovAdminPrivacyList"); // console.log("[Start] EgovAdminPrivacyList ------------------------------"); // console.log("EgovAdminPrivacyList [props] : ", props); const location = useLocation(); // console.log("EgovAdminPrivacyList [location] : ", location); // const cndRef = useRef(); // const wrdRef = useRef(); // eslint-disable-next-line no-unused-vars const [searchCondition, setSearchCondition] = useState(location.state?.searchCondition || { pageIndex: 1, searchCnd: '0', searchWrd: '' });// 기존 조회에서 접근 했을 시 || 신규로 접근 했을 시 const [paginationInfo, setPaginationInfo] = useState({}); const [listTag, setListTag] = useState([]); const retrieveList = useCallback((srchCnd) => { // console.groupCollapsed("EgovAdminUsageList.retrieveList()"); const retrieveListURL = '/admin/logs/privacy'; const requestOptions = { method: "POST", headers: { 'Content-type': 'application/json', }, body: JSON.stringify(srchCnd) } EgovNet.requestFetch(retrieveListURL, requestOptions, (resp) => { setPaginationInfo(resp.result.paginationInfo); let mutListTag = []; listTag.push(
데이터가 없습니다.
); // 게시판 목록 초기값 const resultCnt = parseInt(resp.result.resultCnt); const currentPageNo = resp.result.paginationInfo.pageIndex; const pageSize = resp.result.paginationInfo.rowCnt; const startIndex = (currentPageNo - 1) * pageSize; const endIndex = Math.min(startIndex + pageSize, resultCnt); // 리스트 항목 구성 for (let index = startIndex; index < endIndex; index++) { const listIdx = itemIdxByPage(resultCnt, currentPageNo, 0, index); // pageSize 로 넣으면 listIdx값이 2배씩 줄어서 0으로 수정 const item = resp.result.resultList[index]; mutListTag.push(