랜드 소유권 변경 타입추가 및 버그 수정

This commit is contained in:
2025-03-14 18:24:05 +09:00
parent 5d9b6871fb
commit f2d7c87f38
4 changed files with 60 additions and 51 deletions

View File

@@ -223,8 +223,8 @@ export const opLandInfoStatusType = [
{ value: 'ALL', name: '전체' }, { value: 'ALL', name: '전체' },
{ value: 'NONE', name: '' }, { value: 'NONE', name: '' },
{ value: 'OWNED', name: '지급 완료' }, { value: 'OWNED', name: '지급 완료' },
{ value: 'OWNED_WAIT', name: '지급 예약' },
{ value: 'AUCTION_END', name: '경매 완료' }, { value: 'AUCTION_END', name: '경매 완료' },
{ value: 'RESV_START', name: '경매 예정' }, { value: 'AUCTION_WAIT', name: '경매 대기' },
{ value: 'WAIT', name: '경매 대기' }, { value: 'AUCTION_RUNNING', name: '경매 진행' },
{ value: 'AUCTION_START', name: '경매 진행' },
]; ];

View File

@@ -75,7 +75,8 @@ const LandInfoView = () => {
const { const {
selectedRows, selectedRows,
handleSelectRow, handleSelectRow,
isRowSelected isRowSelected,
removeSelectedRows
} = useTable(dataList?.land_info_list || [], {mode: 'single'}); } = useTable(dataList?.land_info_list || [], {mode: 'single'});
// const { // const {
@@ -161,6 +162,13 @@ const LandInfoView = () => {
} }
} }
const handleDetailView = () => {
handleModalClose('detail');
handleSearch();
removeSelectedRows();
}
!loading && console.log(dataList?.land_info_list)
return ( return (
<> <>
<Title>랜드 정보 조회</Title> <Title>랜드 정보 조회</Title>
@@ -189,54 +197,56 @@ const LandInfoView = () => {
)} )}
</ViewTableInfo> </ViewTableInfo>
{loading ? <TableSkeleton width='100%' count={15} /> : {loading ? <TableSkeleton width='100%' count={15} /> :
<TableWrapper> <>
<TableStyle ref={tableRef}> <TableWrapper>
<thead> <TableStyle ref={tableRef}>
<tr> <thead>
<th width="40"></th> <tr>
<th width="150">랜드 ID</th> <th width="40"></th>
<th>랜드 이름</th> <th width="150">랜드 ID</th>
<th>랜드 상태</th> <th>랜드 이름</th>
<th>카테고리</th> <th>랜드 상태</th>
<th>랜드 크기</th> <th>카테고리</th>
<th>인스턴스 </th> <th>랜드 크기</th>
<th>유저 소유 여부</th> <th>인스턴스 </th>
<th>보유자</th> <th>유저 소유 여부</th>
<th>보유시작일</th> <th>보유</th>
<th>낙찰 가격</th> <th>보유시작일</th>
</tr> <th>낙찰 가격</th>
</thead> </tr>
<tbody> </thead>
{dataList?.land_info_list?.map((data, index) => ( <tbody>
<Fragment key={index}> {dataList?.land_info_list?.map((data, index) => (
<tr> <Fragment key={index}>
<td> <tr>
<CheckBox name={'select'} id={data.id} <td>
setData={(e) => handleSelectRow(e, data)} <CheckBox name={'select'} id={data.id}
checked={isRowSelected(data.id)} /> setData={(e) => handleSelectRow(e, data)}
</td> checked={isRowSelected(data.id)} />
<td>{data.land_id}</td> </td>
<td>{data.land_name}</td> <td>{data.land_id}</td>
<td>{opLandInfoStatusType.find(option => option.value === data.status)?.name}</td> <td>{data.land_name}</td>
<td>{opLandCategoryType.find(option => option.value === data.category)?.name}</td> <td>{opLandInfoStatusType.find(option => option.value === data.status)?.name}</td>
<td>{landSize.find(option => option.value === data.land_size)?.name}</td> <td>{opLandCategoryType.find(option => option.value === data.category)?.name}</td>
<td>{data.socket}</td> <td>{landSize.find(option => option.value === data.land_size)?.name}</td>
<td>{opLandOwnedType.find(option => option.value === data.owned)?.name}</td> <td>{data.socket}</td>
<td>{data.owner_user_nickname}</td> <td>{opLandOwnedType.find(option => option.value === data.owned)?.name}</td>
{/*<td>{convertKTCDate(data.owner_user_create_date)}</td>*/} <td>{data.owner_user_nickname}</td>
<td>{data.owner_user_create_date}</td> {/*<td>{convertKTCDate(data.owner_user_create_date)}</td>*/}
<td>{Number(data.owner_price) > 0 ? data.owner_price : ''}</td> <td>{data.owner_user_create_date}</td>
</tr> <td>{Number(data.owner_price) > 0 ? data.owner_price : ''}</td>
</Fragment> </tr>
))} </Fragment>
</tbody> ))}
</TableStyle> </tbody>
</TableWrapper> </TableStyle>
</TableWrapper>
<Pagination postsPerPage={searchParams.pageSize} totalPosts={dataList?.total_all} setCurrentPage={handlePageChange} currentPage={searchParams.currentPage} pageLimit={INITIAL_PAGE_LIMIT} />
</>
} }
<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');handleSearch()}} content={detailData} setDetailData={setDetailData} /> <OwnerChangeModal modalType={modalType} detailView={modalState.detailModal} handleDetailView={() => handleDetailView()} content={detailData} setDetailData={setDetailData} />
<DynamicModal <DynamicModal
modalType={modalTypes.completed} modalType={modalTypes.completed}

View File

@@ -17,7 +17,6 @@ export const convertKTC = (dt, nation = true) => {
} }
export const convertKTCDate = (dt) => { export const convertKTCDate = (dt) => {
if(!dt) return "";
const date = new Date(dt); const date = new Date(dt);
date.setHours(date.getHours() + 9); date.setHours(date.getHours() + 9);
return date; return date;

View File

@@ -91,8 +91,8 @@ export const useTable = (tableData = [], options = {mode: 'multi'}) => {
tableDataRef.current[index]?.id !== item.id tableDataRef.current[index]?.id !== item.id
); );
setSelectedRows([]);
if (hasDataChanged) { if (hasDataChanged) {
setSelectedRows([]);
tableDataRef.current = tableData; tableDataRef.current = tableData;
} }
}, [tableData]); }, [tableData]);