From 9221a06a8e03b47b562aa30302c5a6cb9762388b Mon Sep 17 00:00:00 2001 From: bcjang Date: Wed, 2 Apr 2025 18:02:36 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B8=B0=ED=83=80=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DataManage/UserMailInfo.js | 11 +++++++---- src/pages/UserManage/DataInitView.js | 8 ++++---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/components/DataManage/UserMailInfo.js b/src/components/DataManage/UserMailInfo.js index 6bf1d22..524ea60 100644 --- a/src/components/DataManage/UserMailInfo.js +++ b/src/components/DataManage/UserMailInfo.js @@ -17,6 +17,7 @@ import { useRecoilValue } from 'recoil'; import { authList } from '../../store/authList'; import { convertKTC } from '../../utils'; import { TableSkeleton } from '../Skeleton/TableSkeleton'; +import { opPickupType, opReadType, opYNType } from '../../assets/data/options'; const UserMailInfo = ({ userInfo }) => { const token = sessionStorage.getItem('token'); @@ -52,6 +53,7 @@ const UserMailInfo = ({ userInfo }) => { }, [authInfo]); const fetchData = async option => { + setLoading(true); await UserMailView(token, userInfo.guid, option).then(data =>{ setDataList(data); setLoading(false); @@ -211,10 +213,10 @@ const UserMailInfo = ({ userInfo }) => { {mail.title} - {mail.status === true ? '확인' : '미확인'} - {mail.item_list.length > 0 ? 'Y' : 'N'} - {mail.is_get_item === true ? '수령함' : '미수령함'} - {mail.is_system_mail === true ? 'Y' : 'N'} + {opReadType.find(type => type.value === mail.status).name} + {opYNType.find(type => type.value === (mail.item_list.length > 0)).name} + {opPickupType.find(type => type.value === mail.is_get_item).name} + {opYNType.find(type => type.value === mail.is_system_mail).name} {/* {mail.is_get_item_dt && String(new Date(new Date(mail.is_get_item_dt).setHours(new Date(mail.is_get_item_dt).getHours() + 9)).toLocaleString())} */} @@ -365,6 +367,7 @@ const UserTableWrapper = styled.div` const MailLink = styled.div` color: #61a2d0; text-decoration: underline; + cursor: pointer; `; const SelectWrapper = styled.div` diff --git a/src/pages/UserManage/DataInitView.js b/src/pages/UserManage/DataInitView.js index bdf779a..82ce717 100644 --- a/src/pages/UserManage/DataInitView.js +++ b/src/pages/UserManage/DataInitView.js @@ -56,7 +56,7 @@ const DataInitView = () => { handleSearch, handleReset, updateSearchParams - } = useDataInitSearch(token, 500, setAlertMsg); + } = useDataInitSearch(token, setAlertMsg); const toggleRowExpand = (index) => { setExpandedRows(prev => ({ @@ -114,7 +114,6 @@ const DataInitView = () => { setLoading(true); await InitData(token, resultData).then(data => { - setLoading(false); handleModalClose('registConfirm'); if(data.result === "SUCCESS") { handleModalView('registComplete'); @@ -122,9 +121,10 @@ const DataInitView = () => { setAlertMsg(t('REGIST_FAIL')); } }).catch(reason => { - setLoading(false); handleModalClose('registConfirm'); setAlertMsg(t('API_FAIL')); + }).finally(() => { + setLoading(false); }); break; @@ -244,7 +244,7 @@ const DataInitView = () => { modalText={alertMsg} handleSubmit={() => setAlertMsg('')} /> - {loading && } + {(loading || dataLoading) && } );