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

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: 'NONE', name: '' },
{ value: 'OWNED', name: '지급 완료' },
{ value: 'OWNED_WAIT', name: '지급 예약' },
{ value: 'AUCTION_END', name: '경매 완료' },
{ value: 'RESV_START', name: '경매 예정' },
{ value: 'WAIT', name: '경매 대기' },
{ value: 'AUCTION_START', name: '경매 진행' },
{ value: 'AUCTION_WAIT', name: '경매 대기' },
{ value: 'AUCTION_RUNNING', name: '경매 진행' },
];

View File

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

View File

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

View File

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