랜드 소유권 변경
This commit is contained in:
@@ -10,17 +10,25 @@ import { useNavigate } from 'react-router-dom';
|
||||
import { authList } from '../../store/authList';
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { useDataFetch, useModal, useTable, withAuth } from '../../utils/hook';
|
||||
import { authType } from '../../assets/data';
|
||||
import {
|
||||
authType,
|
||||
landAuctionStatus,
|
||||
landSize,
|
||||
modalTypes,
|
||||
opLandCategoryType,
|
||||
opLandOwnedType,
|
||||
} from '../../assets/data';
|
||||
import { useLandAuctionSearch } from '../../components/ServiceManage/searchBar/LandAuctionSearchBar';
|
||||
import { INITIAL_PAGE_LIMIT, INITIAL_PAGE_SIZE } from '../../assets/data/adminConstants';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { CheckBox, ExcelDownButton, Pagination, ViewTableInfo } from '../../components/common';
|
||||
import { CheckBox, DynamicModal, ExcelDownButton, Pagination, ViewTableInfo } from '../../components/common';
|
||||
import { LandAuctionSearchBar } from '../../components/ServiceManage';
|
||||
import LandInfoSearchBar, { useLandInfoSearch } from '../../components/ServiceManage/searchBar/LandInfoSearchBar';
|
||||
import { convertKTCDate } from '../../utils';
|
||||
import Loading from '../../components/common/Loading';
|
||||
import { TableSkeleton } from '../../components/Skeleton/TableSkeleton';
|
||||
import OwnerChangeModal from '../../components/ServiceManage/modal/OwnerChangeModal';
|
||||
import { StatusLabel, StatusWapper } from '../../styles/ModuleComponents';
|
||||
|
||||
const LandInfoView = () => {
|
||||
const token = sessionStorage.getItem('token');
|
||||
@@ -69,6 +77,12 @@ const LandInfoView = () => {
|
||||
switch (type) {
|
||||
case "regist":
|
||||
setModalType('regist');
|
||||
const selectRow = selectedRows[0];
|
||||
if(!selectRow.owned) {
|
||||
setAlertMsg(t('LAND_OWNED_CHANGES_WARNING'))
|
||||
return;
|
||||
}
|
||||
setDetailData(selectRow);
|
||||
handleModalView('detail');
|
||||
break;
|
||||
// case "detail":
|
||||
@@ -128,11 +142,12 @@ const LandInfoView = () => {
|
||||
// // fetchData(option);
|
||||
// window.location.reload();
|
||||
// break;
|
||||
// case "warning":
|
||||
// setAlertMsg('')
|
||||
// break;
|
||||
case "warning":
|
||||
setAlertMsg('')
|
||||
break;
|
||||
}
|
||||
}
|
||||
console.log(dataList?.land_info_list)
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -177,7 +192,6 @@ const LandInfoView = () => {
|
||||
<th>보유자</th>
|
||||
<th>보유시작일</th>
|
||||
<th>낙찰 가격</th>
|
||||
<th width="150">상세보기</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -192,17 +206,19 @@ const LandInfoView = () => {
|
||||
<td>{data.land_id}</td>
|
||||
<td>{data.land_name}</td>
|
||||
<td>{data.status}</td>
|
||||
<td>{data.editor}</td>
|
||||
<td>{data.land_size}</td>
|
||||
{/*<StatusWapper>*/}
|
||||
{/* <StatusLabel $status={data.status}>*/}
|
||||
{/* {landAuctionStatus.find(option => option.value === data.status)?.name}*/}
|
||||
{/* </StatusLabel>*/}
|
||||
{/*</StatusWapper>*/}
|
||||
<td>{opLandCategoryType.find(option => option.value === data.category)?.name}</td>
|
||||
<td>{landSize.find(option => option.value === data.land_size)?.name}</td>
|
||||
<td>{data.socket}</td>
|
||||
<td>{data.non_auction}</td>
|
||||
<td>{opLandOwnedType.find(option => option.value === data.owned)?.name}</td>
|
||||
<td>{data.owner_user_nickname}</td>
|
||||
{/*<td>{convertKTCDate(data.owner_user_create_date)}</td>*/}
|
||||
<td>{data.owner_user_create_date}</td>
|
||||
<td>{data.owner_user_price}</td>
|
||||
<td>
|
||||
{/*<Button theme="line" text="상세보기" handleClick={handleClick} />*/}
|
||||
</td>
|
||||
<td>{Number(data.owner_price) > 0 ? data.owner_price : ''}</td>
|
||||
</tr>
|
||||
</Fragment>
|
||||
))}
|
||||
@@ -214,6 +230,13 @@ const LandInfoView = () => {
|
||||
<Pagination postsPerPage={searchParams.pageSize} totalPosts={dataList?.total_all} setCurrentPage={handlePageChange} currentPage={searchParams.currentPage} pageLimit={INITIAL_PAGE_LIMIT} />
|
||||
|
||||
<OwnerChangeModal modalType={modalType} detailView={modalState.detailModal} handleDetailView={() => handleModalClose('detail')} content={detailData} setDetailData={setDetailData} />
|
||||
|
||||
<DynamicModal
|
||||
modalType={modalTypes.completed}
|
||||
view={alertMsg ? 'view' : 'hidden'}
|
||||
modalText={alertMsg}
|
||||
handleSubmit={() => handleModalSubmit('warning')}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user