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/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/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" > -