wr: 페이지이동시 선택 해제
This commit is contained in:
@@ -19,6 +19,9 @@ Main technologies:
|
||||
- UTF-8
|
||||
- 한글이 깨지지 않도록 주의할 것
|
||||
|
||||
## 주석 comment
|
||||
- 한글 주석을 삭제하지 말 것
|
||||
|
||||
## Monorepo structure
|
||||
apps/
|
||||
_template
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
## Project
|
||||
This repository contains a Next.js web application.
|
||||
|
||||
Main technologies:
|
||||
- Next.js
|
||||
- TypeScript
|
||||
- pnpm workspace
|
||||
- turborepo
|
||||
|
||||
이 저장소는 pnpm workspace + Turborepo 기반 monorepo이다.
|
||||
|
||||
- 워크스페이스 범위는 `apps/*`, `apps/common/*`, `packages/*`, `packages/common/*`
|
||||
- 루트 스크립트는 `turbo run build`, `turbo run dev` 를 사용한다
|
||||
- `build` 작업은 의존 패키지의 `build` 를 먼저 수행한다 (`dependsOn: ["^build"]`)
|
||||
- `dev` 는 캐시하지 않는 지속 실행 작업이다
|
||||
- 변경 범위만 선택 실행할 수 있으므로, 전체 빌드보다 `--filter` 사용을 우선한다
|
||||
|
||||
## Encoding
|
||||
- UTF-8
|
||||
- 한글이 깨지지 않도록 주의할 것
|
||||
|
||||
## 주석 comment
|
||||
- 한글 주석을 삭제하지 말 것
|
||||
|
||||
## Monorepo structure
|
||||
apps/
|
||||
_template
|
||||
as
|
||||
cm
|
||||
cs
|
||||
dc
|
||||
dm
|
||||
dm_new
|
||||
fo
|
||||
sn
|
||||
st
|
||||
wr
|
||||
|
||||
@@ -80,6 +80,8 @@ export default function PublicReuseFaciltyInsert() {
|
||||
const [bdstTable, setbdstTable] = useState<pubHasuType[]>();
|
||||
const [selectRow, setSelectRow] = useState<pubHasuType>();
|
||||
const [resetPage, isResetPage] = useState(false);
|
||||
const [selectedRowIndex, setSelectedRowIndex] = useState<number>(-1);
|
||||
const [resetSelection, setResetSelection] = useState(false);
|
||||
|
||||
const [pageNation, setPageNation] = useState<number>(1);
|
||||
const form = useForm<{
|
||||
@@ -238,6 +240,8 @@ export default function PublicReuseFaciltyInsert() {
|
||||
const cellClick = (val: number | undefined) => {
|
||||
if (val === undefined) return;
|
||||
const selectRow = pbnstHasuRes?.[val];
|
||||
setSelectedRowIndex(val);
|
||||
setResetSelection(false);
|
||||
setSelectRow(pbnstHasuRes?.[val]);
|
||||
if (selectRow) {
|
||||
pbnstRegClick(selectRow);
|
||||
@@ -285,7 +289,10 @@ export default function PublicReuseFaciltyInsert() {
|
||||
useEffect(() => {
|
||||
pubHasuInit(String(pageNation), laeSeCd);
|
||||
isResetPage(false);
|
||||
}, [pageNation, pubHasuInit]);
|
||||
setSelectRow(undefined);
|
||||
setSelectedRowIndex(-1);
|
||||
setResetSelection(true);
|
||||
}, [pageNation, pubHasuInit, laeSeCd]);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -352,8 +359,16 @@ export default function PublicReuseFaciltyInsert() {
|
||||
total={pbnstHasuResCount || 20}
|
||||
headName={"공공 하수처리시설 목록"}
|
||||
cellClick={cellClick}
|
||||
onPageChange={setPageNation}
|
||||
onPageChange={(page) => {
|
||||
setSelectRow(undefined);
|
||||
setSelectedRowIndex(-1);
|
||||
setResetSelection(true);
|
||||
setPageNation(page);
|
||||
}}
|
||||
resetPageNo={resetPage}
|
||||
resetSelection={resetSelection}
|
||||
index={selectedRowIndex}
|
||||
curPage={pageNation}
|
||||
/>
|
||||
{/* </ScrollArea> */}
|
||||
</ListDiv>
|
||||
|
||||
@@ -62,12 +62,12 @@ export type PbnstDemandComType = {
|
||||
export const pubHasuZod = z.object({
|
||||
choose: z.boolean().default(false),
|
||||
bscFctCd: z.string(),
|
||||
sido: z.string().default(""),
|
||||
gugun: z.string().default(""),
|
||||
bscFctNm: z.string().default(""),
|
||||
efflWqltStndrdNm: z.string().default(""),
|
||||
fctCpc: z.number().default(0),
|
||||
addr: z.string().nullish(),
|
||||
sido: z.string().default(""), // 시도
|
||||
gugun: z.string().default(""), // 구군
|
||||
bscFctNm: z.string().default(""), // 시설명
|
||||
efflWqltStndrdNm: z.string().default(""), // 지역구분
|
||||
fctCpc: z.number().default(0), // 시설용량
|
||||
addr: z.string().nullish(), // 위치
|
||||
});
|
||||
|
||||
export type pubHasuType = z.infer<typeof pubHasuZod>;
|
||||
|
||||
@@ -90,6 +90,7 @@ export default function CoRegExcel({
|
||||
});
|
||||
} else {
|
||||
loadingOpen(false);
|
||||
toast.error(`엑셀 파일을 선택해 주세요.`);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user