Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
myhr-portal
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
myhr-portal
Commits
3fc8fd7a
Commit
3fc8fd7a
authored
Jun 26, 2024
by
Nakarin Luankla
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UPDATE เพิ่มกลุ่ม
parent
daa88ded
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
364 additions
and
50 deletions
+364
-50
list-course.component.html
src/app/apps/list-course/list-course.component.html
+16
-2
list-course.component.ts
src/app/apps/list-course/list-course.component.ts
+17
-2
list-doc.component.html
src/app/apps/list-doc/list-doc.component.html
+24
-4
list-doc.component.ts
src/app/apps/list-doc/list-doc.component.ts
+17
-2
list-excell.component.html
src/app/apps/list-excell/list-excell.component.html
+56
-3
list-excell.component.ts
src/app/apps/list-excell/list-excell.component.ts
+18
-1
view-list-course.component.html
...app/apps/view-list-course/view-list-course.component.html
+4
-0
view-list-doc.component.html
src/app/apps/view-list-doc/view-list-doc.component.html
+4
-0
view-list-excel.component.html
src/app/apps/view-list-excel/view-list-excel.component.html
+4
-0
course-content.model.ts
src/app/model/course-content.model.ts
+22
-0
course.model.ts
src/app/model/course.model.ts
+32
-16
document-content.model.ts
src/app/model/document-content.model.ts
+22
-0
document.model.ts
src/app/model/document.model.ts
+24
-8
excel-content.model.ts
src/app/model/excel-content.model.ts
+34
-2
excel.model.ts
src/app/model/excel.model.ts
+30
-8
group.mmodel.ts
src/app/model/group.mmodel.ts
+20
-0
group.service.ts
src/app/service/group.service.ts
+18
-0
environment.prod.ts
src/environments/environment.prod.ts
+1
-1
environment.ts
src/environments/environment.ts
+1
-1
No files found.
src/app/apps/list-course/list-course.component.html
View file @
3fc8fd7a
...
...
@@ -53,7 +53,7 @@
<button
type=
"button"
[
disabled
]="
data
.
status
!=
0
"
class=
"btn btn-circle btn-primary rounded-circle btn-sm mr-2"
(
click
)="
openModal
(
editTemplateModal
,
data
)"
placement=
"top"
ngbTooltip=
"แก้ไข"
>
<i
class=
"fas fa-edit"
></i>
</button>
<button
type=
"button"
[
disabled
]="
data
.
status
!=
0
"
class=
"btn btn-circle btn-danger rounded-circle btn-sm mr-2"
(
click
)="
deleteFile
(
data
)"
placement=
"top"
ngbTooltip=
"ลบ"
>
<button
type=
"button"
class=
"btn btn-circle btn-danger rounded-circle btn-sm mr-2"
(
click
)="
deleteFile
(
data
)"
placement=
"top"
ngbTooltip=
"ลบ"
>
<i
class=
"fas fa-trash-alt"
></i>
</button>
<!-- <a href="javascript: void(0);" (click)="openModal(editTemplateModal,data)" class="link mr-2"
...
...
@@ -173,13 +173,19 @@
</div>
</div>
<div
class=
"form-group row"
>
<label
for=
"name"
class=
"col-sm-4 col-form-label"
>
ไฟล์อัพโหลด
</label>
<div
class=
"
col-sm-8
"
>
<div
class=
"
{{!modelCourse.courseObj||!checkEdit ? 'col-sm-8' : 'col-sm-6'}}
"
>
<input
type=
"file"
class=
"form-control"
(
change
)="
onSelectFile
($
event
)"
>
<div
class=
"msg-detail"
>
ไฟล์ที่อนุญาต:*.json
</div>
</div>
<div
class=
"col-auto"
*
ngIf=
"modelCourse.courseObj&&checkEdit"
>
<button
class=
"btn btn-primary"
(
click
)="
downloadFile
(
modelCourse
.
logId
)"
><i
class=
"fas fa-download"
></i></button>
</div>
</div>
<div
class=
"form-group row"
>
<label
for=
"name"
class=
"col-sm-4 col-form-label"
>
รูปภาพตัวอย่าง
</label>
<div
class=
"col-sm-8"
>
...
...
@@ -205,6 +211,14 @@
</div>
</div>
<div
class=
"form-group row"
>
<label
for=
"position"
class=
"col-sm-4 col-form-label"
>
กลุ่ม
</label>
<div
class=
"col-sm-8"
>
<select
class=
"custom-select"
[(
ngModel
)]="
modelCourse
.
group
.
groupId
"
(
change
)="
selectGroup
()"
>
<option
*
ngFor=
"let item of listGroup"
[
ngValue
]="
item
.
groupId
"
>
{{item.thName}}
</option>
</select>
</div>
</div>
<div
class=
"form-group row"
>
<label
for=
"position"
class=
"col-sm-4 col-form-label"
>
หมายเหตุ
</label>
<div
class=
"col-sm-8"
>
<textarea
class=
"form-control"
[(
ngModel
)]="
modelCourse
.
remark
"
></textarea>
...
...
src/app/apps/list-course/list-course.component.ts
View file @
3fc8fd7a
...
...
@@ -8,6 +8,8 @@ import { CourseService } from 'src/app/service/course.service';
import
{
UploadService
}
from
'src/app/service/upload.service'
;
import
{
TagService
}
from
'src/app/service/tag.service'
;
import
{
TagModel
}
from
'src/app/model/tag.mmodel'
;
import
{
GroupModel
}
from
'src/app/model/group.mmodel'
;
import
{
GroupService
}
from
'src/app/service/group.service'
;
declare
var
require
:
any
const
FileSaver
=
require
(
'file-saver'
);
@
Component
({
...
...
@@ -23,7 +25,8 @@ export class ListCourseComponent implements OnInit {
checkEdit
:
boolean
=
false
search
:
string
=
''
listTag
:
TagModel
[]
=
[]
constructor
(
private
modalService
:
NgbModal
,
private
courseService
:
CourseService
,
private
uploadService
:
UploadService
,
private
tagService
:
TagService
)
{
listGroup
:
GroupModel
[]
=
[]
constructor
(
private
modalService
:
NgbModal
,
private
courseService
:
CourseService
,
private
uploadService
:
UploadService
,
private
tagService
:
TagService
,
private
groupService
:
GroupService
)
{
}
async
onUploadImage
(
event
:
any
){
try
{
...
...
@@ -199,8 +202,20 @@ export class ListCourseComponent implements OnInit {
ngOnInit
()
{
this
.
getListCourse
();
this
.
getListTag
();
this
.
getListGroup
();
}
async
getListGroup
(){
try
{
const
data
=
await
this
.
groupService
.
getList
().
toPromise
();
this
.
listGroup
=
data
.
map
(
x
=>
new
GroupModel
(
x
))
}
catch
(
error
){
console
.
error
(
'Error loading data:'
,
error
);
}
}
selectGroup
(){
let
findData
=
this
.
listGroup
.
find
(
x
=>
x
.
groupId
==
this
.
modelCourse
.
group
.
groupId
)
this
.
modelCourse
.
group
=
findData
?
new
GroupModel
(
findData
):
new
GroupModel
({})
}
closeBtnClick
()
{
this
.
modalService
.
dismissAll
();
...
...
src/app/apps/list-doc/list-doc.component.html
View file @
3fc8fd7a
...
...
@@ -54,7 +54,7 @@
<button
type=
"button"
[
disabled
]="
data
.
status
!=
0
"
class=
"btn btn-circle btn-primary rounded-circle btn-sm mr-2"
(
click
)="
openModal
(
editTemplateModal
,
data
)"
placement=
"top"
ngbTooltip=
"แก้ไข"
>
<i
class=
"fas fa-edit"
></i>
</button>
<button
type=
"button"
[
disabled
]="
data
.
status
!=
0
"
class=
"btn btn-circle btn-danger rounded-circle btn-sm mr-2"
(
click
)="
deleteFile
(
data
)"
placement=
"top"
ngbTooltip=
"ลบ"
>
<button
type=
"button"
class=
"btn btn-circle btn-danger rounded-circle btn-sm mr-2"
(
click
)="
deleteFile
(
data
)"
placement=
"top"
ngbTooltip=
"ลบ"
>
<i
class=
"fas fa-trash-alt"
></i>
</button>
</td>
...
...
@@ -120,24 +120,36 @@
<div
class=
"form-group row"
>
<label
for=
"position"
class=
"col-sm-4 col-form-label"
>
ภาษาที่รองรับ
</label>
<div
class=
"col-sm-8"
>
<input
type=
"text"
class=
"form-control"
id=
"nameeng"
[(
ngModel
)]="
modelDoc
.
langSupport
"
>
<select
class=
"custom-select"
[(
ngModel
)]="
modelDoc
.
langSupport
"
>
<option
value=
"THA"
>
ไทย
</option>
<option
value=
"ENG"
>
English
</option>
</select>
<!-- <input type="text" class="form-control" id="nameeng" [(ngModel)]="modelDoc.langSupport"> -->
</div>
</div>
<div
class=
"form-group row"
>
<label
for=
"name"
class=
"col-sm-4 col-form-label"
>
ไฟล์อัพโหลด (ไทย)
</label>
<div
class=
"
col-sm-8
"
>
<div
class=
"
{{!modelDoc.thDocObj||!checkEdit ? 'col-sm-8' : 'col-sm-6'}}
"
>
<input
type=
"file"
class=
"form-control"
(
change
)="
onSelectFile
($
event
,'
th
')"
>
<div
class=
"msg-detail"
>
ไฟล์ที่อนุญาต:*.doc
</div>
</div>
<div
class=
"col-auto"
*
ngIf=
"modelDoc.thDocObj&&checkEdit"
>
<button
class=
"btn btn-primary"
(
click
)="
downloadFile
(
modelDoc
.
logId
,'
tha
')"
><i
class=
"fas fa-download"
></i></button>
</div>
</div>
<div
class=
"form-group row"
>
<label
for=
"name"
class=
"col-sm-4 col-form-label"
>
ไฟล์อัพโหลด (อังกฤษ)
</label>
<div
class=
"
col-sm-8
"
>
<div
class=
"
{{!modelDoc.engDocObj||!checkEdit ? 'col-sm-8' : 'col-sm-6'}}
"
>
<input
type=
"file"
class=
"form-control"
(
change
)="
onSelectFile
($
event
,'
eng
')"
>
<div
class=
"msg-detail"
>
ไฟล์ที่อนุญาต:*.doc
</div>
</div>
<div
class=
"col-auto"
*
ngIf=
"modelDoc.engDocObj&&checkEdit"
>
<button
class=
"btn btn-primary"
(
click
)="
downloadFile
(
modelDoc
.
logId
,'
eng
')"
><i
class=
"fas fa-download"
></i></button>
</div>
</div>
<div
class=
"form-group row"
>
<label
for=
"name"
class=
"col-sm-4 col-form-label"
>
รูปภาพตัวอย่าง
</label>
...
...
@@ -164,6 +176,14 @@
</div>
</div>
<div
class=
"form-group row"
>
<label
for=
"position"
class=
"col-sm-4 col-form-label"
>
กลุ่ม
</label>
<div
class=
"col-sm-8"
>
<select
class=
"custom-select"
[(
ngModel
)]="
modelDoc
.
group
.
groupId
"
(
change
)="
selectGroup
()"
>
<option
*
ngFor=
"let item of listGroup"
[
ngValue
]="
item
.
groupId
"
>
{{item.thName}}
</option>
</select>
</div>
</div>
<div
class=
"form-group row"
>
<label
for=
"position"
class=
"col-sm-4 col-form-label"
>
หมายเหตุ
</label>
<div
class=
"col-sm-8"
>
<textarea
class=
"form-control"
[(
ngModel
)]="
modelDoc
.
remark
"
></textarea>
...
...
src/app/apps/list-doc/list-doc.component.ts
View file @
3fc8fd7a
...
...
@@ -7,6 +7,8 @@ import { DocumentModel } from 'src/app/model/document.model';
import
{
UploadService
}
from
'src/app/service/upload.service'
;
import
{
TagService
}
from
'src/app/service/tag.service'
;
import
{
TagModel
}
from
'src/app/model/tag.mmodel'
;
import
{
GroupModel
}
from
'src/app/model/group.mmodel'
;
import
{
GroupService
}
from
'src/app/service/group.service'
;
declare
var
require
:
any
const
FileSaver
=
require
(
'file-saver'
);
@
Component
({
...
...
@@ -22,7 +24,8 @@ export class ListDocComponent implements OnInit {
checkEdit
:
boolean
=
false
search
:
string
=
''
listTag
:
TagModel
[]
=
[]
constructor
(
private
modalService
:
NgbModal
,
private
documentService
:
DocumentService
,
private
uploadService
:
UploadService
,
private
tagService
:
TagService
)
{
listGroup
:
GroupModel
[]
=
[]
constructor
(
private
modalService
:
NgbModal
,
private
documentService
:
DocumentService
,
private
uploadService
:
UploadService
,
private
tagService
:
TagService
,
private
groupService
:
GroupService
)
{
}
async
onUploadImage
(
event
:
any
){
try
{
...
...
@@ -209,8 +212,20 @@ export class ListDocComponent implements OnInit {
ngOnInit
()
{
this
.
getListDoc
();
this
.
getListTag
();
this
.
getListGroup
();
}
async
getListGroup
(){
try
{
const
data
=
await
this
.
groupService
.
getList
().
toPromise
();
this
.
listGroup
=
data
.
map
(
x
=>
new
GroupModel
(
x
))
}
catch
(
error
){
console
.
error
(
'Error loading data:'
,
error
);
}
}
selectGroup
(){
let
findData
=
this
.
listGroup
.
find
(
x
=>
x
.
groupId
==
this
.
modelDoc
.
group
.
groupId
)
this
.
modelDoc
.
group
=
findData
?
new
GroupModel
(
findData
):
new
GroupModel
({})
}
async
getListTag
(){
try
{
const
data
=
await
this
.
tagService
.
getList
().
toPromise
();
...
...
src/app/apps/list-excell/list-excell.component.html
View file @
3fc8fd7a
...
...
@@ -53,7 +53,7 @@
<button
type=
"button"
[
disabled
]="
data
.
status
!=
0
"
class=
"btn btn-circle btn-primary rounded-circle btn-sm mr-2"
(
click
)="
openModal
(
editTemplateModal
,
data
)"
placement=
"top"
ngbTooltip=
"แก้ไข"
>
<i
class=
"fas fa-edit"
></i>
</button>
<button
type=
"button"
[
disabled
]="
data
.
status
!=
0
"
class=
"btn btn-circle btn-danger rounded-circle btn-sm mr-2"
(
click
)="
deleteFile
(
data
)"
placement=
"top"
ngbTooltip=
"ลบ"
>
<button
type=
"button"
class=
"btn btn-circle btn-danger rounded-circle btn-sm mr-2"
(
click
)="
deleteFile
(
data
)"
placement=
"top"
ngbTooltip=
"ลบ"
>
<i
class=
"fas fa-trash-alt"
></i>
</button>
</td>
...
...
@@ -119,17 +119,25 @@
<div
class=
"form-group row"
>
<label
for=
"position"
class=
"col-sm-4 col-form-label"
>
ดาต้าเบสที่รองรับ
</label>
<div
class=
"col-sm-8"
>
<input
type=
"text"
class=
"form-control"
id=
"nameeng"
[(
ngModel
)]="
modelExcel
.
dbSupport
"
>
<select
class=
"custom-select"
[(
ngModel
)]="
modelExcel
.
dbSupport
"
>
<option
value=
"SQLServer"
>
SQLServer
</option>
<option
value=
"PostgreSQL"
>
PostgreSQL
</option>
<option
value=
"Oracle"
>
Oracle
</option>
</select>
<!-- <input type="text" class="form-control" id="nameeng" [(ngModel)]="modelExcel.dbSupport"> -->
</div>
</div>
<div
class=
"form-group row"
>
<label
for=
"name"
class=
"col-sm-4 col-form-label"
>
ไฟล์อัพโหลด
</label>
<div
class=
"
col-sm-8
"
>
<div
class=
"
{{!modelExcel.excelObj||!checkEdit ? 'col-sm-8' : 'col-sm-6'}}
"
>
<input
type=
"file"
class=
"form-control"
(
change
)="
onSelectFile
($
event
)"
>
<div
class=
"msg-detail"
>
ไฟล์ที่อนุญาต:*.xlsx
</div>
</div>
<div
class=
"col-auto"
*
ngIf=
"modelExcel.excelObj&&checkEdit"
>
<button
class=
"btn btn-primary"
(
click
)="
downloadFile
(
modelExcel
.
logId
)"
><i
class=
"fas fa-download"
></i></button>
</div>
</div>
<div
class=
"form-group row"
>
...
...
@@ -156,8 +164,53 @@
</tag-input>
</div>
</div>
<div
class=
"form-group row"
>
<label
for=
"position"
class=
"col-sm-4 col-form-label"
>
กลุ่ม
</label>
<div
class=
"col-sm-8"
>
<select
class=
"custom-select"
[(
ngModel
)]="
modelExcel
.
group
.
groupId
"
(
change
)="
selectGroup
()"
>
<option
*
ngFor=
"let item of listGroup"
[
ngValue
]="
item
.
groupId
"
>
{{item.thName}}
</option>
</select>
</div>
</div>
<div
class=
"form-group row"
>
<label
for=
"position"
class=
"col-sm-4 col-form-label"
>
แสดงรูปแบบ Pivot
</label>
<div
class=
"col-sm-8 d-flex"
>
<div
class=
"form-check form-check-inline"
>
<div
class=
"custom-control custom-radio"
>
<input
type=
"radio"
class=
"custom-control-input"
id=
"pivot0"
name=
"radio-pivot"
[
value
]="
0
"
[(
ngModel
)]="
modelExcel
.
isPivot
"
>
<label
class=
"custom-control-label"
for=
"pivot0"
>
ใช่
</label>
</div>
</div>
<div
class=
"form-check form-check-inline"
>
<div
class=
"custom-control custom-radio"
>
<input
type=
"radio"
class=
"custom-control-input"
id=
"pivot1"
name=
"radio-pivot"
[
value
]="
1
"
[(
ngModel
)]="
modelExcel
.
isPivot
"
>
<label
class=
"custom-control-label"
for=
"pivot1"
>
ไม่ใช่
</label>
</div>
</div>
</div>
</div>
<div
class=
"form-group row"
>
<label
for=
"position"
class=
"col-sm-4 col-form-label"
>
แสดงรูปแบบ DataGrid
</label>
<div
class=
"col-sm-8 d-flex"
>
<div
class=
"form-check form-check-inline"
>
<div
class=
"custom-control custom-radio"
>
<input
type=
"radio"
class=
"custom-control-input"
id=
"datagrid"
name=
"datagridCheck"
[
value
]="
0
"
[(
ngModel
)]="
modelExcel
.
isDataGrid
"
>
<label
class=
"custom-control-label"
for=
"datagrid"
>
ใช่
</label>
</div>
</div>
<div
class=
"form-check form-check-inline"
>
<div
class=
"custom-control custom-radio"
>
<input
type=
"radio"
class=
"custom-control-input"
id=
"datagrid1"
name=
"datagridCheck"
[
value
]="
1
"
[(
ngModel
)]="
modelExcel
.
isDataGrid
"
>
<label
class=
"custom-control-label"
for=
"datagrid1"
>
ไม่ใช่
</label>
</div>
</div>
</div>
</div>
<div
class=
"form-group row"
>
<label
for=
"position"
class=
"col-sm-4 col-form-label"
>
หมายเหตุ
</label>
<div
class=
"col-sm-8"
>
<textarea
class=
"form-control"
[(
ngModel
)]="
modelExcel
.
remark
"
></textarea>
...
...
src/app/apps/list-excell/list-excell.component.ts
View file @
3fc8fd7a
...
...
@@ -7,6 +7,8 @@ import { AlertModalComponent } from '../alert-modal/alert-modal.component';
import
{
UploadService
}
from
'src/app/service/upload.service'
;
import
{
TagService
}
from
'src/app/service/tag.service'
;
import
{
TagModel
}
from
'src/app/model/tag.mmodel'
;
import
{
GroupService
}
from
'src/app/service/group.service'
;
import
{
GroupModel
}
from
'src/app/model/group.mmodel'
;
declare
var
require
:
any
const
FileSaver
=
require
(
'file-saver'
);
...
...
@@ -24,7 +26,8 @@ export class ListExcelComponent implements OnInit {
search
:
string
=
''
listTag
:
TagModel
[]
=
[]
constructor
(
private
modalService
:
NgbModal
,
private
excelService
:
ExcelService
,
private
uploadService
:
UploadService
,
private
tagService
:
TagService
)
{
listGroup
:
GroupModel
[]
=
[]
constructor
(
private
modalService
:
NgbModal
,
private
excelService
:
ExcelService
,
private
uploadService
:
UploadService
,
private
tagService
:
TagService
,
private
groupService
:
GroupService
)
{
}
async
onUploadImage
(
event
:
any
){
try
{
...
...
@@ -54,6 +57,18 @@ export class ListExcelComponent implements OnInit {
console
.
error
(
'Error loading data:'
,
error
);
}
}
async
getListGroup
(){
try
{
const
data
=
await
this
.
groupService
.
getList
().
toPromise
();
this
.
listGroup
=
data
.
map
(
x
=>
new
GroupModel
(
x
))
}
catch
(
error
){
console
.
error
(
'Error loading data:'
,
error
);
}
}
selectGroup
(){
let
findData
=
this
.
listGroup
.
find
(
x
=>
x
.
groupId
==
this
.
modelExcel
.
group
.
groupId
)
this
.
modelExcel
.
group
=
findData
?
new
GroupModel
(
findData
):
new
GroupModel
({})
}
onSelectFile
(
event
:
any
)
{
if
(
event
.
target
.
files
&&
event
.
target
.
files
[
0
])
{
const
reader
=
new
FileReader
();
...
...
@@ -168,6 +183,7 @@ export class ListExcelComponent implements OnInit {
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
,
...
...
@@ -221,6 +237,7 @@ export class ListExcelComponent implements OnInit {
ngOnInit
()
{
this
.
getListExcel
();
this
.
getListTag
();
this
.
getListGroup
();
}
...
...
src/app/apps/view-list-course/view-list-course.component.html
View file @
3fc8fd7a
...
...
@@ -16,6 +16,8 @@
<th
scope=
"col"
>
ประเภทหลักสูตร
</th>
<th
scope=
"col"
>
ลิงค์
</th>
<th
scope=
"col"
>
สถานะ
</th>
<th
scope=
"col"
class=
"text-center"
>
วันที่อัพโหลด
</th>
<th
scope=
"col"
class=
"text-center"
>
วันล่าสุดดาวน์โหลด
</th>
<th
scope=
"col"
class=
"text-center"
>
จำนวนดาวน์โหลด
</th>
<th
scope=
"col"
*
ngIf=
"checkType == '1'"
></th>
</tr>
...
...
@@ -32,6 +34,8 @@
<td>
{{data.courseType}}
</td>
<td
class=
"text-center"
><i
class=
"fas fa-link pointer"
(
click
)="
openLink
(
data
.
link1
)"
></i></td>
<td
class=
"text-center"
>
<i
class=
"fas fa-download pointer"
(
click
)="
downloadFile
(
data
.
courseId
)"
></i></td>
<td
class=
"text-center"
>
{{data.uploadDate}} {{data.uploadTime}}
</td>
<td
class=
"text-center"
>
{{data.downloadDate}} {{data.downloadTime}}
</td>
<td
class=
"text-center"
>
{{data.dwTime}} ครั้ง
</td>
<td
*
ngIf=
"checkType == '1'"
>
<button
type=
"button"
class=
"btn btn-circle btn-danger rounded-circle btn-sm mr-2"
(
click
)="
deleteFile
(
data
)"
placement=
"top"
ngbTooltip=
"ลบ"
><i
class=
"fas fa-trash-alt"
></i></button>
...
...
src/app/apps/view-list-doc/view-list-doc.component.html
View file @
3fc8fd7a
...
...
@@ -17,6 +17,8 @@
<th
scope=
"col"
class=
"text-center"
>
ลิงค์
</th>
<th
scope=
"col"
class=
"text-center"
>
ไฟล์ (ไทย)
</th>
<th
scope=
"col"
class=
"text-center"
>
ไฟล์ (อังกฤษ)
</th>
<th
scope=
"col"
class=
"text-center"
>
วันที่อัพโหลด
</th>
<th
scope=
"col"
class=
"text-center"
>
วันล่าสุดดาวน์โหลด
</th>
<th
scope=
"col"
class=
"text-center"
>
จำนวนดาวน์โหลด
</th>
<th
scope=
"col"
*
ngIf=
"checkType == '1'"
></th>
</tr>
...
...
@@ -34,6 +36,8 @@
<td
class=
"text-center"
><i
class=
"fas fa-link pointer"
(
click
)="
openLink
(
data
.
link1
)"
></i></td>
<td
class=
"text-center"
>
<i
class=
"fas fa-download pointer"
(
click
)="
downloadFile
(
data
.
docId
,'
tha
')"
></i></td>
<td
class=
"text-center"
>
<i
class=
"fas fa-download pointer"
(
click
)="
downloadFile
(
data
.
docId
,'
eng
')"
></i></td>
<td
class=
"text-center"
>
{{data.uploadDate}} {{data.uploadTime}}
</td>
<td
class=
"text-center"
>
{{data.downloadDate}} {{data.downloadTime}}
</td>
<td
class=
"text-center"
>
{{data.dwTime}} ครั้ง
</td>
<td
*
ngIf=
"checkType == '1'"
>
<button
type=
"button"
class=
"btn btn-circle btn-danger rounded-circle btn-sm mr-2"
(
click
)="
deleteFile
(
data
)"
placement=
"top"
ngbTooltip=
"ลบ"
><i
class=
"fas fa-trash-alt"
></i></button>
...
...
src/app/apps/view-list-excel/view-list-excel.component.html
View file @
3fc8fd7a
...
...
@@ -16,6 +16,8 @@
<th
scope=
"col"
>
รายละเอียด
</th>
<th
scope=
"col"
class=
"text-center"
>
ลิงค์
</th>
<th
scope=
"col"
class=
"text-center"
>
ไฟล์
</th>
<th
scope=
"col"
class=
"text-center"
>
วันที่อัพโหลด
</th>
<th
scope=
"col"
class=
"text-center"
>
วันล่าสุดดาวน์โหลด
</th>
<th
scope=
"col"
class=
"text-center"
>
จำนวนดาวน์โหลด
</th>
<th
scope=
"col"
*
ngIf=
"checkType == '1'"
></th>
</tr>
...
...
@@ -32,6 +34,8 @@
<td>
{{ data.thDesc }}
</td>
<td
class=
"text-center"
><i
class=
"fas fa-link pointer"
(
click
)="
openLink
(
data
.
link1
)"
></i></td>
<td
class=
"text-center"
>
<i
class=
"fas fa-download pointer"
(
click
)="
downloadFile
(
data
.
excelId
)"
></i></td>
<td
class=
"text-center"
>
{{data.uploadDate}} {{data.uploadTime}}
</td>
<td
class=
"text-center"
>
{{data.downloadDate}} {{data.downloadTime}}
</td>
<td
class=
"text-center"
>
{{data.dwTime}} ครั้ง
</td>
<td
*
ngIf=
"checkType == '1'"
>
<button
type=
"button"
class=
"btn btn-circle btn-danger rounded-circle btn-sm mr-2"
(
click
)="
deleteFile
(
data
)"
placement=
"top"
ngbTooltip=
"ลบ"
><i
class=
"fas fa-trash-alt"
></i></button>
...
...
src/app/model/course-content.model.ts
View file @
3fc8fd7a
import
{
environment
}
from
"src/environments/environment"
import
{
TagModel
}
from
"./tag.mmodel"
import
{
GroupModel
}
from
"./group.mmodel"
export
interface
CourseContentModel
{
courseId
:
string
...
...
@@ -18,11 +19,18 @@ export interface CourseContentModel {
courseTrainerDetail
:
string
courseObj
:
string
uploadBy
:
string
uploadDate
:
string
uploadTime
:
string
dwTime
:
number
downloadDate
:
string
downloadTime
:
string
remark
:
string
referId
:
string
approveBy
:
string
approveDate
:
string
approveTime
:
string
tags
:
TagModel
[]
group
:
GroupModel
}
export
class
CourseContentModel
implements
CourseContentModel
{
...
...
@@ -42,11 +50,18 @@ export class CourseContentModel implements CourseContentModel {
courseTrainerDetail
:
string
courseObj
:
string
uploadBy
:
string
uploadDate
:
string
uploadTime
:
string
dwTime
:
number
downloadDate
:
string
downloadTime
:
string
remark
:
string
referId
:
string
approveBy
:
string
approveDate
:
string
approveTime
:
string
tags
:
TagModel
[]
group
:
GroupModel
constructor
(
data
:
Partial
<
any
>
)
{
this
.
courseId
=
data
.
courseId
?
data
.
courseId
:
''
this
.
objective
=
data
.
objective
?
data
.
objective
:
''
...
...
@@ -69,6 +84,13 @@ export class CourseContentModel implements CourseContentModel {
this
.
courseTrainerDetail
=
data
.
courseTrainerDetail
?
data
.
courseTrainerDetail
:
''
this
.
referId
=
data
.
referId
?
data
.
referId
:
''
this
.
tags
=
data
.
tags
?
data
.
tags
:[]
this
.
uploadDate
=
data
.
uploadDate
?
data
.
uploadDate
:
''
this
.
uploadTime
=
data
.
uploadTime
?
data
.
uploadTime
:
''
this
.
downloadDate
=
data
.
downloadDate
?
data
.
downloadDate
:
''
this
.
downloadTime
=
data
.
downloadTime
?
data
.
downloadTime
:
''
this
.
approveDate
=
data
.
approveDate
?
data
.
approveDate
:
''
this
.
approveTime
=
data
.
approveTime
?
data
.
approveTime
:
''
this
.
group
=
data
.
group
?
new
GroupModel
(
data
.
group
):
new
GroupModel
({})
}
getImage
(){
if
(
this
.
thumbnail
){
...
...
src/app/model/course.model.ts
View file @
3fc8fd7a
import
{
environment
}
from
"src/environments/environment"
import
{
TagModel
}
from
"./tag.mmodel"
import
{
GroupModel
}
from
"./group.mmodel"
export
interface
CourseModel
{
logId
:
string
objective
:
string
thumbnail
:
string
link1
:
string
courseObj
:
string
uploadBy
:
string
remark
:
string
status
:
number
approveBy
:
string
thName
:
string
engName
:
string
thDesc
:
string
engDesc
:
string
objective
:
string
courseOutline
:
string
thumbnail
:
string
link1
:
string
courseType
:
string
courseLevel
:
string
courseTime
:
string
courseTrainer
:
string
courseTrainerDetail
:
string
tags
:
TagModel
[]
}
export
class
CourseModel
implements
CourseModel
{
logId
:
string
objective
:
string
thumbnail
:
string
link1
:
string
courseObj
:
string
uploadBy
:
string
uploadDate
:
string
uploadTime
:
string
remark
:
string
status
:
number
approveBy
:
string
approveDate
:
string
approveTime
:
string
tags
:
TagModel
[]
group
:
GroupModel
}
export
class
CourseModel
implements
CourseModel
{
logId
:
string
thName
:
string
engName
:
string
thDesc
:
string
engDesc
:
string
objective
:
string
courseOutline
:
string
thumbnail
:
string
link1
:
string
courseType
:
string
courseLevel
:
string
courseTime
:
string
courseTrainer
:
string
courseTrainerDetail
:
string
courseObj
:
string
uploadBy
:
string
uploadDate
:
string
uploadTime
:
string
remark
:
string
status
:
number
approveBy
:
string
approveDate
:
string
approveTime
:
string
tags
:
TagModel
[]
group
:
GroupModel
constructor
(
data
:
Partial
<
any
>
)
{
this
.
logId
=
data
.
logId
?
data
.
logId
:
''
this
.
objective
=
data
.
objective
?
data
.
objective
:
''
...
...
@@ -66,6 +77,11 @@ export class CourseModel implements CourseModel {
this
.
courseTrainer
=
data
.
courseTrainer
?
data
.
courseTrainer
:
''
this
.
courseTrainerDetail
=
data
.
courseTrainerDetail
?
data
.
courseTrainerDetail
:
''
this
.
tags
=
data
.
tags
?
data
.
tags
:[]
this
.
uploadDate
=
data
.
uploadDate
?
data
.
uploadDate
:
''
this
.
uploadTime
=
data
.
uploadTime
?
data
.
uploadTime
:
''
this
.
approveDate
=
data
.
approveDate
?
data
.
approveDate
:
''
this
.
approveTime
=
data
.
approveTime
?
data
.
approveTime
:
''
this
.
group
=
data
.
group
?
new
GroupModel
(
data
.
group
):
new
GroupModel
({})
}
getImage
(){
if
(
this
.
thumbnail
){
...
...
src/app/model/document-content.model.ts
View file @
3fc8fd7a
import
{
environment
}
from
"src/environments/environment"
import
{
TagModel
}
from
"./tag.mmodel"
import
{
GroupModel
}
from
"./group.mmodel"
export
interface
DocumentContentModel
{
docId
:
string
...
...
@@ -13,11 +14,18 @@ export interface DocumentContentModel {
thDocObj
:
string
engDocObj
:
string
uploadBy
:
string
uploadDate
:
string
uploadTime
:
string
dwTime
:
number
downloadDate
:
string
downloadTime
:
string
remark
:
string
referId
:
string
approveBy
:
string
approveDate
:
string
approveTime
:
string
tags
:
TagModel
[]
group
:
GroupModel
}
export
class
DocumentContentModel
implements
DocumentContentModel
{
...
...
@@ -32,11 +40,18 @@ export class DocumentContentModel implements DocumentContentModel {
thDocObj
:
string
engDocObj
:
string
uploadBy
:
string
uploadDate
:
string
uploadTime
:
string
dwTime
:
number
downloadDate
:
string
downloadTime
:
string
remark
:
string
referId
:
string
approveBy
:
string
approveDate
:
string
approveTime
:
string
tags
:
TagModel
[]
group
:
GroupModel
constructor
(
data
:
Partial
<
any
>
)
{
this
.
docId
=
data
.
docId
?
data
.
docId
:
''
this
.
thumbnail
=
data
.
thumbnail
?
data
.
thumbnail
:
''
...
...
@@ -54,6 +69,13 @@ export class DocumentContentModel implements DocumentContentModel {
this
.
engDesc
=
data
.
engDesc
?
data
.
engDesc
:
''
this
.
referId
=
data
.
referId
?
data
.
referId
:
''
this
.
tags
=
data
.
tags
?
data
.
tags
:[]
this
.
uploadDate
=
data
.
uploadDate
?
data
.
uploadDate
:
''
this
.
uploadTime
=
data
.
uploadTime
?
data
.
uploadTime
:
''
this
.
downloadDate
=
data
.
downloadDate
?
data
.
downloadDate
:
''
this
.
downloadTime
=
data
.
downloadTime
?
data
.
downloadTime
:
''
this
.
approveDate
=
data
.
approveDate
?
data
.
approveDate
:
''
this
.
approveTime
=
data
.
approveTime
?
data
.
approveTime
:
''
this
.
group
=
data
.
group
?
new
GroupModel
(
data
.
group
):
new
GroupModel
({})
}
getImage
(){
...
...
src/app/model/document.model.ts
View file @
3fc8fd7a
import
{
environment
}
from
"src/environments/environment"
import
{
TagModel
}
from
"./tag.mmodel"
import
{
GroupModel
}
from
"./group.mmodel"
export
interface
DocumentModel
{
logId
:
string
thName
:
string
engName
:
string
thDesc
:
string
engDesc
:
string
thumbnail
:
string
link1
:
string
langSupport
:
string
thDocObj
:
string
engDocObj
:
string
uploadBy
:
string
uploadDate
:
string
uploadTime
:
string
remark
:
string
status
:
number
approveBy
:
string
thName
:
string
engName
:
string
thDesc
:
string
engDesc
:
string
approveDate
:
string
approveTime
:
string
tags
:
TagModel
[]
group
:
GroupModel
}
export
class
DocumentModel
implements
DocumentModel
{
logId
:
string
thName
:
string
engName
:
string
thDesc
:
string
engDesc
:
string
thumbnail
:
string
link1
:
string
langSupport
:
string
thDocObj
:
string
engDocObj
:
string
uploadBy
:
string
uploadDate
:
string
uploadTime
:
string
remark
:
string
status
:
number
approveBy
:
string
thName
:
string
engName
:
string
thDesc
:
string
engDesc
:
string
approveDate
:
string
approveTime
:
string
tags
:
TagModel
[]
group
:
GroupModel
constructor
(
data
:
Partial
<
any
>
)
{
this
.
logId
=
data
.
logId
?
data
.
logId
:
''
this
.
thumbnail
=
data
.
thumbnail
?
data
.
thumbnail
:
''
...
...
@@ -51,6 +62,11 @@ export class DocumentModel implements DocumentModel {
this
.
thDesc
=
data
.
thDesc
?
data
.
thDesc
:
''
this
.
engDesc
=
data
.
engDesc
?
data
.
engDesc
:
''
this
.
tags
=
data
.
tags
?
data
.
tags
:[]
this
.
uploadDate
=
data
.
uploadDate
?
data
.
uploadDate
:
''
this
.
uploadTime
=
data
.
uploadTime
?
data
.
uploadTime
:
''
this
.
approveDate
=
data
.
approveDate
?
data
.
approveDate
:
''
this
.
approveTime
=
data
.
approveTime
?
data
.
approveTime
:
''
this
.
group
=
data
.
group
?
new
GroupModel
(
data
.
group
):
new
GroupModel
({})
}
getImage
(){
...
...
src/app/model/excel-content.model.ts
View file @
3fc8fd7a
import
{
environment
}
from
"src/environments/environment"
import
{
TagModel
}
from
"./tag.mmodel"
import
{
GroupModel
}
from
"./group.mmodel"
export
interface
ExcelContentModel
{
excelId
:
string
...
...
@@ -9,12 +11,22 @@ export interface ExcelContentModel {
thumbnail
:
string
link1
:
string
dbSupport
:
string
excelObj
:
any
excelObj
:
string
isPivot
:
number
isDataGrid
:
number
uploadBy
:
string
uploadDate
:
string
uploadTime
:
string
dwTime
:
number
downloadDate
:
string
downloadTime
:
string
remark
:
string
referId
:
string
approveBy
:
string
approveDate
:
string
approveTime
:
string
tags
:
TagModel
[]
group
:
GroupModel
}
export
class
ExcelContentModel
implements
ExcelContentModel
{
...
...
@@ -26,12 +38,22 @@ export class ExcelContentModel implements ExcelContentModel {
thumbnail
:
string
link1
:
string
dbSupport
:
string
excelObj
:
any
excelObj
:
string
isPivot
:
number
isDataGrid
:
number
uploadBy
:
string
uploadDate
:
string
uploadTime
:
string
dwTime
:
number
downloadDate
:
string
downloadTime
:
string
remark
:
string
referId
:
string
approveBy
:
string
approveDate
:
string
approveTime
:
string
tags
:
TagModel
[]
group
:
GroupModel
constructor
(
data
:
Partial
<
any
>
)
{
this
.
excelId
=
data
.
excelId
?
data
.
excelId
:
''
this
.
thumbnail
=
data
.
thumbnail
?
data
.
thumbnail
:
''
...
...
@@ -47,6 +69,16 @@ export class ExcelContentModel implements ExcelContentModel {
this
.
thDesc
=
data
.
thDesc
?
data
.
thDesc
:
''
this
.
engDesc
=
data
.
engDesc
?
data
.
engDesc
:
''
this
.
referId
=
data
.
referId
?
data
.
referId
:
''
this
.
isPivot
=
data
.
isPivot
?
data
.
isPivot
:
0
this
.
isDataGrid
=
data
.
isDataGrid
?
data
.
isDataGrid
:
0
this
.
uploadDate
=
data
.
uploadDate
?
data
.
uploadDate
:
''
this
.
uploadTime
=
data
.
uploadTime
?
data
.
uploadTime
:
''
this
.
downloadDate
=
data
.
downloadDate
?
data
.
downloadDate
:
''
this
.
downloadTime
=
data
.
downloadTime
?
data
.
downloadTime
:
''
this
.
approveDate
=
data
.
approveDate
?
data
.
approveDate
:
''
this
.
approveTime
=
data
.
approveTime
?
data
.
approveTime
:
''
this
.
tags
=
data
.
tags
?
data
.
tags
:
''
this
.
group
=
data
.
group
?
new
GroupModel
(
data
.
group
):
new
GroupModel
({})
}
getImage
(){
if
(
this
.
thumbnail
){
...
...
src/app/model/excel.model.ts
View file @
3fc8fd7a
import
{
environment
}
from
"src/environments/environment"
import
{
TagModel
}
from
"./tag.mmodel"
import
{
GroupModel
}
from
"./group.mmodel"
export
interface
ExcelModel
{
logId
:
string
thName
:
string
engName
:
string
thDesc
:
string
engDesc
:
string
thumbnail
:
string
link1
:
string
dbSupport
:
string
excelObj
:
string
isPivot
:
number
isDataGrid
:
number
uploadBy
:
string
uploadDate
:
string
uploadTime
:
string
remark
:
string
status
:
number
approveBy
:
string
thName
:
string
engName
:
string
thDesc
:
string
engDesc
:
string
approveDate
:
string
approveTime
:
string
tags
:
TagModel
[]
group
:
GroupModel
}
export
class
ExcelModel
implements
ExcelModel
{
logId
:
string
thName
:
string
engName
:
string
thDesc
:
string
engDesc
:
string
thumbnail
:
string
link1
:
string
dbSupport
:
string
excelObj
:
string
isPivot
:
number
isDataGrid
:
number
uploadBy
:
string
uploadDate
:
string
uploadTime
:
string
remark
:
string
status
:
number
approveBy
:
string
thName
:
string
engName
:
string
thDesc
:
string
engDesc
:
string
approveDate
:
string
approveTime
:
string
tags
:
TagModel
[]
group
:
GroupModel
constructor
(
data
:
Partial
<
any
>
)
{
this
.
logId
=
data
.
logId
?
data
.
logId
:
''
this
.
thumbnail
=
data
.
thumbnail
?
data
.
thumbnail
:
''
...
...
@@ -48,6 +63,13 @@ export class ExcelModel implements ExcelModel {
this
.
thDesc
=
data
.
thDesc
?
data
.
thDesc
:
''
this
.
engDesc
=
data
.
engDesc
?
data
.
engDesc
:
''
this
.
tags
=
data
.
tags
?
data
.
tags
:[]
this
.
isPivot
=
data
.
isPivot
?
data
.
isPivot
:
0
this
.
isDataGrid
=
data
.
isDataGrid
?
data
.
isDataGrid
:
0
this
.
uploadDate
=
data
.
uploadDate
?
data
.
uploadDate
:
''
this
.
uploadTime
=
data
.
uploadTime
?
data
.
uploadTime
:
''
this
.
approveDate
=
data
.
approveDate
?
data
.
approveDate
:
''
this
.
approveTime
=
data
.
approveTime
?
data
.
approveTime
:
''
this
.
group
=
data
.
group
?
new
GroupModel
(
data
.
group
):
new
GroupModel
({})
}
getImage
(){
if
(
this
.
thumbnail
){
...
...
src/app/model/group.mmodel.ts
0 → 100644
View file @
3fc8fd7a
export
interface
GroupModel
{
groupId
:
string
thName
:
string
engName
:
string
groupType
:
number
}
export
class
GroupModel
implements
GroupModel
{
groupId
:
string
thName
:
string
engName
:
string
groupType
:
number
constructor
(
data
:
Partial
<
any
>
)
{
this
.
groupId
=
data
.
groupId
?
data
.
groupId
:
''
this
.
thName
=
data
.
thName
?
data
.
thName
:
''
this
.
engName
=
data
.
engName
?
data
.
engName
:
''
this
.
groupType
=
data
.
groupType
?
data
.
groupType
:
0
}
}
\ No newline at end of file
src/app/service/group.service.ts
0 → 100644
View file @
3fc8fd7a
import
{
Injectable
}
from
'@angular/core'
;
import
{
environment
}
from
'src/environments/environment'
;
import
{
HttpClient
,
HttpHeaders
}
from
'@angular/common/http'
;
import
{
Observable
,
of
}
from
'rxjs'
;
import
{
GroupModel
}
from
'../model/group.mmodel'
;
@
Injectable
({
providedIn
:
'root'
})
export
class
GroupService
{
url
=
environment
.
url
createStatus
:
boolean
=
true
constructor
(
private
http
:
HttpClient
)
{
}
getList
():
Observable
<
GroupModel
[]
>
{
return
this
.
http
.
get
<
GroupModel
[]
>
(
this
.
url
+
"portal-group/lists"
)
}
}
src/environments/environment.prod.ts
View file @
3fc8fd7a
export
const
environment
=
{
url
:
'http
://192.168.40.35:30537
/'
,
url
:
'http
s://portal.myhr.co.th/api
/'
,
production
:
true
};
src/environments/environment.ts
View file @
3fc8fd7a
...
...
@@ -3,7 +3,7 @@
// The list of file replacements can be found in `angular.json`.
export
const
environment
=
{
url
:
'http
://192.168.40.35:30537
/'
,
url
:
'http
s://portal.myhr.co.th/api
/'
,
production
:
false
};
...
...
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