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 @@
-
+
-
-
-
-
-
-
-
- 아이디
- 닉네임
- 이름
- 사이트
-
-
+
-
-
-
-
-
+
+
+
+
+
+ 등록
+
+
+
+
+
+
+
+
+
+
+
-
- 검색하기
+
+ Search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -130,21 +95,25 @@
class="flex flex-col flex-auto sm:mb-18 overflow-hidden sm:overflow-y-auto"
>
- 0; else noNoticeOneline">
+ 0; else noUser">
-
번호
-
사이트
-
제목
-
작성자
-
작성일
-
조회
-
상태
+
번호
+
사이트
+
제목
+
+ 작성자
+
+ 작성일
+
+
+ 조회
+
+ 상태
+
@@ -158,37 +127,39 @@
class="inventory-grid grid items-center gap-4 py-3 px-6 md:px-8 border-b"
>
-
+
{{ noticeOneline.idx }}
-
+
{{ noticeOneline.site }}
-
+
{{ noticeOneline.title }}
-
-
+
+
{{ noticeOneline.writer }}
-
-
-
+
+
{{ noticeOneline.writeDate }}
-
-
+
+
{{ noticeOneline.views }}
-
-
-
+
+
{{ noticeOneline.state }}
+
+
-
-
등록
@@ -204,11 +175,11 @@
-
+
- There are no noticeOnelines!
+ There are no data!
diff --git a/src/app/modules/admin/board/notice-oneline/components/list.component.ts b/src/app/modules/admin/board/notice-oneline/components/list.component.ts
index 27e8944..94bbd15 100644
--- a/src/app/modules/admin/board/notice-oneline/components/list.component.ts
+++ b/src/app/modules/admin/board/notice-oneline/components/list.component.ts
@@ -8,28 +8,13 @@ import {
ViewChild,
ViewEncapsulation,
} from '@angular/core';
-import {
- FormBuilder,
- FormControl,
- FormGroup,
- Validators,
-} from '@angular/forms';
-import { MatCheckboxChange } from '@angular/material/checkbox';
-import { MatPaginator } from '@angular/material/paginator';
-import { MatSort } from '@angular/material/sort';
-import {
- debounceTime,
- map,
- merge,
- Observable,
- Subject,
- switchMap,
- takeUntil,
-} from 'rxjs';
-import { fuseAnimations } from '@fuse/animations';
-import { FuseConfirmationService } from '@fuse/services/confirmation';
+import { FormBuilder, FormControl } from '@angular/forms';
+
+import { MatPaginator } from '@angular/material/paginator';
+
+import { Observable, Subject, takeUntil } from 'rxjs';
+import { fuseAnimations } from '@fuse/animations';
-import { User } from '../../../member/user/models/user';
import { NoticeOneline } from '../models/notice-oneline';
import { NoticeOnelinePagination } from '../models/notice-oneline-pagination';
import { NoticeOnelineService } from '../services/notice-oneline.service';
@@ -42,18 +27,18 @@ import { Router } from '@angular/router';
/* language=SCSS */
`
.inventory-grid {
- grid-template-columns: 60px auto 40px;
+ grid-template-columns: 40px 40px auto 200px 200px;
@screen sm {
- grid-template-columns: 60px 60px 60px 60px 60px 60px auto 60px;
+ grid-template-columns: 40px 40px auto 200px 200px;
}
@screen md {
- grid-template-columns: 60px 60px 60px 60px 60px 60px auto 60px 60px;
+ grid-template-columns: 40px 40px auto 300px 200px;
}
@screen lg {
- grid-template-columns: 60px 70px 70px 70px 70px 100px 60px 60px auto 60px 60px 60px 60px;
+ grid-template-columns: 40px 40px auto 300px 200px;
}
}
`,
@@ -64,16 +49,16 @@ import { Router } from '@angular/router';
})
export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
@ViewChild(MatPaginator) private _paginator!: MatPaginator;
- @ViewChild(MatSort) private _sort!: MatSort;
noticeOnelines$!: Observable
;
- users$!: Observable;
isLoading = false;
searchInputControl = new FormControl();
selectedNoticeOneline?: NoticeOneline;
pagination?: NoticeOnelinePagination;
+ __isSearchOpened = false;
+
private _unsubscribeAll: Subject = new Subject();
/**
@@ -81,8 +66,6 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
*/
constructor(
private _changeDetectorRef: ChangeDetectorRef,
- private _fuseConfirmationService: FuseConfirmationService,
- private _formBuilder: FormBuilder,
private _noticeOnelineService: NoticeOnelineService,
private router: Router
) {}
@@ -113,45 +96,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
/**
* After view init
*/
- ngAfterViewInit(): void {
- if (this._sort && this._paginator) {
- // Set the initial sort
- this._sort.sort({
- id: 'name',
- start: 'asc',
- disableClear: true,
- });
-
- // Mark for check
- this._changeDetectorRef.markForCheck();
-
- // If the noticeOneline changes the sort order...
- this._sort.sortChange
- .pipe(takeUntil(this._unsubscribeAll))
- .subscribe(() => {
- // Reset back to the first page
- this._paginator.pageIndex = 0;
- });
-
- // Get products if sort or page changes
- merge(this._sort.sortChange, this._paginator.page)
- .pipe(
- switchMap(() => {
- this.isLoading = true;
- return this._noticeOnelineService.getNoticeOnelines(
- this._paginator.pageIndex,
- this._paginator.pageSize,
- this._sort.active,
- this._sort.direction
- );
- }),
- map(() => {
- this.isLoading = false;
- })
- )
- .subscribe();
- }
- }
+ ngAfterViewInit(): void {}
/**
* On destroy
@@ -166,14 +111,24 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
// @ Public methods
// -----------------------------------------------------------------------------------------------------
- viewUserDetail(id: string): void {
- let url: string = 'member/user/' + id;
- this.router.navigateByUrl(url);
- }
// -----------------------------------------------------------------------------------------------------
// @ Private methods
// -----------------------------------------------------------------------------------------------------
+ /**
+ * toggle the search
+ * Used in 'bar'
+ */
+ __onClickTItle(noticeOneline: NoticeOneline): void {}
+ __onClickSearch(): void {
+ this.__isSearchOpened = !this.__isSearchOpened;
+ }
+
+ __onClickReditBtn(event: MouseEvent, id: string): void {
+ const param = id === '0' ? '' : id;
+ let url: string = 'board/notice-oneline/redit/' + param;
+ this.router.navigateByUrl(url);
+ }
/**
* Create product
*/
diff --git a/src/app/modules/admin/board/notice-oneline/components/redit.component.html b/src/app/modules/admin/board/notice-oneline/components/redit.component.html
new file mode 100644
index 0000000..c20167f
--- /dev/null
+++ b/src/app/modules/admin/board/notice-oneline/components/redit.component.html
@@ -0,0 +1,137 @@
+
+
+
+
+
+
+
+ 한줄공지 {{ !noticeOneline ? "등록" : "수정" }}
+
+
+
+
+
+
+
+ 취소
+
+
+
+ {{ !noticeOneline ? "등록" : "수정" }}
+
+
+
+
+
+
+
+
diff --git a/src/app/modules/admin/board/notice-oneline/components/registration.component.ts b/src/app/modules/admin/board/notice-oneline/components/redit.component.ts
similarity index 56%
rename from src/app/modules/admin/board/notice-oneline/components/registration.component.ts
rename to src/app/modules/admin/board/notice-oneline/components/redit.component.ts
index be1797c..c0b797b 100644
--- a/src/app/modules/admin/board/notice-oneline/components/registration.component.ts
+++ b/src/app/modules/admin/board/notice-oneline/components/redit.component.ts
@@ -8,33 +8,20 @@ import {
ViewChild,
ViewEncapsulation,
} from '@angular/core';
-import {
- FormBuilder,
- FormControl,
- FormGroup,
- Validators,
-} from '@angular/forms';
-import { MatCheckboxChange } from '@angular/material/checkbox';
+
+import { ActivatedRoute, Router } from '@angular/router';
+import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
import { MatPaginator } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
-import {
- debounceTime,
- map,
- merge,
- Observable,
- Subject,
- switchMap,
- takeUntil,
-} from 'rxjs';
+import { Subject, takeUntil } from 'rxjs';
import { fuseAnimations } from '@fuse/animations';
import { FuseConfirmationService } from '@fuse/services/confirmation';
-
-import { User } from 'app/modules/admin/member/user/models/user';
-import { UserService } from 'app/modules/admin/member/user/services/user.service';
+import { NoticeOnelineService } from '../services/notice-oneline.service';
+import { NoticeOneline } from '../models/notice-oneline';
@Component({
- selector: 'notice-oneline-registration',
- templateUrl: './registration.component.html',
+ selector: 'notice-oneline-redit',
+ templateUrl: './redit.component.html',
styles: [
/* language=SCSS */
`
@@ -59,14 +46,20 @@ import { UserService } from 'app/modules/admin/member/user/services/user.service
changeDetection: ChangeDetectionStrategy.OnPush,
animations: fuseAnimations,
})
-export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
+export class ReditComponent implements OnInit, AfterViewInit, OnDestroy {
@ViewChild(MatPaginator) private _paginator!: MatPaginator;
@ViewChild(MatSort) private _sort!: MatSort;
isLoading = false;
searchInputControl = new FormControl();
- selectedProductForm!: FormGroup;
- selectedUser?: User;
+ noticeOnelineForm!: FormGroup;
+ editMode: boolean = false;
+
+ noticeType = NOTICE_ONELINE_TYPE;
+ siteType = SITE_NOTICE_ONELINE_TYPE;
+ useOrNotType = USE_OR_NOT_NOTICE_ONELINE_TYPE;
+
+ noticeOneline!: NoticeOneline;
private _unsubscribeAll: Subject = new Subject();
@@ -77,7 +70,9 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
private _changeDetectorRef: ChangeDetectorRef,
private _fuseConfirmationService: FuseConfirmationService,
private _formBuilder: FormBuilder,
- private _userService: UserService
+ private _route: ActivatedRoute,
+ private _router: Router,
+ private _noticeOnelineService: NoticeOnelineService
) {}
// -----------------------------------------------------------------------------------------------------
@@ -88,53 +83,32 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
* On init
*/
ngOnInit(): void {
- this.selectedProductForm = this._formBuilder.group({
- id: [''],
- signinId: [{ value: '', disabled: true }],
- signinPw: [{ value: '' }],
- exchangePw: [''],
- description: [''],
- tags: [[]],
- nickname: [{ value: '', disabled: true }],
- ownCash: [''],
- phoneNumber: [''],
- level: [''],
- status: [''],
- isExcahngeMoney: [''],
- bankname: [''],
- accountNumber: [''],
- accountHolder: [''],
- comp: [''],
- coupon: [''],
- recommender: [{ value: '', disabled: true }],
- changeSite: [''],
- recommendCount: [''],
- hodingGameMoney: [{ value: '0', disabled: true }],
- memo: [''],
- bacaraRate: [],
- rulletRate: [],
- dragonRate: [],
- etcRate: [],
- slotRate: [],
- casinoRusingRate: [],
- slotRusingRate: [],
+ // Create the contact form
+ this.noticeOnelineForm = this._formBuilder.group({
+ writer: ['관리자'],
+ noticeType: [''],
+ useOrNot: [''],
+ widthSize: [''],
+ site: [''],
+ title: [''],
+ writerDate: [''],
+ views: ['0'],
+ content: [''],
});
- // Get the User
- this._userService.user$
+ this._noticeOnelineService.noticeOneline$
.pipe(takeUntil(this._unsubscribeAll))
- .subscribe((user: User | undefined) => {
- if (!user) {
+ .subscribe((noticeOneline: NoticeOneline | undefined) => {
+ if (!noticeOneline) {
return;
}
- this.selectedUser = user;
- this.selectedProductForm.patchValue(user);
+ this.noticeOneline = noticeOneline;
+ this.noticeOnelineForm.patchValue(noticeOneline);
+
// Mark for check
this._changeDetectorRef.markForCheck();
});
-
- /* this.user$ = this._userService.user$; */
}
/**
@@ -159,6 +133,14 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
// @ Private methods
// -----------------------------------------------------------------------------------------------------
+ __onClickeCancel(): void {
+ /* let url: string = 'board/customer-template/';
+ this._router.navigateByUrl(url); */
+ }
+ __onClickReditBtn(noticeOneline: NoticeOneline): void {
+ console.log('click: ', noticeOneline);
+ }
+
/**
* Create product
*/
@@ -171,6 +153,22 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
*/
__toggleDetails(productId: string): void {}
+ /**
+ * Toggle edit mode
+ *
+ * @param editMode
+ */
+ toggleEditMode(editMode: boolean | null = null): void {
+ if (editMode === null) {
+ this.editMode = !this.editMode;
+ } else {
+ this.editMode = editMode;
+ }
+
+ // Mark for check
+ this._changeDetectorRef.markForCheck();
+ }
+
/**
* Track by function for ngFor loops
*
@@ -181,3 +179,28 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
return item.id || index;
}
}
+
+export const NOTICE_ONELINE_TYPE = [
+ {
+ key: '0',
+ value: '흐르는공지',
+ },
+];
+
+export const SITE_NOTICE_ONELINE_TYPE = [
+ {
+ key: '0',
+ value: '--전체--',
+ },
+];
+
+export const USE_OR_NOT_NOTICE_ONELINE_TYPE = [
+ {
+ key: '0',
+ value: '사용(노출)',
+ },
+ {
+ key: '1',
+ value: '미사용',
+ },
+];
diff --git a/src/app/modules/admin/board/notice-oneline/components/registration.component.html b/src/app/modules/admin/board/notice-oneline/components/registration.component.html
deleted file mode 100644
index cccc15f..0000000
--- a/src/app/modules/admin/board/notice-oneline/components/registration.component.html
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
diff --git a/src/app/modules/admin/board/notice-oneline/components/view.component.html b/src/app/modules/admin/board/notice-oneline/components/view.component.html
deleted file mode 100644
index 79fed21..0000000
--- a/src/app/modules/admin/board/notice-oneline/components/view.component.html
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
diff --git a/src/app/modules/admin/board/notice-oneline/components/view.component.ts b/src/app/modules/admin/board/notice-oneline/components/view.component.ts
deleted file mode 100644
index d7f1a89..0000000
--- a/src/app/modules/admin/board/notice-oneline/components/view.component.ts
+++ /dev/null
@@ -1,183 +0,0 @@
-import {
- AfterViewInit,
- ChangeDetectionStrategy,
- ChangeDetectorRef,
- Component,
- OnDestroy,
- OnInit,
- ViewChild,
- ViewEncapsulation,
-} from '@angular/core';
-import {
- FormBuilder,
- FormControl,
- FormGroup,
- Validators,
-} from '@angular/forms';
-import { MatCheckboxChange } from '@angular/material/checkbox';
-import { MatPaginator } from '@angular/material/paginator';
-import { MatSort } from '@angular/material/sort';
-import {
- debounceTime,
- map,
- merge,
- Observable,
- Subject,
- switchMap,
- takeUntil,
-} from 'rxjs';
-import { fuseAnimations } from '@fuse/animations';
-import { FuseConfirmationService } from '@fuse/services/confirmation';
-
-import { User } from 'app/modules/admin/member/user/models/user';
-import { UserService } from 'app/modules/admin/member/user/services/user.service';
-
-@Component({
- selector: 'notice-oneline-view',
- templateUrl: './view.component.html',
- styles: [
- /* language=SCSS */
- `
- .inventory-grid {
- grid-template-columns: 48px auto 40px;
-
- @screen sm {
- grid-template-columns: 48px auto 112px 72px;
- }
-
- @screen md {
- grid-template-columns: 48px 112px auto 112px 72px;
- }
-
- @screen lg {
- grid-template-columns: 48px 112px auto 112px 96px 96px 72px;
- }
- }
- `,
- ],
- encapsulation: ViewEncapsulation.None,
- changeDetection: ChangeDetectionStrategy.OnPush,
- animations: fuseAnimations,
-})
-export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
- @ViewChild(MatPaginator) private _paginator!: MatPaginator;
- @ViewChild(MatSort) private _sort!: MatSort;
-
- isLoading = false;
- searchInputControl = new FormControl();
- selectedProductForm!: FormGroup;
- selectedUser?: User;
-
- private _unsubscribeAll: Subject = new Subject();
-
- /**
- * Constructor
- */
- constructor(
- private _changeDetectorRef: ChangeDetectorRef,
- private _fuseConfirmationService: FuseConfirmationService,
- private _formBuilder: FormBuilder,
- private _userService: UserService
- ) {}
-
- // -----------------------------------------------------------------------------------------------------
- // @ Lifecycle hooks
- // -----------------------------------------------------------------------------------------------------
-
- /**
- * On init
- */
- ngOnInit(): void {
- this.selectedProductForm = this._formBuilder.group({
- id: [''],
- signinId: [{ value: '', disabled: true }],
- signinPw: [{ value: '' }],
- exchangePw: [''],
- description: [''],
- tags: [[]],
- nickname: [{ value: '', disabled: true }],
- ownCash: [''],
- phoneNumber: [''],
- level: [''],
- status: [''],
- isExcahngeMoney: [''],
- bankname: [''],
- accountNumber: [''],
- accountHolder: [''],
- comp: [''],
- coupon: [''],
- recommender: [{ value: '', disabled: true }],
- changeSite: [''],
- recommendCount: [''],
- hodingGameMoney: [{ value: '0', disabled: true }],
- memo: [''],
- bacaraRate: [],
- rulletRate: [],
- dragonRate: [],
- etcRate: [],
- slotRate: [],
- casinoRusingRate: [],
- slotRusingRate: [],
- });
-
- // Get the User
- this._userService.user$
- .pipe(takeUntil(this._unsubscribeAll))
- .subscribe((user: User | undefined) => {
- if (!user) {
- return;
- }
- this.selectedUser = user;
-
- this.selectedProductForm.patchValue(user);
- // Mark for check
- this._changeDetectorRef.markForCheck();
- });
-
- /* this.user$ = this._userService.user$; */
- }
-
- /**
- * After view init
- */
- ngAfterViewInit(): void {}
-
- /**
- * On destroy
- */
- ngOnDestroy(): void {
- // Unsubscribe from all subscriptions
- this._unsubscribeAll.next(null);
- this._unsubscribeAll.complete();
- }
-
- // -----------------------------------------------------------------------------------------------------
- // @ Public methods
- // -----------------------------------------------------------------------------------------------------
-
- // -----------------------------------------------------------------------------------------------------
- // @ Private methods
- // -----------------------------------------------------------------------------------------------------
-
- /**
- * Create product
- */
- __createProduct(): void {}
-
- /**
- * Toggle product details
- *
- * @param productId
- */
- __toggleDetails(productId: string): void {}
-
- /**
- * Track by function for ngFor loops
- *
- * @param index
- * @param item
- */
- __trackByFn(index: number, item: any): any {
- return item.id || index;
- }
-}
diff --git a/src/app/modules/admin/board/notice-oneline/models/notice-oneline.ts b/src/app/modules/admin/board/notice-oneline/models/notice-oneline.ts
index 8e8e85d..a744714 100644
--- a/src/app/modules/admin/board/notice-oneline/models/notice-oneline.ts
+++ b/src/app/modules/admin/board/notice-oneline/models/notice-oneline.ts
@@ -1,4 +1,5 @@
export interface NoticeOneline {
+ id: string;
idx?: number;
site?: string;
title?: string;
diff --git a/src/app/modules/admin/board/notice-oneline/notice-oneline.module.ts b/src/app/modules/admin/board/notice-oneline/notice-oneline.module.ts
index a72789f..d888893 100644
--- a/src/app/modules/admin/board/notice-oneline/notice-oneline.module.ts
+++ b/src/app/modules/admin/board/notice-oneline/notice-oneline.module.ts
@@ -15,6 +15,7 @@ import { MatGridListModule } from '@angular/material/grid-list';
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import { MatRadioModule } from '@angular/material/radio';
import { MatCheckboxModule } from '@angular/material/checkbox';
+import { MatDatepickerModule } from '@angular/material/datepicker';
import { TranslocoModule } from '@ngneat/transloco';
@@ -45,6 +46,7 @@ import { noticeOnelineRoutes } from './notice-oneline.routing';
MatSlideToggleModule,
MatRadioModule,
MatCheckboxModule,
+ MatDatepickerModule,
],
})
export class NoticeOnelineModule {}
diff --git a/src/app/modules/admin/board/notice-oneline/notice-oneline.routing.ts b/src/app/modules/admin/board/notice-oneline/notice-oneline.routing.ts
index 06471ca..9247b39 100644
--- a/src/app/modules/admin/board/notice-oneline/notice-oneline.routing.ts
+++ b/src/app/modules/admin/board/notice-oneline/notice-oneline.routing.ts
@@ -1,24 +1,35 @@
import { Route } from '@angular/router';
import { ListComponent } from './components/list.component';
-import { ViewComponent } from '../../member/user/components/view.component';
+import { ReditComponent } from './components/redit.component';
-import { NoticeOnelinesResolver } from './resolvers/notice-oneline.resolver';
-import { UserResolver } from '../../member/user/resolvers/user.resolver';
+import {
+ NoticeOnelinesResolver,
+ NoticeOnelineResolver,
+} from './resolvers/notice-oneline.resolver';
export const noticeOnelineRoutes: Route[] = [
{
path: '',
+ pathMatch: 'full',
+ redirectTo: 'list',
+ },
+ {
+ path: 'list',
component: ListComponent,
resolve: {
noticeOnelines: NoticeOnelinesResolver,
},
},
{
- path: ':id',
- component: ViewComponent,
+ path: 'redit',
+ component: ReditComponent,
+ },
+ {
+ path: 'redit/:id',
+ component: ReditComponent,
resolve: {
- users: UserResolver,
+ noticeOneline: NoticeOnelineResolver,
},
},
];
diff --git a/src/app/modules/admin/board/notice-oneline/resolvers/notice-oneline.resolver.ts b/src/app/modules/admin/board/notice-oneline/resolvers/notice-oneline.resolver.ts
index 4ca837c..9cf54c8 100644
--- a/src/app/modules/admin/board/notice-oneline/resolvers/notice-oneline.resolver.ts
+++ b/src/app/modules/admin/board/notice-oneline/resolvers/notice-oneline.resolver.ts
@@ -38,7 +38,7 @@ export class NoticeOnelineResolver implements Resolve {
state: RouterStateSnapshot
): Observable {
return this._noticeOnelineService
- .getNoticeOnelineById(route.paramMap.get('title'))
+ .getNoticeOnelineById(route.paramMap.get('id'))
.pipe(
// Error here means the requested product is not available
catchError((error) => {
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 @@
-
-
-
-
-
-
-
- 작성자
- 글제목
- 글내용
-
-
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Search
+
+
+
+
+
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
- 검색하기
+
+ 등록
+
+
+
+ 숨김
+
+
+
+ 완전삭제
@@ -149,22 +116,28 @@
class="flex flex-col flex-auto sm:mb-18 overflow-hidden sm:overflow-y-auto"
>
- 0; else noNotice">
+ 0; else noUser">
-
선택
-
번호
-
사이트
-
제목
-
작성자
-
작성일
-
조회
-
상태
+
+
+
+
번호
+
사이트
+
제목
+
+ 작성자
+
+ 작성일
+
+
+ 조회
+
+ 상태
+
@@ -174,44 +147,44 @@
-
-
+
-
+
{{ notice.idx }}
-
+
{{ notice.site }}
-
+
{{ notice.title }}
-
-
+
+
{{ notice.writer }}
-
-
-
+
+
{{ notice.writeDate }}
-
-
+
+
{{ notice.views }}
-
-
-
+
+
{{ notice.state }}
+
+
-
등록
-
숨김
-
완전삭제
-
+
- There are no notices!
+ There are no data!
diff --git a/src/app/modules/admin/board/notice/components/list.component.ts b/src/app/modules/admin/board/notice/components/list.component.ts
index 812f993..b32b8fd 100644
--- a/src/app/modules/admin/board/notice/components/list.component.ts
+++ b/src/app/modules/admin/board/notice/components/list.component.ts
@@ -42,18 +42,18 @@ import { Router } from '@angular/router';
/* language=SCSS */
`
.inventory-grid {
- grid-template-columns: 60px auto 40px;
+ grid-template-columns: 40px 40px 40px auto 200px 200px;
@screen sm {
- grid-template-columns: 60px 60px 60px 60px 60px 60px auto 60px;
+ grid-template-columns: 40px 40px 40px auto 200px 200px;
}
@screen md {
- grid-template-columns: 60px 60px 60px 60px 60px 60px auto 60px 60px;
+ grid-template-columns: 40px 40px 40px auto 300px 200px;
}
@screen lg {
- grid-template-columns: 60px 70px 70px 70px 70px 100px 60px 60px auto 60px 60px 60px 60px;
+ grid-template-columns: 40px 40px 40px auto 300px 200px;
}
}
`,
@@ -67,13 +67,14 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
@ViewChild(MatSort) private _sort!: MatSort;
notices$!: Observable
;
- users$!: Observable;
isLoading = false;
searchInputControl = new FormControl();
selectedNotice?: Notice;
pagination?: NoticePagination;
+ __isSearchOpened = false;
+
private _unsubscribeAll: Subject = new Subject();
/**
@@ -113,45 +114,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
/**
* After view init
*/
- ngAfterViewInit(): void {
- if (this._sort && this._paginator) {
- // Set the initial sort
- this._sort.sort({
- id: 'name',
- start: 'asc',
- disableClear: true,
- });
-
- // Mark for check
- this._changeDetectorRef.markForCheck();
-
- // If the notice changes the sort order...
- this._sort.sortChange
- .pipe(takeUntil(this._unsubscribeAll))
- .subscribe(() => {
- // Reset back to the first page
- this._paginator.pageIndex = 0;
- });
-
- // Get products if sort or page changes
- merge(this._sort.sortChange, this._paginator.page)
- .pipe(
- switchMap(() => {
- this.isLoading = true;
- return this._noticeService.getNotices(
- this._paginator.pageIndex,
- this._paginator.pageSize,
- this._sort.active,
- this._sort.direction
- );
- }),
- map(() => {
- this.isLoading = false;
- })
- )
- .subscribe();
- }
- }
+ ngAfterViewInit(): void {}
/**
* On destroy
@@ -166,14 +129,19 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
// @ Public methods
// -----------------------------------------------------------------------------------------------------
- viewUserDetail(id: string): void {
- let url: string = 'member/user/' + id;
- this.router.navigateByUrl(url);
- }
// -----------------------------------------------------------------------------------------------------
// @ Private methods
// -----------------------------------------------------------------------------------------------------
+ __onClickReditBtn(event: MouseEvent, id: string): void {
+ const param = id === '0' ? '' : id;
+ let url: string = 'board/notice/redit/' + param;
+ this.router.navigateByUrl(url);
+ }
+ __onClickSearch(): void {
+ this.__isSearchOpened = !this.__isSearchOpened;
+ }
+
/**
* Create product
*/
diff --git a/src/app/modules/admin/board/notice/components/redit.component.html b/src/app/modules/admin/board/notice/components/redit.component.html
new file mode 100644
index 0000000..7b7431b
--- /dev/null
+++ b/src/app/modules/admin/board/notice/components/redit.component.html
@@ -0,0 +1,123 @@
+
+
+
+
+
+
+
+ 공지사항 {{ !notice ? "등록" : "수정" }}
+
+
+
+
+
+
+ 글쓴이(아이디)
+
+
+
+
+
+
+
+ 공지적용
+
+
+
+ {{ type.value }}
+
+
+
+
+
+
+
+
+
+ 제목
+
+
+
+
+
+
+ 등록시간
+
+
+
예) 2001-01-01 23시22분(2001년 1월1일 오후 11시21분)-
+ 미등록시 현재일로 등록
+
+
+
+
+
+
+ 내용
+
+
+
+
+
+
+
+
+ 취소
+
+
+
+ {{ !notice ? "등록" : "수정" }}
+
+
+ 숨김
+
+
+
+
+
+
+
+
diff --git a/src/app/modules/admin/board/notice/components/view.component.ts b/src/app/modules/admin/board/notice/components/redit.component.ts
similarity index 62%
rename from src/app/modules/admin/board/notice/components/view.component.ts
rename to src/app/modules/admin/board/notice/components/redit.component.ts
index 67e7c80..a7a72a0 100644
--- a/src/app/modules/admin/board/notice/components/view.component.ts
+++ b/src/app/modules/admin/board/notice/components/redit.component.ts
@@ -8,33 +8,20 @@ import {
ViewChild,
ViewEncapsulation,
} from '@angular/core';
-import {
- FormBuilder,
- FormControl,
- FormGroup,
- Validators,
-} from '@angular/forms';
-import { MatCheckboxChange } from '@angular/material/checkbox';
+
+import { ActivatedRoute, Router } from '@angular/router';
+import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
import { MatPaginator } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
-import {
- debounceTime,
- map,
- merge,
- Observable,
- Subject,
- switchMap,
- takeUntil,
-} from 'rxjs';
+import { Subject, takeUntil } from 'rxjs';
import { fuseAnimations } from '@fuse/animations';
import { FuseConfirmationService } from '@fuse/services/confirmation';
-
-import { User } from 'app/modules/admin/member/user/models/user';
-import { UserService } from 'app/modules/admin/member/user/services/user.service';
+import { NoticeService } from '../services/notice.service';
+import { Notice } from '../models/notice';
@Component({
- selector: 'notice-view',
- templateUrl: './view.component.html',
+ selector: 'notice-redit',
+ templateUrl: './redit.component.html',
styles: [
/* language=SCSS */
`
@@ -59,14 +46,18 @@ import { UserService } from 'app/modules/admin/member/user/services/user.service
changeDetection: ChangeDetectionStrategy.OnPush,
animations: fuseAnimations,
})
-export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
+export class ReditComponent implements OnInit, AfterViewInit, OnDestroy {
@ViewChild(MatPaginator) private _paginator!: MatPaginator;
@ViewChild(MatSort) private _sort!: MatSort;
isLoading = false;
searchInputControl = new FormControl();
- selectedProductForm!: FormGroup;
- selectedUser?: User;
+ noticeForm!: FormGroup;
+ editMode: boolean = false;
+
+ noticeType = NOTICE_TYPE;
+
+ notice!: Notice;
private _unsubscribeAll: Subject = new Subject();
@@ -77,7 +68,9 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
private _changeDetectorRef: ChangeDetectorRef,
private _fuseConfirmationService: FuseConfirmationService,
private _formBuilder: FormBuilder,
- private _userService: UserService
+ private _route: ActivatedRoute,
+ private _router: Router,
+ private _noticeService: NoticeService
) {}
// -----------------------------------------------------------------------------------------------------
@@ -88,53 +81,28 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
* On init
*/
ngOnInit(): void {
- this.selectedProductForm = this._formBuilder.group({
- id: [''],
- signinId: [{ value: '', disabled: true }],
- signinPw: [{ value: '' }],
- exchangePw: [''],
- description: [''],
- tags: [[]],
- nickname: [{ value: '', disabled: true }],
- ownCash: [''],
- phoneNumber: [''],
- level: [''],
- status: [''],
- isExcahngeMoney: [''],
- bankname: [''],
- accountNumber: [''],
- accountHolder: [''],
- comp: [''],
- coupon: [''],
- recommender: [{ value: '', disabled: true }],
- changeSite: [''],
- recommendCount: [''],
- hodingGameMoney: [{ value: '0', disabled: true }],
- memo: [''],
- bacaraRate: [],
- rulletRate: [],
- dragonRate: [],
- etcRate: [],
- slotRate: [],
- casinoRusingRate: [],
- slotRusingRate: [],
+ // Create the contact form
+ this.noticeForm = this._formBuilder.group({
+ writer: ['관리자'],
+ noticeType: [''],
+ title: [''],
+ writerDate: [''],
+ content: [''],
});
- // Get the User
- this._userService.user$
+ this._noticeService.notice$
.pipe(takeUntil(this._unsubscribeAll))
- .subscribe((user: User | undefined) => {
- if (!user) {
+ .subscribe((notice: Notice | undefined) => {
+ if (!notice) {
return;
}
- this.selectedUser = user;
- this.selectedProductForm.patchValue(user);
+ this.notice = notice;
+ this.noticeForm.patchValue(notice);
+
// Mark for check
this._changeDetectorRef.markForCheck();
});
-
- /* this.user$ = this._userService.user$; */
}
/**
@@ -159,6 +127,14 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
// @ Private methods
// -----------------------------------------------------------------------------------------------------
+ __onClickeCancel(): void {
+ /* let url: string = 'board/customer-template/';
+ this._router.navigateByUrl(url); */
+ }
+ __onClickReditBtn(event: MouseEvent, notice: Notice): void {
+ console.log('click: ', notice);
+ }
+
/**
* Create product
*/
@@ -171,6 +147,22 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
*/
__toggleDetails(productId: string): void {}
+ /**
+ * Toggle edit mode
+ *
+ * @param editMode
+ */
+ toggleEditMode(editMode: boolean | null = null): void {
+ if (editMode === null) {
+ this.editMode = !this.editMode;
+ } else {
+ this.editMode = editMode;
+ }
+
+ // Mark for check
+ this._changeDetectorRef.markForCheck();
+ }
+
/**
* Track by function for ngFor loops
*
@@ -181,3 +173,14 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
return item.id || index;
}
}
+
+export const NOTICE_TYPE = [
+ {
+ key: '0',
+ value: '공지사항',
+ },
+ {
+ key: '1',
+ value: '파트너공지',
+ },
+];
diff --git a/src/app/modules/admin/board/notice/components/view.component.html b/src/app/modules/admin/board/notice/components/view.component.html
deleted file mode 100644
index 07b309a..0000000
--- a/src/app/modules/admin/board/notice/components/view.component.html
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
diff --git a/src/app/modules/admin/board/notice/models/notice.ts b/src/app/modules/admin/board/notice/models/notice.ts
index c322533..71394e5 100644
--- a/src/app/modules/admin/board/notice/models/notice.ts
+++ b/src/app/modules/admin/board/notice/models/notice.ts
@@ -1,5 +1,5 @@
export interface Notice {
- id?: string;
+ id: string;
idx?: number;
site?: string;
title?: string;
diff --git a/src/app/modules/admin/board/notice/notice.module.ts b/src/app/modules/admin/board/notice/notice.module.ts
index 0ffebc2..10181be 100644
--- a/src/app/modules/admin/board/notice/notice.module.ts
+++ b/src/app/modules/admin/board/notice/notice.module.ts
@@ -15,6 +15,8 @@ import { MatGridListModule } from '@angular/material/grid-list';
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import { MatRadioModule } from '@angular/material/radio';
import { MatCheckboxModule } from '@angular/material/checkbox';
+import { MatDatepickerModule } from '@angular/material/datepicker';
+import { MatMomentDateModule } from '@angular/material-moment-adapter';
import { TranslocoModule } from '@ngneat/transloco';
@@ -45,6 +47,8 @@ import { noticeRoutes } from './notice.routing';
MatSlideToggleModule,
MatRadioModule,
MatCheckboxModule,
+ MatDatepickerModule,
+ MatMomentDateModule,
],
})
export class NoticeModule {}
diff --git a/src/app/modules/admin/board/notice/notice.routing.ts b/src/app/modules/admin/board/notice/notice.routing.ts
index 04c30c6..ef85069 100644
--- a/src/app/modules/admin/board/notice/notice.routing.ts
+++ b/src/app/modules/admin/board/notice/notice.routing.ts
@@ -1,24 +1,32 @@
import { Route } from '@angular/router';
import { ListComponent } from './components/list.component';
-import { ViewComponent } from '../../member/user/components/view.component';
+import { ReditComponent } from './components/redit.component';
-import { NoticesResolver } from './resolvers/notice.resolver';
-import { UserResolver } from '../../member/user/resolvers/user.resolver';
+import { NoticesResolver, NoticeResolver } from './resolvers/notice.resolver';
export const noticeRoutes: Route[] = [
{
path: '',
+ pathMatch: 'full',
+ redirectTo: 'list',
+ },
+ {
+ path: 'list',
component: ListComponent,
resolve: {
notices: NoticesResolver,
},
},
{
- path: ':id',
- component: ViewComponent,
+ path: 'redit',
+ component: ReditComponent,
+ },
+ {
+ path: 'redit/:id',
+ component: ReditComponent,
resolve: {
- users: UserResolver,
+ notice: NoticeResolver,
},
},
];
diff --git a/src/app/modules/admin/board/popup/components/redit.component.ts b/src/app/modules/admin/board/popup/components/redit.component.ts
index cb8f2f3..b889715 100644
--- a/src/app/modules/admin/board/popup/components/redit.component.ts
+++ b/src/app/modules/admin/board/popup/components/redit.component.ts
@@ -55,7 +55,6 @@ export class ReditComponent implements OnInit, AfterViewInit, OnDestroy {
searchInputControl = new FormControl();
popupForm!: FormGroup;
editMode: boolean = false;
- contact = contacts[0];
categories = categories;
popup: Popup | undefined;
@@ -159,20 +158,7 @@ export class ReditComponent implements OnInit, AfterViewInit, OnDestroy {
// Mark for check
this._changeDetectorRef.markForCheck();
}
- /**
- * Get country info by iso code
- *
- * @param iso
- */
- getCountryByIso(iso: string): Country {
- return {
- id: '19430ee3-b0fe-4987-a7c8-74453ad5504d',
- iso: 'af',
- name: 'Afghanistan',
- code: '+93',
- flagImagePos: '-1px -3180px',
- } as Country;
- }
+
/**
* Track by function for ngFor loops
*
@@ -184,52 +170,6 @@ export class ReditComponent implements OnInit, AfterViewInit, OnDestroy {
}
}
-export const contacts = [
- {
- id: 'cd5fa417-b667-482d-b208-798d9da3213c',
- avatar: 'assets/images/avatars/male-01.jpg',
- background: 'assets/images/cards/14-640x480.jpg',
- name: 'Dejesus Michael',
- emails: [
- {
- email: 'dejesusmichael@mail.org',
- label: '가로',
- },
- {
- email: 'michael.dejesus@vitricomp.io',
- label: '세로',
- },
- ],
- phoneNumbers: [
- {
- country: 'bs',
- phoneNumber: 'TOP',
- label: 'Mobile',
- },
- {
- country: 'bs',
- phoneNumber: 'LEFT',
- label: 'Work',
- },
- ],
- title: 'Track Service Worker',
- company: 'Vitricomp',
- birthday: '1975-01-10T12:00:00.000Z',
- address: '279 Independence Avenue, Calvary, Guam, PO4127',
- notes:
- 'Do incididunt cillum duis eu pariatur enim proident minim officia amet proident consequat consequat qui consequat magna magna occaecat aliquip culpa pariatur velit nisi nostrud irure eu ullamco exercitation sint.
Cillum deserunt laborum laborum quis nisi enim et aliquip labore excepteur in excepteur labore amet in ipsum ipsum nostrud deserunt lorem nisi voluptate dolor minim enim ut eu cupidatat enim.
',
- tags: ['56ddbd47-4078-4ddd-8448-73c5e88d5f59'],
- },
-];
-
-export interface Country {
- id: string;
- iso: string;
- name: string;
- code: string;
- flagImagePos: string;
-}
-
export const categories = [
{
id: 'b899ec30-b85a-40ab-bb1f-18a596d5c6de',