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
6f28c7db
Commit
6f28c7db
authored
Jul 09, 2025
by
Natthaphat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
แก้ layout หน้าเพิ่มรายงาน Excel
parent
e8b711e4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
581 additions
and
325 deletions
+581
-325
excel-list.component.html
...al/set-excel-reports/excel-list/excel-list.component.html
+466
-265
excel-list.component.scss
...al/set-excel-reports/excel-list/excel-list.component.scss
+11
-0
excel-list.component.ts
...rtal/set-excel-reports/excel-list/excel-list.component.ts
+102
-56
pdpa-manage.component.ts
src/app/DPU/common/pdpa-manage/pdpa-manage.component.ts
+1
-2
user-setting.component.ts
...on/user-management/user-setting/user-setting.component.ts
+1
-2
No files found.
src/app/DPU/common/myportal/set-excel-reports/excel-list/excel-list.component.html
View file @
6f28c7db
<div
class=
"row"
>
<app-page-header
[
title
]="'เพิ่มรายงาน
Excel
'"
[
activeTitle
]="'ผู้ดูแลระบบ'"
<div
class=
"col-12"
>
[
title1
]="'เพิ่มรายงาน
Excel
'"
></app-page-header>
<div
class=
"card card-body"
>
<div
class=
"grid grid-cols-12 gap-6"
>
<h4
class=
"card-title"
>
รายการเอกสาร
</h4>
<div
class=
"xl:col-span-12 col-span-12"
>
<div
class=
"row align-items-center mb-2"
>
<div
class=
"box"
>
<div
class=
"col-4 col-lg-3 text-right"
>
<div
class=
"box-header justify-between"
>
Search By
<div
class=
"box-title"
>
รายการเอกสาร
</div>
</div>
<div
class=
"col-8 col-lg-3"
>
<div
class=
"flex flex-wrap gap-4"
>
<select
class=
"custom-select"
[(
ngModel
)]="
searchBy
"
>
<!-- Search By -->
<option
style=
"color: red"
[
class
.
d-none
]="
searchBy=
=''"
[
value
]="''"
>
<div
class=
"d-flex flex-column"
style=
"min-width: 200px;"
>
{{searchBy!=''?'ยกเลิก':''}}
</option>
<label
class=
"mb-1 font-medium text-sm"
>
Search By
</label>
<option
[
value
]="'
templateId
'"
>
รหัสกลุ่มแม่แบบ
</option>
<select
class=
"form-control h-100"
[(
ngModel
)]="
searchBy
"
>
<option
[
value
]="'
module
'"
>
โมดูล
</option>
<option
style=
"color: red"
[
class
.
d-none
]="
searchBy=
=''"
[
value
]="''"
>
<option
[
value
]="'
tname
'"
>
ชื่อกลุ่มรายงาน (ภาษาไทย)
</option>
{{searchBy!=''?'ยกเลิก':'--- เลือก ---'}}
</option>
<option
[
value
]="'
ename
'"
>
ชื่อกลุ่มรายงาน (ภาษาอังกฤษ)
</option>
<option
[
value
]="'
templateId
'"
>
รหัสกลุ่มแม่แบบ
</option>
<option
[
value
]="'
tdesc
'"
>
รายละเอียด (ภาษาไทย)
</option>
<option
[
value
]="'
module
'"
>
โมดูล
</option>
<option
[
value
]="'
edesc
'"
>
รายละเอียด (ภาษาอังกฤษ)
</option>
<option
[
value
]="'
tname
'"
>
ชื่อกลุ่มรายงาน (ภาษาไทย)
</option>
</select>
<option
[
value
]="'
ename
'"
>
ชื่อกลุ่มรายงาน (ภาษาอังกฤษ)
</option>
</div>
<option
[
value
]="'
tdesc
'"
>
รายละเอียด (ภาษาไทย)
</option>
</div>
<option
[
value
]="'
edesc
'"
>
รายละเอียด (ภาษาอังกฤษ)
</option>
<div
class=
"row align-items-center mb-2"
>
</select>
<div
class=
"col-4 col-lg-3 text-right"
>
</div>
Condition
</div>
<!-- Condition -->
<div
class=
"col-8 col-lg-3"
>
<div
class=
"d-flex flex-column"
style=
"min-width: 200px;"
>
<select
class=
"custom-select"
[(
ngModel
)]="
condition
"
>
<label
class=
"mb-1 font-medium text-sm"
>
Condition
</label>
<option
style=
"color: red"
[
class
.
d-none
]="
condition=
=''"
[
value
]="''"
>
<select
class=
"form-control h-100"
[(
ngModel
)]="
condition
"
>
{{condition!=''?'ยกเลิก':''}}
</option>
<option
style=
"color: red"
[
class
.
d-none
]="
condition=
=''"
[
value
]="''"
>
<option
value=
"includes"
>
คำในประโยค
</option>
{{condition!=''?'ยกเลิก':'--- เลือก ---'}}
</option>
<option
value=
"lt"
>
น้อยกว่า
</option>
<option
value=
"includes"
>
คำในประโยค
</option>
<option
value=
"gt"
>
มากกว่า
</option>
<option
value=
"lt"
>
น้อยกว่า
</option>
<option
value=
"eq"
>
เท่ากับ
</option>
<option
value=
"gt"
>
มากกว่า
</option>
<option
value=
"lte"
>
น้อยกว่าเท่ากับ
</option>
<option
value=
"eq"
>
เท่ากับ
</option>
<option
value=
"gte"
>
มากกว่าเท่ากับ
</option>
<option
value=
"lte"
>
น้อยกว่าเท่ากับ
</option>
<option
value=
"neq"
>
ไม่เท่ากับ
</option>
<option
value=
"gte"
>
มากกว่าเท่ากับ
</option>
</select>
<option
value=
"neq"
>
ไม่เท่ากับ
</option>
</div>
</select>
</div>
</div>
<div
class=
"row align-items-center mb-2"
>
<div
class=
"col-4 col-lg-3 text-right"
>
<!-- Key Value -->
Key Value
<div
class=
"d-flex flex-column"
style=
"min-width: 200px;"
>
</div>
<label
class=
"mb-1 font-medium text-sm"
>
Key Value
</label>
<div
class=
"col-8 col-lg-3"
>
<input
class=
"form-control h-100"
type=
"text"
placeholder=
"ค้นหา"
<input
type=
"text"
class=
"form-control"
[(
ngModel
)]="
searchValue
"
>
aria-label=
".form-control-sm example"
[(
ngModel
)]="
searchValue
"
>
</div>
<!-- Buttons -->
<div
class=
"flex items-end gap-2"
>
<a
href=
"javascript:void(0);"
class=
"hs-dropdown-toggle ti-btn ti-btn-primary-full"
style=
"margin-bottom: unset;"
(
click
)="
openTemplate
.
clear
();
templateListSearch
()"
>
<i
class=
"ri-search-line font-semibold align-middle"
></i>
ค้นหา
</a>
<a
href=
"javascript:void(0);"
class=
"hs-dropdown-toggle ti-btn ti-btn-success-full"
style=
"margin-bottom: unset;"
(
click
)="
openAddGroupModal
()"
>
<i
class=
"ri-add-line font-semibold align-middle"
></i>
Add Group
</a>
</div>
</div>
</div>
</div>
</div>
<div
class=
"row justify-content-center align-items-center mb-2"
>
<button
type=
"button"
class=
"btn btn-info"
<div
class=
"box-body"
>
(
click
)="
openTemplate
.
clear
();
templateListSearch
()"
>
ค้นหา
</button>
<div
class=
"table-responsive"
>
</div>
<table
class=
"table whitespace-nowrap min-w-full ti-custom-table-hover"
>
<div
class=
"row m-0 justify-content-end align-items-center"
>
<thead>
<button
type=
"button"
class=
"btn btn-info"
(
click
)="
openAddGroupModal
(
addGroupModal
)"
>
Add Group
</button>
<tr>
</div>
<th
class=
"text-center"
scope=
"col"
>
ชื่อกลุ่มรายงาน (ภาษาไทย)
</th>
<div
class=
"table-responsive"
>
<th
class=
"text-center"
scope=
"col"
>
ชื่อกลุ่มรายงาน (ภาษาอังกฤษ)
</th>
<table
class=
"table mb-0 no-wrap v-middle "
>
<th
class=
"text-center"
scope=
"col"
style=
"min-width: 200px"
>
สร้างโดย
</th>
<thead
class=
"bg-info text-white"
>
<th
class=
"text-center"
scope=
"col"
style=
"min-width:120px"
>
วันที่สร้าง
</th>
<tr>
<th
class=
"text-center"
scope=
"col"
>
สร้างเมื่อ
</th>
<th
class=
"text-center"
scope=
"col"
>
ชื่อกลุ่มรายงาน (ภาษาไทย)
</th>
<th
class=
"text-center"
scope=
"col"
style=
"min-width: 120px;"
>
โมดูล
</th>
<th
class=
"text-center"
scope=
"col"
>
ชื่อกลุ่มรายงาน (ภาษาอังกฤษ)
</th>
<th
class=
"text-center"
scope=
"col"
>
Add file
</th>
<th
class=
"text-center"
scope=
"col"
style=
"min-width: 200px"
>
สร้างโดย
</th>
</tr>
<th
class=
"text-center"
scope=
"col"
style=
"min-width:120px"
>
วันที่สร้าง
</th>
</thead>
<th
class=
"text-center"
scope=
"col"
>
สร้างเมื่อ
</th>
<tbody
*
ngIf=
"!template.filter.length"
>
<th
class=
"text-center"
scope=
"col"
style=
"min-width: 120px;"
>
โมดูล
</th>
<tr
style=
"background-color:#ebf2f6"
>
<th
class=
"text-center"
scope=
"col"
>
Add file
</th>
<td
colspan=
"7"
class=
"text-center"
>
ไม่พบข้อมูล
</td>
</tr>
</tr>
</thead>
</tbody>
<tbody
*
ngIf=
"!template.filter.length"
>
<tbody
id=
"tableBody"
*
ngIf=
"isSearching || template.filter.length"
>
<tr
style=
"background-color:#ebf2f6"
>
<tr
*
ngIf=
"isSearching"
>
<td
colspan=
"7"
class=
"text-center"
>
ไม่พบข้อมูล
</td>
<td
colspan=
"7"
class=
"loading"
>
</tr>
<div
class=
"spinner"
></div>
</tbody>
<div
class=
"spinner"
></div>
<tbody
*
ngIf=
"template.filter.length"
>
<div
class=
"spinner"
></div>
<ng-container
<span>
กำลังค้นหา...
</span>
*
ngFor=
"let items of template.filter | slice: (page-1) * pageSize : (page-1) * pageSize + pageSize ; let i = index"
>
<tr
(
mouseenter
)="
tableHover
.
set
(
items
.
templateId
,!
tableHover
.
get
(
items
.
templateId
))"
(
mouseleave
)="
tableHover
.
clear
()"
[
ngStyle
]="{'
background-color
'
:tableHover
.
get
(
items
.
templateId
)?'
rgb
(
201
223
235
)'
:
'#
ebf2f6
'}"
>
<td
colspan=
"6"
class=
"font-16 font-medium"
>
<span
class=
"cursor-pointer text-info"
style=
"text-decoration: underline;"
(
click
)="
openAddGroupModal
(
addGroupModal
,
items
)"
>
{{items.tname}}
</span>
<span
*
ngIf=
"items.tdesc"
>
-{{items.tdesc}}
</span>
</td>
<td
class=
"text-center"
>
<ng-container
*
ngIf=
"items.templateFile.length"
>
<ng-container
*
ngIf=
"!openTemplate.get(items.templateId)"
>
<button
type=
"button"
title=
"เปิด"
class=
"btn"
style=
"border:3px solid #2962ff;border-radius: 10%;"
(
click
)="
openTemplate
.
set
(
items
.
templateId
,
true
)"
(
mouseenter
)="
buttonHover
.
set
(
items
.
templateId
+'
open
',!
buttonHover
.
get
(
items
.
templateId
))"
(
mouseleave
)="
buttonHover
.
clear
()"
[
ngStyle
]="{'
background-color
'
:buttonHover
.
get
(
items
.
templateId
+'
open
')?'#
dfdfdf
'
:
'#
ffffff
'}"
>
<i
class=
"fa fa-arrow-right text-info"
></i>
</button>
</ng-container>
<ng-container
*
ngIf=
"openTemplate.get(items.templateId)"
>
<button
type=
"button"
title=
"ปิด"
class=
"btn"
style=
"border:3px solid #2962ff;border-radius: 10%;"
(
click
)="
openTemplate
.
set
(
items
.
templateId
,
false
)"
(
mouseenter
)="
buttonHover
.
set
(
items
.
templateId
+'
close
',!
buttonHover
.
get
(
items
.
templateId
))"
(
mouseleave
)="
buttonHover
.
clear
()"
[
ngStyle
]="{'
background-color
'
:buttonHover
.
get
(
items
.
templateId
+'
close
')?'#
dfdfdf
'
:
'#
ffffff
'}"
>
<i
class=
"fa fa-arrow-down text-info"
></i>
</button>
</ng-container>
</ng-container>
<button
type=
"button"
title=
"เพิ่ม EXCCHILD"
class=
"btn"
style=
"border:3px solid #2962ff;border-radius: 10%;"
(
click
)="
openAddChildModal
(
addChildModal
,
items
,'
add
')"
(
mouseenter
)="
buttonHover
.
set
(
items
.
templateId
+'
add
',!
buttonHover
.
get
(
items
.
templateId
))"
(
mouseleave
)="
buttonHover
.
clear
()"
[
ngStyle
]="{'
background-color
'
:buttonHover
.
get
(
items
.
templateId
+'
add
')?'#
dfdfdf
'
:
'#
ffffff
'}"
>
<i
class=
"fa fa-floppy-o text-info"
></i>
</button>
<button
type=
"button"
title=
"ลบ"
class=
"btn"
style=
"border:3px solid #2962ff;border-radius: 10%;"
(
mouseenter
)="
buttonHover
.
set
(
items
.
templateId
+'
delete
',!
buttonHover
.
get
(
items
.
templateId
))"
(
mouseleave
)="
buttonHover
.
clear
()"
[
ngStyle
]="{'
background-color
'
:buttonHover
.
get
(
items
.
templateId
+'
delete
')?'#
dfdfdf
'
:
'#
ffffff
'}"
(
click
)="
deleteTemplate
(
items
)"
>
<i
class=
"fa fa-trash text-danger"
></i>
</button>
</td>
</td>
</tr>
</tr>
<ng-container
*
ngIf=
"
openTemplate.get(items.templateId)
"
>
<ng-container
*
ngIf=
"
!isSearching
"
>
<ng-container
<ng-container
*
ngFor=
"let item
of items.templateFile
| slice: (page-1) * pageSize : (page-1) * pageSize + pageSize ; let i = index"
>
*
ngFor=
"let item
s of template.filter
| slice: (page-1) * pageSize : (page-1) * pageSize + pageSize ; let i = index"
>
<tr
(
mouseenter
)="
tableHover
.
set
(
item
.
fileName
,!
tableHover
.
get
(
item
.
fileName
))"
<tr
(
mouseenter
)="
tableHover
.
set
(
item
s
.
templateId
,!
tableHover
.
get
(
items
.
templateId
))"
(
mouseleave
)="
tableHover
.
clear
()"
(
mouseleave
)="
tableHover
.
clear
()"
[
ngStyle
]="{'
background-color
'
:tableHover
.
get
(
item
.
fileName
)?'
rgb
(
201
223
235
)'
:
'#
ffffff
'}"
>
[
ngStyle
]="{'
background-color
'
:tableHover
.
get
(
items
.
templateId
)?'
rgb
(
201
223
235
)'
:
'#
ebf2f6
'}"
>
<ng-container
*
ngIf=
"downloadTemplateFileLoading.get(item.fileName)"
>
<td
colspan=
"6"
class=
"font-16 font-medium"
>
<td
colspan=
"7"
class=
"text-center"
>
<span
class=
"cursor-pointer text-info"
style=
"text-decoration: underline;"
<div
*
ngFor=
"let item of [1,2,3]"
class=
"spinner-grow text-info mx-1"
(
click
)="
openAddGroupModal
(
items
)"
>
role=
"status"
>
{{items.tname}}
<span
class=
"sr-only"
>
Loading...
</span>
</span>
</div>
<span
*
ngIf=
"items.tdesc"
>
</td>
-{{items.tdesc}}
</ng-container>
</span>
<ng-container
*
ngIf=
"!downloadTemplateFileLoading.get(item.fileName)"
>
</td>
<td
style=
"white-space: normal !important;word-break: break-word;"
>
<td
class=
"text-center"
>
<i
*
ngIf=
"item.menuActive=='0'"
<ng-container
*
ngIf=
"items.templateFile.length"
>
class=
"fa fa-times text-danger cursor-pointer"
<ng-container
*
ngIf=
"!openTemplate.get(items.templateId)"
>
style=
"text-decoration: underline;"
<a
aria-label=
"anchor"
title=
"เปิด"
(
click
)="
menuActiveTemplateFile
(
item
)"
></i>
(
click
)="
openTemplate
.
set
(
items
.
templateId
,
true
)"
<i
*
ngIf=
"item.menuActive=='1'"
(
mouseenter
)="
buttonHover
.
set
(
items
.
templateId
,
true
)"
class=
"fa fa-check text-success cursor-pointer"
(
mouseleave
)="
buttonHover
.
set
(
items
.
templateId
,
false
)"
style=
"text-decoration: underline;"
class=
"ti-btn ti-btn-wave !gap-0 !m-0 bg-info/10 text-info hover:bg-info hover:text-white hover:border-info"
><i
(
click
)="
menuActiveTemplateFile
(
item
)"
></i>
class=
"ri-arrow-right-line"
></i></a>
</ng-container>
<span
class=
"cursor-pointer text-info"
style=
"text-decoration: underline;"
<ng-container
*
ngIf=
"openTemplate.get(items.templateId)"
>
(
click
)="
openAddChildModal
(
addChildModal
,
item
,'
edit
')"
>
<a
aria-label=
"anchor"
title=
"ปิด"
(
click
)="
{{item.tdesc}}
openTemplate
.
set
(
items
.
templateId
,
false
)"
</span>
(
mouseenter
)="
buttonHover
.
set
(
items
.
templateId
+'
close
',!
buttonHover
.
get
(
items
.
templateId
))"
</td>
(
mouseleave
)="
buttonHover
.
clear
()"
<td
style=
"white-space: normal !important;word-break: break-word;"
>
class=
"ti-btn ti-btn-wave !gap-0 !m-0 bg-info/10 text-info hover:bg-info hover:text-white hover:border-info"
><i
{{item.edesc}}
</td>
class=
"ri-arrow-down-line"
></i></a>
<td
class=
"text-center"
</ng-container>
style=
"white-space: normal !important;word-break: break-word;"
>
<!-- {{item.createBy.thFullName}}</td> -->
<td
class=
"text-center"
style=
"white-space: normal !important;word-break: break-word;"
>
{{formatISOToLocal(item.createDate).date}}
</td>
<td
class=
"text-center"
style=
"white-space: normal !important;word-break: break-word;"
>
{{formatISOToLocal(item.createDate).time}}
</td>
<td
class=
"text-center"
style=
"white-space: normal !important;word-break: break-word;"
>
{{item.module}}
</td>
<td
class=
"text-center"
class=
"text-center"
>
<button
type=
"button"
title=
"Download File"
class=
"btn"
style=
"border:3px solid #2962ff;border-radius: 10%"
(
mouseenter
)="
buttonHover
.
set
(
item
.
fileName
+'
copy
',!
buttonHover
.
get
(
item
.
fileName
))"
(
mouseleave
)="
buttonHover
.
clear
()"
[
ngStyle
]="{'
background-color
'
:buttonHover
.
get
(
item
.
fileName
+'
copy
')?'#
dfdfdf
'
:
'#
ffffff
'}"
(
click
)="
downloadTemplateFile
(
item
)"
>
<i
class=
"fa fa-files-o text-info"
></i>
</button>
<button
type=
"button"
title=
"Print"
class=
"btn"
style=
"border:3px solid #2962ff;border-radius: 10%"
(
mouseenter
)="
buttonHover
.
set
(
item
.
fileName
+'
print
',!
buttonHover
.
get
(
item
.
fileName
))"
(
mouseleave
)="
buttonHover
.
clear
()"
[
ngStyle
]="{'
background-color
'
:buttonHover
.
get
(
item
.
fileName
+'
print
')?'#
dfdfdf
'
:
'#
ffffff
'}"
(
click
)="
openPrintModal
(
printModal
,
item
);"
>
<i
class=
"fa fa-print text-info"
></i>
</button>
<button
type=
"button"
title=
"ลบ"
class=
"btn"
</ng-container>
style=
"border:3px solid #2962ff;border-radius: 10%;"
<a
aria-label=
"anchor"
title=
"เพิ่ม EXCCHILD"
(
mouseenter
)="
buttonHover
.
set
(
item
.
fileName
+'
delete
',!
buttonHover
.
get
(
item
.
fileName
))"
(
click
)="
openAddChildModal
(
items
,'
add
')"
(
mouseleave
)="
buttonHover
.
clear
()"
(
mouseenter
)="
buttonHover
.
set
(
items
.
templateId
+'
add
',!
buttonHover
.
get
(
items
.
templateId
))"
[
ngStyle
]="{'
background-color
'
:buttonHover
.
get
(
item
.
fileName
+'
delete
')?'#
dfdfdf
'
:
'#
ffffff
'}"
(
mouseleave
)="
buttonHover
.
clear
()"
(
click
)="
deleteTemplateFile
(
item
)"
>
class=
"ti-btn ti-btn-wave product-btn !gap-0 !m-0 bg-success/10 text-success hover:bg-success hover:text-white hover:border-success"
><i
<i
class=
"fa fa-trash text-danger"
></i>
class=
"ri-save-2-line"
></i></a>
</button>
</td>
<a
aria-label=
"anchor"
title=
"ลบ"
(
click
)="
deleteTemplate
(
items
)"
</ng-container>
(
mouseenter
)="
buttonHover
.
set
(
items
.
templateId
+'
delete
',!
buttonHover
.
get
(
items
.
templateId
))"
(
mouseleave
)="
buttonHover
.
clear
()"
class=
"ti-btn ti-btn-wave product-btn !gap-0 !m-0 bg-danger/10 text-danger hover:bg-danger hover:text-white hover:border-danger"
><i
class=
"ri-delete-bin-line"
></i></a>
</td>
</tr>
</tr>
<ng-container
*
ngIf=
"openTemplate.get(items.templateId)"
>
<ng-container
*
ngFor=
"let item of items.templateFile | slice: (page-1) * pageSize : (page-1) * pageSize + pageSize ; let i = index"
>
<tr
(
mouseenter
)="
tableHover
.
set
(
item
.
fileName
,!
tableHover
.
get
(
item
.
fileName
))"
(
mouseleave
)="
tableHover
.
clear
()"
[
ngStyle
]="{'
background-color
'
:tableHover
.
get
(
item
.
fileName
)?'
rgb
(
201
223
235
)'
:
'#
ffffff
'}"
>
<ng-container
*
ngIf=
"downloadTemplateFileLoading.get(item.fileName)"
>
<td
colspan=
"7"
class=
"text-center"
>
<div
*
ngFor=
"let item of [1,2,3]"
class=
"spinner-grow text-info mx-1"
role=
"status"
>
<span
class=
"sr-only"
>
Loading...
</span>
</div>
</td>
</ng-container>
<ng-container
*
ngIf=
"!downloadTemplateFileLoading.get(item.fileName)"
>
<td
style=
"white-space: normal !important;word-break: break-word;"
>
<i
*
ngIf=
"item.menuActive=='0'"
class=
"fa fa-times text-danger cursor-pointer"
style=
"text-decoration: underline;"
(
click
)="
menuActiveTemplateFile
(
item
)"
></i>
<i
*
ngIf=
"item.menuActive=='1'"
class=
"fa fa-check text-success cursor-pointer"
style=
"text-decoration: underline;"
(
click
)="
menuActiveTemplateFile
(
item
)"
></i>
<span
class=
"cursor-pointer text-info"
style=
"text-decoration: underline;"
(
click
)="
openAddChildModal
(
item
,'
edit
')"
>
{{item.tdesc}}
</span>
</td>
<td
style=
"white-space: normal !important;word-break: break-word;"
>
{{item.edesc}}
</td>
<td
class=
"text-center"
style=
"white-space: normal !important;word-break: break-word;"
>
<!-- {{item.createBy.thFullName}}</td> -->
<td
class=
"text-center"
style=
"white-space: normal !important;word-break: break-word;"
>
{{formatISOToLocal(item.createDate).date}}
</td>
<td
class=
"text-center"
style=
"white-space: normal !important;word-break: break-word;"
>
{{formatISOToLocal(item.createDate).time}}
</td>
<td
class=
"text-center"
style=
"white-space: normal !important;word-break: break-word;"
>
{{item.module}}
</td>
<td
class=
"text-center"
class=
"text-center"
>
<a
aria-label=
"anchor"
title=
"Download File"
(
mouseenter
)="
buttonHover
.
set
(
item
.
fileName
+'
copy
',!
buttonHover
.
get
(
item
.
fileName
))"
(
mouseleave
)="
buttonHover
.
clear
()"
(
click
)="
downloadTemplateFile
(
item
)"
class=
"ti-btn ti-btn-wave !gap-0 !m-0 bg-info/10 text-info hover:bg-info hover:text-white hover:border-info"
><i
class=
"ri-file-download-line"
></i></a>
<a
aria-label=
"anchor"
title=
"Print"
(
mouseenter
)="
buttonHover
.
set
(
item
.
fileName
+'
print
',!
buttonHover
.
get
(
item
.
fileName
))"
(
mouseleave
)="
buttonHover
.
clear
()"
(
click
)="
openPrintModal
(
printModal
,
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=
"ri-printer-line"
></i></a>
<a
aria-label=
"anchor"
title=
"ลบ"
(
mouseenter
)="
buttonHover
.
set
(
item
.
fileName
+'
delete
',!
buttonHover
.
get
(
item
.
fileName
))"
(
mouseleave
)="
buttonHover
.
clear
()"
(
click
)="
deleteTemplateFile
(
item
)"
class=
"ti-btn ti-btn-wave product-btn !gap-0 !m-0 bg-danger/10 text-danger hover:bg-danger hover:text-white hover:border-danger"
><i
class=
"ri-delete-bin-line"
></i></a>
</td>
</ng-container>
</tr>
</ng-container>
</ng-container>
</ng-container>
</ng-container>
</ng-container>
</ng-container>
</ng-container>
</tbody>
</tbody>
</table>
</table>
</div>
</div>
<div
class=
"d-flex justify-content-end py-2"
>
<select
class=
"custom-select m-r-5"
style=
"width: auto"
[(
ngModel
)]="
pageSize
"
(
ngModelChange
)="
page
"
>
<option
[
ngValue
]="
10
"
>
รายการต่อหน้า: 10
</option>
<option
[
ngValue
]="
50
"
>
รายการต่อหน้า: 50
</option>
<option
[
ngValue
]="
100
"
>
รายการต่อหน้า: 100
</option>
</select>
<ngb-pagination
[(
page
)]="
page
"
[
pageSize
]="
pageSize
"
[
collectionSize
]="
template
.
filter
.
length
"
[
maxSize
]="
3
"
[
rotate
]="
true
"
>
<ng-template
ngbPaginationPrevious
>
ก่อนหน้า
</ng-template>
<ng-template
ngbPaginationNext
>
ถัดไป
</ng-template>
</ngb-pagination>
</div>
</div>
<div
class=
"row justify-content-end align-items-center"
>
<div
class=
"box-footer"
>
<i
class=
"fa fa-times text-danger"
></i>
=
used on menu
<div
class=
"flex items-center flex-wrap overflow-auto"
*
ngIf=
"template.filter.length > 0"
>
<i
class=
"fa fa-check text-success"
></i>
=
unused on menu
<div
class=
"mb-2 sm:mb-0"
>
<i
class=
"fa fa-files-o text-info"
></i>
=
copy template
<div>
<i
class=
"fa fa-print text-info"
></i>
=
print report
{{'Showing' | translate}} {{template.filter.length}} {{'entries'
| 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 {{pageIndex==0 ? 'disabled' : ''}}"
><a
class=
"page-link px-3 py-[0.375rem] cursor-pointer"
(
click
)="
pageIndex =
pageIndex-1;updatePagedItems()"
>
{{'Previous' |
translate}}
</a></li>
<li
class=
"page-item"
><a
class=
"page-link px-3 py-[0.375rem]"
href=
"javascript:void(0);"
*
ngIf=
"pageIndex-1>0"
(
click
)="
pageIndex =
pageIndex-2;updatePagedItems()"
>
{{pageIndex-1}}
</a>
</li>
<li
class=
"page-item"
><a
class=
"page-link px-3 py-[0.375rem]"
href=
"javascript:void(0);"
*
ngIf=
"pageIndex>0 && ((pageIndex-1)*10 < (searchText == '' ? template.data.length : template.filter.length))"
(
click
)="
pageIndex =
pageIndex-1;updatePagedItems()"
>
{{pageIndex}}
</a></li>
<li
class=
"page-item"
><a
class=
"page-link active px-3 py-[0.375rem]"
href=
"javascript:void(0);"
>
{{pageIndex +1}}
</a>
</li>
<li
class=
"page-item"
><a
class=
"page-link px-3 py-[0.375rem]"
href=
"javascript:void(0);"
*
ngIf=
"(pageIndex+1)*10 < (searchText == '' ? template.data.length : template.filter.length)"
(
click
)="
pageIndex =
pageIndex+1;updatePagedItems()"
>
{{pageIndex +2}}
</a></li>
<li
class=
"page-item"
><a
class=
"page-link px-3 py-[0.375rem]"
href=
"javascript:void(0);"
*
ngIf=
"(pageIndex+2)*10 < (searchText == '' ? template.data.length : template.filter.length)"
(
click
)="
pageIndex =
pageIndex+2;updatePagedItems()"
>
{{pageIndex +3}}
</a></li>
<li
*
ngIf=
"(pageIndex+1)*10 < (searchText == '' ? template.data.length : template.filter.length)"
class=
"page-item"
><a
class=
"page-link px-3 py-[0.375rem] cursor-pointer"
(
click
)="
pageIndex =
pageIndex+1;updatePagedItems()"
>
{{'Next' |
translate}}
</a>
</li>
</ul>
</nav>
</div>
</div>
<div
class=
"flex justify-end items-center flex-wrap gap-4 mt-3"
>
<div><i
class=
"fa fa-times text-danger"
></i>
= used on menu
</div>
<div><i
class=
"fa fa-check text-success"
></i>
= unused on menu
</div>
<div><i
class=
"ri-file-download-line text-info"
></i>
= download files
</div>
<div><i
class=
"ri-printer-line text-warning"
></i>
= print report
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<ng-template
#
addGroupModal
let-modal
>
<ng-template
#
addGroupModal
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"
>
EXCHEAD, Template header excel
</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"
>
</button>
EXCHEAD, Template header excel
</div
>
</h6
>
<div
class=
"modal-body"
>
<div
class=
"form-group row"
>
<button
type=
"button"
class=
"hs-dropdown-toggle !text-[1rem] !font-semibold !text-defaulttextcolor"
<label
for=
"nameth"
class=
"col-sm-4 col-form-label"
>
(
click
)="
closeModalAddGroup
()"
#
closeModal
>
รหัสกลุ่มแม่แบบ
</label
>
<span
class=
"sr-only"
>
{{'Close' | translate}}
</span
>
<div
class=
"col-sm-8"
>
<i
class=
"ri-close-line"
></i
>
<
input
type=
"text"
class=
"form-control"
disabled
[
value
]="
bodyTemplate
.
data
.
templateId
"
>
<
/button
>
</div>
</div>
</div>
<div
class=
"ti-modal-body px-4 mt-3"
>
<div
class=
"form-group row"
>
<div
class=
"grid grid-cols-12 gap-4"
>
<label
for=
"nameth"
class=
"col-sm-4 col-form-label"
>
ชื่อกลุ่มรายงาน (ภาษาไทย)
<span
style=
"color: red"
>
*
</span></label>
<div
class=
"xl:col-span-12 col-span-12"
>
<div
class=
"col-sm-8"
>
<label
for=
"deal-title"
class=
"form-label"
>
รหัสกลุ่มแม่แบบ
</label>
<input
type=
"text"
class=
"form-control"
[(
ngModel
)]="
bodyTemplate
.
data
.
tname
"
>
<input
type=
"text"
class=
"form-control !bg-input-readonly"
id=
"deal-title"
placeholder=
""
value=
"AUTO-001"
disabled
[
value
]="
bodyTemplate
.
data
.
templateId
"
>
</div>
<div
class=
"xl:col-span-6 col-span-12"
>
<label
for=
"deal-title"
class=
"form-label"
>
ชื่อกลุ่มรายงาน (ภาษาไทย)
<span
class=
"required text-danger"
>
*
</span>
</label>
<input
type=
"text"
class=
"form-control"
id=
"deal-title"
placeholder=
""
[(
ngModel
)]="
bodyTemplate
.
data
.
tname
"
>
<div
class=
"text-danger"
*
ngIf=
"!bodyTemplate.data.tname"
>
กรอกชื่อกลุ่มรายงานภาษาไทย
</div>
</div>
<div
class=
"xl:col-span-6 col-span-12"
>
<label
for=
"deal-title"
class=
"form-label"
>
ชื่อกลุ่มรายงาน (ภาษาอังกฤษ)
</label>
<input
type=
"text"
class=
"form-control"
id=
"deal-title"
placeholder=
""
[(
ngModel
)]="
bodyTemplate
.
data
.
ename
"
>
<div
class=
"text-danger"
*
ngIf=
"!bodyTemplate.data.ename"
>
Enter report group name in English
</div>
</div>
<div
class=
"xl:col-span-6 col-span-12"
>
<label
for=
"deal-title"
class=
"form-label"
>
รายละเอียด (ภาษาไทย)
</label>
<textarea
type=
"text"
class=
"form-control"
id=
"deal-title"
placeholder=
"กรอกรายละเอียดภาษาไทย..."
[(
ngModel
)]="
bodyTemplate
.
data
.
tdesc
"
></textarea>
</div>
<div
class=
"xl:col-span-6 col-span-12"
>
<label
for=
"deal-title"
class=
"form-label"
>
รายละเอียด (ภาษาอังกฤษ)
</label>
<textarea
type=
"text"
class=
"form-control"
id=
"deal-title"
placeholder=
"Enter description in English..."
[(
ngModel
)]="
bodyTemplate
.
data
.
edesc
"
></textarea>
</div>
<div
class=
"xl:col-span-12 col-span-12"
>
<label
class=
"form-label"
>
โมดูล
<span
class=
"required text-danger"
>
*
</span>
</label>
<select
class=
"form-select"
required
[
disabled
]="
bodyTemplate
.
status=
='edit'"
[(
ngModel
)]="
bodyTemplate
.
data
.
module
"
>
<option
style=
"color: red"
[
class
.
d-none
]="
bodyTemplate
.
data
.
module=
=''"
[
value
]="''"
>
{{bodyTemplate.data.module!=''?'ยกเลิก':''}}
</option>
<option
*
ngFor=
"let item of module.data"
[
ngValue
]="
item
.
code
"
>
{{item.tdesc}}
</option>
</select>
</div>
</div>
</div>
</div>
</div>
<div
class=
"ti-modal-footer flex justify-center gap-3 mb-3 mt-3"
>
<div
class=
"form-group row"
>
<button
type=
"button"
class=
"ti-btn bg-danger text-white !font-medium"
(
click
)="
closeModalAddGroup
()"
>
<label
for=
"nameeng"
class=
"col-sm-4 col-form-label"
>
ชื่อกลุ่มรายงาน (ภาษาอังกฤษ)
</label>
{{'Cancel' | translate}}
<div
class=
"col-sm-8"
>
</button>
<input
type=
"text"
class=
"form-control"
[(
ngModel
)]="
bodyTemplate
.
data
.
ename
"
>
<button
type=
"button"
[
class
.
ti-btn-disabled
]="!
bodyTemplate
.
data
.
tname
||!
bodyTemplate
.
data
.
module
"
[
disabled
]="!
bodyTemplate
.
data
.
tname
||!
bodyTemplate
.
data
.
module
"
(
click
)="
closeModalAddGroup
()"
class=
"ti-btn bg-primary text-white !font-medium"
>
{{'Save' |
translate}}
</button>
</div>
</div>
</div>
</div>
<div
class=
"form-group row"
>
</div>
<label
for=
"position"
class=
"col-sm-4 col-form-label"
>
รายละเอียด (ภาษาไทย)
</label>
</ng-template>
<div
class=
"col-sm-8"
>
<textarea
class=
"form-control"
[(
ngModel
)]="
bodyTemplate
.
data
.
tdesc
"
></textarea>
<ng-template
#
addChildModal
let-modal
>
<div
class=
"hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out"
>
<div
class=
"ti-modal-content"
>
<div
class=
"ti-modal-header flex justify-between items-center p-5"
>
<h6
class=
"ti-modal-title text-[1rem] font-semibold text-defaulttextcolor"
id=
"mail-ComposeLabel"
>
EXCCHILD, Template file excel
</h6>
<button
type=
"button"
class=
"hs-dropdown-toggle !text-[1rem] !font-semibold !text-defaulttextcolor"
(
click
)="
closeModalAddGroup
()"
#
closeModal
>
<span
class=
"sr-only"
>
{{'Close' | translate}}
</span>
<i
class=
"ri-close-line"
></i>
</button>
</div>
</div>
</div>
<div
class=
"ti-modal-body px-4 mt-3"
>
<div
class=
"form-group row"
>
<div
class=
"flex flex-col space-y-4"
>
<label
for=
"position"
class=
"col-sm-4 col-form-label"
>
รายละเอียด (ภาษาอังกฤษ)
</label>
<div
class=
"col-sm-8"
>
<!-- ตัวเลือกไฟล์จาก Portal -->
<textarea
class=
"form-control"
[(
ngModel
)]="
bodyTemplate
.
data
.
edesc
"
></textarea>
<div>
<div
class=
"flex items-center gap-2 mb-2"
>
<input
type=
"radio"
class=
"custom-control-input cursor-pointer"
name=
"excelFile"
id=
"excelFilePortal"
[
checked
]="
templateFileType=
='portal'"
(
click
)="
templateFileTypeChange
()"
>
<label
class=
"custom-control-label cursor-pointer"
for=
"excelFilePortal"
>
เลือกเอ็กเซลล์ไฟล์จาก Portal
<span
*
ngIf=
"templateFileType=='portal'"
class=
"text-red-500"
>
*
</span>
</label>
</div>
<div
*
ngIf=
"templateFileType=='portal'"
class=
"flex items-center gap-2"
>
<input
*
ngIf=
"templateFile.portalId"
type=
"text"
class=
"form-control bg-white w-full"
[
value
]="
templateFile
.
portalId
"
readonly
>
<button
type=
"button"
class=
"hs-dropdown-toggle ti-btn ti-btn-primary-full"
(
click
)="
openExcelPortalModal
(
excel_portalModal
)"
>
<i
class=
"ri-search-line font-semibold align-middle"
></i>
</button>
</div>
</div>
<!-- อัปโหลดไฟล์ -->
<div>
<div
class=
"flex items-center gap-2 mb-2"
>
<input
type=
"radio"
class=
"custom-control-input cursor-pointer"
name=
"excelFile"
id=
"excelFileUpload"
[
checked
]="
templateFileType=
='upload'"
(
click
)="
templateFileTypeChange
()"
>
<label
class=
"custom-control-label cursor-pointer"
for=
"excelFileUpload"
>
อัพโหลดเอ็กเซลล์ไฟล์
<span
*
ngIf=
"templateFileType=='upload'"
class=
"text-red-500"
>
*
</span>
</label>
</div>
<div
*
ngIf=
"templateFileType=='upload'"
class=
"flex items-center gap-2"
>
<input
#
fileInput
type=
"file"
accept=
".xlsx"
(
change
)="
onFileSelected
($
event
)"
class=
"hidden"
/>
<button
class=
"ti-btn"
(
click
)="
fileInput
.
click
()"
>
เลือกไฟล์
</button>
<span
*
ngIf=
"templateFileName"
>
{{ templateFileName }}
</span>
</div>
</div>
<!-- รายละเอียด ภาษาไทย -->
<div>
<label
class=
"block mb-1"
>
รายละเอียด (ภาษาไทย)
<span
class=
"text-red-500"
>
*
</span></label>
<input
type=
"text"
class=
"form-control w-full"
[(
ngModel
)]="
templateFile
.
tdesc
"
>
</div>
<!-- รายละเอียด ภาษาอังกฤษ -->
<div>
<label
class=
"block mb-1"
>
รายละเอียด (ภาษาอังกฤษ)
</label>
<input
type=
"text"
class=
"form-control w-full"
[(
ngModel
)]="
templateFile
.
edesc
"
>
</div>
<!-- แบ่งปัน -->
<div>
<label
class=
"block mb-1"
>
แบ่งปัน
</label>
<div
class=
"flex gap-4"
>
<div
class=
"flex items-center gap-2"
>
<input
type=
"radio"
class=
"custom-control-input cursor-pointer"
name=
"share"
id=
"shareNo"
[
checked
]="
templateFile
.
isShare=
='0'"
(
click
)="
templateFile
.
isShare=
'0'
"
>
<label
class=
"custom-control-label cursor-pointer"
for=
"shareNo"
>
ไม่ใช่
</label>
</div>
<div
class=
"flex items-center gap-2"
>
<input
type=
"radio"
class=
"custom-control-input cursor-pointer"
name=
"share"
id=
"shareYes"
[
checked
]="
templateFile
.
isShare=
='1'"
(
click
)="
templateFile
.
isShare=
'1'
"
>
<label
class=
"custom-control-label cursor-pointer"
for=
"shareYes"
>
ใช่
</label>
</div>
</div>
</div>
<!-- แสดง Pivot -->
<div>
<label
class=
"block mb-1"
>
แสดงรูปแบบ pivot
</label>
<div
class=
"flex gap-4"
>
<div
class=
"flex items-center gap-2"
>
<input
type=
"radio"
class=
"custom-control-input cursor-pointer"
name=
"pivot"
id=
"pivotNo"
[
checked
]="
templateFile
.
isPivot=
='0'"
(
click
)="
templateFile
.
isPivot=
'0'
"
>
<label
class=
"custom-control-label cursor-pointer"
for=
"pivotNo"
>
ไม่ใช่
</label>
</div>
<div
class=
"flex items-center gap-2"
>
<input
type=
"radio"
class=
"custom-control-input cursor-pointer"
name=
"pivot"
id=
"pivotYes"
[
checked
]="
templateFile
.
isPivot=
='1'"
(
click
)="
templateFile
.
isPivot=
'1'
"
>
<label
class=
"custom-control-label cursor-pointer"
for=
"pivotYes"
>
ใช่
</label>
</div>
</div>
</div>
<!-- แสดง DataGrid -->
<div>
<label
class=
"block mb-1"
>
แสดงรูปแบบ datagrid
</label>
<div
class=
"flex gap-4"
>
<div
class=
"flex items-center gap-2"
>
<input
type=
"radio"
class=
"custom-control-input cursor-pointer"
name=
"datagt"
id=
"datagtNo"
[
checked
]="
templateFile
.
isDataGrid=
='0'"
(
click
)="
templateFile
.
isDataGrid=
'0'
"
>
<label
class=
"custom-control-label cursor-pointer"
for=
"datagtNo"
>
ไม่ใช่
</label>
</div>
<div
class=
"flex items-center gap-2"
>
<input
type=
"radio"
class=
"custom-control-input cursor-pointer"
name=
"datagt"
id=
"datagtYes"
[
checked
]="
templateFile
.
isDataGrid=
='1'"
(
click
)="
templateFile
.
isDataGrid=
'1'
"
>
<label
class=
"custom-control-label cursor-pointer"
for=
"datagtYes"
>
ใช่
</label>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"form-group row
"
>
<div
class=
"ti-modal-footer flex justify-center gap-3 mb-3 mt-3
"
>
<label
for=
"position"
class=
"col-sm-4 col-form-label"
>
โมดูล
<span
style=
"color: red"
>
*
</span></label
>
<button
type=
"button"
class=
"ti-btn bg-danger text-white !font-medium"
(
click
)="
closeModaladdChild
()"
>
<div
class=
"col-sm-8"
>
{{'Cancel' | translate}}
<
select
class=
" custom-select"
[
disabled
]="
bodyTemplate
.
status=
='edit'"
<
/button>
[(
ngModel
)]="
bodyTemplate
.
data
.
module
"
>
<button
type=
"submit"
<option
style=
"color: red"
[
class
.
d-none
]="
bodyTemplate
.
data
.
module=
=''"
[
value
]="''"
>
[
class
.
ti-btn-disabled
]="(!
templateFile
.
portalId
&&!
templateFileName
)||!
templateFile
.
tdesc
"
{{bodyTemplate.data.module!=''?'ยกเลิก':''}}
</option>
[
disabled
]="(!
templateFile
.
portalId
&&!
templateFileName
)||!
templateFile
.
tdesc
"
<option
*
ngFor=
"let item of module.data"
[
ngValue
]="
item
.
code
"
>
{{item.tdesc}}
</option>
(
click
)="
postTemplateFile
()"
class=
"ti-btn bg-primary text-white !font-medium"
>
{{'Save' |
</select
>
translate}}
</button
>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"modal-footer "
>
<button
type=
"submit"
class=
"btn btn-info"
[
disabled
]="!
bodyTemplate
.
data
.
tname
||!
bodyTemplate
.
data
.
module
"
(
click
)="
modal
.
close
()"
>
บันทึก
</button>
<button
type=
"button"
class=
"btn btn-danger"
(
click
)="
modal
.
dismiss
()"
>
ปิด
</button>
</div>
</ng-template>
</ng-template>
<ng-template
#
addChildModal
let-modal
>
<ng-template
#
addChildModal
s
let-modal
>
<div
class=
"modal-header"
>
<div
class=
"modal-header"
>
<h5
class=
"modal-title"
id=
"edittemplateLabel"
>
EXCCHILD, Template file excel
</h5>
<h5
class=
"modal-title"
id=
"edittemplateLabel"
>
EXCCHILD, Template file excel
</h5>
<button
type=
"button"
class=
"close"
(
click
)="
modal
.
dismiss
()"
aria-label=
"Close"
>
<button
type=
"button"
class=
"close"
(
click
)="
modal
.
dismiss
()"
aria-label=
"Close"
>
...
...
src/app/DPU/common/myportal/set-excel-reports/excel-list/excel-list.component.scss
View file @
6f28c7db
.ti-modal-header
{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
border-bottom-width
:
1px
;
padding-top
:
0
.75rem
;
padding-bottom
:
0
.75rem
;
padding-left
:
1rem
;
padding-right
:
1rem
;
}
\ No newline at end of file
src/app/DPU/common/myportal/set-excel-reports/excel-list/excel-list.component.ts
View file @
6f28c7db
...
@@ -17,7 +17,7 @@ import { NgSelectModule } from '@ng-select/ng-select';
...
@@ -17,7 +17,7 @@ import { NgSelectModule } from '@ng-select/ng-select';
import
{
SharedModule
}
from
'../../../../../shared/shared.module'
;
import
{
SharedModule
}
from
'../../../../../shared/shared.module'
;
import
{
MatPaginator
}
from
'@angular/material/paginator'
;
import
{
MatPaginator
}
from
'@angular/material/paginator'
;
import
{
QuillModule
}
from
'ngx-quill'
;
import
{
QuillModule
}
from
'ngx-quill'
;
import
{
MatDialogModule
}
from
'@angular/material/dialog'
;
import
{
MatDialog
,
MatDialog
Module
}
from
'@angular/material/dialog'
;
import
{
FileUploadModule
}
from
'ng2-file-upload'
;
import
{
FileUploadModule
}
from
'ng2-file-upload'
;
import
{
FormsModule
,
NgModel
}
from
'@angular/forms'
;
import
{
FormsModule
,
NgModel
}
from
'@angular/forms'
;
import
{
DatagridSyncfutionComponent
}
from
'../../../../../datagrid-syncfution/datagrid-syncfution.component'
;
import
{
DatagridSyncfutionComponent
}
from
'../../../../../datagrid-syncfution/datagrid-syncfution.component'
;
...
@@ -57,6 +57,8 @@ export class ExcelListComponent implements OnInit {
...
@@ -57,6 +57,8 @@ export class ExcelListComponent implements OnInit {
template
:
{
data
:
TemplateModel
[],
filter
:
TemplateModel
[],
loading
:
boolean
}
=
{
data
:
[],
filter
:
[],
loading
:
false
}
template
:
{
data
:
TemplateModel
[],
filter
:
TemplateModel
[],
loading
:
boolean
}
=
{
data
:
[],
filter
:
[],
loading
:
false
}
templateFile
:
TemplateFileModel
=
new
MyTemplateFileModel
()
templateFile
:
TemplateFileModel
=
new
MyTemplateFileModel
()
module
:
{
data
:
ModuleModel
[],
loading
:
boolean
}
=
{
data
:
[],
loading
:
false
}
module
:
{
data
:
ModuleModel
[],
loading
:
boolean
}
=
{
data
:
[],
loading
:
false
}
pageIndex
:
number
=
0
;
itemsPerPage
:
number
=
10
;
page
=
1
page
=
1
pageSize
=
10
pageSize
=
10
pageModal
=
1
pageModal
=
1
...
@@ -140,10 +142,18 @@ export class ExcelListComponent implements OnInit {
...
@@ -140,10 +142,18 @@ export class ExcelListComponent implements OnInit {
gridLayout
:
{
stimulate
:
boolean
,
data
:
string
}
=
{
stimulate
:
false
,
data
:
''
}
gridLayout
:
{
stimulate
:
boolean
,
data
:
string
}
=
{
stimulate
:
false
,
data
:
''
}
pivotLayout
:
{
stimulate
:
boolean
,
data
:
string
}
=
{
stimulate
:
false
,
data
:
''
}
pivotLayout
:
{
stimulate
:
boolean
,
data
:
string
}
=
{
stimulate
:
false
,
data
:
''
}
setPerspective
=
""
setPerspective
=
""
isSearching
=
false
;
modalRef
:
any
;
modalRefaddChild
:
any
;
searchText
:
string
=
''
;
@
ViewChild
(
'addGroupModal'
)
addGroupModal
!
:
TemplateRef
<
any
>
;
@
ViewChild
(
'addChildModal'
)
addChildModal
!
:
TemplateRef
<
any
>
;
constructor
(
private
excelReportService
:
ExcelReportService
,
constructor
(
private
excelReportService
:
ExcelReportService
,
private
modalService
:
NgbModal
,
private
modalService
:
NgbModal
,
private
customCubeService
:
CustomCubeService
,
private
customCubeService
:
CustomCubeService
,
private
cdr
:
ChangeDetectorRef
)
{
private
cdr
:
ChangeDetectorRef
,
private
modal
:
MatDialog
)
{
}
}
ngOnInit
():
void
{
ngOnInit
():
void
{
...
@@ -153,6 +163,31 @@ export class ExcelListComponent implements OnInit {
...
@@ -153,6 +163,31 @@ export class ExcelListComponent implements OnInit {
this
.
getExcelPortalgGroupList
()
this
.
getExcelPortalgGroupList
()
this
.
getExcelPortalTagsList
()
this
.
getExcelPortalTagsList
()
}
}
get
totalItems
():
number
{
return
this
.
searchText
==
''
?
this
.
template
.
data
.
length
:
this
.
template
.
filter
.
length
;
}
get
totalPages
():
number
{
return
Math
.
ceil
(
this
.
totalItems
/
this
.
itemsPerPage
);
}
get
totalPagesArray
():
number
[]
{
return
Array
(
this
.
totalPages
).
fill
(
0
);
}
goToPage
(
index
:
number
):
void
{
if
(
index
<
0
||
index
>=
this
.
totalPages
)
return
;
this
.
pageIndex
=
index
;
this
.
updatePagedItems
();
}
updatePagedItems
():
void
{
const
start
=
this
.
pageIndex
*
this
.
itemsPerPage
;
const
end
=
start
+
this
.
itemsPerPage
;
const
source
=
this
.
searchText
==
''
?
this
.
template
.
data
:
this
.
template
.
filter
;
this
.
template
.
filter
=
source
.
slice
(
start
,
end
);
}
getExcelPortalList
()
{
getExcelPortalList
()
{
this
.
excelPortal
.
loading
=
true
this
.
excelPortal
.
loading
=
true
this
.
excelReportService
.
getExcelPortalList
().
subscribe
(
response
=>
{
this
.
excelReportService
.
getExcelPortalList
().
subscribe
(
response
=>
{
...
@@ -235,9 +270,9 @@ export class ExcelListComponent implements OnInit {
...
@@ -235,9 +270,9 @@ export class ExcelListComponent implements OnInit {
},
reason
=>
{
},
reason
=>
{
})
})
}
}
openAddGroupModal
(
targetModal
:
TemplateRef
<
any
>
,
data
?:
TemplateModel
)
{
openAddGroupModal
(
data
?:
TemplateModel
)
{
if
(
data
)
{
if
(
data
)
{
this
.
bodyTemplate
.
status
=
'edit'
this
.
bodyTemplate
.
status
=
'edit'
;
this
.
bodyTemplate
.
data
=
{
this
.
bodyTemplate
.
data
=
{
templateId
:
data
.
templateId
,
templateId
:
data
.
templateId
,
tname
:
data
.
tname
,
tname
:
data
.
tname
,
...
@@ -245,9 +280,9 @@ export class ExcelListComponent implements OnInit {
...
@@ -245,9 +280,9 @@ export class ExcelListComponent implements OnInit {
tdesc
:
data
.
tdesc
,
tdesc
:
data
.
tdesc
,
edesc
:
data
.
edesc
,
edesc
:
data
.
edesc
,
module
:
data
.
module
module
:
data
.
module
}
}
;
}
else
{
}
else
{
this
.
bodyTemplate
.
status
=
'add'
this
.
bodyTemplate
.
status
=
'add'
;
this
.
bodyTemplate
.
data
=
{
this
.
bodyTemplate
.
data
=
{
templateId
:
''
,
templateId
:
''
,
tname
:
''
,
tname
:
''
,
...
@@ -255,32 +290,10 @@ export class ExcelListComponent implements OnInit {
...
@@ -255,32 +290,10 @@ export class ExcelListComponent implements OnInit {
tdesc
:
''
,
tdesc
:
''
,
edesc
:
''
,
edesc
:
''
,
module
:
''
module
:
''
}
}
;
}
}
const
modalRef
=
this
.
modalService
.
open
(
targetModal
,
{
this
.
openModalAddGroup
()
centered
:
true
,
backdrop
:
'static'
,
size
:
'lg'
})
modalRef
.
result
.
then
(
result
=>
{
const
modalConfirmRef
=
this
.
modalService
.
open
(
ConfirmModalComponent
,
{
centered
:
true
,
backdrop
:
'static'
,
})
modalConfirmRef
.
componentInstance
.
message
=
'คุณต้องการบันทึกข้อมูลหรือไม่'
modalConfirmRef
.
result
.
then
(
result
=>
{
this
.
excelReportService
.
postTemplate
(
this
.
bodyTemplate
.
data
).
subscribe
((
response
:
any
)
=>
{
this
.
openAlertModal
(
response
.
message
)
if
(
response
.
success
)
{
this
.
getExcelList
()
this
.
getModuleList
()
}
},
error
=>
{
this
.
openAlertModal
(
error
.
message
)
})
},
reject
=>
{
})
},
reject
=>
{
})
}
}
deleteTemplate
(
template
:
TemplateModel
)
{
deleteTemplate
(
template
:
TemplateModel
)
{
...
@@ -302,7 +315,7 @@ export class ExcelListComponent implements OnInit {
...
@@ -302,7 +315,7 @@ export class ExcelListComponent implements OnInit {
})
})
},
reject
=>
{
})
},
reject
=>
{
})
}
}
openAddChildModal
(
targetModal
:
TemplateRef
<
any
>
,
data
:
TemplateModel
|
TemplateFileModel
,
status
:
'add'
|
'edit'
)
{
openAddChildModal
(
data
:
TemplateModel
|
TemplateFileModel
,
status
:
'add'
|
'edit'
)
{
if
(
status
==
'add'
)
{
if
(
status
==
'add'
)
{
this
.
templateFile
=
new
MyTemplateFileModel
({
templateId
:
data
.
templateId
,
module
:
data
.
module
})
this
.
templateFile
=
new
MyTemplateFileModel
({
templateId
:
data
.
templateId
,
module
:
data
.
module
})
this
.
templateFileType
=
'portal'
this
.
templateFileType
=
'portal'
...
@@ -313,11 +326,7 @@ export class ExcelListComponent implements OnInit {
...
@@ -313,11 +326,7 @@ export class ExcelListComponent implements OnInit {
this
.
templateFileName
=
this
.
templateFile
.
portalId
?
''
:
this
.
templateFile
.
fileName
this
.
templateFileName
=
this
.
templateFile
.
portalId
?
''
:
this
.
templateFile
.
fileName
this
.
templateFile
.
realFileNameOld
=
this
.
templateFile
.
fileName
this
.
templateFile
.
realFileNameOld
=
this
.
templateFile
.
fileName
}
}
this
.
addChildModalRef
=
this
.
modalService
.
open
(
targetModal
,
{
this
.
openModaladdChild
()
centered
:
true
,
backdrop
:
'static'
,
size
:
'lg'
})
}
}
openExcelPortalModal
(
targetModal
:
TemplateRef
<
any
>
)
{
openExcelPortalModal
(
targetModal
:
TemplateRef
<
any
>
)
{
...
@@ -362,29 +371,42 @@ export class ExcelListComponent implements OnInit {
...
@@ -362,29 +371,42 @@ export class ExcelListComponent implements OnInit {
}
}
templateListSearch
()
{
templateListSearch
()
{
if
(
!
this
.
searchBy
||
!
this
.
condition
||
!
this
.
searchValue
)
{
this
.
isSearching
=
true
;
this
.
template
.
filter
=
this
.
template
.
data
.
map
(
e
=>
new
MyTemplateModel
(
e
))
}
const
conditionMap
:
{
[
key
:
string
]:
(
a
:
any
,
b
:
any
)
=>
boolean
}
=
{
includes
:
(
a
,
b
)
=>
(
a
||
''
).
toString
().
toLowerCase
().
includes
((
b
||
''
).
toString
().
toLowerCase
()),
lt
:
(
a
,
b
)
=>
parseFloat
(
a
)
<
parseFloat
(
b
),
gt
:
(
a
,
b
)
=>
parseFloat
(
a
)
>
parseFloat
(
b
),
eq
:
(
a
,
b
)
=>
a
==
b
,
lte
:
(
a
,
b
)
=>
parseFloat
(
a
)
<=
parseFloat
(
b
),
gte
:
(
a
,
b
)
=>
parseFloat
(
a
)
>=
parseFloat
(
b
),
neq
:
(
a
,
b
)
=>
a
!=
b
,
};
const
compareFn
=
conditionMap
[
this
.
condition
];
if
(
!
compareFn
)
{
this
.
template
.
filter
=
this
.
template
.
data
.
map
(
e
=>
new
MyTemplateModel
(
e
))
}
setTimeout
(()
=>
{
if
(
!
this
.
searchBy
||
!
this
.
condition
||
!
this
.
searchValue
)
{
this
.
template
.
filter
=
this
.
template
.
data
.
map
(
e
=>
new
MyTemplateModel
(
e
));
this
.
isSearching
=
false
;
return
;
}
const
conditionMap
:
{
[
key
:
string
]:
(
a
:
any
,
b
:
any
)
=>
boolean
}
=
{
includes
:
(
a
,
b
)
=>
(
a
||
''
).
toString
().
toLowerCase
().
includes
((
b
||
''
).
toString
().
toLowerCase
()),
lt
:
(
a
,
b
)
=>
parseFloat
(
a
)
<
parseFloat
(
b
),
gt
:
(
a
,
b
)
=>
parseFloat
(
a
)
>
parseFloat
(
b
),
eq
:
(
a
,
b
)
=>
a
==
b
,
lte
:
(
a
,
b
)
=>
parseFloat
(
a
)
<=
parseFloat
(
b
),
gte
:
(
a
,
b
)
=>
parseFloat
(
a
)
>=
parseFloat
(
b
),
neq
:
(
a
,
b
)
=>
a
!=
b
,
};
const
compareFn
=
conditionMap
[
this
.
condition
];
if
(
!
compareFn
)
{
this
.
template
.
filter
=
this
.
template
.
data
.
map
(
e
=>
new
MyTemplateModel
(
e
));
this
.
isSearching
=
false
;
return
;
}
this
.
template
.
filter
=
this
.
template
.
data
.
filter
(
item
=>
{
const
value
=
(
item
as
any
)[
this
.
searchBy
];
return
compareFn
(
value
,
this
.
searchValue
);
})
.
map
(
e
=>
new
MyTemplateModel
(
e
));
this
.
template
.
filter
=
this
.
template
.
data
.
filter
(
item
=>
{
this
.
isSearching
=
false
;
const
value
=
(
item
as
any
)[
this
.
searchBy
];
},
1000
);
// delay mock loading
return
compareFn
(
value
,
this
.
searchValue
);
}).
map
(
e
=>
new
MyTemplateModel
(
e
));
}
}
onFileSelected
(
event
:
any
)
{
onFileSelected
(
event
:
any
)
{
...
@@ -802,4 +824,27 @@ export class ExcelListComponent implements OnInit {
...
@@ -802,4 +824,27 @@ export class ExcelListComponent implements OnInit {
},
500
);
},
500
);
}
}
}
}
openModalAddGroup
()
{
this
.
modalRef
=
this
.
modal
.
open
(
this
.
addGroupModal
,
{
width
:
'1000px'
,
height
:
'500px'
})
}
closeModalAddGroup
()
{
this
.
modalRef
?.
close
()
}
openModaladdChild
()
{
this
.
modalRefaddChild
=
this
.
modal
.
open
(
this
.
addChildModal
,
{
width
:
'1000px'
,
height
:
'500px'
})
}
closeModaladdChild
()
{
this
.
modalRefaddChild
?.
close
()
}
}
}
\ No newline at end of file
src/app/DPU/common/pdpa-manage/pdpa-manage.component.ts
View file @
6f28c7db
...
@@ -29,11 +29,10 @@ import { MyPdpaModel, PdpaModel } from "../../models/pdpa.model";
...
@@ -29,11 +29,10 @@ import { MyPdpaModel, PdpaModel } from "../../models/pdpa.model";
TranslateModule
,
TranslateModule
,
NgSelectModule
,
NgSelectModule
,
FormsModule
,
FormsModule
,
MatPaginator
,
FileUploadModule
,
FileUploadModule
,
PdpaConfigComponent
,
PdpaConfigComponent
,
QuillModule
QuillModule
],
],
templateUrl
:
'./pdpa-manage.component.html'
,
templateUrl
:
'./pdpa-manage.component.html'
,
styleUrl
:
'./pdpa-manage.component.css'
styleUrl
:
'./pdpa-manage.component.css'
})
})
...
...
src/app/DPU/common/user-management/user-setting/user-setting.component.ts
View file @
6f28c7db
...
@@ -23,9 +23,8 @@ import { TokenService } from "../../../../shared/services/token.service";
...
@@ -23,9 +23,8 @@ import { TokenService } from "../../../../shared/services/token.service";
TranslateModule
,
TranslateModule
,
NgSelectModule
,
NgSelectModule
,
FormsModule
,
FormsModule
,
MatPaginator
,
FileUploadModule
FileUploadModule
],
],
templateUrl
:
'./user-setting.component.html'
,
templateUrl
:
'./user-setting.component.html'
,
styleUrl
:
'./user-setting.component.css'
styleUrl
:
'./user-setting.component.css'
})
})
...
...
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