From f503b86c736c9eb058f2bef1b1fdf0d97daf7de9 Mon Sep 17 00:00:00 2001 From: Park Byung Eun Date: Mon, 1 Aug 2022 08:59:00 +0000 Subject: [PATCH] =?UTF-8?q?=EA=B3=B5=EC=A7=80=EC=82=AC=ED=95=AD=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/mock-api/apps/board/notice/api.ts | 18 +- src/app/mock-api/apps/board/notice/data.ts | 34 +++ .../components/redit.component.ts | 12 +- .../admin/board/notice/components/index.ts | 3 +- .../notice/components/list.component.html | 265 ++++++++---------- .../board/notice/components/list.component.ts | 64 ++--- .../notice/components/redit.component.html | 123 ++++++++ .../{view.component.ts => redit.component.ts} | 129 ++++----- .../notice/components/view.component.html | 2 - .../admin/board/notice/models/notice.ts | 2 +- .../admin/board/notice/notice.module.ts | 4 + .../admin/board/notice/notice.routing.ts | 20 +- 12 files changed, 386 insertions(+), 290 deletions(-) create mode 100644 src/app/modules/admin/board/notice/components/redit.component.html rename src/app/modules/admin/board/notice/components/{view.component.ts => redit.component.ts} (62%) delete mode 100644 src/app/modules/admin/board/notice/components/view.component.html diff --git a/src/app/mock-api/apps/board/notice/api.ts b/src/app/mock-api/apps/board/notice/api.ts index 5974981..fc51b73 100644 --- a/src/app/mock-api/apps/board/notice/api.ts +++ b/src/app/mock-api/apps/board/notice/api.ts @@ -33,29 +33,13 @@ export class BoardNoticeMockApi { .reply(({ request }) => { // Get available queries const search = request.params.get('search'); - const sort = request.params.get('sort') || 'name'; - const order = request.params.get('order') || 'asc'; + const page = parseInt(request.params.get('page') ?? '1', 10); const size = parseInt(request.params.get('size') ?? '10', 10); // Clone the notices let notices: any[] | null = cloneDeep(this._notices); - // Sort the notices - if (sort === 'sku' || sort === 'name' || sort === 'active') { - notices.sort((a, b) => { - const fieldA = a[sort].toString().toUpperCase(); - const fieldB = b[sort].toString().toUpperCase(); - return order === 'asc' - ? fieldA.localeCompare(fieldB) - : fieldB.localeCompare(fieldA); - }); - } else { - notices.sort((a, b) => - order === 'asc' ? a[sort] - b[sort] : b[sort] - a[sort] - ); - } - // If search exists... if (search) { // Filter the notices diff --git a/src/app/mock-api/apps/board/notice/data.ts b/src/app/mock-api/apps/board/notice/data.ts index f416a0e..8a52f37 100644 --- a/src/app/mock-api/apps/board/notice/data.ts +++ b/src/app/mock-api/apps/board/notice/data.ts @@ -2,6 +2,40 @@ export const notices = [ { + id: '1', + idx: 80, + site: '', + title: + '게임멈춤,튕기는 현상및 계좌문의시 확인및 입금전후 확인사항 대한 공지사항', + writer: '관리자', + writeDate: '2021-10-25 02:25', + views: 136, + state: '노출', + }, + { + id: '2', + idx: 80, + site: '', + title: + '게임멈춤,튕기는 현상및 계좌문의시 확인및 입금전후 확인사항 대한 공지사항', + writer: '관리자', + writeDate: '2021-10-25 02:25', + views: 136, + state: '노출', + }, + { + id: '3', + idx: 80, + site: 'all', + title: + '게임멈춤,튕기는 현상및 계좌문의시 확인및 입금전후 확인사항 대한 공지사항', + writer: '관리자', + writeDate: '2021-10-25 02:25', + views: 136, + state: '노출', + }, + { + id: '4', idx: 80, site: '', title: diff --git a/src/app/modules/admin/board/notice-oneline/components/redit.component.ts b/src/app/modules/admin/board/notice-oneline/components/redit.component.ts index 53ae71c..c0b797b 100644 --- a/src/app/modules/admin/board/notice-oneline/components/redit.component.ts +++ b/src/app/modules/admin/board/notice-oneline/components/redit.component.ts @@ -55,9 +55,9 @@ export class ReditComponent implements OnInit, AfterViewInit, OnDestroy { noticeOnelineForm!: FormGroup; editMode: boolean = false; - noticeType = NOTICE_TYPE; - siteType = SITE_TYPE; - useOrNotType = USE_OR_NOT_TYPE; + noticeType = NOTICE_ONELINE_TYPE; + siteType = SITE_NOTICE_ONELINE_TYPE; + useOrNotType = USE_OR_NOT_NOTICE_ONELINE_TYPE; noticeOneline!: NoticeOneline; @@ -180,21 +180,21 @@ export class ReditComponent implements OnInit, AfterViewInit, OnDestroy { } } -export const NOTICE_TYPE = [ +export const NOTICE_ONELINE_TYPE = [ { key: '0', value: '흐르는공지', }, ]; -export const SITE_TYPE = [ +export const SITE_NOTICE_ONELINE_TYPE = [ { key: '0', value: '--전체--', }, ]; -export const USE_OR_NOT_TYPE = [ +export const USE_OR_NOT_NOTICE_ONELINE_TYPE = [ { key: '0', value: '사용(노출)', diff --git a/src/app/modules/admin/board/notice/components/index.ts b/src/app/modules/admin/board/notice/components/index.ts index 04759eb..d187813 100644 --- a/src/app/modules/admin/board/notice/components/index.ts +++ b/src/app/modules/admin/board/notice/components/index.ts @@ -1,3 +1,4 @@ import { ListComponent } from './list.component'; +import { ReditComponent } from './redit.component'; -export const COMPONENTS = [ListComponent]; +export const COMPONENTS = [ListComponent, ReditComponent]; diff --git a/src/app/modules/admin/board/notice/components/list.component.html b/src/app/modules/admin/board/notice/components/list.component.html index 753facc..c404905 100644 --- a/src/app/modules/admin/board/notice/components/list.component.html +++ b/src/app/modules/admin/board/notice/components/list.component.html @@ -12,132 +12,99 @@
공지사항
-
- - - - - - - 작성자 - 글제목 - 글내용 - - - +
- + +
+
+ + + +
+ +
+ + + +
+ +
+ - + + - +
+ +
+ + + + + +
+
+ +
+ +
+ + +
+ + +
@@ -149,22 +116,28 @@ class="flex flex-col flex-auto sm:mb-18 overflow-hidden sm:overflow-y-auto" > - +
- - - - - - - - + + + + + +
@@ -174,44 +147,44 @@
- -