diff --git a/src/app/modules/beteran/compose/compose.module.ts b/src/app/modules/beteran/compose/compose.module.ts index ceef0b5..81d05c1 100644 --- a/src/app/modules/beteran/compose/compose.module.ts +++ b/src/app/modules/beteran/compose/compose.module.ts @@ -9,6 +9,7 @@ import { MatDialogModule } from '@angular/material/dialog'; import { MatSelectModule } from '@angular/material/select'; import { MatButtonToggleModule } from '@angular/material/button-toggle'; import { MatExpansionModule } from '@angular/material/expansion'; +import { MatTableModule } from '@angular/material/table'; import { FuseCardModule } from '@fuse/components/card'; import { SharedModule } from 'app/shared/shared.module'; @@ -30,6 +31,7 @@ import { COMPOSE } from './compose'; MatSelectModule, MatButtonToggleModule, MatExpansionModule, + MatTableModule, FuseCardModule, SharedModule, diff --git a/src/app/modules/beteran/compose/compose/notice-compose.component.html b/src/app/modules/beteran/compose/compose/notice-compose.component.html index 8e15163..163344b 100644 --- a/src/app/modules/beteran/compose/compose/notice-compose.component.html +++ b/src/app/modules/beteran/compose/compose/notice-compose.component.html @@ -11,44 +11,50 @@ > -
- + + {{ column }} + {{ element[column] }} + - -
- There are no data! -
-
-
+ + +
+ {{ element.description }} +
+
+
+ + + + + + + + +
+ There are no data! +
+
diff --git a/src/app/modules/beteran/compose/compose/notice-compose.component.ts b/src/app/modules/beteran/compose/compose/notice-compose.component.ts index 8825175..e351853 100644 --- a/src/app/modules/beteran/compose/compose/notice-compose.component.ts +++ b/src/app/modules/beteran/compose/compose/notice-compose.component.ts @@ -1,18 +1,23 @@ import { Component, OnInit, ViewEncapsulation } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { MatDialogRef } from '@angular/material/dialog'; +import { + animate, + state, + style, + transition, + trigger, +} from '@angular/animations'; @Component({ selector: 'notice-compose', templateUrl: './notice-compose.component.html', - styles: [ - /* language=SCSS */ - ` - .notice-grid { - /* 번호 내용 날짜 */ - grid-template-columns: 100px 250px 100px; - } - `, + + animations: [ + trigger('detailExpand', [ + state('collapsed', style({ height: '0px', minHeight: '0' })), + state('expanded', style({ height: '*', minHeight: '*' })), + ]), ], encapsulation: ViewEncapsulation.None, }) @@ -29,6 +34,9 @@ export class NoticeComposeComponent implements OnInit { ['clean'], ], }; + dataSource = ELEMENT_DATA; + columnsToDisplay = ['idx', 'content', 'applicationDate']; + expandedElement: PeriodicElement | null | undefined; /** * Constructor @@ -38,21 +46,6 @@ export class NoticeComposeComponent implements OnInit { private _formBuilder: FormBuilder ) {} - notice = [ - { - idx: '1', - title: '계좌등록안내', - contents: '안녕하세요. 운영진입니다dkfjkjdfkjdkfjfkjdkjkdfjdkjk', - applicationDate: '2022.08.23', - }, - { - idx: '2', - title: '오토프로그램 이용안내', - contents: '안녕하세요. 운영진입니다', - applicationDate: '2022.08.23', - }, - ]; - // ----------------------------------------------------------------------------------------------------- // @ Lifecycle hooks // ----------------------------------------------------------------------------------------------------- @@ -60,16 +53,7 @@ export class NoticeComposeComponent implements OnInit { /** * On init */ - ngOnInit(): void { - // Create the form - this.composeForm = this._formBuilder.group({ - to: ['', [Validators.required, Validators.email]], - cc: ['', [Validators.email]], - bcc: ['', [Validators.email]], - subject: [''], - body: ['', [Validators.required]], - }); - } + ngOnInit(): void {} // ----------------------------------------------------------------------------------------------------- // @ Public methods @@ -115,14 +99,32 @@ export class NoticeComposeComponent implements OnInit { * Send the message */ send(): void {} - - /** - * Track by function for ngFor loops - * - * @param index - * @param item - */ - __trackByFn(index: number, item: any): any { - return item.id || index; - } } + +export interface PeriodicElement { + idx: number; + content: string; + applicationDate: string; + description: string; +} + +const ELEMENT_DATA: PeriodicElement[] = [ + { + idx: 1, + content: '계좌등록안내', + applicationDate: '2022-08-23', + description: `안녕하세요. 운영진입니다.`, + }, + { + idx: 2, + content: '오토프로그램 이용 안내', + applicationDate: '2022-08-23', + description: `하단이미지를 참고해주시기바랍니다`, + }, + { + idx: 3, + content: '입출금 규정 안내', + applicationDate: '2022-08-23', + description: `입금해라입금. 출금해라출금 이로이로ㅓㅁ;ㅇ롱러;올;ㅣㅁㄴ더ㅗ래;ㄷ로ㅑ`, + }, +];