Skip to content

Commit

Permalink
Fix: 카테고리에 하위 항목의 갯수를 나타내는 필드 추가(#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
ohinhyuk committed Oct 11, 2023
1 parent 0488e21 commit f436257
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/assets/data/fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,5 @@ export const MOD_DATE = 'modDate';
export const RECORD_NAME = 'recordName';
export const LEVEL = 'level';
export const TYPE = 'type';

export const ITEM_COUNT = 'itemCount';
12 changes: 12 additions & 0 deletions src/pages/mileage/category/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
ORDER_IDX,
TITLE,
MOD_DATE,
ITEM_COUNT,
} from 'src/assets/data/fields';
import SWModal from 'src/components/common/modal/SWModal';
import { EDITCATEGORY } from 'src/assets/data/modal/modals';
Expand All @@ -29,6 +30,7 @@ export enum MileageCategoryBoard {
'ORDER_IDX' = ORDER_IDX,
'DESCRIPTION1' = DESCRIPTION1,
'DESCRIPTION2' = DESCRIPTION2,
'ITEM_COUNT' = ITEM_COUNT,
'MOD_DATE' = MOD_DATE,
'MANAGE' = MANAGE,
}
Expand All @@ -45,6 +47,7 @@ interface Data {
[MileageCategoryBoard.ORDER_IDX]: number;
[MileageCategoryBoard.DESCRIPTION1]: string;
[MileageCategoryBoard.DESCRIPTION2]: string;
[MileageCategoryBoard.ITEM_COUNT]: number;
[MileageCategoryBoard.MOD_DATE]: string;
[MileageCategoryBoard.MANAGE]: ReactNode;
}
Expand All @@ -62,6 +65,7 @@ function createData(
ORDER_IDX: number,
DESCRIPTION1: string,
DESCRIPTION2: string,
ITEM_COUNT: number,
MOD_DATE: string,
MANAGE: ReactNode
): Data {
Expand All @@ -72,6 +76,7 @@ function createData(
[MileageCategoryBoard.ORDER_IDX]: ORDER_IDX,
[MileageCategoryBoard.DESCRIPTION1]: DESCRIPTION1,
[MileageCategoryBoard.DESCRIPTION2]: DESCRIPTION2,
[MileageCategoryBoard.ITEM_COUNT]: ITEM_COUNT,
[MileageCategoryBoard.MOD_DATE]: MOD_DATE,
[MileageCategoryBoard.MANAGE]: MANAGE,
};
Expand Down Expand Up @@ -119,6 +124,12 @@ const headCells = [
disablePadding: false,
label: '설명2',
},
{
id: [MileageCategoryBoard.ITEM_COUNT],
numeric: true,
disablePadding: false,
label: '하위 항목 개수',
},
{
id: [MileageCategoryBoard.MOD_DATE],
numeric: true,
Expand Down Expand Up @@ -205,6 +216,7 @@ export default function MileageCategory({
item[ORDER_IDX],
item[DESCRIPTION1],
item[DESCRIPTION2],
item[ITEM_COUNT],
item[MOD_DATE],
<SWModal type={EDITCATEGORY} beforeData={beforeData} />
);
Expand Down

0 comments on commit f436257

Please sign in to comment.