Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
myjob-manage
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
angular
myjob-manage
Commits
ce6154cd
Commit
ce6154cd
authored
Jul 10, 2025
by
Natthaphat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
เพิ่ม modal Excel Report, Table memployee
parent
8d6cbd3d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
207 additions
and
122 deletions
+207
-122
excel-list.component.html
...al/set-excel-reports/excel-list/excel-list.component.html
+173
-97
excel-list.component.ts
...rtal/set-excel-reports/excel-list/excel-list.component.ts
+34
-25
No files found.
src/app/DPU/common/myportal/set-excel-reports/excel-list/excel-list.component.html
View file @
ce6154cd
...
@@ -194,7 +194,7 @@
...
@@ -194,7 +194,7 @@
<a
aria-label=
"anchor"
title=
"Print"
<a
aria-label=
"anchor"
title=
"Print"
(
mouseenter
)="
buttonHover
.
set
(
item
.
fileName
+'
print
',!
buttonHover
.
get
(
item
.
fileName
))"
(
mouseenter
)="
buttonHover
.
set
(
item
.
fileName
+'
print
',!
buttonHover
.
get
(
item
.
fileName
))"
(
mouseleave
)="
buttonHover
.
clear
()"
(
mouseleave
)="
buttonHover
.
clear
()"
(
click
)="
openPrintModal
(
printModal
,
item
);"
(
click
)="
openPrintModal
(
item
);"
class=
"ti-btn ti-btn-wave product-btn !gap-0 !m-0 bg-warning/10 text-warning hover:bg-warning hover:text-white hover:border-warning"
><i
class=
"ti-btn ti-btn-wave product-btn !gap-0 !m-0 bg-warning/10 text-warning hover:bg-warning hover:text-white hover:border-warning"
><i
class=
"ri-printer-line"
></i></a>
class=
"ri-printer-line"
></i></a>
...
@@ -396,7 +396,7 @@
...
@@ -396,7 +396,7 @@
id=
"excelFileUpload"
[
checked
]="
templateFileType=
='upload'"
id=
"excelFileUpload"
[
checked
]="
templateFileType=
='upload'"
(
click
)="
templateFileTypeChange
()"
>
(
click
)="
templateFileTypeChange
()"
>
<label
class=
"custom-control-label cursor-pointer"
for=
"excelFileUpload"
>
<label
class=
"custom-control-label cursor-pointer
font-bold
"
for=
"excelFileUpload"
>
อัพโหลดเอ็กเซลล์ไฟล์
อัพโหลดเอ็กเซลล์ไฟล์
<span
*
ngIf=
"templateFileType=='upload'"
style=
"color: red"
>
*
</span>
<span
*
ngIf=
"templateFileType=='upload'"
style=
"color: red"
>
*
</span>
</label>
</label>
...
@@ -704,21 +704,27 @@
...
@@ -704,21 +704,27 @@
<ng-template
#
videoModal
let-modal
>
<ng-template
#
videoModal
let-modal
>
<div
style=
"width: 100%; height: 100%;"
>
<div
style=
"width: 100%; height: 100%;"
>
<iframe
style=
"width: 100%; height: 100%;"
[
src
]="
videoLink
|
safeUrl
"
frameborder=
"0"
allow=
"autoplay; encrypted-media"
<iframe
style=
"width: 100%; height: 100%;"
[
src
]="
videoLink
|
safeUrl
"
frameborder=
"0"
allowfullscreen
>
allow
=
"autoplay; encrypted-media"
allow
fullscreen
>
</iframe>
</iframe>
</div>
</div>
</ng-template>
</ng-template>
<ng-template
#
printModal
let-modal
>
<ng-template
#
printModal
let-modal
>
<div
class=
"modal-header"
>
<div
class=
"hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out"
>
<h5
class=
"modal-title"
id=
"edittemplateLabel"
>
Excel Report
</h5>
<div
class=
"ti-modal-content"
>
<button
type=
"button"
class=
"close"
(
click
)="
modal
.
dismiss
()"
aria-label=
"Close"
>
<div
class=
"ti-modal-header flex justify-between items-center p-5"
>
<span
aria-hidden=
"true"
>
×
</span>
<h6
class=
"ti-modal-title text-[1rem] font-semibold text-defaulttextcolor"
id=
"mail-ComposeLabel"
>
Excel Report
</h6>
<button
type=
"button"
class=
"hs-dropdown-toggle !text-[1rem] !font-semibold !text-defaulttextcolor"
(
click
)="
closeModalprintModal
()"
#
closeModal
>
<span
class=
"sr-only"
>
{{'Close' | translate}}
</span>
<i
class=
"ri-close-line"
></i>
</button>
</button>
</div>
</div>
<div
class=
"modal-body
"
>
<div
class=
"ti-modal-body px-4 mt-3
"
>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"d-flex col-12 justify-content-center"
*
ngIf=
"loading||loadingExcel"
>
<div
class=
"d-flex col-12 justify-content-center"
*
ngIf=
"loading||loadingExcel"
>
<div
*
ngFor=
"let item of [1,2,3]"
class=
"spinner-grow text-info mx-1"
role=
"status"
>
<div
*
ngFor=
"let item of [1,2,3]"
class=
"spinner-grow text-info mx-1"
role=
"status"
>
...
@@ -727,82 +733,90 @@
...
@@ -727,82 +733,90 @@
</div>
</div>
<ng-container
*
ngIf=
"!loading&&!loadingExcel"
>
<ng-container
*
ngIf=
"!loading&&!loadingExcel"
>
<ng-container
*
ngFor=
"let item of variableSheet; let i=index"
>
<ng-container
*
ngFor=
"let item of variableSheet; let i=index"
>
<div
class=
"col-12 row"
>
<div
class=
"flex items-center mb-4"
>
<div
class=
"col-3 form-group justify-content-center font-weight-bold control-label col-form-label font-14"
<!-- Label -->
style=
"text-align: end;"
>
<label
class=
"w-1/4 text-right pr-4 font-semibold text-sm"
>
{{item.label}}
{{ item.label }}
</div>
</label>
<div
class=
"col-3 d-flex form-group align-items-center"
>
<ng-container
*
ngIf=
"item.type=='text'"
>
<!-- Input -->
<input
type=
"text"
class=
"form-control"
[(
ngModel
)]="
item
.
value
"
>
<div
class=
"w-3/4"
>
</ng-container>
<ng-container
[
ngSwitch
]="
item
.
type
"
>
<ng-container
*
ngIf=
"item.type=='list'"
>
<select
class=
"custom-select"
[(
ngModel
)]="
item
.
value
"
>
<!-- Text -->
<input
*
ngSwitchCase=
"'text'"
type=
"text"
class=
"form-input w-full"
[(
ngModel
)]="
item
.
value
"
/>
<!-- List -->
<select
*
ngSwitchCase=
"'list'"
class=
"form-select w-full"
[(
ngModel
)]="
item
.
value
"
>
<option
*
ngFor=
"let list of item.option"
[
value
]="
list
.
value
"
>
<option
*
ngFor=
"let list of item.option"
[
value
]="
list
.
value
"
>
{{list.text
}}
{{ list.text
}}
</option>
</option>
</select>
</select>
</ng-container>
<ng-container
*
ngIf=
"item.type=='radio'"
>
<!-- Radio --
>
<div
class=
"row m-0
"
>
<div
*
ngSwitchCase=
"'radio'"
class=
"flex flex-wrap gap-4
"
>
<ng-container
*
ngFor=
"let radioItem of item.option"
>
<label
*
ngFor=
"let radioItem of item.option"
<div
class=
"col-auto custom-control custom-radio
"
>
class=
"inline-flex items-center
"
>
<input
type=
"radio"
class=
"custom-control-input
"
<input
type=
"radio"
class=
"form-radio mr-2
"
[
name
]="'
group-
'
+
item
.
label
"
[
id
]="
radioItem
.
text
+
radioItem
.
value
"
[
name
]="'
group-
'
+
item
.
label
"
[
id
]="
radioItem
.
text
+
radioItem
.
value
"
[
value
]="
radioItem
.
value
"
[(
ngModel
)]="
item
.
value
"
>
[
value
]="
radioItem
.
value
"
[(
ngModel
)]="
item
.
value
"
/>
<label
class=
"custom-control-label"
{{ radioItem.text }}
[
for
]="
radioItem
.
text
+
radioItem
.
value
"
>
{{radioItem.text}}
</label>
</label>
</div>
</ng-container>
</div>
</div>
</ng-container>
<ng-container
*
ngIf=
"item.type=='help'"
>
<!-- Help -->
<div
class=
"input-group"
>
<div
*
ngSwitchCase=
"'help'"
class=
"flex items-stretch"
>
<input
type=
"text"
readonly
class=
"form-control bg-white cursor-pointer"
<input
type=
"text"
readonly
class=
"form-input w-1/2 bg-white cursor-pointer"
[
value
]="
item
.
value
.
tdesc
"
(
click
)="
openModalData
(
item
,
modalData
)"
>
[
value
]="
item
.
value
.
tdesc
"
(
click
)="
openModalData
(
item
)"
/>
<div
class=
"input-group-append"
>
<button
class=
"btn mr-0 btn-info"
type=
"button"
<button
(
click
)="
openModalData
(
item
,
modalData
)"
>
class=
"bg-primary hover:bg-primary text-white px-3 flex items-center justify-center rounded-none border"
<i
class=
"fa fa-search"
></i>
type=
"button"
(
click
)="
openModalData
(
item
)"
>
<i
class=
"ri-search-line font-semibold align-middle"
></i>
</button>
</button>
</div>
</div>
<button
type=
"button"
</ng-container>
class=
"bg-red hover:bg-red text-white text-sm ml-5 w-10 h-10 flex items-center justify-center rounded-full"
<ng-container
*
ngIf=
"item.type=='calendar'"
>
(
click
)="
item
.
value=
{id:'',tdesc:'',edesc:''}"
>
<div
class=
"input-group"
>
<i
class=
"fa fa-times text-xs"
></i>
<input
class=
"form-control bg-white cursor-pointer"
placeholder=
"{{ 'dd.mm.yyyy' }}"
name=
"dp1"
ngbDatepicker
#
d1=
"ngbDatepicker"
[(
ngModel
)]="
select
[
item
.
key
]"
readonly
(
click
)="
d1
.
toggle
()"
(
ngModelChange
)="
formatNgbDate
(
item
.
key
,
select
[
item
.
key
])"
#
c1=
"ngModel"
(
change
)="
validateDate
(
c1
)"
>
<div
class=
"input-group-append"
>
<button
class=
"btn btn-outline-info no-shadow"
(
click
)="
d1
.
toggle
()"
type=
"button"
>
<i
class=
"far fa-calendar-alt"
></i>
</button>
</button>
</div>
</div>
</div>
</ng-container>
<!-- Calendar -->
</div>
<div
*
ngSwitchCase=
"'calendar'"
class=
"flex items-stretch"
>
<div
class=
"col"
>
<!-- Input -->
<ng-container
*
ngIf=
"item.type=='help'"
>
<input
class=
"form-input w-1/2 bg-white cursor-pointer rounded-r-none"
<button
type=
"button"
class=
"btn btn-danger btn-sm btn-circle"
style=
"border-color: #e9edf6;"
placeholder=
"dd.mm.yyyy"
name=
"dp1"
(
click
)="
item
.
value=
{id:'',tdesc:'',edesc:''}"
><i
class=
"fa fa-times"
></i>
ngbDatepicker
#
d1=
"ngbDatepicker"
[(
ngModel
)]="
select
[
item
.
key
]"
</button>
readonly
(
click
)="
d1
.
toggle
()"
</ng-container>
(
ngModelChange
)="
formatNgbDate
(
item
.
key
,
select
[
item
.
key
])"
<ng-container
*
ngIf=
"item.type=='calendar'"
>
#
c1=
"ngModel"
(
change
)="
validateDate
(
c1
)"
>
<button
type=
"button"
class=
"btn btn-danger btn-sm btn-circle"
(
click
)="
select
[
item
.
key
]=
null
;
formatNgbDate
(
item
.
key
)"
><i
class=
"fa fa-times"
></i>
<!-- Calendar Button -->
<button
type=
"button"
class=
"bg-white hover:bg-primary text-primary hover:text-white px-3 flex items-center justify-center rounded-none border"
style=
"border-color: #154c9c;"
(
click
)="
d1
.
toggle
()"
>
<i
class=
"ri-calendar-2-line"
></i>
</button>
</button>
</ng-container>
<ng-container
*
ngIf=
"item.type=='list'"
>
<button
type=
"button"
class=
"btn btn-danger btn-sm btn-circle"
<!-- Clear Button -->
(
click
)="
item
.
value=
''
"
><i
class=
"fa fa-times"
></i>
<button
type=
"button"
class=
"bg-red hover:bg-red text-white text-sm ml-5 w-10 h-10 flex items-center justify-center rounded-full"
(
click
)="
select
[
item
.
key
]=
null
;
formatNgbDate
(
item
.
key
)"
>
<i
class=
"fa fa-times text-xs"
></i>
</button>
</button>
</div>
</ng-container>
</ng-container>
</div>
</div>
</div>
</div>
</ng-container>
</ng-container>
<!-- <div *ngIf="variableSheet.length&&!loadingExcel"
<!-- <div *ngIf="variableSheet.length&&!loadingExcel"
class="col-12 justify-content-center align-content-center d-flex" style="margin-bottom: 1rem;">
class="col-12 justify-content-center align-content-center d-flex" style="margin-bottom: 1rem;">
<button type="submit" class="btn btn-info waves-effect waves-light btn-w-100"
<button type="submit" class="btn btn-info waves-effect waves-light btn-w-100"
...
@@ -816,53 +830,72 @@
...
@@ -816,53 +830,72 @@
<span class="sr-only">Loading...</span>
<span class="sr-only">Loading...</span>
</div>
</div>
</div> -->
</div> -->
<div
*
ngIf=
"!variableSheet.length"
class=
"col-12 justify-content-center align-content-center d-flex"
<div
*
ngIf=
"!variableSheet.length"
class=
"col-12 justify-content-center align-content-center d-flex"
style=
"margin-bottom: 1rem;margin-top: 1rem;"
>
style=
"margin-bottom: 1rem;margin-top: 1rem;"
>
<div
<div
class=
"col-3 justify-content-center text-center font-weight-bold control-label col-form-label font-14"
>
class=
"col-3 justify-content-center text-center font-weight-bold control-label col-form-label font-14"
>
{{'No Data Found' }}
{{'No Data Found' }}
</div>
</div>
</div>
</div>
<div
class=
"row col-12
"
<div
class=
"row col-12 flex justify-center
"
*
ngIf=
"variableSheet.length&&(excelReport.isDataGrid=='1'||excelReport.isPivot=='1')"
>
*
ngIf=
"variableSheet.length&&(excelReport.isDataGrid=='1'||excelReport.isPivot=='1')"
>
<div
class=
"col-12 d-flex justify-content-center align-content-center"
>
<div
class=
"col-12 d-flex justify-content-center align-content-center"
>
<button
type=
"button"
*
ngIf=
"excelReport.isDataGrid=='1'"
class=
"btn btn-info"
<button
type=
"button"
*
ngIf=
"excelReport.isDataGrid=='1'"
class=
"ti-btn ti-btn-primary-full"
(
click
)="
getExcelData
(
gridModal
,'
grid
')"
>
Datagrid
</button>
(
click
)="
getExcelData
(
gridModal
,'
grid
')"
>
Datagrid
</button>
<ng-container
*
ngIf=
"excelReport.isDataGrid=='1'&&excelReport.isPivot=='1'"
>
<ng-container
*
ngIf=
"excelReport.isDataGrid=='1'&&excelReport.isPivot=='1'"
>
</ng-container>
</ng-container>
<button
type=
"button"
*
ngIf=
"excelReport.isPivot=='1'"
class=
"btn btn-info"
<button
type=
"button"
*
ngIf=
"excelReport.isPivot=='1'"
class=
"ti-btn ti-btn-primary-full"
(
click
)="
getExcelData
(
pivotModal
,'
pivot
')"
>
Pivot
</button>
(
click
)="
getExcelData
(
pivotModal
,'
pivot
')"
>
Pivot
</button>
</div>
</div>
</div>
</div>
</ng-container>
</ng-container>
</div>
</div>
</div>
</div>
<div
class=
"modal-footer "
>
<div
class=
"border-t mt-3"
>
<div
class=
"ti-modal-footer flex justify-end gap-1 mb-3 mt-3 mr-3"
>
<ng-container
*
ngIf=
"variableSheet.length"
>
<ng-container
*
ngIf=
"variableSheet.length"
>
<button
type=
"submit"
class=
"btn btn-info waves-effect waves-light btn-w-100"
[
disabled
]="
loadingExcel
"
<button
type=
"submit"
class=
"ti-btn ti-btn-info-full waves-effect waves-light btn-w-100
"
(
click
)="
dowloadExcelReport
()"
>
[
disabled
]="
loadingExcel
"
(
click
)="
dowloadExcelReport
()"
>
{{"Print" }}
{{"Print" }}
</button>
</button>
</ng-container>
</ng-container>
<button
type=
"button"
class=
"btn btn-danger"
(
click
)="
modal
.
dismiss
()"
>
ปิด
</button>
<button
type=
"button"
class=
"ti-btn bg-danger text-white !font-medium"
(
click
)="
closeModalprintModal
()"
>
ปิด
</button>
</div>
</div>
</div>
</div>
</div>
</ng-template>
</ng-template>
<ng-template
#
modalData
let-modal
>
<ng-template
#
modalData
let-modal
>
<div
class=
"modal-header"
>
<div
class=
"hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out"
>
<h5
class=
"modal-title"
id=
"edittemplateLabel"
>
{{modalDetail.text.cardHead }}
</h5>
<div
class=
"ti-modal-content"
>
<button
type=
"button"
class=
"close"
(
click
)="
modal
.
dismiss
()"
aria-label=
"Close"
>
<div
class=
"ti-modal-header flex justify-between items-center p-5"
>
<span
aria-hidden=
"true"
>
×
</span>
<h6
class=
"ti-modal-title text-[1rem] font-semibold text-defaulttextcolor"
id=
"mail-ComposeLabel"
>
{{modalDetail.text.cardHead }}
</h6>
<button
type=
"button"
class=
"hs-dropdown-toggle !text-[1rem] !font-semibold !text-defaulttextcolor"
(
click
)="
closeModalmodalData
()"
#
closeModal
>
<span
class=
"sr-only"
>
{{'Close' | translate}}
</span>
<i
class=
"ri-close-line"
></i>
</button>
</button>
</div>
</div>
<div
class=
"modal-body
"
>
<div
class=
"ti-modal-body px-4 mt-3
"
>
<div
class=
"d-flex mb-1"
>
<div
class=
"d-flex mb-1"
>
<input
type=
"text"
placeholder=
"{{'systemcode.search' }} {{modalDetail.text.search[0]}}"
<input
type=
"text"
placeholder=
"{{'systemcode.search' }} {{modalDetail.text.search[0]}}"
class=
" form-control w-75 border-color-gray-full-focus"
[(
ngModel
)]='
searchModal
'
>
class=
" form-control w-75 border-color-gray-full-focus"
[(
ngModel
)]='
searchModal
'
>
</div>
</div>
<div
class=
"table-responsive"
>
<div
class=
"table-responsive"
>
<table
class=
"table table-hover table-striped-myhr table-sm mb-0 no-wrap v-middle "
>
<table
class=
"table table-hover table-striped-myhr table-sm mb-0 no-wrap v-middle "
style=
"width: 100%"
>
<thead
class=
"bg-info "
>
<thead
class=
"bg-info "
>
<tr
class=
"text-white font-weight-normal"
>
<tr
class=
"text-white font-weight-normal"
>
<th
class=
"font-weight-normal text-center"
scope=
"col"
<th
class=
"font-weight-normal text-center"
scope=
"col"
...
@@ -881,7 +914,7 @@
...
@@ -881,7 +914,7 @@
<tbody
*
ngIf=
"valueDetailFilter().length"
>
<tbody
*
ngIf=
"valueDetailFilter().length"
>
<tr
class=
"cursor-pointer"
<tr
class=
"cursor-pointer"
*
ngFor=
"let item of valueDetailFilter() | slice: (pageModal-1) * pageSizeModal : (pageModal-1) * pageSizeModal + pageSizeModal; let i=index"
*
ngFor=
"let item of valueDetailFilter() | slice: (pageModal-1) * pageSizeModal : (pageModal-1) * pageSizeModal + pageSizeModal; let i=index"
(
click
)="
selectData
(
item
);
modal
.
dismiss
()"
(
click
)="
selectData
(
item
);
closeModalmodalData
()"
(
mouseenter
)="
tableHover
.
set
(
item
.
id
,!
tableHover
.
get
(
item
.
id
))"
(
mouseenter
)="
tableHover
.
set
(
item
.
id
,!
tableHover
.
get
(
item
.
id
))"
(
mouseleave
)="
tableHover
.
clear
()"
(
mouseleave
)="
tableHover
.
clear
()"
[
ngStyle
]="{'
background-color
'
:tableHover
.
get
(
item
.
id
)?'
rgb
(
201
223
235
)'
:
'#
ffffff
'}"
>
[
ngStyle
]="{'
background-color
'
:tableHover
.
get
(
item
.
id
)?'
rgb
(
201
223
235
)'
:
'#
ffffff
'}"
>
...
@@ -898,6 +931,10 @@
...
@@ -898,6 +931,10 @@
</tbody>
</tbody>
</table>
</table>
</div>
</div>
</div>
<div
class=
"box-footer !border-t-0"
>
<div
class=
"flex items-center flex-wrap overflow-auto"
*
ngIf=
"valueDetailFilter().length > 0"
>
<div
class=
"d-flex justify-content-end p-2"
>
<div
class=
"d-flex justify-content-end p-2"
>
<select
class=
"custom-select m-r-5 border-color-gray-full-focus"
style=
"width: auto"
<select
class=
"custom-select m-r-5 border-color-gray-full-focus"
style=
"width: auto"
[(
ngModel
)]="
pageSizeModal
"
(
ngModelChange
)="
pageModal=
1"
>
[(
ngModel
)]="
pageSizeModal
"
(
ngModelChange
)="
pageModal=
1"
>
...
@@ -905,21 +942,60 @@
...
@@ -905,21 +942,60 @@
{{"Items per page"}}: {{item}}
{{"Items per page"}}: {{item}}
</option>
</option>
</select>
</select>
<ngb-pagination
[
collectionSize
]="
valueDetailFilter
().
length
"
[(
page
)]="
pageModal
"
</div>
[
pageSize
]="
pageSizeModal
"
[
maxSize
]="
3
"
[
rotate
]="
true
"
>
<div
class=
"mb-2 sm:mb-0"
>
<ng-template
ngbPaginationPrevious
>
{{"Prev"}}
</ng-template>
<div>
<ng-template
ngbPaginationNext
>
{{"Next"}}
</ng-template>
{{'Showing' | translate}} {{valueDetailFilter().length}} {{'entries'
</ngb-pagination>
| translate}}
<i
class=
"bi bi-arrow-right ms-2 font-semibold"
></i>
</div>
</div>
<div
class=
"ms-auto"
>
<nav
aria-label=
"Page navigation"
>
<ul
class=
"ti-pagination mb-0"
>
<li
*
ngIf=
"pageIndex>0"
class=
"page-item {{pageModal==0 ? 'disabled' : ''}}"
><a
class=
"page-link px-3 py-[0.375rem] cursor-pointer"
(
click
)="
pageModal =
pageModal-1;updatePagedItems()"
>
{{'Previous' |
translate}}
</a></li>
<li
class=
"page-item"
><a
class=
"page-link px-3 py-[0.375rem]"
href=
"javascript:void(0);"
*
ngIf=
"pageModal-1>0"
(
click
)="
pageModal =
pageModal-2;updatePagedItems()"
>
{{pageModal-1}}
</a>
</li>
<li
class=
"page-item"
><a
class=
"page-link px-3 py-[0.375rem]"
href=
"javascript:void(0);"
*
ngIf=
"pageModal>0 && ((pageModal-1)*10 < (searchText == '' ? valueDetailFilter().length : valueDetailFilter().length))"
(
click
)="
pageModal =
pageModal-1;updatePagedItems()"
>
{{pageModal}}
</a></li>
<li
class=
"page-item"
><a
class=
"page-link active px-3 py-[0.375rem]"
href=
"javascript:void(0);"
>
{{pageModal +1}}
</a>
</li>
<li
class=
"page-item"
><a
class=
"page-link px-3 py-[0.375rem]"
href=
"javascript:void(0);"
*
ngIf=
"(pageModal+1)*10 < (searchText == '' ? valueDetailFilter().length : valueDetailFilter().length)"
(
click
)="
pageModal =
pageModal+1;updatePagedItems()"
>
{{pageModal +2}}
</a></li>
<li
class=
"page-item"
><a
class=
"page-link px-3 py-[0.375rem]"
href=
"javascript:void(0);"
*
ngIf=
"(pageModal+2)*10 < (searchText == '' ? valueDetailFilter().length : valueDetailFilter().length)"
(
click
)="
pageModal =
pageModal+2;updatePagedItems()"
>
{{pageModal +3}}
</a></li>
<li
*
ngIf=
"(pageModal+1)*10 < (searchText == '' ? valueDetailFilter().length : valueDetailFilter().length)"
class=
"page-item"
><a
class=
"page-link px-3 py-[0.375rem] cursor-pointer"
(
click
)="
pageModal =
pageModal+1;updatePagedItems()"
>
{{'Next' |
translate}}
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-danger"
(
click
)="
modal
.
close
()"
>
{{"ปิด"}}
</button>
</div>
</div>
</ng-template>
<div
class=
"border-t"
>
<div
class=
"ti-modal-footer flex justify-end gap-3 mb-3 mt-3 mr-3"
>
<button
type=
"button"
class=
"ti-btn bg-danger text-white !font-medium"
(
click
)="
closeModalmodalData
()"
>
ปิด
</button>
</div>
</div>
</div>
</div>
</ng-template>
<ng-template
#
gridModal
let-modal
>
<ng-template
#
gridModal
let-modal
>
<div
class=
"modal-header"
>
<div
class=
"modal-header"
>
...
...
src/app/DPU/common/myportal/set-excel-reports/excel-list/excel-list.component.ts
View file @
ce6154cd
...
@@ -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
(
t
argetModal
:
TemplateRef
<
any
>
,
t
emplateFile
:
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
()
{
openMod
al
videoModal
()
{
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment