Commit ce6154cd by Natthaphat

เพิ่ม modal Excel Report, Table memployee

parent 8d6cbd3d
...@@ -148,12 +148,16 @@ export class ExcelListComponent implements OnInit { ...@@ -148,12 +148,16 @@ export class ExcelListComponent implements OnInit {
modalRefaddChild: any; modalRefaddChild: any;
modalRefexcel_portal: MatDialogRef<any>; modalRefexcel_portal: MatDialogRef<any>;
modalRefvideoModal: any; modalRefvideoModal: any;
modalRefprintModal: any;
modalRefmodalData: any;
searchText: string = ''; searchText: string = '';
@ViewChild('addGroupModal') addGroupModal!: TemplateRef<any>; @ViewChild('addGroupModal') addGroupModal!: TemplateRef<any>;
@ViewChild('addChildModal') addChildModal!: TemplateRef<any>; @ViewChild('addChildModal') addChildModal!: TemplateRef<any>;
@ViewChild('excel_portalModal') excel_portalModal!: TemplateRef<any>; @ViewChild('excel_portalModal') excel_portalModal!: TemplateRef<any>;
@ViewChild('videoModal') videoModal!: TemplateRef<any>; @ViewChild('videoModal') videoModal!: TemplateRef<any>;
@ViewChild('printModal') printModal!: TemplateRef<any>;
@ViewChild('modalData') modalData!: TemplateRef<any>;
constructor(private excelReportService: ExcelReportService, constructor(private excelReportService: ExcelReportService,
private modalService: NgbModal, private modalService: NgbModal,
private customCubeService: CustomCubeService, private customCubeService: CustomCubeService,
...@@ -352,13 +356,6 @@ export class ExcelListComponent implements OnInit { ...@@ -352,13 +356,6 @@ export class ExcelListComponent implements OnInit {
} }
}); });
} }
// openVideoModal(targetModal: TemplateRef<any>, videoLink: string) {
// this.videoLink = this.convertToEmbedUrl(videoLink)
// this.modalService.open(targetModal, {
// centered: true,
// windowClass: 'my-dialog-video-preview'
// })
// }
openVideoModal(videoLink: string) { openVideoModal(videoLink: string) {
this.videoLink = this.convertToEmbedUrl(videoLink); this.videoLink = this.convertToEmbedUrl(videoLink);
this.modalRefvideoModal = this.modal.open(this.videoModal, { this.modalRefvideoModal = this.modal.open(this.videoModal, {
...@@ -368,14 +365,6 @@ export class ExcelListComponent implements OnInit { ...@@ -368,14 +365,6 @@ export class ExcelListComponent implements OnInit {
backdropClass: 'video-backdrop' backdropClass: 'video-backdrop'
}); });
} }
// openVideoModal(videoLink: string) {
// this.videoLink = this.convertToEmbedUrl(videoLink);
// this.modalRefvideoModal = this.modal.open(this.videoModal, {
// width: '100%',
// height: '100%',
// panelClass: 'video-dialog-custom'
// });
// }
convertToEmbedUrl(youtubeUrl: string): string { convertToEmbedUrl(youtubeUrl: string): string {
try { try {
const url = new URL(youtubeUrl); const url = new URL(youtubeUrl);
...@@ -559,12 +548,9 @@ export class ExcelListComponent implements OnInit { ...@@ -559,12 +548,9 @@ export class ExcelListComponent implements OnInit {
this.openAlertModal(error.message) this.openAlertModal(error.message)
}) })
} }
openPrintModal(targetModal: TemplateRef<any>, templateFile: TemplateFileModel) { openPrintModal(templateFile: TemplateFileModel) {
this.getTemplateFile(templateFile) this.getTemplateFile(templateFile)
this.modalService.open(targetModal, { this.openModalprintModal()
centered: true,
size: 'lg'
})
} }
getTemplateFile(templateFile: TemplateFileModel) { getTemplateFile(templateFile: TemplateFileModel) {
this.loading = true this.loading = true
...@@ -611,7 +597,7 @@ export class ExcelListComponent implements OnInit { ...@@ -611,7 +597,7 @@ export class ExcelListComponent implements OnInit {
}) })
} }
openModalData(data: any, modal: any) { openModalData(data: any) {
this.searchModal = '' this.searchModal = ''
this.page = 1 this.page = 1
this.pageSize = 10 this.pageSize = 10
...@@ -624,7 +610,7 @@ export class ExcelListComponent implements OnInit { ...@@ -624,7 +610,7 @@ export class ExcelListComponent implements OnInit {
tableHead: ['ID', 'detailTH', 'detailENG'] tableHead: ['ID', 'detailTH', 'detailENG']
} }
} }
this.modalService.open(modal, { centered: true, size: 'lg' }) this.openModalmodalData()
} }
valueDetailFilter(): ValueDetailItem[] { valueDetailFilter(): ValueDetailItem[] {
...@@ -894,15 +880,37 @@ export class ExcelListComponent implements OnInit { ...@@ -894,15 +880,37 @@ export class ExcelListComponent implements OnInit {
this.modalRefexcel_portal?.close() this.modalRefexcel_portal?.close()
} }
openModvideoModal() { openModalvideoModal() {
this.modalRefvideoModal = this.modal.open(this.videoModal, { this.modalRefvideoModal = this.modal.open(this.videoModal, {
width: '1500px', width: '1500px',
height: '700px' height: '700px'
}) })
} }
closeModvideoModal() { closeModalvideoModal() {
this.modalRefexcel_portal?.close() this.modalRefvideoModal?.close()
}
openModalprintModal() {
this.modalRefprintModal = this.modal.open(this.printModal, {
width: '700px',
height: '300px'
})
}
closeModalprintModal() {
this.modalRefprintModal?.close()
}
openModalmodalData() {
this.modalRefmodalData = this.modal.open(this.modalData, {
width: '800px',
height: '580px'
})
}
closeModalmodalData() {
this.modalRefmodalData?.close()
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment