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
956b2d7e
Commit
956b2d7e
authored
Aug 29, 2025
by
Natthaphat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swal alert เพิ่ม
parent
7830ab69
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
323 additions
and
352 deletions
+323
-352
view-list-course.component.html
...ved-list/view-list-course/view-list-course.component.html
+1
-1
view-list-course.component.ts
...roved-list/view-list-course/view-list-course.component.ts
+22
-27
view-list-doc.component.ts
...nt/approved-list/view-list-doc/view-list-doc.component.ts
+22
-27
view-list-excel.component.ts
...pproved-list/view-list-excel/view-list-excel.component.ts
+22
-27
approve-course.component.ts
...y-list-approve/approve-course/approve-course.component.ts
+63
-62
approve-doc.component.ts
...ategory-list-approve/approve-doc/approve-doc.component.ts
+63
-62
approve-excel.component.ts
...ory-list-approve/approve-excel/approve-excel.component.ts
+63
-62
view-list-course.component.ts
...x/myportal/view-list-course/view-list-course.component.ts
+22
-27
view-list-doc.component.ts
...skill-x/myportal/view-list-doc/view-list-doc.component.ts
+22
-28
view-list-excel.component.ts
...l-x/myportal/view-list-excel/view-list-excel.component.ts
+23
-29
No files found.
src/app/DPU/myskill-x/myportal/management/approved-list/view-list-course/view-list-course.component.html
View file @
956b2d7e
...
...
@@ -140,7 +140,7 @@
<td
class=
"!text-center"
>
{{data.downloadDate}} {{data.downloadTime}}
</td>
<td
class=
"!text-center"
>
{{data.dwTime}} ครั้ง
</td>
<td
*
ngIf=
"checkType == '1'"
>
<button
type=
"button"
class=
"b
tn btn-circle btn-danger rounded-circle btn-sm mr-2
"
(
click
)="
deleteFile
(
data
)"
placement=
"top"
ngbTooltip=
"ลบ"
><i
class=
"fas fa-trash-alt"
></i></button>
<button
type=
"button"
class=
"b
g-danger hover:bg-danger text-white text-sm ml-5 w-10 h-10 flex items-center justify-center rounded-full
"
(
click
)="
deleteFile
(
data
)"
placement=
"top"
ngbTooltip=
"ลบ"
><i
class=
"fas fa-trash-alt"
></i></button>
</td>
</tr>
<tr
*
ngIf=
"filterListCourse().length === 0"
>
...
...
src/app/DPU/myskill-x/myportal/management/approved-list/view-list-course/view-list-course.component.ts
View file @
956b2d7e
...
...
@@ -16,6 +16,7 @@ import { CourseContentModel } from '../../../../../models/course-content.model';
import
{
CourseService
}
from
'../../../../../services/course.service'
;
declare
var
require
:
any
import
FileSaver
from
'file-saver'
;
import
swal
from
'sweetalert'
;
@
Component
({
selector
:
'app-view-list-course'
,
templateUrl
:
'./view-list-course.component.html'
,
...
...
@@ -103,23 +104,26 @@ export class ViewListCourseComponent implements OnInit {
}
}
deleteFile
(
item
:
CourseContentModel
)
{
const
modalRef
=
this
.
modalService
.
open
(
ConfirmModalComponent
,
{
centered
:
true
,
backdrop
:
'static'
,
swal
({
title
:
"คุณแน่ใจหรือไม่?"
,
text
:
"คุณต้องการลบข้อมูลนี้หรือไม่"
,
icon
:
"warning"
,
dangerMode
:
true
,
buttons
:
[
"ยกเลิก"
,
"ยืนยัน"
],
}).
then
((
willDelete
:
boolean
)
=>
{
if
(
willDelete
)
{
this
.
courseService
.
deleteCourseContent
(
item
).
subscribe
(
result
=>
{
if
(
result
)
{
this
.
openAlertModal
(
'ลบข้อมูลสำเร็จ'
,
'success'
)
this
.
getListCourse
();
}
else
{
this
.
openAlertModal
(
'ไม่สามารถลบข้อมูลได้'
,
'error'
)
}
},
error
=>
{
this
.
openAlertModal
(
error
.
message
,
'error'
)
})
}
})
modalRef
.
componentInstance
.
message
=
'คุณต้องการลบข้อมูลหรือไม่'
modalRef
.
result
.
then
(
result
=>
{
this
.
courseService
.
deleteCourseContent
(
item
).
subscribe
(
result
=>
{
if
(
result
)
{
this
.
openAlertModal
(
'ลบข้อมูลสำเร็จ'
)
this
.
getListCourse
();
}
else
{
this
.
openAlertModal
(
'ไม่สามารถลบข้อมูลได้'
)
}
},
error
=>
{
this
.
openAlertModal
(
error
.
message
)
})
},
reject
=>
{
})
}
ngOnInit
()
{
this
.
getListCourse
();
...
...
@@ -127,17 +131,8 @@ export class ViewListCourseComponent implements OnInit {
openLink
(
url
:
string
)
{
window
.
open
(
url
,
"_blank"
);
}
openAlertModal
(
message
?:
string
)
{
const
modalRef
=
this
.
modalService
.
open
(
AlertModalComponent
,
{
centered
:
true
,
backdrop
:
'static'
})
modalRef
.
componentInstance
.
message
=
message
?
message
:
""
modalRef
.
result
.
then
(
result
=>
{
this
.
modalService
.
dismissAll
()
},
reason
=>
{
this
.
modalService
.
dismissAll
()
})
openAlertModal
(
text
:
string
,
type
:
'success'
|
'error'
)
{
swal
(
"แจ้งเตือน"
,
text
,
type
);
}
coverDate
(
date
:
string
)
{
...
...
src/app/DPU/myskill-x/myportal/management/approved-list/view-list-doc/view-list-doc.component.ts
View file @
956b2d7e
...
...
@@ -16,6 +16,7 @@ import { DocumentContentModel } from '../../../../../models/document-content.mod
import
{
DocumentService
}
from
'../../../../../services/document.service'
;
declare
var
require
:
any
import
FileSaver
from
'file-saver'
;
import
swal
from
'sweetalert'
;
@
Component
({
selector
:
'app-view-list-doc'
,
templateUrl
:
'./view-list-doc.component.html'
,
...
...
@@ -81,23 +82,26 @@ export class ViewListDocComponent implements OnInit {
})
}
deleteFile
(
item
:
DocumentContentModel
)
{
const
modalRef
=
this
.
modalService
.
open
(
ConfirmModalComponent
,
{
centered
:
true
,
backdrop
:
'static'
,
swal
({
title
:
"คุณแน่ใจหรือไม่?"
,
text
:
"คุณต้องการลบข้อมูลนี้หรือไม่"
,
icon
:
"warning"
,
dangerMode
:
true
,
buttons
:
[
"ยกเลิก"
,
"ยืนยัน"
],
}).
then
((
willDelete
:
boolean
)
=>
{
if
(
willDelete
)
{
this
.
documentService
.
deleteExcelContent
(
item
).
subscribe
(
result
=>
{
if
(
result
)
{
this
.
openAlertModal
(
'ลบข้อมูลสำเร็จ'
,
'success'
)
this
.
getListDoc
();
}
else
{
this
.
openAlertModal
(
'ไม่สามารถลบข้อมูลได้'
,
'error'
)
}
},
error
=>
{
this
.
openAlertModal
(
error
.
message
,
'error'
)
})
}
})
modalRef
.
componentInstance
.
message
=
'คุณต้องการลบข้อมูลหรือไม่'
modalRef
.
result
.
then
(
result
=>
{
this
.
documentService
.
deleteExcelContent
(
item
).
subscribe
(
result
=>
{
if
(
result
)
{
this
.
openAlertModal
(
'ลบข้อมูลสำเร็จ'
)
this
.
getListDoc
();
}
else
{
this
.
openAlertModal
(
'ไม่สามารถลบข้อมูลได้'
)
}
},
error
=>
{
this
.
openAlertModal
(
error
.
message
)
})
},
reject
=>
{
})
}
async
downloadFile
(
logId
:
string
,
lang
:
string
)
{
...
...
@@ -125,17 +129,8 @@ export class ViewListDocComponent implements OnInit {
this
.
getListDoc
();
}
openAlertModal
(
message
?:
string
)
{
const
modalRef
=
this
.
modalService
.
open
(
AlertModalComponent
,
{
centered
:
true
,
backdrop
:
'static'
})
modalRef
.
componentInstance
.
message
=
message
?
message
:
""
modalRef
.
result
.
then
(
result
=>
{
this
.
modalService
.
dismissAll
()
},
reason
=>
{
this
.
modalService
.
dismissAll
()
})
openAlertModal
(
text
:
string
,
type
:
'success'
|
'error'
)
{
swal
(
"แจ้งเตือน"
,
text
,
type
);
}
openLink
(
url
:
string
)
{
window
.
open
(
url
,
"_blank"
);
...
...
src/app/DPU/myskill-x/myportal/management/approved-list/view-list-excel/view-list-excel.component.ts
View file @
956b2d7e
...
...
@@ -16,6 +16,7 @@ import { MatDialogModule } from '@angular/material/dialog';
import
{
TranslateModule
}
from
'@ngx-translate/core'
;
declare
var
require
:
any
import
FileSaver
from
'file-saver'
;
import
swal
from
'sweetalert'
;
@
Component
({
selector
:
'app-view-list-excel'
,
templateUrl
:
'./view-list-excel.component.html'
,
...
...
@@ -81,23 +82,26 @@ export class ViewListExcelComponent implements OnInit {
})
}
deleteFile
(
item
:
ExcelContentModel
)
{
const
modalRef
=
this
.
modalService
.
open
(
ConfirmModalComponent
,
{
centered
:
true
,
backdrop
:
'static'
,
swal
({
title
:
"คุณแน่ใจหรือไม่?"
,
text
:
"คุณต้องการลบข้อมูลนี้หรือไม่"
,
icon
:
"warning"
,
dangerMode
:
true
,
buttons
:
[
"ยกเลิก"
,
"ยืนยัน"
],
}).
then
((
willDelete
:
boolean
)
=>
{
if
(
willDelete
)
{
this
.
excelService
.
deleteExcelContent
(
item
).
subscribe
(
result
=>
{
if
(
result
)
{
this
.
openAlertModal
(
'ลบข้อมูลสำเร็จ'
,
'success'
)
this
.
getListExcel
();
}
else
{
this
.
openAlertModal
(
'ไม่สามารถลบข้อมูลได้'
,
'error'
)
}
},
error
=>
{
this
.
openAlertModal
(
error
.
message
,
'error'
)
})
}
})
modalRef
.
componentInstance
.
message
=
'คุณต้องการลบข้อมูลหรือไม่'
modalRef
.
result
.
then
(
result
=>
{
this
.
excelService
.
deleteExcelContent
(
item
).
subscribe
(
result
=>
{
if
(
result
)
{
this
.
openAlertModal
(
'ลบข้อมูลสำเร็จ'
)
this
.
getListExcel
();
}
else
{
this
.
openAlertModal
(
'ไม่สามารถลบข้อมูลได้'
)
}
},
error
=>
{
this
.
openAlertModal
(
error
.
message
)
})
},
reject
=>
{
})
}
async
downloadFile
(
logId
:
string
)
{
try
{
...
...
@@ -140,17 +144,8 @@ export class ViewListExcelComponent implements OnInit {
}
openAlertModal
(
message
?:
string
)
{
const
modalRef
=
this
.
modalService
.
open
(
AlertModalComponent
,
{
centered
:
true
,
backdrop
:
'static'
})
modalRef
.
componentInstance
.
message
=
message
?
message
:
""
modalRef
.
result
.
then
(
result
=>
{
this
.
modalService
.
dismissAll
()
},
reason
=>
{
this
.
modalService
.
dismissAll
()
})
openAlertModal
(
text
:
string
,
type
:
'success'
|
'error'
)
{
swal
(
"แจ้งเตือน"
,
text
,
type
);
}
coverDate
(
date
:
string
)
{
return
date
.
split
(
'-'
).
reverse
().
join
(
'/'
)
...
...
src/app/DPU/myskill-x/myportal/management/portal-category-list-approve/approve-course/approve-course.component.ts
View file @
956b2d7e
...
...
@@ -15,6 +15,7 @@ import { TranslateModule } from '@ngx-translate/core';
import
{
firstValueFrom
}
from
'rxjs'
;
declare
var
require
:
any
import
FileSaver
from
'file-saver'
;
import
swal
from
'sweetalert'
;
@
Component
({
selector
:
'app-approve-course'
,
templateUrl
:
'./approve-course.component.html'
,
...
...
@@ -97,82 +98,82 @@ export class ApproveCourseComponent implements OnInit {
}
}
onApprove
(
item
:
CourseModel
)
{
const
modalRef
=
this
.
modalService
.
open
(
ConfirmModalComponent
,
{
centered
:
true
,
backdrop
:
'static'
,
swal
({
title
:
"คุณแน่ใจหรือไม่?"
,
text
:
"คุณต้องการอนุมัติข้อมูลหรือไม่"
,
icon
:
"warning"
,
dangerMode
:
false
,
buttons
:
[
"ยกเลิก"
,
"ยืนยัน"
],
}).
then
((
willSave
:
boolean
)
=>
{
if
(
willSave
)
{
item
.
status
=
1
this
.
courseService
.
approve
(
item
).
subscribe
(
result
=>
{
if
(
result
)
{
this
.
modalService
.
dismissAll
()
this
.
openAlertModal
(
'บันทึกข้อมูลสำเร็จ'
,
'error'
)
this
.
getListCourse
();
}
else
{
this
.
openAlertModal
(
'ไม่สามารถบันทึกข้อมูลได้'
,
'success'
)
}
},
error
=>
{
this
.
openAlertModal
(
error
.
message
,
'error'
)
})
}
})
modalRef
.
componentInstance
.
message
=
'คุณต้องการอนุมัติข้อมูลหรือไม่'
modalRef
.
result
.
then
(
result
=>
{
item
.
status
=
1
this
.
courseService
.
approve
(
item
).
subscribe
(
result
=>
{
if
(
result
)
{
this
.
modalService
.
dismissAll
()
this
.
openAlertModal
(
'บันทึกข้อมูลสำเร็จ'
)
this
.
getListCourse
();
}
else
{
this
.
openAlertModal
(
'ไม่สามารถบันทึกข้อมูลได้'
)
}
},
error
=>
{
this
.
openAlertModal
(
error
.
message
)
})
},
reject
=>
{
})
}
onCancelApprove
(
item
:
CourseModel
)
{
const
modalRef
=
this
.
modalService
.
open
(
ConfirmModalComponent
,
{
centered
:
true
,
backdrop
:
'static'
,
swal
({
title
:
"คุณแน่ใจหรือไม่?"
,
text
:
"คุณต้องการไม่อนุมัติข้อมูลหรือไม่"
,
icon
:
"warning"
,
dangerMode
:
false
,
buttons
:
[
"ยกเลิก"
,
"ยืนยัน"
],
}).
then
((
willSave
:
boolean
)
=>
{
if
(
willSave
)
{
item
.
status
=
2
this
.
courseService
.
approve
(
item
).
subscribe
(
result
=>
{
if
(
result
)
{
this
.
openAlertModal
(
'บันทึกข้อมูลสำเร็จ'
,
'success'
)
this
.
getListCourse
();
}
else
{
this
.
openAlertModal
(
'ไม่สามารถบันทึกข้อมูลได้'
,
'error'
)
}
},
error
=>
{
this
.
openAlertModal
(
error
.
message
,
'error'
)
})
}
})
modalRef
.
componentInstance
.
message
=
'คุณต้องการไม่อนุมัติข้อมูลหรือไม่'
modalRef
.
result
.
then
(
result
=>
{
item
.
status
=
2
this
.
courseService
.
approve
(
item
).
subscribe
(
result
=>
{
if
(
result
)
{
this
.
openAlertModal
(
'บันทึกข้อมูลสำเร็จ'
)
this
.
getListCourse
();
}
else
{
this
.
openAlertModal
(
'ไม่สามารถบันทึกข้อมูลได้'
)
}
},
error
=>
{
this
.
openAlertModal
(
error
.
message
)
})
},
reject
=>
{
})
}
ngOnInit
()
{
this
.
getListCourse
();
}
deleteFile
(
item
:
CourseModel
)
{
const
modalRef
=
this
.
modalService
.
open
(
ConfirmModalComponent
,
{
centered
:
true
,
backdrop
:
'static'
,
swal
({
title
:
"คุณแน่ใจหรือไม่?"
,
text
:
"คุณต้องการลบข้อมูลนี้หรือไม่"
,
icon
:
"warning"
,
dangerMode
:
true
,
buttons
:
[
"ยกเลิก"
,
"ยืนยัน"
],
}).
then
((
willDelete
:
boolean
)
=>
{
if
(
willDelete
)
{
this
.
courseService
.
deleteCourse
(
item
).
subscribe
(
result
=>
{
if
(
result
)
{
this
.
openAlertModal
(
'ลบข้อมูลสำเร็จ'
,
'success'
)
this
.
getListCourse
();
}
else
{
this
.
openAlertModal
(
'ไม่สามารถลบข้อมูลได้'
,
'error'
)
}
},
error
=>
{
this
.
openAlertModal
(
error
.
message
,
'error'
)
})
}
})
modalRef
.
componentInstance
.
message
=
'คุณต้องการลบข้อมูลหรือไม่'
modalRef
.
result
.
then
(
result
=>
{
this
.
courseService
.
deleteCourse
(
item
).
subscribe
(
result
=>
{
if
(
result
)
{
this
.
openAlertModal
(
'ลบข้อมูลสำเร็จ'
)
this
.
getListCourse
();
}
else
{
this
.
openAlertModal
(
'ไม่สามารถลบข้อมูลได้'
)
}
},
error
=>
{
this
.
openAlertModal
(
error
.
message
)
})
},
reject
=>
{
})
}
openAlertModal
(
message
?:
string
)
{
const
modalRef
=
this
.
modalService
.
open
(
AlertModalComponent
,
{
centered
:
true
,
backdrop
:
'static'
})
modalRef
.
componentInstance
.
message
=
message
?
message
:
""
modalRef
.
result
.
then
(
result
=>
{
// this.modalService.dismissAll()
},
reason
=>
{
// this.modalService.dismissAll()
})
openAlertModal
(
text
:
string
,
type
:
'success'
|
'error'
)
{
swal
(
"แจ้งเตือน"
,
text
,
type
);
}
openLink
(
url
:
string
)
{
window
.
open
(
url
,
"_blank"
);
...
...
src/app/DPU/myskill-x/myportal/management/portal-category-list-approve/approve-doc/approve-doc.component.ts
View file @
956b2d7e
...
...
@@ -15,6 +15,7 @@ import { DocumentService } from '../../../../../services/document.service';
import
{
firstValueFrom
}
from
'rxjs'
;
declare
var
require
:
any
import
FileSaver
from
'file-saver'
;
import
swal
from
'sweetalert'
;
@
Component
({
selector
:
'app-approve-doc'
,
templateUrl
:
'./approve-doc.component.html'
,
...
...
@@ -100,80 +101,80 @@ export class ApproveDocComponent implements OnInit {
}
}
onApprove
(
item
:
DocumentModel
)
{
const
modalRef
=
this
.
modalService
.
open
(
ConfirmModalComponent
,
{
centered
:
true
,
backdrop
:
'static'
,
swal
({
title
:
"คุณแน่ใจหรือไม่?"
,
text
:
"คุณต้องการอนุมัติข้อมูลหรือไม่"
,
icon
:
"warning"
,
dangerMode
:
false
,
buttons
:
[
"ยกเลิก"
,
"ยืนยัน"
],
}).
then
((
willSave
:
boolean
)
=>
{
if
(
willSave
)
{
item
.
status
=
1
this
.
documentService
.
approve
(
item
).
subscribe
(
result
=>
{
if
(
result
)
{
this
.
modalService
.
dismissAll
()
this
.
openAlertModal
(
'บันทึกข้อมูลสำเร็จ'
,
'success'
)
this
.
getListDoc
();
}
else
{
this
.
openAlertModal
(
'ไม่สามารถบันทึกข้อมูลได้'
,
'error'
)
}
},
error
=>
{
this
.
openAlertModal
(
error
.
message
,
'error'
)
})
}
})
modalRef
.
componentInstance
.
message
=
'คุณต้องการอนุมัติข้อมูลหรือไม่'
modalRef
.
result
.
then
(
result
=>
{
item
.
status
=
1
this
.
documentService
.
approve
(
item
).
subscribe
(
result
=>
{
if
(
result
)
{
this
.
modalService
.
dismissAll
()
this
.
openAlertModal
(
'บันทึกข้อมูลสำเร็จ'
)
this
.
getListDoc
();
}
else
{
this
.
openAlertModal
(
'ไม่สามารถบันทึกข้อมูลได้'
)
}
},
error
=>
{
this
.
openAlertModal
(
error
.
message
)
})
},
reject
=>
{
})
}
onCancelApprove
(
item
:
DocumentModel
)
{
const
modalRef
=
this
.
modalService
.
open
(
ConfirmModalComponent
,
{
centered
:
true
,
backdrop
:
'static'
,
swal
({
title
:
"คุณแน่ใจหรือไม่?"
,
text
:
"คุณต้องการไม่อนุมัติข้อมูลหรือไม่"
,
icon
:
"warning"
,
dangerMode
:
false
,
buttons
:
[
"ยกเลิก"
,
"ยืนยัน"
],
}).
then
((
willSave
:
boolean
)
=>
{
if
(
willSave
)
{
item
.
status
=
2
this
.
documentService
.
approve
(
item
).
subscribe
(
result
=>
{
if
(
result
)
{
this
.
openAlertModal
(
'บันทึกข้อมูลสำเร็จ'
,
'success'
)
this
.
getListDoc
();
}
else
{
this
.
openAlertModal
(
'ไม่สามารถบันทึกข้อมูลได้'
,
'error'
)
}
},
error
=>
{
this
.
openAlertModal
(
error
.
message
,
'error'
)
})
}
})
modalRef
.
componentInstance
.
message
=
'คุณต้องการไม่อนุมัติข้อมูลหรือไม่'
modalRef
.
result
.
then
(
result
=>
{
item
.
status
=
2
this
.
documentService
.
approve
(
item
).
subscribe
(
result
=>
{
if
(
result
)
{
this
.
openAlertModal
(
'บันทึกข้อมูลสำเร็จ'
)
this
.
getListDoc
();
}
else
{
this
.
openAlertModal
(
'ไม่สามารถบันทึกข้อมูลได้'
)
}
},
error
=>
{
this
.
openAlertModal
(
error
.
message
)
})
},
reject
=>
{
})
}
ngOnInit
()
{
this
.
getListDoc
();
}
deleteFile
(
item
:
DocumentModel
)
{
const
modalRef
=
this
.
modalService
.
open
(
ConfirmModalComponent
,
{
centered
:
true
,
backdrop
:
'static'
,
swal
({
title
:
"คุณแน่ใจหรือไม่?"
,
text
:
"คุณต้องการลบข้อมูลนี้หรือไม่"
,
icon
:
"warning"
,
dangerMode
:
true
,
buttons
:
[
"ยกเลิก"
,
"ยืนยัน"
],
}).
then
((
willDelete
:
boolean
)
=>
{
if
(
willDelete
)
{
this
.
documentService
.
deleteExcel
(
item
).
subscribe
(
result
=>
{
if
(
result
)
{
this
.
openAlertModal
(
'ลบข้อมูลสำเร็จ'
,
'success'
)
this
.
getListDoc
();
}
else
{
this
.
openAlertModal
(
'ไม่สามารถลบข้อมูลได้'
,
'error'
)
}
},
error
=>
{
this
.
openAlertModal
(
error
.
message
,
'error'
)
})
}
})
modalRef
.
componentInstance
.
message
=
'คุณต้องการลบข้อมูลหรือไม่'
modalRef
.
result
.
then
(
result
=>
{
this
.
documentService
.
deleteExcel
(
item
).
subscribe
(
result
=>
{
if
(
result
)
{
this
.
openAlertModal
(
'ลบข้อมูลสำเร็จ'
)
this
.
getListDoc
();
}
else
{
this
.
openAlertModal
(
'ไม่สามารถลบข้อมูลได้'
)
}
},
error
=>
{
this
.
openAlertModal
(
error
.
message
)
})
},
reject
=>
{
})
}
openAlertModal
(
message
?:
string
)
{
const
modalRef
=
this
.
modalService
.
open
(
AlertModalComponent
,
{
centered
:
true
,
backdrop
:
'static'
})
modalRef
.
componentInstance
.
message
=
message
?
message
:
""
modalRef
.
result
.
then
(
result
=>
{
// this.modalService.dismissAll()
},
reason
=>
{
// this.modalService.dismissAll()
})
openAlertModal
(
text
:
string
,
type
:
'success'
|
'error'
)
{
swal
(
"แจ้งเตือน"
,
text
,
type
);
}
}
src/app/DPU/myskill-x/myportal/management/portal-category-list-approve/approve-excel/approve-excel.component.ts
View file @
956b2d7e
...
...
@@ -15,6 +15,7 @@ import { ExcelService } from '../../../../../services/excel.service';
import
{
firstValueFrom
}
from
'rxjs'
;
declare
var
require
:
any
import
FileSaver
from
'file-saver'
;
import
swal
from
'sweetalert'
;
import
{
TemplateModel
}
from
'../../../../../models/template.model'
;
@
Component
({
selector
:
'app-approve-excel'
,
...
...
@@ -99,45 +100,51 @@ export class ApproveExcelComponent implements OnInit {
}
}
onApprove
(
item
:
ExcelModel
)
{
const
modalRef
=
this
.
modalService
.
open
(
ConfirmModalComponent
,
{
centered
:
true
,
backdrop
:
'static'
,
swal
({
title
:
"คุณแน่ใจหรือไม่?"
,
text
:
"คุณต้องการอนุมัติข้อมูลหรือไม่"
,
icon
:
"warning"
,
dangerMode
:
false
,
buttons
:
[
"ยกเลิก"
,
"ยืนยัน"
],
}).
then
((
willSave
:
boolean
)
=>
{
if
(
willSave
)
{
item
.
status
=
1
this
.
excelService
.
approve
(
item
).
subscribe
(
result
=>
{
if
(
result
)
{
this
.
openAlertModal
(
'บันทึกข้อมูลสำเร็จ'
,
'success'
)
this
.
getListExcel
();
}
else
{
this
.
openAlertModal
(
'ไม่สามารถบันทึกข้อมูลได้'
,
'error'
)
}
},
error
=>
{
this
.
openAlertModal
(
error
.
message
,
'error'
)
})
}
})
modalRef
.
componentInstance
.
message
=
'คุณต้องการอนุมัติข้อมูลหรือไม่'
modalRef
.
result
.
then
(
result
=>
{
item
.
status
=
1
this
.
excelService
.
approve
(
item
).
subscribe
(
result
=>
{
if
(
result
)
{
this
.
openAlertModal
(
'บันทึกข้อมูลสำเร็จ'
)
this
.
getListExcel
();
}
else
{
this
.
openAlertModal
(
'ไม่สามารถบันทึกข้อมูลได้'
)
}
},
error
=>
{
this
.
openAlertModal
(
error
.
message
)
})
},
reject
=>
{
})
}
onCancelApprove
(
item
:
ExcelModel
)
{
const
modalRef
=
this
.
modalService
.
open
(
ConfirmModalComponent
,
{
centered
:
true
,
backdrop
:
'static'
,
swal
({
title
:
"คุณแน่ใจหรือไม่?"
,
text
:
"คุณต้องการไม่อนุมัติข้อมูลหรือไม่"
,
icon
:
"warning"
,
dangerMode
:
false
,
buttons
:
[
"ยกเลิก"
,
"ยืนยัน"
],
}).
then
((
willSave
:
boolean
)
=>
{
if
(
willSave
)
{
item
.
status
=
2
this
.
excelService
.
approve
(
item
).
subscribe
(
result
=>
{
if
(
result
)
{
this
.
modalService
.
dismissAll
()
this
.
openAlertModal
(
'บันทึกข้อมูลสำเร็จ'
,
'success'
)
this
.
getListExcel
();
}
else
{
this
.
openAlertModal
(
'ไม่สามารถบันทึกข้อมูลได้'
,
'error'
)
}
},
error
=>
{
this
.
openAlertModal
(
error
.
message
,
'error'
)
})
}
})
modalRef
.
componentInstance
.
message
=
'คุณต้องการไม่อนุมัติข้อมูลหรือไม่'
modalRef
.
result
.
then
(
result
=>
{
item
.
status
=
2
this
.
excelService
.
approve
(
item
).
subscribe
(
result
=>
{
if
(
result
)
{
this
.
modalService
.
dismissAll
()
this
.
openAlertModal
(
'บันทึกข้อมูลสำเร็จ'
)
this
.
getListExcel
();
}
else
{
this
.
openAlertModal
(
'ไม่สามารถบันทึกข้อมูลได้'
)
}
},
error
=>
{
this
.
openAlertModal
(
error
.
message
)
})
},
reject
=>
{
})
}
ngOnInit
()
{
this
.
getListExcel
();
...
...
@@ -145,36 +152,30 @@ export class ApproveExcelComponent implements OnInit {
}
deleteFile
(
item
:
ExcelModel
)
{
const
modalRef
=
this
.
modalService
.
open
(
ConfirmModalComponent
,
{
centered
:
true
,
backdrop
:
'static'
,
swal
({
title
:
"คุณแน่ใจหรือไม่?"
,
text
:
"คุณต้องการลบข้อมูลนี้หรือไม่"
,
icon
:
"warning"
,
dangerMode
:
true
,
buttons
:
[
"ยกเลิก"
,
"ยืนยัน"
],
}).
then
((
willDelete
:
boolean
)
=>
{
if
(
willDelete
)
{
this
.
excelService
.
deleteExcel
(
item
).
subscribe
(
result
=>
{
if
(
result
)
{
this
.
openAlertModal
(
'ลบข้อมูลสำเร็จ'
,
'success'
)
this
.
getListExcel
();
}
else
{
this
.
openAlertModal
(
'ไม่สามารถลบข้อมูลได้'
,
'error'
)
}
},
error
=>
{
this
.
openAlertModal
(
error
.
message
,
'error'
)
})
}
})
modalRef
.
componentInstance
.
message
=
'คุณต้องการลบข้อมูลหรือไม่'
modalRef
.
result
.
then
(
result
=>
{
this
.
excelService
.
deleteExcel
(
item
).
subscribe
(
result
=>
{
if
(
result
)
{
this
.
openAlertModal
(
'ลบข้อมูลสำเร็จ'
)
this
.
getListExcel
();
}
else
{
this
.
openAlertModal
(
'ไม่สามารถลบข้อมูลได้'
)
}
},
error
=>
{
this
.
openAlertModal
(
error
.
message
)
})
},
reject
=>
{
})
}
openAlertModal
(
message
?:
string
)
{
const
modalRef
=
this
.
modalService
.
open
(
AlertModalComponent
,
{
centered
:
true
,
backdrop
:
'static'
})
modalRef
.
componentInstance
.
message
=
message
?
message
:
""
modalRef
.
result
.
then
(
result
=>
{
// this.modalService.dismissAll()
},
reason
=>
{
// this.modalService.dismissAll()
})
openAlertModal
(
text
:
string
,
type
:
'success'
|
'error'
)
{
swal
(
"แจ้งเตือน"
,
text
,
type
);
}
openLink
(
url
:
string
)
{
window
.
open
(
url
,
"_blank"
);
...
...
src/app/DPU/myskill-x/myportal/view-list-course/view-list-course.component.ts
View file @
956b2d7e
...
...
@@ -13,6 +13,7 @@ import { NgSelectModule } from '@ng-select/ng-select';
import
{
SharedModule
}
from
'../../../../shared/shared.module'
;
import
{
TranslateModule
}
from
'@ngx-translate/core'
;
import
saveAs
from
'file-saver'
;
import
swal
from
'sweetalert'
;
@
Component
({
selector
:
'app-view-list-course'
,
...
...
@@ -101,23 +102,26 @@ export class ViewListCourseComponent implements OnInit {
}
}
deleteFile
(
item
:
CourseContentModel
)
{
const
modalRef
=
this
.
modalService
.
open
(
ConfirmModalComponent
,
{
centered
:
true
,
backdrop
:
'static'
,
swal
({
title
:
"คุณแน่ใจหรือไม่?"
,
text
:
"คุณต้องการลบข้อมูลนี้หรือไม่"
,
icon
:
"warning"
,
dangerMode
:
true
,
buttons
:
[
"ยกเลิก"
,
"ยืนยัน"
],
}).
then
((
willDelete
:
boolean
)
=>
{
if
(
willDelete
)
{
this
.
courseService
.
deleteCourseContent
(
item
).
subscribe
(
result
=>
{
if
(
result
)
{
this
.
openAlertModal
(
'ลบข้อมูลสำเร็จ'
,
'success'
)
this
.
getListCourse
();
}
else
{
this
.
openAlertModal
(
'ไม่สามารถลบข้อมูลได้'
,
'error'
)
}
},
error
=>
{
this
.
openAlertModal
(
error
.
message
,
'error'
)
})
}
})
modalRef
.
componentInstance
.
message
=
'คุณต้องการลบข้อมูลหรือไม่'
modalRef
.
result
.
then
(
result
=>
{
this
.
courseService
.
deleteCourseContent
(
item
).
subscribe
(
result
=>
{
if
(
result
)
{
this
.
openAlertModal
(
'ลบข้อมูลสำเร็จ'
)
this
.
getListCourse
();
}
else
{
this
.
openAlertModal
(
'ไม่สามารถลบข้อมูลได้'
)
}
},
error
=>
{
this
.
openAlertModal
(
error
.
message
)
})
},
reject
=>
{
})
}
ngOnInit
()
{
this
.
getListCourse
();
...
...
@@ -125,17 +129,8 @@ export class ViewListCourseComponent implements OnInit {
openLink
(
url
:
string
)
{
window
.
open
(
url
,
"_blank"
);
}
openAlertModal
(
message
?:
string
)
{
const
modalRef
=
this
.
modalService
.
open
(
AlertModalComponent
,
{
centered
:
true
,
backdrop
:
'static'
})
modalRef
.
componentInstance
.
message
=
message
?
message
:
""
modalRef
.
result
.
then
(
result
=>
{
this
.
modalService
.
dismissAll
()
},
reason
=>
{
this
.
modalService
.
dismissAll
()
})
openAlertModal
(
text
:
string
,
type
:
'success'
|
'error'
)
{
swal
(
"แจ้งเตือน"
,
text
,
type
);
}
coverDate
(
date
:
string
)
{
...
...
src/app/DPU/myskill-x/myportal/view-list-doc/view-list-doc.component.ts
View file @
956b2d7e
...
...
@@ -11,7 +11,7 @@ import { CommonModule } from '@angular/common';
import
{
FormsModule
}
from
'@angular/forms'
;
import
{
NgSelectModule
}
from
'@ng-select/ng-select'
;
import
{
SharedModule
}
from
'../../../../shared/shared.module'
;
import
swal
from
'sweetalert'
;
import
{
saveAs
}
from
'file-saver'
;
import
{
TranslateModule
}
from
'@ngx-translate/core'
;
...
...
@@ -60,23 +60,26 @@ export class ViewListDocComponent implements OnInit {
}
deleteFile
(
item
:
DocumentContentModel
)
{
const
modalRef
=
this
.
modalService
.
open
(
ConfirmModalComponent
,
{
centered
:
true
,
backdrop
:
'static'
,
swal
({
title
:
"คุณแน่ใจหรือไม่?"
,
text
:
"คุณต้องการลบข้อมูลนี้หรือไม่"
,
icon
:
"warning"
,
dangerMode
:
true
,
buttons
:
[
"ยกเลิก"
,
"ยืนยัน"
],
}).
then
((
willDelete
:
boolean
)
=>
{
if
(
willDelete
)
{
this
.
documentService
.
deleteExcelContent
(
item
).
subscribe
(
result
=>
{
if
(
result
)
{
this
.
openAlertModal
(
'ลบข้อมูลสำเร็จ'
,
'success'
)
this
.
getListDoc
();
}
else
{
this
.
openAlertModal
(
'ไม่สามารถลบข้อมูลได้'
,
'error'
)
}
},
error
=>
{
this
.
openAlertModal
(
error
.
message
,
'error'
)
})
}
})
modalRef
.
componentInstance
.
message
=
'คุณต้องการลบข้อมูลหรือไม่'
modalRef
.
result
.
then
(
result
=>
{
this
.
documentService
.
deleteExcelContent
(
item
).
subscribe
(
result
=>
{
if
(
result
)
{
this
.
openAlertModal
(
'ลบข้อมูลสำเร็จ'
)
this
.
getListDoc
();
}
else
{
this
.
openAlertModal
(
'ไม่สามารถลบข้อมูลได้'
)
}
},
error
=>
{
this
.
openAlertModal
(
error
.
message
)
})
},
reject
=>
{
})
}
...
...
@@ -105,17 +108,8 @@ export class ViewListDocComponent implements OnInit {
this
.
getListDoc
();
}
openAlertModal
(
message
?:
string
)
{
const
modalRef
=
this
.
modalService
.
open
(
AlertModalComponent
,
{
centered
:
true
,
backdrop
:
'static'
})
modalRef
.
componentInstance
.
message
=
message
?
message
:
""
modalRef
.
result
.
then
(
result
=>
{
this
.
modalService
.
dismissAll
()
},
reason
=>
{
this
.
modalService
.
dismissAll
()
})
openAlertModal
(
text
:
string
,
type
:
'success'
|
'error'
)
{
swal
(
"แจ้งเตือน"
,
text
,
type
);
}
openLink
(
url
:
string
)
{
window
.
open
(
url
,
"_blank"
);
...
...
src/app/DPU/myskill-x/myportal/view-list-excel/view-list-excel.component.ts
View file @
956b2d7e
...
...
@@ -12,7 +12,7 @@ import { NgSelectModule } from '@ng-select/ng-select';
import
{
SharedModule
}
from
'../../../../shared/shared.module'
;
import
{
MatDialog
,
MatDialogModule
}
from
'@angular/material/dialog'
;
import
{
TranslateModule
}
from
'@ngx-translate/core'
;
import
swal
from
'sweetalert'
;
import
{
saveAs
}
from
'file-saver'
;
@
Component
({
...
...
@@ -59,7 +59,7 @@ export class ViewListExcelComponent implements OnInit {
panelClass
:
'my-dialog-img-preview'
,
};
this
.
dialogRef
=
this
.
dialog
.
open
(
OpenImageComponent
,
dialogConfig
);
this
.
dialogRef
.
afterClosed
().
subscribe
((
result
:
any
)
=>
{
this
.
dialogRef
.
afterClosed
().
subscribe
((
result
:
any
)
=>
{
console
.
log
(
'The dialog was closed'
,
result
);
},
(
reason
:
any
)
=>
{
});
...
...
@@ -78,23 +78,26 @@ export class ViewListExcelComponent implements OnInit {
// }
deleteFile
(
item
:
ExcelContentModel
)
{
const
modalRef
=
this
.
modalService
.
open
(
ConfirmModalComponent
,
{
centered
:
true
,
backdrop
:
'static'
,
swal
({
title
:
"คุณแน่ใจหรือไม่?"
,
text
:
"คุณต้องการลบข้อมูลนี้หรือไม่"
,
icon
:
"warning"
,
dangerMode
:
true
,
buttons
:
[
"ยกเลิก"
,
"ยืนยัน"
],
}).
then
((
willDelete
:
boolean
)
=>
{
if
(
willDelete
)
{
this
.
excelService
.
deleteExcelContent
(
item
).
subscribe
(
result
=>
{
if
(
result
)
{
this
.
openAlertModal
(
'ลบข้อมูลสำเร็จ'
,
'success'
);
this
.
getListExcel
();
}
else
{
this
.
openAlertModal
(
'ไม่สามารถลบข้อมูลได้'
,
'error'
);
}
},
error
=>
{
this
.
openAlertModal
(
error
.
message
,
'error'
);
});
}
});
modalRef
.
componentInstance
.
message
=
'คุณต้องการลบข้อมูลหรือไม่'
;
modalRef
.
result
.
then
(
result
=>
{
this
.
excelService
.
deleteExcelContent
(
item
).
subscribe
(
result
=>
{
if
(
result
)
{
this
.
openAlertModal
(
'ลบข้อมูลสำเร็จ'
);
this
.
getListExcel
();
}
else
{
this
.
openAlertModal
(
'ไม่สามารถลบข้อมูลได้'
);
}
},
error
=>
{
this
.
openAlertModal
(
error
.
message
);
});
},
reject
=>
{
});
}
async
downloadFile
(
logId
:
string
)
{
...
...
@@ -140,17 +143,8 @@ export class ViewListExcelComponent implements OnInit {
window
.
open
(
url
,
"_blank"
);
}
openAlertModal
(
message
?:
string
)
{
const
modalRef
=
this
.
modalService
.
open
(
AlertModalComponent
,
{
centered
:
true
,
backdrop
:
'static'
});
modalRef
.
componentInstance
.
message
=
message
?
message
:
""
;
modalRef
.
result
.
then
(
result
=>
{
this
.
modalService
.
dismissAll
();
},
reason
=>
{
this
.
modalService
.
dismissAll
();
});
openAlertModal
(
text
:
string
,
type
:
'success'
|
'error'
)
{
swal
(
"แจ้งเตือน"
,
text
,
type
);
}
coverDate
(
date
:
string
)
{
...
...
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