From cdd5586744aab2a7d74b6fcfecf8a1709a34e541 Mon Sep 17 00:00:00 2001 From: Park Byung Eun Date: Mon, 1 Aug 2022 08:03:31 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=ED=95=9C=EC=A4=84=EA=B3=B5=EC=A7=80=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 --- .../mock-api/apps/board/notice-oneline/api.ts | 18 +- .../apps/board/notice-oneline/data.ts | 41 ++++ .../board/notice-oneline/components/index.ts | 3 +- .../components/list.component.html | 227 ++++++++---------- .../components/list.component.ts | 99 +++----- .../components/redit.component.html | 137 +++++++++++ ...ration.component.ts => redit.component.ts} | 149 +++++++----- .../components/registration.component.html | 2 - .../components/view.component.html | 2 - .../components/view.component.ts | 183 -------------- .../notice-oneline/models/notice-oneline.ts | 1 + .../notice-oneline/notice-oneline.module.ts | 2 + .../notice-oneline/notice-oneline.routing.ts | 23 +- .../resolvers/notice-oneline.resolver.ts | 2 +- .../board/popup/components/redit.component.ts | 62 +---- 15 files changed, 415 insertions(+), 536 deletions(-) create mode 100644 src/app/modules/admin/board/notice-oneline/components/redit.component.html rename src/app/modules/admin/board/notice-oneline/components/{registration.component.ts => redit.component.ts} (57%) delete mode 100644 src/app/modules/admin/board/notice-oneline/components/registration.component.html delete mode 100644 src/app/modules/admin/board/notice-oneline/components/view.component.html delete mode 100644 src/app/modules/admin/board/notice-oneline/components/view.component.ts diff --git a/src/app/mock-api/apps/board/notice-oneline/api.ts b/src/app/mock-api/apps/board/notice-oneline/api.ts index af9ed95..c107c15 100644 --- a/src/app/mock-api/apps/board/notice-oneline/api.ts +++ b/src/app/mock-api/apps/board/notice-oneline/api.ts @@ -33,29 +33,13 @@ export class BoardNoticeOnelineMockApi { .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 noticeOnelines let noticeOnelines: any[] | null = cloneDeep(this._noticeOnelines); - // Sort the noticeOnelines - if (sort === 'sku' || sort === 'name' || sort === 'active') { - noticeOnelines.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 { - noticeOnelines.sort((a, b) => - order === 'asc' ? a[sort] - b[sort] : b[sort] - a[sort] - ); - } - // If search exists... if (search) { // Filter the noticeOnelines diff --git a/src/app/mock-api/apps/board/notice-oneline/data.ts b/src/app/mock-api/apps/board/notice-oneline/data.ts index d629dc9..558160f 100644 --- a/src/app/mock-api/apps/board/notice-oneline/data.ts +++ b/src/app/mock-api/apps/board/notice-oneline/data.ts @@ -2,6 +2,7 @@ export const noticeOnelines = [ { + id: '1', idx: 25, site: 'All', title: '-입금문의안내(필독)-', @@ -10,4 +11,44 @@ export const noticeOnelines = [ views: 65, state: '노출', }, + { + id: '2', + idx: 26, + site: 'All', + title: '-입금문의안내(필독)-', + writer: '관리자', + writeDate: '2021-06-08 00:43', + views: 65, + state: '노출', + }, + { + id: '3', + idx: 27, + site: 'All', + title: '-입금문의안내(필독)-', + writer: '관리자', + writeDate: '2021-06-08 00:43', + views: 65, + state: '노출', + }, + { + id: '4', + idx: 28, + site: 'All', + title: '-입금문의안내(필독)-', + writer: '관리자', + writeDate: '2021-06-08 00:43', + views: 65, + state: '노출', + }, + { + id: '5', + idx: 29, + site: 'All', + title: '-입금문의안내(필독)-', + writer: '관리자', + writeDate: '2021-06-08 00:43', + views: 65, + state: '노출', + }, ]; diff --git a/src/app/modules/admin/board/notice-oneline/components/index.ts b/src/app/modules/admin/board/notice-oneline/components/index.ts index 04759eb..d187813 100644 --- a/src/app/modules/admin/board/notice-oneline/components/index.ts +++ b/src/app/modules/admin/board/notice-oneline/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-oneline/components/list.component.html b/src/app/modules/admin/board/notice-oneline/components/list.component.html index 280858f..80ecff4 100644 --- a/src/app/modules/admin/board/notice-oneline/components/list.component.html +++ b/src/app/modules/admin/board/notice-oneline/components/list.component.html @@ -10,117 +10,82 @@ -
한줄공지
+
쪽지함
-
- - - - - - - 아이디 - 닉네임 - 이름 - 사이트 - - +
- - - - - + + +
+
+ + +
+ +
+ + +
+ +
+ + + + + +
+ +
+ + + + + +
@@ -130,21 +95,25 @@ class="flex flex-col flex-auto sm:mb-18 overflow-hidden sm:overflow-y-auto" > - +
- - - - - - - + + + + +
@@ -158,37 +127,39 @@ class="inventory-grid grid items-center gap-4 py-3 px-6 md:px-8 border-b" > -