Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
portal-apps-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
portal-apps-manage
Commits
c8b0be7c
Commit
c8b0be7c
authored
Jul 23, 2025
by
DESKTOP-E3GSHH7\myhr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
เเก้ตอนบันทึกข้อมูลเสร็จmodal เปิด เเต่หน้าไม่สามารถกดอะไรได้ เพิ่มpointer hover
parent
c3010f5d
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
175 additions
and
67 deletions
+175
-67
alert-modal.component.html
...PU/common/myportal/alert-modal/alert-modal.component.html
+21
-1
alert-modal.component.ts
.../DPU/common/myportal/alert-modal/alert-modal.component.ts
+19
-6
list-course.component.html
...PU/common/myportal/list-course/list-course.component.html
+2
-2
list-course.component.ts
.../DPU/common/myportal/list-course/list-course.component.ts
+10
-8
list-doc.component.html
src/app/DPU/common/myportal/list-doc/list-doc.component.html
+3
-3
list-doc.component.ts
src/app/DPU/common/myportal/list-doc/list-doc.component.ts
+10
-8
list-excell.component.html
...PU/common/myportal/list-excell/list-excell.component.html
+8
-6
list-excell.component.ts
.../DPU/common/myportal/list-excell/list-excell.component.ts
+81
-19
list-widgets.component.html
.../common/myportal/list-widgets/list-widgets.component.html
+2
-2
list-widgets.component.ts
...PU/common/myportal/list-widgets/list-widgets.component.ts
+10
-8
approved-list.component.html
...tal/management/approved-list/approved-list.component.html
+2
-1
portal-category-list-approve.component.html
...-list-approve/portal-category-list-approve.component.html
+2
-1
portal-category-list.component.html
.../portal-category-list/portal-category-list.component.html
+3
-1
portal-create-category.component.html
...tal-create-category/portal-create-category.component.html
+2
-1
No files found.
src/app/DPU/common/myportal/alert-modal/alert-modal.component.html
View file @
c8b0be7c
<div
class=
"modal-header"
>
<
!-- <
div class="modal-header">
<h5 class="modal-title" id="editLabel">ข้อความแจ้งเตือน</h5>
<button type="button" class="close" (click)="activeModal.dismiss('dismiss')" aria-label="Close">
<span aria-hidden="true">×</span>
...
...
@@ -16,4 +16,23 @@
<ng-template #InnerHTML>
<div class="modal-body" [innerHTML]="innerHTML">
</div>
</ng-template> -->
<div
class=
"modal-header"
>
<h5
class=
"modal-title"
id=
"editLabel"
>
ข้อความแจ้งเตือน
</h5>
<button
type=
"button"
class=
"close"
(
click
)="
close
()"
aria-label=
"Close"
>
<span
aria-hidden=
"true"
>
×
</span>
</button>
</div>
<ng-container
*
ngIf=
"data.innerHTML != undefined then InnerHTML else Message"
></ng-container>
<ng-template
#
Message
>
<div
class=
"modal-body"
>
{{data.message}}
</div>
</ng-template>
<ng-template
#
InnerHTML
>
<div
class=
"modal-body"
[
innerHTML
]="
data
.
innerHTML
"
>
</div>
</ng-template>
\ No newline at end of file
src/app/DPU/common/myportal/alert-modal/alert-modal.component.ts
View file @
c8b0be7c
import
{
Component
,
Input
,
OnInit
}
from
'@angular/core'
;
import
{
NgbActiveModal
}
from
'@ng-bootstrap/ng-bootstrap'
;
import
{
Component
,
OnInit
,
Inject
}
from
'@angular/core'
;
import
{
MatDialogRef
,
MAT_DIALOG_DATA
,
MatDialogModule
}
from
'@angular/material/dialog'
;
import
{
CommonModule
}
from
'@angular/common'
;
import
{
FormsModule
}
from
'@angular/forms'
;
@
Component
({
selector
:
'app-alert-modal'
,
templateUrl
:
'./alert-modal.component.html'
,
styleUrls
:
[
'./alert-modal.component.scss'
]
styleUrls
:
[
'./alert-modal.component.scss'
],
standalone
:
true
,
imports
:
[
CommonModule
,
FormsModule
,
MatDialogModule
]
})
export
class
AlertModalComponent
implements
OnInit
{
@
Input
()
message
:
string
=
""
@
Input
()
innerHTML
?:
string
constructor
(
public
activeModal
:
NgbActiveModal
)
{
}
constructor
(
public
dialogRef
:
MatDialogRef
<
AlertModalComponent
>
,
@
Inject
(
MAT_DIALOG_DATA
)
public
data
:
{
message
:
string
;
innerHTML
?:
string
}
)
{
}
ngOnInit
():
void
{
}
close
():
void
{
this
.
dialogRef
.
close
();
}
}
\ No newline at end of file
src/app/DPU/common/myportal/list-course/list-course.component.html
View file @
c8b0be7c
...
...
@@ -69,7 +69,7 @@
<td>
<div>
<span
class=
"block mb-1"
>
<i
class=
"fa fa-link text-blue-600 text-base flex-shrink-0"
(
click
)="
openLink
(
data
.
link1
)"
<i
class=
"fa fa-link text-blue-600 text-base flex-shrink-0
cursor-pointer active: hover:text-danger
"
(
click
)="
openLink
(
data
.
link1
)"
style=
"font-size: 20px;"
></i>
</span>
</div>
...
...
@@ -77,7 +77,7 @@
<td>
<div>
<span
class=
"block mb-1"
>
<i
class=
"fa fa-download text-blue-600 text-base flex-shrink-0"
(
click
)="
downloadFile
(
data
.
logId
)"
<i
class=
"fa fa-download text-blue-600 text-base flex-shrink-0
cursor-pointer active hover:text-success
"
(
click
)="
downloadFile
(
data
.
logId
)"
style=
"font-size: 20px;"
></i>
</span>
</div>
...
...
src/app/DPU/common/myportal/list-course/list-course.component.ts
View file @
c8b0be7c
...
...
@@ -154,10 +154,10 @@ export class ListCourseComponent implements OnInit {
if
(
willDelete
)
{
this
.
courseService
.
deleteCourse
(
item
).
subscribe
(
result
=>
{
if
(
result
)
{
this
.
openAlertModalWithMatDialog
(
'ลบข้อมูลสำเร็จ'
);
swal
(
"ลบสำเร็จ!!"
,
"บันทึกข้อมูลสำเร็จ"
,
"success"
);
this
.
getListCourse
();
}
else
{
this
.
openAlertModalWithMatDialog
(
'ไม่สามารถลบข้อมูลได้'
);
swal
(
"สำเร็จบางส่วน/ข้อผิดพลาด!!"
,
"มีการลบข้อมูลบางส่วนไม่สำเร็จ หรือมีข้อผิดพลาด"
,
"warning"
);
}
},
error
=>
{
this
.
openAlertModalWithMatDialog
(
error
.
message
);
...
...
@@ -186,14 +186,15 @@ export class ListCourseComponent implements OnInit {
console
.
log
(
this
.
modelCourse
);
this
.
courseService
.
createCourse
(
this
.
modelCourse
).
subscribe
(
res
=>
{
if
(
res
)
{
this
.
openAlertModalWithMatDialog
(
'อัพเดทข้อมูลสำเร็จ'
);
swal
(
"บันทึกสำเร็จ!!"
,
"อัพเดทข้อมูลสำเร็จ"
,
"success"
);
this
.
closeDialog
();
this
.
getListCourse
();
}
else
{
this
.
openAlertModalWithMatDialog
(
'ไม่สามารถอัพเดทข้อมูลได้'
);
swal
(
'ไม่สามารถอัพเดทข้อมูลได้'
);
}
},
error
=>
{
this
.
openAlertModalWithMatDialog
(
error
.
message
);
console
.
error
(
"เกิดข้อผิดพลาดในการบันทึก/อัปเดต:"
,
error
);
swal
(
"ข้อผิดพลาด!!"
,
"ไม่สามารถบันทึก/อัปเดตข้อมูลได้"
,
"error"
);
});
}
});
...
...
@@ -210,14 +211,15 @@ export class ListCourseComponent implements OnInit {
if
(
willSave
)
{
this
.
courseService
.
createCourse
(
this
.
modelCourse
).
subscribe
(
res
=>
{
if
(
res
)
{
this
.
openAlertModalWithMatDialog
(
'บันทึกข้อมูลสำเร็จ'
);
swal
(
"บันทึกสำเร็จ!!"
,
"บันทึกข้อมูลสมาชิก"
,
"success"
);
this
.
closeDialog
();
this
.
getListCourse
();
}
else
{
this
.
openAlertModalWithMatDialog
(
'ไม่สามารถสร้างเอกสารได้'
);
swal
(
'ไม่สามารถสร้างเอกสารได้'
);
}
},
error
=>
{
this
.
openAlertModalWithMatDialog
(
error
.
message
);
console
.
error
(
"เกิดข้อผิดพลาดในการบันทึก/อัปเดต:"
,
error
);
swal
(
"ข้อผิดพลาด!!"
,
"ไม่สามารถบันทึก/อัปเดตข้อมูลได้"
,
"error"
);
});
}
});
...
...
src/app/DPU/common/myportal/list-doc/list-doc.component.html
View file @
c8b0be7c
...
...
@@ -149,7 +149,7 @@
<td
style=
"justify-items: center;"
>
<div>
<span
class=
"block mb-1"
>
<i
class=
"fa fa-link text-blue-600 text-base flex-shrink-0"
(
click
)="
openLink
(
data
.
link1
)"
<i
class=
"fa fa-link text-blue-600 text-base flex-shrink-0
cursor-pointer active: hover:text-danger
"
(
click
)="
openLink
(
data
.
link1
)"
style=
"font-size: 20px;"
></i>
</span>
</div>
...
...
@@ -157,7 +157,7 @@
<td
style=
"justify-items: center;"
>
<div>
<span
class=
"block mb-1"
>
<i
class=
"fa fa-download text-blue-600 text-base flex-shrink-0"
<i
class=
"fa fa-download text-blue-600 text-base flex-shrink-0
cursor-pointer active hover:text-success
"
(
click
)="
downloadFile
(
data
.
logId
,'
tha
')"
style=
"font-size: 20px;"
></i>
</span>
</div>
...
...
@@ -165,7 +165,7 @@
<td
style=
"justify-items: center;"
>
<div>
<span
class=
"block mb-1"
>
<i
class=
"fa fa-download text-blue-600 text-base flex-shrink-0"
<i
class=
"fa fa-download text-blue-600 text-base flex-shrink-0
cursor-pointer active hover:text-success
"
(
click
)="
downloadFile
(
data
.
logId
,'
eng
')"
style=
"font-size: 20px;"
></i>
</span>
</div>
...
...
src/app/DPU/common/myportal/list-doc/list-doc.component.ts
View file @
c8b0be7c
...
...
@@ -155,10 +155,10 @@ export class ListDocComponent implements OnInit {
if
(
willDelete
)
{
this
.
documentService
.
deleteExcel
(
item
).
subscribe
(
result
=>
{
if
(
result
)
{
this
.
openAlertModalWithMatDialog
(
'ลบข้อมูลสำเร็จ'
);
swal
(
"ลบสำเร็จ!!"
,
"บันทึกข้อมูลสำเร็จ"
,
"success"
);
this
.
getListDoc
();
// โหลดข้อมูลใหม่ทั้งหมดและใช้ applyFilterAndPagination
}
else
{
this
.
openAlertModalWithMatDialog
(
'ไม่สามารถลบข้อมูลได้'
);
swal
(
"สำเร็จบางส่วน/ข้อผิดพลาด!!"
,
"มีการลบข้อมูลบางส่วนไม่สำเร็จ หรือมีข้อผิดพลาด"
,
"warning"
);
}
},
error
=>
{
this
.
openAlertModalWithMatDialog
(
error
.
message
);
...
...
@@ -187,14 +187,15 @@ export class ListDocComponent implements OnInit {
console
.
log
(
this
.
modelDoc
);
this
.
documentService
.
createDoc
(
this
.
modelDoc
).
subscribe
(
res
=>
{
if
(
res
)
{
this
.
openAlertModalWithMatDialog
(
'อัพเดทข้อมูลสำเร็จ'
);
swal
(
"บันทึกสำเร็จ!!"
,
"อัพเดทข้อมูลสำเร็จ"
,
"success"
);
this
.
closeDialog
();
// ปิด MatDialog
this
.
getListDoc
();
// โหลดข้อมูลใหม่ทั้งหมดและใช้ applyFilterAndPagination
}
else
{
this
.
openAlertModalWithMatDialog
(
'ไม่สามารถอัพเดทข้อมูลได้'
);
swal
(
'ไม่สามารถอัพเดทข้อมูลได้'
);
}
},
error
=>
{
this
.
openAlertModalWithMatDialog
(
error
.
message
);
console
.
error
(
"เกิดข้อผิดพลาดในการบันทึก/อัปเดต:"
,
error
);
swal
(
"ข้อผิดพลาด!!"
,
"ไม่สามารถบันทึก/อัปเดตข้อมูลได้"
,
"error"
);
});
}
});
...
...
@@ -211,14 +212,15 @@ export class ListDocComponent implements OnInit {
if
(
willSave
)
{
this
.
documentService
.
createDoc
(
this
.
modelDoc
).
subscribe
(
res
=>
{
if
(
res
)
{
this
.
openAlertModalWithMatDialog
(
'บันทึกข้อมูลสำเร็จ'
);
swal
(
"บันทึกสำเร็จ!!"
,
"บันทึกข้อมูลสมาชิก"
,
"success"
);
this
.
closeDialog
();
// ปิด MatDialog
this
.
getListDoc
();
// โหลดข้อมูลใหม่ทั้งหมดและใช้ applyFilterAndPagination
}
else
{
this
.
openAlertModalWithMatDialog
(
'ไม่สามารถสร้างเอกสารได้'
);
swal
(
'ไม่สามารถสร้างเอกสารได้'
);
}
},
error
=>
{
this
.
openAlertModalWithMatDialog
(
error
.
message
);
console
.
error
(
"เกิดข้อผิดพลาดในการบันทึก/อัปเดต:"
,
error
);
swal
(
"ข้อผิดพลาด!!"
,
"ไม่สามารถบันทึก/อัปเดตข้อมูลได้"
,
"error"
);
});
}
});
...
...
src/app/DPU/common/myportal/list-excell/list-excell.component.html
View file @
c8b0be7c
...
...
@@ -8,7 +8,7 @@
{{ 'All List' | translate}}
</div>
<div
class=
"flex flex-wrap gap-2"
>
<a
href=
"javascript:void(0);"
class=
"hs-dropdown-toggle ti-btn ti-btn-primary-full me-2"
<a
href=
"javascript:void(0);"
class=
"hs-dropdown-toggle ti-btn ti-btn-primary-full me-2
hover:scale-105 transition duration-300
"
(
click
)="
openEditExcelDialog
()"
><i
class=
"ri-add-line font-semibold align-middle"
></i>
{{ 'Create' |
translate}}
</a>
...
...
@@ -69,7 +69,7 @@
<td>
<div>
<span
class=
"block mb-1"
>
<i
class=
"fa fa-link text-blue-600 text-base flex-shrink-0"
(
click
)="
openLink
(
data
.
link1
)"
<i
class=
"fa fa-link text-blue-600 text-base flex-shrink-0
cursor-pointer active: hover:text-danger hover:scale-125 transition duration-300
"
(
click
)="
openLink
(
data
.
link1
)"
style=
"font-size: 20px;"
></i>
</span>
</div>
...
...
@@ -77,8 +77,8 @@
<td>
<div>
<span
class=
"block mb-1"
>
<i
class=
"fa fa-download text-blue-600 text-base flex-shrink-0
"
(
click
)="
downloadFile
(
data
.
logId
)
"
style=
"font-size: 20px;"
></i>
<i
class=
"fa fa-download text-blue-600 text-base flex-shrink-0
cursor-pointer active hover:text-success hover:scale-125 transition duration-300
"
(
click
)="
downloadFile
(
data
.
logId
)"
style=
"font-size: 20px;"
></i>
</span>
</div>
</td>
...
...
@@ -121,7 +121,8 @@
<div
class=
"box-footer"
>
<div
class=
"flex items-center flex-wrap overflow-auto"
>
<div
class=
"mb-2 sm:mb-0"
>
<select
class=
"custom-select m-r-5"
style=
"width: auto"
[(
ngModel
)]="
pageSize
"
(
ngModelChange
)="
goToPage
(
0
)"
>
<select
class=
"custom-select m-r-5"
style=
"width: auto"
[(
ngModel
)]="
pageSize
"
(
ngModelChange
)="
goToPage
(
0
)"
>
<option
[
ngValue
]="
10
"
>
รายการต่อหน้า: 10
</option>
<option
[
ngValue
]="
50
"
>
รายการต่อหน้า: 50
</option>
<option
[
ngValue
]="
100
"
>
รายการต่อหน้า: 100
</option>
...
...
@@ -158,7 +159,8 @@
</div>
</div>
<div
class=
"box p-4"
*
ngIf=
"checkType === '1'"
>
<div
class=
"flex flex-wrap -mx-2"
>
<div
class=
"box p-4"
*
ngIf=
"checkType === '1'"
>
<div
class=
"flex flex-wrap -mx-2"
>
<div
class=
"w-full"
>
<div
class=
"py-3 px-2"
>
<input
type=
"text"
...
...
src/app/DPU/common/myportal/list-excell/list-excell.component.ts
View file @
c8b0be7c
...
...
@@ -2,7 +2,6 @@ import { Component, OnInit, TemplateRef, ViewChild } from '@angular/core';
import
{
NgbModal
,
NgbPaginationModule
}
from
'@ng-bootstrap/ng-bootstrap'
;
import
{
ExcelModel
}
from
'../../../models/excel.model'
;
import
{
ExcelService
}
from
'../../../services/excel.service'
;
import
{
ConfirmModalComponent
}
from
'../confirm-modal/confirm-modal.component'
;
import
{
AlertModalComponent
}
from
'../alert-modal/alert-modal.component'
;
import
{
UploadService
}
from
'../../../services/upload.service'
;
import
{
TagService
}
from
'../../../services/tag.service'
;
...
...
@@ -35,7 +34,6 @@ import swal from 'sweetalert';
SharedModule
,
MatDialogModule
,
TranslateModule
,
NgbPaginationModule
,
TagInputModule
,
],
})
...
...
@@ -62,7 +60,6 @@ export class ListExcelComponent implements OnInit {
listGroup
:
GroupModel
[]
=
[];
constructor
(
private
modalService
:
NgbModal
,
private
excelService
:
ExcelService
,
private
uploadService
:
UploadService
,
private
tagService
:
TagService
,
...
...
@@ -183,10 +180,10 @@ export class ListExcelComponent implements OnInit {
if
(
willDelete
)
{
this
.
excelService
.
deleteExcel
(
item
).
subscribe
(
result
=>
{
if
(
result
)
{
this
.
openAlertModalWithMatDialog
(
'ลบข้อมูลสำเร็จ'
);
swal
(
"ลบสำเร็จ!!"
,
"บันทึกข้อมูลสำเร็จ"
,
"success"
);
this
.
getListExcel
();
}
else
{
this
.
openAlertModalWithMatDialog
(
'ไม่สามารถลบข้อมูลได้'
);
swal
(
"สำเร็จบางส่วน/ข้อผิดพลาด!!"
,
"มีการลบข้อมูลบางส่วนไม่สำเร็จ หรือมีข้อผิดพลาด"
,
"warning"
);
}
},
error
=>
{
this
.
openAlertModalWithMatDialog
(
error
.
message
);
...
...
@@ -215,14 +212,15 @@ export class ListExcelComponent implements OnInit {
console
.
log
(
this
.
modelExcel
);
this
.
excelService
.
createExcel
(
this
.
modelExcel
).
subscribe
(
res
=>
{
if
(
res
)
{
this
.
openAlertModalWithMatDialog
(
'อัพเดทข้อมูลสำเร็จ'
);
swal
(
"บันทึกสำเร็จ!!"
,
"อัพเดทข้อมูลสำเร็จ"
,
"success"
);
this
.
closeDialog
();
this
.
getListExcel
();
}
else
{
this
.
openAlertModalWithMatDialog
(
'ไม่สามารถอัพเดทข้อมูลได้'
);
swal
(
'ไม่สามารถอัพเดทข้อมูลได้'
);
}
},
error
=>
{
this
.
openAlertModalWithMatDialog
(
error
.
message
);
console
.
error
(
"เกิดข้อผิดพลาดในการบันทึก/อัปเดต:"
,
error
);
swal
(
"ข้อผิดพลาด!!"
,
"ไม่สามารถบันทึก/อัปเดตข้อมูลได้"
,
"error"
);
});
}
});
...
...
@@ -239,18 +237,79 @@ export class ListExcelComponent implements OnInit {
if
(
willSave
)
{
this
.
excelService
.
createExcel
(
this
.
modelExcel
).
subscribe
(
res
=>
{
if
(
res
)
{
this
.
openAlertModalWithMatDialog
(
'บันทึกข้อมูลสำเร็จ'
);
swal
(
"บันทึกสำเร็จ!!"
,
"บันทึกข้อมูลสมาชิก"
,
"success"
);
this
.
closeDialog
();
this
.
getListExcel
();
}
else
{
this
.
openAlertModalWithMatDialog
(
'ไม่สามารถสร้างเอกสารได้'
);
swal
(
'ไม่สามารถสร้างเอกสารได้'
);
}
},
error
=>
{
this
.
openAlertModalWithMatDialog
(
error
.
message
);
console
.
error
(
"เกิดข้อผิดพลาดในการบันทึก/อัปเดต:"
,
error
);
swal
(
"ข้อผิดพลาด!!"
,
"ไม่สามารถบันทึก/อัปเดตข้อมูลได้"
,
"error"
);
});
}
});
}
// onUpdate() {
// swal({
// title: "คุณแน่ใจหรือไม่?",
// text: "คุณต้องการอัพเดทข้อมูลหรือไม่",
// icon: "warning",
// dangerMode: false,
// buttons: ["ยกเลิก", "ยืนยัน"],
// }).then((willUpdate: boolean) => {
// if (willUpdate) {
// this.excelService.createExcel(this.modelExcel).subscribe({
// next: (res) => {
// console.log('Excel update response:', res);
// if (res) {
// // this.openAlertModalWithMatDialog('อัพเดทข้อมูลสำเร็จ');
// } else {
// this.openAlertModalWithMatDialog('ไม่สามารถอัพเดทข้อมูลได้ (res is false/null)');
// }
// this.closeDialog();
// this.getListExcel();
// },
// error: (error) => {
// this.openAlertModalWithMatDialog(error.message || 'เกิดข้อผิดพลาดในการอัปเดทข้อมูล');
// this.closeDialog();
// },
// });
// } else {
// this.closeDialog();
// }
// });
// }
// onCreate() {
// swal({
// title: "คุณแน่ใจหรือไม่?",
// text: "คุณต้องการบันทึกหรือไม่",
// icon: "warning",
// dangerMode: false,
// buttons: ["ยกเลิก", "ยืนยัน"],
// }).then((willSave: boolean) => {
// if (willSave) {
// this.excelService.createExcel(this.modelExcel).subscribe({
// next: (res) => {
// if (res) {
// // this.openAlertModalWithMatDialog('บันทึกข้อมูลสำเร็จ'); // <--- ลบบรรทัดนี้ออก
// } else {
// this.openAlertModalWithMatDialog('ไม่สามารถสร้างเอกสารได้ (res is false/null)');
// }
// this.closeDialog();
// this.getListExcel();
// },
// error: (error) => {
// this.openAlertModalWithMatDialog(error.message || 'เกิดข้อผิดพลาดในการสร้างเอกสาร');
// this.closeDialog();
// },
// });
// } else {
// this.closeDialog();
// }
// });
// }
onSumit
()
{
if
(
this
.
checkEdit
)
{
...
...
@@ -260,20 +319,26 @@ export class ListExcelComponent implements OnInit {
}
}
async
getExcelById
(
targetModal
:
NgbModal
,
id
:
string
)
{
async
getExcelById
(
id
:
string
)
{
// <--- แก้ไขตรงนี้
try
{
const
data
=
await
this
.
excelService
.
getExcelById
(
id
).
toPromise
();
this
.
modelExcel
=
new
ExcelModel
(
data
!
);
console
.
log
(
"🚀 ~ ListExcelComponent ~ getExcelById ~ this.modelExcel:"
,
this
.
modelExcel
);
if
(
data
)
{
this
.
modalService
.
open
(
targetModal
,
{
centered
:
true
,
backdrop
:
'static'
,
size
:
'lg'
this
.
dialogRef
=
this
.
dialog
.
open
(
this
.
editTemplateModalRef
,
{
width
:
'1100px'
,
disableClose
:
true
,
});
this
.
dialogRef
.
afterClosed
().
subscribe
((
result
:
boolean
)
=>
{
console
.
log
(
'Excel dialog opened by getExcelById closed with result:'
,
result
);
if
(
result
===
true
)
{
this
.
getListExcel
();
}
});
}
}
catch
(
error
)
{
console
.
error
(
'Error loading data:'
,
error
);
this
.
openAlertModalWithMatDialog
(
'ไม่สามารถโหลดข้อมูลได้'
);
// เพิ่มการแจ้งเตือน
}
}
...
...
@@ -370,9 +435,6 @@ export class ListExcelComponent implements OnInit {
});
}
closeBtnClick
()
{
this
.
modalService
.
dismissAll
();
}
coverDate
(
date
:
string
)
{
return
date
.
split
(
'-'
).
reverse
().
join
(
'/'
);
...
...
src/app/DPU/common/myportal/list-widgets/list-widgets.component.html
View file @
c8b0be7c
...
...
@@ -68,7 +68,7 @@
<td>
<div>
<span
class=
"block mb-1"
>
<i
class=
"fa fa-link text-blue-600 text-base flex-shrink-0 cursor-pointer"
<i
class=
"fa fa-link text-blue-600 text-base flex-shrink-0 cursor-pointer
active: hover:text-danger hover:scale-125 transition duration-300
"
(
click
)="
openLink
(
data
.
link1
)"
style=
"font-size: 20px;"
></i>
</span>
</div>
...
...
@@ -76,7 +76,7 @@
<td>
<div>
<span
class=
"block mb-1"
>
<i
class=
"fa fa-download text-blue-600 text-base flex-shrink-0 cursor-pointer"
<i
class=
"fa fa-download text-blue-600 text-base flex-shrink-0 cursor-pointer
active hover:text-success hover:scale-125 transition duration-300
"
(
click
)="
downloadFile
(
data
.
widgetId
)"
style=
"font-size: 20px;"
></i>
</span>
</div>
...
...
src/app/DPU/common/myportal/list-widgets/list-widgets.component.ts
View file @
c8b0be7c
...
...
@@ -167,10 +167,10 @@ export class ListWidgetsComponent implements OnInit {
if
(
willDelete
)
{
this
.
widgetService
.
deleteWidget
(
item
).
subscribe
(
result
=>
{
if
(
result
)
{
this
.
openAlertModalWithMatDialog
(
'ลบข้อมูลสำเร็จ'
);
swal
(
"ลบสำเร็จ!!"
,
"บันทึกข้อมูลสำเร็จ"
,
"success"
);
this
.
getListWidgets
();
// Re-fetch and re-apply filter/pagination
}
else
{
this
.
openAlertModalWithMatDialog
(
'ไม่สามารถลบข้อมูลได้'
);
swal
(
"สำเร็จบางส่วน/ข้อผิดพลาด!!"
,
"มีการลบข้อมูลบางส่วนไม่สำเร็จ หรือมีข้อผิดพลาด"
,
"warning"
);
}
},
error
=>
{
this
.
openAlertModalWithMatDialog
(
error
.
message
);
...
...
@@ -199,14 +199,15 @@ export class ListWidgetsComponent implements OnInit {
console
.
log
(
this
.
modelWidget
);
this
.
widgetService
.
createWidget
(
this
.
modelWidget
).
subscribe
(
res
=>
{
if
(
res
)
{
this
.
openAlertModalWithMatDialog
(
'อัพเดทข้อมูลสำเร็จ'
);
swal
(
"บันทึกสำเร็จ!!"
,
"อัพเดทข้อมูลสำเร็จ"
,
"success"
);
this
.
closeDialog
();
this
.
getListWidgets
();
// Re-fetch and re-apply filter/pagination
}
else
{
this
.
openAlertModalWithMatDialog
(
'ไม่สามารถอัพเดทข้อมูลได้'
);
swal
(
'ไม่สามารถอัพเดทข้อมูลได้'
);
}
},
error
=>
{
this
.
openAlertModalWithMatDialog
(
error
.
message
);
console
.
error
(
"เกิดข้อผิดพลาดในการบันทึก/อัปเดต:"
,
error
);
swal
(
"ข้อผิดพลาด!!"
,
"ไม่สามารถบันทึก/อัปเดตข้อมูลได้"
,
"error"
);
});
}
});
...
...
@@ -223,14 +224,15 @@ export class ListWidgetsComponent implements OnInit {
if
(
willSave
)
{
this
.
widgetService
.
createWidget
(
this
.
modelWidget
).
subscribe
(
res
=>
{
if
(
res
)
{
this
.
openAlertModalWithMatDialog
(
'บันทึกข้อมูลสำเร็จ'
);
swal
(
"บันทึกสำเร็จ!!"
,
"บันทึกข้อมูลสมาชิก"
,
"success"
);
this
.
closeDialog
();
this
.
getListWidgets
();
// Re-fetch and re-apply filter/pagination
}
else
{
this
.
openAlertModalWithMatDialog
(
'ไม่สามารถสร้างเอกสารได้'
);
swal
(
'ไม่สามารถสร้างเอกสารได้'
);
}
},
error
=>
{
this
.
openAlertModalWithMatDialog
(
error
.
message
);
console
.
error
(
"เกิดข้อผิดพลาดในการบันทึก/อัปเดต:"
,
error
);
swal
(
"ข้อผิดพลาด!!"
,
"ไม่สามารถบันทึก/อัปเดตข้อมูลได้"
,
"error"
);
});
}
});
...
...
src/app/DPU/common/myportal/management/approved-list/approved-list.component.html
View file @
c8b0be7c
...
...
@@ -52,7 +52,8 @@
</div>
<div>
<button
class=
"bg-primary inline-flex items-center px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white text-sm font-medium rounded-md shadow-md transition duration-150 ease-in-out focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50"
class=
"bg-primary inline-flex items-center px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white text-sm font-medium rounded-md shadow-md
active hover:bg-success hover:scale-110 transition duration-300 ease-in-out focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50"
(
click
)="
openView
(
c
.
id
)"
>
รายละเอียด
...
...
src/app/DPU/common/myportal/management/portal-category-list-approve/portal-category-list-approve.component.html
View file @
c8b0be7c
...
...
@@ -52,7 +52,8 @@
</div>
<div>
<button
class=
"bg-primary inline-flex items-center px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white text-sm font-medium rounded-md shadow-md transition duration-150 ease-in-out focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50"
class=
"bg-primary inline-flex items-center px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white text-sm font-medium rounded-md shadow-md
active hover:bg-success hover:scale-110 transition duration-300 ease-in-out focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50"
(
click
)="
openView
(
c
.
id
)"
>
รายละเอียด
...
...
src/app/DPU/common/myportal/portal-category-list/portal-category-list.component.html
View file @
c8b0be7c
...
...
@@ -50,7 +50,9 @@
</div>
<div>
<button
class=
"bg-primary inline-flex items-center px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white text-sm font-medium rounded-md shadow-md transition duration-150 ease-in-out focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50"
class=
"bg-primary inline-flex items-center px-4 py-2 bg-blue-600 hover:bg-blue-700
text-white text-sm font-medium rounded-md shadow-md ease-in-out focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50
active hover:bg-success hover:scale-110 transition duration-300"
(
click
)="
openView
(
c
.
id
)"
>
รายละเอียด
...
...
src/app/DPU/common/myportal/portal-create-category/portal-create-category.component.html
View file @
c8b0be7c
...
...
@@ -53,7 +53,8 @@
</div>
<div>
<button
class=
"bg-primary inline-flex items-center px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white text-sm font-medium rounded-md shadow-md transition duration-150 ease-in-out focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50"
class=
"bg-primary inline-flex items-center px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white text-sm font-medium rounded-md shadow-md
active hover:bg-success hover:scale-110 transition duration-300 ease-in-out focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50"
(
click
)="
openView
(
c
.
id
)"
>
รายละเอียด
</button>
...
...
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