diff --git a/apps/cm/src/entities/post/api/post-service.ts b/apps/cm/src/entities/post/api/post-service.ts index b7016b780..5855c16cf 100644 --- a/apps/cm/src/entities/post/api/post-service.ts +++ b/apps/cm/src/entities/post/api/post-service.ts @@ -11,9 +11,11 @@ import { type MyPostList, type PostParams, type MyPostParams, + type NoticePostParams, type PostFormData, type PostUpdateFormData, type PostService, + type NoticePostList, } from "../model/post-interface"; export class PostApiService implements PostService { @@ -28,6 +30,17 @@ export class PostApiService implements PostService { return response.data; } + + public async getNoticePostList( + params?: NoticePostParams, + ): Promise { + const response = await client.get( + `${ENDPOINT.BOARD_SERVICE.POSTS}/recentPosts`, + { params }, + ); + return response.data; + } + public async getMyPostList( params?: MyPostParams, ): Promise { diff --git a/apps/cm/src/entities/post/index.ts b/apps/cm/src/entities/post/index.ts index e0241e2f4..e7482a879 100644 --- a/apps/cm/src/entities/post/index.ts +++ b/apps/cm/src/entities/post/index.ts @@ -4,11 +4,13 @@ export { postUpdateFormSchema, type Post, type MyPost, + type NoticePost, type MovePost, type DeletePost, type PostList, type PostParams, type MyPostParams, + type NoticePostParams, type PostFormData, type PostUpdateFormData, type PostService, diff --git a/apps/cm/src/entities/post/model/post-interface.ts b/apps/cm/src/entities/post/model/post-interface.ts index 1be87dadd..a8b23462f 100644 --- a/apps/cm/src/entities/post/model/post-interface.ts +++ b/apps/cm/src/entities/post/model/post-interface.ts @@ -12,6 +12,20 @@ export interface PostParams extends PageableParams { ansUseYn?: string; } +export interface NoticePostParams extends PageableParams { + keywordType?: string; + keyword?: string; + bbsId?: number | null; + delYn?: string; + frDateYmd?: string; + toDateYmd?: string; +} + +export interface NoticePost extends Post { + bbsNm: string; + bbsTypeCd: string; +} + export interface MyPostParams extends PageableParams { keywordType?: string; keyword?: string; @@ -99,6 +113,7 @@ export const postUpdateFormSchema = postFormSchema.omit({ export type PostList = PageableList; export type MyPostList = PageableList; +export type NoticePostList = PageableList; export type PostFormData = z.infer; export type PostUpdateFormData = z.infer; diff --git a/apps/cm/src/pages/dashboard/lib/korea-basin-map.tsx b/apps/cm/src/pages/dashboard/lib/korea-basin-map.tsx index 637f88e9d..989839187 100644 --- a/apps/cm/src/pages/dashboard/lib/korea-basin-map.tsx +++ b/apps/cm/src/pages/dashboard/lib/korea-basin-map.tsx @@ -353,11 +353,12 @@ export function KoreaBasinMap() { id="stage" style={ { + aspectRatio: 0.72/1, width: "100%", - height: "560px", + maxHeight: "100%", position: "relative", - zIndex: 20, - "--map-inset": "0", + margin: "auto", + "--map-inset": "0%", } as React.CSSProperties } > diff --git a/apps/cm/src/pages/dashboard/model/table-columns.tsx b/apps/cm/src/pages/dashboard/model/table-columns.tsx index aac2b2868..64d654dcf 100644 --- a/apps/cm/src/pages/dashboard/model/table-columns.tsx +++ b/apps/cm/src/pages/dashboard/model/table-columns.tsx @@ -1,9 +1,9 @@ import dayjs from "dayjs"; import type { ColumnDef } from "@tanstack/react-table"; import { Badge } from "@common/components"; -import type { Post, MyPost } from "@/entities/post"; +import type { MyPost, NoticePost } from "@/entities/post"; -const noticePostTableColumns: ColumnDef[] = [ +const noticePostTableColumns: ColumnDef[] = [ { header: "번호", cell: ({ row, table }) => { diff --git a/apps/cm/src/pages/dashboard/ui/dashboard-page.tsx b/apps/cm/src/pages/dashboard/ui/dashboard-page.tsx index d0cc508b6..3fa6ed8e2 100644 --- a/apps/cm/src/pages/dashboard/ui/dashboard-page.tsx +++ b/apps/cm/src/pages/dashboard/ui/dashboard-page.tsx @@ -137,12 +137,14 @@ function DashboardPage() { {/* 지도영역 */} -
-
+
+

유역별 정보

- +
+ +
diff --git a/apps/cm/src/pages/dashboard/ui/fo-fclt-cnt-rt.tsx b/apps/cm/src/pages/dashboard/ui/fo-fclt-cnt-rt.tsx index f9534f1aa..bed250f4d 100644 --- a/apps/cm/src/pages/dashboard/ui/fo-fclt-cnt-rt.tsx +++ b/apps/cm/src/pages/dashboard/ui/fo-fclt-cnt-rt.tsx @@ -52,7 +52,7 @@ const FoFcltCntRt: React.FC = () => { }, [operFcltStatus, selectedBasin]); return ( -
+

수계별 시설운영 개소수 및 가동률

diff --git a/apps/cm/src/pages/dashboard/ui/fo-wqlt-Infl-effl.tsx b/apps/cm/src/pages/dashboard/ui/fo-wqlt-Infl-effl.tsx index 7ea5c3c15..328f89839 100644 --- a/apps/cm/src/pages/dashboard/ui/fo-wqlt-Infl-effl.tsx +++ b/apps/cm/src/pages/dashboard/ui/fo-wqlt-Infl-effl.tsx @@ -179,7 +179,7 @@ const FoWqltInflEffl: React.FC = () => { }; return ( -
+

수계별 유입ㆍ방류수질 분석

diff --git a/apps/cm/src/pages/dashboard/ui/notice-list.tsx b/apps/cm/src/pages/dashboard/ui/notice-list.tsx new file mode 100644 index 000000000..3462844dc --- /dev/null +++ b/apps/cm/src/pages/dashboard/ui/notice-list.tsx @@ -0,0 +1,51 @@ +"use client"; + +import { useRouter } from "next/navigation"; +import { useQuery } from "@tanstack/react-query"; +import { getCoreRowModel } from "@tanstack/react-table"; +import { PostApi, type NoticePost } from "@/entities/post"; +import { ENDPOINT } from "@/shared/config"; +import { useDataTable } from "@/shared/lib"; +import { + noticePostTableColumns, +} from "../model/table-columns"; + + +function NoticeList() { + const router = useRouter(); + const noticePostQuery = useQuery({ + queryKey: [ENDPOINT.BOARD_SERVICE.POSTS], + queryFn: () => + PostApi.getNoticePostList({ + page: 0, + size: 5, + keywordType: "bbsTypeCd", + keyword: "BBSNOTICE", + }), + }); + + const handleNoticePostRowClick = (row: NoticePost) => { + router.push(`/bbs/bbsnotice/${row.bbsId}/${row.pstNo}`); + }; + + const { tableComponent: noticePostTableComponent } = useDataTable({ + query: noticePostQuery, + tableOptions: { + columns: noticePostTableColumns, + getCoreRowModel: getCoreRowModel(), + }, + dataTableOptions: { + variant: "line", + onRowClick: handleNoticePostRowClick, + }, + }); + + return ( +
+
+

공지사항

+
+ {noticePostTableComponent} +
+ ); +} \ No newline at end of file diff --git a/apps/cm/src/pages/dashboard/ui/reuse-chart.tsx b/apps/cm/src/pages/dashboard/ui/reuse-chart.tsx index 0a9879c19..37bdb8fad 100644 --- a/apps/cm/src/pages/dashboard/ui/reuse-chart.tsx +++ b/apps/cm/src/pages/dashboard/ui/reuse-chart.tsx @@ -176,7 +176,7 @@ const ReuseChart: React.FC = () => { }; return ( -
+

{chartItems[activeIndex]?.title}

diff --git a/apps/cm/src/pages/dashboard/ui/reuse-status.tsx b/apps/cm/src/pages/dashboard/ui/reuse-status.tsx index dc55f8339..fbe58ed84 100644 --- a/apps/cm/src/pages/dashboard/ui/reuse-status.tsx +++ b/apps/cm/src/pages/dashboard/ui/reuse-status.tsx @@ -27,7 +27,7 @@ const ReuseStatus: React.FC = () => { }; return ( -
+

물재이용 현황 (재이용량, m³)

diff --git a/apps/cm/src/pages/dashboard/ui/sn-old-ppl.tsx b/apps/cm/src/pages/dashboard/ui/sn-old-ppl.tsx index 622445baf..1e4157974 100644 --- a/apps/cm/src/pages/dashboard/ui/sn-old-ppl.tsx +++ b/apps/cm/src/pages/dashboard/ui/sn-old-ppl.tsx @@ -165,7 +165,7 @@ export default function SnOldPpl() { }; return ( -
+

노후 하수관로 현황

diff --git a/apps/cm/src/pages/dashboard/ui/sn-ppl-status.tsx b/apps/cm/src/pages/dashboard/ui/sn-ppl-status.tsx index 19ff5fa2c..292e83075 100644 --- a/apps/cm/src/pages/dashboard/ui/sn-ppl-status.tsx +++ b/apps/cm/src/pages/dashboard/ui/sn-ppl-status.tsx @@ -187,7 +187,7 @@ export default function SnPplStatus() { //const data = { labels, datasets }; return ( -
+

오수관로 및 우수관로 현황