Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STYLE : 요구사항에 따라 세부사항을 글로벌과 학기별 세부 사항으로 나눈다. (#12) #13

Merged
merged 4 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/assets/data/board/board.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import Checkbox from '@mui/material/Checkbox';

export enum Board {
'마일리지 카테고리',
'마일리지 항목',
'마일리지 글로벌 항목',
'마일리지 학기별 항목',
'마일리지 조회',
'마일리지 등록',
'신청자 관리',
Expand All @@ -23,7 +24,8 @@ export enum Board {

export const BoardList = [
'마일리지 카테고리',
'마일리지 항목',
'마일리지 글로벌 항목',
'마일리지 학기별 항목',
'마일리지 조회',
'마일리지 등록',
'신청자 관리',
Expand Down
4 changes: 4 additions & 0 deletions src/assets/data/modal/modals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ export const DELETECATEGORY = 'deleteCategory';
export const ADDITEM = 'addItem';
export const EDITITEM = 'editItem';
export const DELETEITEM = 'deleteItme';

export const ADDGLOBALITEM = 'addGlobalItem';
export const EDITGLOBALITEM = 'editGlobalItem';
export const DELETEGLOBALITEM = 'deleteGlobalItem';
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ import {
MAX_MAILEAGE,
} from 'src/assets/data/fields';
import SWModal from '../common/modal/SWModal';
import { EDITITEM } from 'src/assets/data/modal/modals';

import { EDITGLOBALITEM, EDITITEM } from 'src/assets/data/modal/modals';

/**
* @component [마일리지 항목] 게시판
Expand All @@ -35,7 +34,7 @@ import { EDITITEM } from 'src/assets/data/modal/modals';
* @breif enum
*/

export enum MileageItemBoard {
export enum MileageGlobalItemBoard {
'NUM' = NUM,
'CATEGORY' = CATEGORY,
'SEMESTER' = SEMESTER,
Expand All @@ -51,16 +50,16 @@ export enum MileageItemBoard {
* @breif 데이터 인터페이스
*/
interface Data {
[MileageItemBoard.CATEGORY]: string;
[MileageItemBoard.SEMESTER]: string;
[MileageItemBoard.ITEM]: string;
[MileageItemBoard.MILEAGE]: number;
[MileageItemBoard.ISVISIBLE]: boolean;
[MileageItemBoard.REGISTERED_DATE]: string;
[MileageItemBoard.MANAGE]: string;
[MileageGlobalItemBoard.CATEGORY]: string;
[MileageGlobalItemBoard.SEMESTER]: string;
[MileageGlobalItemBoard.ITEM]: string;
[MileageGlobalItemBoard.MILEAGE]: number;
[MileageGlobalItemBoard.ISVISIBLE]: boolean;
[MileageGlobalItemBoard.REGISTERED_DATE]: string;
[MileageGlobalItemBoard.MANAGE]: string;
}

export default function MileageItem() {
export default function MileageGlobalItem() {
/**
* @kind [마일리지 항목]
* @brief 데이터 생성 함수
Expand All @@ -77,14 +76,14 @@ export default function MileageItem() {
manage: string
): Data {
return {
[MileageItemBoard.NUM]: num,
[MileageItemBoard.CATEGORY]: category,
[MileageItemBoard.SEMESTER]: semester,
[MileageItemBoard.ITEM]: item,
[MileageItemBoard.MILEAGE]: mileage,
[MileageItemBoard.ISVISIBLE]: isVisible,
[MileageItemBoard.REGISTERED_DATE]: registeredDate,
[MileageItemBoard.MANAGE]: manage,
[MileageGlobalItemBoard.NUM]: num,
[MileageGlobalItemBoard.CATEGORY]: category,
[MileageGlobalItemBoard.SEMESTER]: semester,
[MileageGlobalItemBoard.ITEM]: item,
[MileageGlobalItemBoard.MILEAGE]: mileage,
[MileageGlobalItemBoard.ISVISIBLE]: isVisible,
[MileageGlobalItemBoard.REGISTERED_DATE]: registeredDate,
[MileageGlobalItemBoard.MANAGE]: manage,
};
}

Expand All @@ -94,49 +93,49 @@ export default function MileageItem() {
*/
const headCells = [
{
id: [MileageItemBoard.NUM],
id: [MileageGlobalItemBoard.NUM],
numeric: false,
disablePadding: true,
label: '번호',
},
{
id: [MileageItemBoard.CATEGORY],
id: [MileageGlobalItemBoard.CATEGORY],
numeric: true,
disablePadding: false,
label: '카테고리명',
},
{
id: [MileageItemBoard.SEMESTER],
id: [MileageGlobalItemBoard.SEMESTER],
numeric: true,
disablePadding: false,
label: '학기',
},
{
id: [MileageItemBoard.ITEM],
id: [MileageGlobalItemBoard.ITEM],
numeric: true,
disablePadding: false,
label: '항목명',
},
{
id: [MileageItemBoard.MILEAGE],
id: [MileageGlobalItemBoard.MILEAGE],
numeric: true,
disablePadding: false,
label: '마일리지',
},
{
id: [MileageItemBoard.ISVISIBLE],
id: [MileageGlobalItemBoard.ISVISIBLE],
numeric: true,
disablePadding: false,
label: '보이기',
},
{
id: [MileageItemBoard.REGISTERED_DATE],
id: [MileageGlobalItemBoard.REGISTERED_DATE],
numeric: true,
disablePadding: false,
label: '등록일',
},
{
id: [MileageItemBoard.MANAGE],
id: [MileageGlobalItemBoard.MANAGE],
numeric: true,
disablePadding: false,
label: '관리',
Expand Down Expand Up @@ -177,8 +176,7 @@ export default function MileageItem() {
'y',
'2023-08-21',

<SWModal type={EDITITEM} beforeData={IParams} />

<SWModal type={EDITGLOBALITEM} beforeData={IParams} />
),
createData(
2,
Expand All @@ -189,8 +187,7 @@ export default function MileageItem() {
'y',
'2023-08-21',

<SWModal type={EDITITEM} beforeData={IParams} />

<SWModal type={EDITGLOBALITEM} beforeData={IParams} />
),
createData(
3,
Expand All @@ -201,8 +198,7 @@ export default function MileageItem() {
'y',
'2023-08-21',

<SWModal type={EDITITEM} beforeData={IParams} />

<SWModal type={EDITGLOBALITEM} beforeData={IParams} />
),
createData(
4,
Expand All @@ -213,8 +209,7 @@ export default function MileageItem() {
'y',
'2023-08-21',

<SWModal type={EDITITEM} beforeData={IParams} />

<SWModal type={EDITGLOBALITEM} beforeData={IParams} />
),
createData(
5,
Expand All @@ -224,7 +219,7 @@ export default function MileageItem() {
30,
'y',
'2023-08-21',
<StarIcon />
<SWModal type={EDITGLOBALITEM} beforeData={IParams} />
),
createData(
6,
Expand All @@ -234,11 +229,9 @@ export default function MileageItem() {
30,
'y',
'2023-08-21',
<StarIcon />
<SWModal type={EDITGLOBALITEM} beforeData={IParams} />
),
];


return <EnhancedTable rows={rows} headCells={headCells} type="마일리지 항목" />;

return <EnhancedTable rows={rows} headCells={headCells} type="마일리지 글로벌 항목" />;
}
2 changes: 1 addition & 1 deletion src/components/board/MileageRegister.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,5 +218,5 @@ export default function MileageRegister() {
),
];

return <EnhancedTable rows={rows} headCells={headCells} />;
return <EnhancedTable rows={rows} headCells={headCells} type="마일리지 등록" />;
}
2 changes: 1 addition & 1 deletion src/components/board/MileageResult.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,5 +188,5 @@ export default function MileageResult() {
),
];

return <EnhancedTable rows={rows} headCells={headCells} />;
return <EnhancedTable rows={rows} headCells={headCells} type="마일리지 선정결과" />;
}
Loading