칼리움 완료처리 파라미터 변경
우편 상세 확인시 페이지 처리 조회조건 변경시 페이지 초기화 랜드경매 메시지 제거
This commit is contained in:
@@ -65,7 +65,6 @@ const LandAuctionModal = ({ modalType, detailView, handleDetailView, content, se
|
|||||||
resv_end_dt: convertKTCDate(content.resv_end_dt),
|
resv_end_dt: convertKTCDate(content.resv_end_dt),
|
||||||
auction_start_dt: convertKTCDate(content.auction_start_dt),
|
auction_start_dt: convertKTCDate(content.auction_start_dt),
|
||||||
auction_end_dt: convertKTCDate(content.auction_end_dt),
|
auction_end_dt: convertKTCDate(content.auction_end_dt),
|
||||||
message_list: content.message_list,
|
|
||||||
});
|
});
|
||||||
const land = landData.find(land => land.id === parseInt(content.land_id));
|
const land = landData.find(land => land.id === parseInt(content.land_id));
|
||||||
setSelectLand(land);
|
setSelectLand(land);
|
||||||
@@ -126,30 +125,6 @@ const LandAuctionModal = ({ modalType, detailView, handleDetailView, content, se
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 입력 글자 제한
|
|
||||||
const handleInputData = e => {
|
|
||||||
if (e.target.value.length > 250) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const updatedMessages = resultData.message_list.map(msg =>
|
|
||||||
msg.language === message_lang
|
|
||||||
? { ...msg, content: e.target.value.trimStart() }
|
|
||||||
: msg
|
|
||||||
);
|
|
||||||
|
|
||||||
setResultData(prev => ({
|
|
||||||
...prev,
|
|
||||||
message_list: updatedMessages
|
|
||||||
}));
|
|
||||||
};
|
|
||||||
|
|
||||||
// 언어 선택
|
|
||||||
const handleLanguage = e => {
|
|
||||||
setMessage_lang(e.target.value);
|
|
||||||
if(!resultData.message_list.some(({language}) => language === e.target.value))
|
|
||||||
setResultData({ ...resultData, message_list: [...resultData.message_list, {language: e.target.value, content: ''}] })
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleLand = e => {
|
const handleLand = e => {
|
||||||
const land_id = e.target.value;
|
const land_id = e.target.value;
|
||||||
const land = landData.find(land => land.id === parseInt(land_id));
|
const land = landData.find(land => land.id === parseInt(land_id));
|
||||||
@@ -256,7 +231,6 @@ const LandAuctionModal = ({ modalType, detailView, handleDetailView, content, se
|
|||||||
&& resultData.resv_start_dt !== ''
|
&& resultData.resv_start_dt !== ''
|
||||||
&& resultData.resv_end_dt !== ''
|
&& resultData.resv_end_dt !== ''
|
||||||
&& resultData.land_id !== ''
|
&& resultData.land_id !== ''
|
||||||
// && resultData.message_list?.every(data => data.content !== '')
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -368,42 +342,6 @@ const LandAuctionModal = ({ modalType, detailView, handleDetailView, content, se
|
|||||||
endLabel="종료 일자"
|
endLabel="종료 일자"
|
||||||
reset={resetDateTime}
|
reset={resetDateTime}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/*<NoticeInputRow2>*/}
|
|
||||||
{/* <InputLabel>*/}
|
|
||||||
{/* 메세지 작성[경매 시작 5분전 공지 - 미구현]*/}
|
|
||||||
{/* </InputLabel>*/}
|
|
||||||
{/* <NoticeInputItem2>*/}
|
|
||||||
{/* <InputLabel>언어</InputLabel>*/}
|
|
||||||
{/* <SelectInput onChange={e => handleLanguage(e) } value={message_lang}>*/}
|
|
||||||
{/* {languageType.map((data, index) => (*/}
|
|
||||||
{/* <option key={index} value={data.value}>*/}
|
|
||||||
{/* {data.name}*/}
|
|
||||||
{/* </option>*/}
|
|
||||||
{/* ))}*/}
|
|
||||||
{/* </SelectInput>*/}
|
|
||||||
{/* </NoticeInputItem2>*/}
|
|
||||||
{/*</NoticeInputRow2>*/}
|
|
||||||
{/*<BoxWrapper>*/}
|
|
||||||
{/* {resultData.message_list.map(content => {*/}
|
|
||||||
{/* return (*/}
|
|
||||||
{/* <Fragment key={content.language}>*/}
|
|
||||||
{/* {message_lang === content.language && (*/}
|
|
||||||
{/* <FormTextAreaWrapper>*/}
|
|
||||||
{/* <FormTextArea*/}
|
|
||||||
{/* name="content"*/}
|
|
||||||
{/* id={content.language}*/}
|
|
||||||
{/* value={content.content}*/}
|
|
||||||
{/* onChange={e => handleInputData(e)}*/}
|
|
||||||
{/* maxLength={250}*/}
|
|
||||||
{/* disabled={!isView('message')}*/}
|
|
||||||
{/* />*/}
|
|
||||||
{/* </FormTextAreaWrapper>*/}
|
|
||||||
{/* )}*/}
|
|
||||||
{/* </Fragment>*/}
|
|
||||||
{/* );*/}
|
|
||||||
{/* })}*/}
|
|
||||||
{/*</BoxWrapper>*/}
|
|
||||||
{!isView() && isNullValue && <SearchBarAlert $marginTop="25px" $align="right">{t('REQUIRED_VALUE_CHECK')}</SearchBarAlert>}
|
{!isView() && isNullValue && <SearchBarAlert $marginTop="25px" $align="right">{t('REQUIRED_VALUE_CHECK')}</SearchBarAlert>}
|
||||||
</MessageWrapper>
|
</MessageWrapper>
|
||||||
|
|
||||||
@@ -465,12 +403,7 @@ export const initData = {
|
|||||||
resv_start_dt: '',
|
resv_start_dt: '',
|
||||||
resv_end_dt: '',
|
resv_end_dt: '',
|
||||||
auction_start_dt: '',
|
auction_start_dt: '',
|
||||||
auction_end_dt: '',
|
auction_end_dt: ''
|
||||||
message_list: [
|
|
||||||
{ language: 'KO', content: '' },
|
|
||||||
{ language: 'EN', content: '' },
|
|
||||||
{ language: 'JA', content: '' },
|
|
||||||
],
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const initLandData = {
|
export const initLandData = {
|
||||||
|
|||||||
@@ -102,7 +102,22 @@ export const useCommonSearchOld = (configPath) => {
|
|||||||
}, [configLoaded, config, searchParams, fetchData]);
|
}, [configLoaded, config, searchParams, fetchData]);
|
||||||
|
|
||||||
// 검색 파라미터 업데이트
|
// 검색 파라미터 업데이트
|
||||||
const updateSearchParams = useCallback((newParams) => {
|
const updateSearchParams = useCallback((newParams, resetPage = false) => {
|
||||||
|
const pageField = config?.apiInfo?.pageField || 'currentPage';
|
||||||
|
|
||||||
|
setSearchParams(prev => {
|
||||||
|
// 페이지 필드 자체가 변경되는 경우가 아니라면 1페이지로 리셋
|
||||||
|
const shouldResetPage = !newParams.hasOwnProperty(pageField) && prev[pageField] > 1;
|
||||||
|
|
||||||
|
return {
|
||||||
|
...prev,
|
||||||
|
...newParams,
|
||||||
|
...(shouldResetPage && { [pageField]: 1 })
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}, [config]);
|
||||||
|
|
||||||
|
const updateSearchParamsForPagination = useCallback((newParams) => {
|
||||||
setSearchParams(prev => ({
|
setSearchParams(prev => ({
|
||||||
...prev,
|
...prev,
|
||||||
...newParams
|
...newParams
|
||||||
@@ -142,8 +157,14 @@ export const useCommonSearchOld = (configPath) => {
|
|||||||
if (!config) return null;
|
if (!config) return null;
|
||||||
|
|
||||||
const pageField = config.apiInfo?.pageField || 'currentPage';
|
const pageField = config.apiInfo?.pageField || 'currentPage';
|
||||||
return await handleSearch({ [pageField]: newPage }, true);
|
const updatedParams = {
|
||||||
}, [handleSearch, config]);
|
...searchParams,
|
||||||
|
[pageField]: newPage
|
||||||
|
};
|
||||||
|
|
||||||
|
updateSearchParamsForPagination(updatedParams);
|
||||||
|
return await fetchData(updatedParams);
|
||||||
|
}, [searchParams, fetchData, config, updateSearchParamsForPagination]);
|
||||||
|
|
||||||
// 페이지 크기 변경
|
// 페이지 크기 변경
|
||||||
const handlePageSizeChange = useCallback(async (newSize) => {
|
const handlePageSizeChange = useCallback(async (newSize) => {
|
||||||
|
|||||||
@@ -1,21 +1,14 @@
|
|||||||
import React, { Fragment, useState } from 'react';
|
import React, { Fragment, useState } from 'react';
|
||||||
import { Link } from 'react-router-dom';
|
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
|
|
||||||
import Button from '../../components/common/button/Button';
|
import Button from '../../components/common/button/Button';
|
||||||
import CheckBox from '../../components/common/input/CheckBox';
|
import CheckBox from '../../components/common/input/CheckBox';
|
||||||
import Modal from '../../components/common/modal/Modal';
|
|
||||||
|
|
||||||
import styled from 'styled-components';
|
|
||||||
import {
|
import {
|
||||||
Title,
|
Title,
|
||||||
TableWrapper,
|
TableWrapper,
|
||||||
BtnWrapper,
|
|
||||||
TableInfo,
|
TableInfo,
|
||||||
ListOption,
|
ListOption,
|
||||||
TableStyle,
|
TableStyle,
|
||||||
ButtonClose,
|
|
||||||
ModalText,
|
|
||||||
DetailMessage,
|
DetailMessage,
|
||||||
} from '../../styles/Components';
|
} from '../../styles/Components';
|
||||||
|
|
||||||
@@ -23,14 +16,11 @@ import { NoticeDelete, NoticeDetailView, NoticeListView } from '../../apis/Notic
|
|||||||
import { BoardInfoModal, BoardRegistModal } from '../../components/ServiceManage';
|
import { BoardInfoModal, BoardRegistModal } from '../../components/ServiceManage';
|
||||||
import { authList } from '../../store/authList';
|
import { authList } from '../../store/authList';
|
||||||
import { useRecoilValue } from 'recoil';
|
import { useRecoilValue } from 'recoil';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { convertKTC } from '../../utils';
|
||||||
import { convertKTC, timeDiffMinute } from '../../utils';
|
import { authType } from '../../assets/data';
|
||||||
import AuthModal from '../../components/common/modal/AuthModal';
|
|
||||||
import { authType, landAuctionStatusType } from '../../assets/data';
|
|
||||||
import { useAlert } from '../../context/AlertProvider';
|
import { useAlert } from '../../context/AlertProvider';
|
||||||
import { message_type, sendStatus } from '../../assets/data/options';
|
import { message_type, sendStatus } from '../../assets/data/options';
|
||||||
import { BattleEventDelete, BattleEventDetailView, BattleEventStop } from '../../apis/Battle';
|
import { alertTypes } from '../../assets/data/types';
|
||||||
import { alertTypes, battleEventStatusType } from '../../assets/data/types';
|
|
||||||
import { useModal, useTable, withAuth } from '../../hooks/hook';
|
import { useModal, useTable, withAuth } from '../../hooks/hook';
|
||||||
import { useLoading } from '../../context/LoadingProvider';
|
import { useLoading } from '../../context/LoadingProvider';
|
||||||
import LogDetailModal from '../../components/common/modal/LogDetailModal';
|
import LogDetailModal from '../../components/common/modal/LogDetailModal';
|
||||||
@@ -109,7 +99,7 @@ const Board = () => {
|
|||||||
|
|
||||||
selectedRows.map(data =>
|
selectedRows.map(data =>
|
||||||
list.push({
|
list.push({
|
||||||
message_id: data.id,
|
id: data.id,
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ const Items = () => {
|
|||||||
pagination,
|
pagination,
|
||||||
goToNextPage,
|
goToNextPage,
|
||||||
goToPrevPage,
|
goToPrevPage,
|
||||||
|
handlePageChange
|
||||||
} = useEnhancedCommonSearch("itemSearch");
|
} = useEnhancedCommonSearch("itemSearch");
|
||||||
|
|
||||||
const {
|
const {
|
||||||
@@ -85,7 +86,7 @@ const Items = () => {
|
|||||||
showToast('API_FAIL', {type: alertTypes.error});
|
showToast('API_FAIL', {type: alertTypes.error});
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
setItemCount('1');
|
setItemCount('1');
|
||||||
handleSearch(updateSearchParams);
|
handlePageChange(pagination.currentPage);
|
||||||
});
|
});
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -118,7 +119,7 @@ const Items = () => {
|
|||||||
}).catch(reason => {
|
}).catch(reason => {
|
||||||
showToast('API_FAIL', {type: alertTypes.error});
|
showToast('API_FAIL', {type: alertTypes.error});
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
handleSearch(updateSearchParams);
|
handlePageChange(pagination.currentPage);
|
||||||
});
|
});
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ const Mail = () => {
|
|||||||
detailView={modalState.detailModal}
|
detailView={modalState.detailModal}
|
||||||
handleDetailView={() =>{
|
handleDetailView={() =>{
|
||||||
handleModalClose('detail');
|
handleModalClose('detail');
|
||||||
handleSearch(updateSearchParams);
|
handlePageChange(searchParams.currentPage);
|
||||||
}}
|
}}
|
||||||
content={detailData}
|
content={detailData}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ const CaliumRequest = () => {
|
|||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const tableRef = useRef(null);
|
const tableRef = useRef(null);
|
||||||
const [selectCharge, setSelectCharge] = useState({});
|
|
||||||
const [historyData, setHistoryData] = useState({});
|
const [historyData, setHistoryData] = useState({});
|
||||||
|
|
||||||
const {
|
const {
|
||||||
@@ -90,15 +89,15 @@ const CaliumRequest = () => {
|
|||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case "chargedConfirm":
|
case "chargedConfirm":
|
||||||
setSelectCharge({id: param.id, count: param.count});
|
const select = {id: param.id, count: param.count};
|
||||||
showModal('CALIUM_CHARGE_CONFIRM', {
|
showModal('CALIUM_CHARGE_CONFIRM', {
|
||||||
type: alertTypes.confirm,
|
type: alertTypes.confirm,
|
||||||
onConfirm: () => handleSubmit('charged')
|
onConfirm: () => handleSubmit('charged', select)
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case "charged":
|
case "charged":
|
||||||
await withLoading( async () => {
|
await withLoading( async () => {
|
||||||
return await CaliumCharge(token, selectCharge);
|
return await CaliumCharge(token, param);
|
||||||
}).then(data => {
|
}).then(data => {
|
||||||
if(data.result === "SUCCESS") {
|
if(data.result === "SUCCESS") {
|
||||||
showToast('CHARGE_COMPLTED', {type: alertTypes.success});
|
showToast('CHARGE_COMPLTED', {type: alertTypes.success});
|
||||||
@@ -110,7 +109,6 @@ const CaliumRequest = () => {
|
|||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
showToast('API_FAIL', {type: alertTypes.error});
|
showToast('API_FAIL', {type: alertTypes.error});
|
||||||
}).finally(() =>{
|
}).finally(() =>{
|
||||||
setSelectCharge({});
|
|
||||||
handleSearch(updateSearchParams);
|
handleSearch(updateSearchParams);
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user