Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
BookingMyHrManagement
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
Chanachai
BookingMyHrManagement
Commits
3b3c8056
Commit
3b3c8056
authored
Dec 02, 2021
by
DESKTOP-HF0LVOG\myhr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Edit ปุ่มเพิ่มรายการ และเพิ่มหน้าอุปกรณ์ admin
parent
31cfe643
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
137 additions
and
11 deletions
+137
-11
app.module.ts
src/app/app.module.ts
+2
-1
sidebar.component.ts
src/app/components/sidebar/sidebar.component.ts
+8
-0
admin-layout.routing.ts
src/app/layouts/admin-layout/admin-layout.routing.ts
+2
-0
admin-equirment.component.html
src/app/pages/admin-equirment/admin-equirment.component.html
+0
-0
admin-equirment.component.scss
src/app/pages/admin-equirment/admin-equirment.component.scss
+0
-0
admin-equirment.component.spec.ts
...p/pages/admin-equirment/admin-equirment.component.spec.ts
+25
-0
admin-equirment.component.ts
src/app/pages/admin-equirment/admin-equirment.component.ts
+88
-0
equipment.component.html
src/app/pages/equipment/equipment.component.html
+6
-4
equipment.component.ts
src/app/pages/equipment/equipment.component.ts
+4
-4
room.service.ts
src/app/service/room.service.ts
+2
-2
No files found.
src/app/app.module.ts
View file @
3b3c8056
...
@@ -21,6 +21,7 @@ import { EquipmentComponent } from "./pages/equipment/equipment.component";
...
@@ -21,6 +21,7 @@ import { EquipmentComponent } from "./pages/equipment/equipment.component";
import
{
CalenRoomComponent
}
from
'./pages/calen-room/calen-room.component'
;
import
{
CalenRoomComponent
}
from
'./pages/calen-room/calen-room.component'
;
import
{
AdminPendingComponent
}
from
'./pages/admin-pending/admin-pending.component'
;
import
{
AdminPendingComponent
}
from
'./pages/admin-pending/admin-pending.component'
;
import
{
PendingComponent
}
from
'./pages/pending/pending.component'
;
import
{
PendingComponent
}
from
'./pages/pending/pending.component'
;
import
{
AdminEquirmentComponent
}
from
'./pages/admin-equirment/admin-equirment.component'
;
FullCalendarModule
.
registerPlugins
([
// register FullCalendar plugins
FullCalendarModule
.
registerPlugins
([
// register FullCalendar plugins
dayGridPlugin
,
dayGridPlugin
,
...
@@ -39,7 +40,7 @@ FullCalendarModule.registerPlugins([ // register FullCalendar plugins
...
@@ -39,7 +40,7 @@ FullCalendarModule.registerPlugins([ // register FullCalendar plugins
ToastrModule
.
forRoot
(),
ToastrModule
.
forRoot
(),
FullCalendarModule
,
FullCalendarModule
,
],
],
declarations
:
[
AppComponent
,
AdminLayoutComponent
,
AuthLayoutComponent
,
HomePageComponent
,
EquipmentComponent
,
CalenRoomComponent
,
AdminPendingComponent
,
PendingComponent
],
declarations
:
[
AppComponent
,
AdminLayoutComponent
,
AuthLayoutComponent
,
HomePageComponent
,
EquipmentComponent
,
CalenRoomComponent
,
AdminPendingComponent
,
PendingComponent
,
AdminEquirmentComponent
],
providers
:
[],
providers
:
[],
bootstrap
:
[
AppComponent
]
bootstrap
:
[
AppComponent
]
})
})
...
...
src/app/components/sidebar/sidebar.component.ts
View file @
3b3c8056
...
@@ -23,6 +23,13 @@ export const ROUTES: RouteInfo[] = [
...
@@ -23,6 +23,13 @@ export const ROUTES: RouteInfo[] = [
class
:
""
class
:
""
},
},
{
{
path
:
"/admin-equirment"
,
title
:
"รายการอุปกรณ์ Admin"
,
rtlTitle
:
""
,
icon
:
"icon-bag-16"
,
class
:
""
},
{
path
:
"/pending"
,
path
:
"/pending"
,
title
:
"รายการทั้งหมด"
,
title
:
"รายการทั้งหมด"
,
rtlTitle
:
""
,
rtlTitle
:
""
,
...
@@ -36,6 +43,7 @@ export const ROUTES: RouteInfo[] = [
...
@@ -36,6 +43,7 @@ export const ROUTES: RouteInfo[] = [
icon
:
"icon-bag-16"
,
icon
:
"icon-bag-16"
,
class
:
""
class
:
""
},
},
{
{
path
:
"/lend-page"
,
path
:
"/lend-page"
,
title
:
"รายการดำเนินการ"
,
title
:
"รายการดำเนินการ"
,
...
...
src/app/layouts/admin-layout/admin-layout.routing.ts
View file @
3b3c8056
...
@@ -12,11 +12,13 @@ import { EquipmentComponent } from "src/app/pages/equipment/equipment.component"
...
@@ -12,11 +12,13 @@ import { EquipmentComponent } from "src/app/pages/equipment/equipment.component"
import
{
AdminPendingComponent
}
from
"src/app/pages/admin-pending/admin-pending.component"
;
import
{
AdminPendingComponent
}
from
"src/app/pages/admin-pending/admin-pending.component"
;
import
{
PendingComponent
}
from
"src/app/pages/pending/pending.component"
;
import
{
PendingComponent
}
from
"src/app/pages/pending/pending.component"
;
import
{
LendPageComponent
}
from
"src/app/pages/lend-page/lend-page.component"
;
import
{
LendPageComponent
}
from
"src/app/pages/lend-page/lend-page.component"
;
import
{
AdminEquirmentComponent
}
from
"src/app/pages/admin-equirment/admin-equirment.component"
;
// import { RtlComponent } from "../../pages/rtl/rtl.component";
// import { RtlComponent } from "../../pages/rtl/rtl.component";
export
const
AdminLayoutRoutes
:
Routes
=
[
export
const
AdminLayoutRoutes
:
Routes
=
[
{
path
:
"home-page"
,
component
:
HomePageComponent
},
{
path
:
"home-page"
,
component
:
HomePageComponent
},
{
path
:
"equipment"
,
component
:
EquipmentComponent
},
{
path
:
"equipment"
,
component
:
EquipmentComponent
},
{
path
:
"admin-equirment"
,
component
:
AdminEquirmentComponent
},
{
path
:
"admin-pending"
,
component
:
AdminPendingComponent
},
{
path
:
"admin-pending"
,
component
:
AdminPendingComponent
},
{
path
:
"pending"
,
component
:
PendingComponent
},
{
path
:
"pending"
,
component
:
PendingComponent
},
{
path
:
"lend-page"
,
component
:
LendPageComponent
},
{
path
:
"lend-page"
,
component
:
LendPageComponent
},
...
...
src/app/pages/admin-equirment/admin-equirment.component.html
0 → 100644
View file @
3b3c8056
This diff is collapsed.
Click to expand it.
src/app/pages/admin-equirment/admin-equirment.component.scss
0 → 100644
View file @
3b3c8056
src/app/pages/admin-equirment/admin-equirment.component.spec.ts
0 → 100644
View file @
3b3c8056
import
{
ComponentFixture
,
TestBed
}
from
'@angular/core/testing'
;
import
{
AdminEquirmentComponent
}
from
'./admin-equirment.component'
;
describe
(
'AdminEquirmentComponent'
,
()
=>
{
let
component
:
AdminEquirmentComponent
;
let
fixture
:
ComponentFixture
<
AdminEquirmentComponent
>
;
beforeEach
(
async
()
=>
{
await
TestBed
.
configureTestingModule
({
declarations
:
[
AdminEquirmentComponent
]
})
.
compileComponents
();
});
beforeEach
(()
=>
{
fixture
=
TestBed
.
createComponent
(
AdminEquirmentComponent
);
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
});
it
(
'should create'
,
()
=>
{
expect
(
component
).
toBeTruthy
();
});
});
src/app/pages/admin-equirment/admin-equirment.component.ts
0 → 100644
View file @
3b3c8056
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
NgbModal
,
ModalDismissReasons
}
from
'@ng-bootstrap/ng-bootstrap'
;
import
{
Equirment
}
from
'src/app/models/equirment.model'
;
import
{
Room
}
from
'src/app/models/rooms.model'
;
import
{
EquirmentService
}
from
'src/app/service/equirment.service'
;
import
{
RoomService
}
from
'src/app/service/room.service'
;
@
Component
({
selector
:
'app-admin-equirment'
,
templateUrl
:
'./admin-equirment.component.html'
,
styleUrls
:
[
'./admin-equirment.component.scss'
]
})
export
class
AdminEquirmentComponent
implements
OnInit
{
time
=
{
hour
:
13
,
minute
:
30
};
page
=
1
;
pageSize
=
10
;
closeResult
=
''
;
listEquirmentModel
:
Equirment
[]
=
[];
listRoomModel
:
Room
[]
=
[];
collectionSize
=
this
.
listEquirmentModel
.
length
;
modelEquirment
=
new
Equirment
();
modelRoom
=
new
Room
();
constructor
(
private
modalService
:
NgbModal
,
private
equirmentService
:
EquirmentService
,
private
roomService
:
RoomService
)
{
}
ngOnInit
()
{
this
.
listEquirmentModel
=
this
.
equirmentService
.
getListEquirment
();
this
.
listRoomModel
=
this
.
roomService
.
getListRoom
();
}
Eopen
(
contentequirment
)
{
this
.
modelEquirment
=
new
Equirment
();
this
.
modalService
.
open
(
contentequirment
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
this
.
closeResult
=
`Closed with:
${
result
}
`
;
},
(
reason
)
=>
{
this
.
closeResult
=
`Dismissed
${
this
.
getDismissReason
(
reason
)}
`
;
});
}
Ropen
(
contentroom
)
{
this
.
modelRoom
=
new
Room
();
this
.
modalService
.
open
(
contentroom
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
this
.
closeResult
=
`Closed with:
${
result
}
`
;
},
(
reason
)
=>
{
this
.
closeResult
=
`Dismissed
${
this
.
getDismissReason
(
reason
)}
`
;
});
}
private
getDismissReason
(
reason
:
any
):
string
{
if
(
reason
===
ModalDismissReasons
.
ESC
)
{
return
'by pressing ESC'
;
}
else
if
(
reason
===
ModalDismissReasons
.
BACKDROP_CLICK
)
{
return
'by clicking on a backdrop'
;
}
else
{
return
`with:
${
reason
}
`
;
}
}
refreshCountries
()
{
this
.
listEquirmentModel
=
this
.
listEquirmentModel
this
.
listRoomModel
=
this
.
listRoomModel
.
map
((
item
,
i
)
=>
({
id
:
i
+
1
,
...
item
}))
.
slice
((
this
.
page
-
1
)
*
this
.
pageSize
,
(
this
.
page
-
1
)
*
this
.
pageSize
+
this
.
pageSize
);
}
NgbdTimepickerBasic
()
{
}
saveEquirment
()
{
this
.
equirmentService
.
addEquirment
(
this
.
modelEquirment
);
this
.
modalService
.
dismissAll
();
this
.
ngOnInit
();
}
saveRoom
()
{
this
.
roomService
.
addRoom
(
this
.
modelRoom
);
this
.
modalService
.
dismissAll
();
this
.
ngOnInit
();
}
}
src/app/pages/equipment/equipment.component.html
View file @
3b3c8056
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
<div
class=
"card-body"
>
<div
class=
"card-body"
>
<button
class=
"btn btn-lg btn-outline-primary"
<button
class=
"btn btn-lg btn-outline-primary"
(
click
)="
Ropen
(
content
)"
>
เพิ่มรายการ
</button>
(
click
)="
open
(
contentroom
)"
>
เพิ่มรายการ
</button>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-sm-3"
*
ngFor=
"let item of listRoomModel"
>
<div
class=
"col-sm-3"
*
ngFor=
"let item of listRoomModel"
>
...
@@ -64,6 +64,8 @@
...
@@ -64,6 +64,8 @@
</div>
</div>
</ng-template>
</ng-template>
</li>
</li>
<li
ngbNavItem
>
<li
ngbNavItem
>
<a
ngbNavLink
>
การเบิก
</a>
<a
ngbNavLink
>
การเบิก
</a>
<ng-template
ngbNavContent
>
<ng-template
ngbNavContent
>
...
@@ -71,7 +73,7 @@
...
@@ -71,7 +73,7 @@
<div
class=
"col-sm-12"
>
<div
class=
"col-sm-12"
>
<div
class=
""
>
<div
class=
""
>
<div
class=
"card-body"
>
<div
class=
"card-body"
>
<ng-template
#
content
let-modal
style=
"padding: 0; "
>
<ng-template
#
content
equirment
let-modal
style=
"padding: 0; "
>
<div
class=
" col-md-12"
>
<div
class=
" col-md-12"
>
<div
class=
"card"
>
<div
class=
"card"
>
<div
class=
" card-header"
>
<div
class=
" card-header"
>
...
@@ -126,7 +128,7 @@
...
@@ -126,7 +128,7 @@
</ng-template>
</ng-template>
<button
class=
"btn btn-lg btn-outline-primary"
<button
class=
"btn btn-lg btn-outline-primary"
(
click
)="
Eqopen
(
cont
ent
)"
>
เพิ่มรายการ
</button>
(
click
)="
open
(
contentequirm
ent
)"
>
เพิ่มรายการ
</button>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-sm-3"
*
ngFor=
"let item of listEquirmentModel"
>
<div
class=
"col-sm-3"
*
ngFor=
"let item of listEquirmentModel"
>
...
@@ -176,7 +178,7 @@
...
@@ -176,7 +178,7 @@
<div
[
ngbNavOutlet
]="
nav
"
></div>
<div
[
ngbNavOutlet
]="
nav
"
></div>
</div>
</div>
<ng-template
#
content
let-modal
style=
"padding: 0; "
>
<ng-template
#
content
room
let-modal
style=
"padding: 0; "
>
<div
class=
" col-md-12"
>
<div
class=
" col-md-12"
>
<div
class=
"card"
>
<div
class=
"card"
>
<div
class=
" card-header"
>
<div
class=
" card-header"
>
...
...
src/app/pages/equipment/equipment.component.ts
View file @
3b3c8056
...
@@ -32,18 +32,18 @@ export class EquipmentComponent implements OnInit {
...
@@ -32,18 +32,18 @@ export class EquipmentComponent implements OnInit {
this
.
listRoomModel
=
this
.
roomService
.
getListRoom
();
this
.
listRoomModel
=
this
.
roomService
.
getListRoom
();
}
}
E
qopen
(
cont
ent
)
{
E
open
(
contentequirm
ent
)
{
this
.
modelEquirment
=
new
Equirment
();
this
.
modelEquirment
=
new
Equirment
();
this
.
modalService
.
open
(
content
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
this
.
modalService
.
open
(
content
equirment
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
this
.
closeResult
=
`Closed with:
${
result
}
`
;
this
.
closeResult
=
`Closed with:
${
result
}
`
;
},
(
reason
)
=>
{
},
(
reason
)
=>
{
this
.
closeResult
=
`Dismissed
${
this
.
getDismissReason
(
reason
)}
`
;
this
.
closeResult
=
`Dismissed
${
this
.
getDismissReason
(
reason
)}
`
;
});
});
}
}
Ropen
(
content
)
{
Ropen
(
content
room
)
{
this
.
modelRoom
=
new
Room
();
this
.
modelRoom
=
new
Room
();
this
.
modalService
.
open
(
content
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
this
.
modalService
.
open
(
content
room
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
this
.
closeResult
=
`Closed with:
${
result
}
`
;
this
.
closeResult
=
`Closed with:
${
result
}
`
;
},
(
reason
)
=>
{
},
(
reason
)
=>
{
this
.
closeResult
=
`Dismissed
${
this
.
getDismissReason
(
reason
)}
`
;
this
.
closeResult
=
`Dismissed
${
this
.
getDismissReason
(
reason
)}
`
;
...
...
src/app/service/room.service.ts
View file @
3b3c8056
...
@@ -44,7 +44,7 @@ export class RoomService {
...
@@ -44,7 +44,7 @@ export class RoomService {
]
]
listRoomSearch
:
Room
[]
=
[];
listRoomSearch
:
Room
[]
=
[];
addRoom
(
model
:
Room
)
{
addRoom
(
model
:
Room
)
{
this
.
listRoomModel
.
push
(
model
);
this
.
listRoomModel
.
push
(
model
);
}
}
...
@@ -61,7 +61,7 @@ export class RoomService {
...
@@ -61,7 +61,7 @@ export class RoomService {
}
}
searchListRoom
(
searchModel
:
SearchRoomModel
)
{
searchListRoom
(
searchModel
:
SearchRoomModel
)
{
this
.
http
.
get
(
this
.
url
+
'/limits?roomlimit='
+
searchModel
.
roomlimit
+
'&startDate='
+
searchModel
.
sdate
.
split
(
"-"
)[
2
]
+
'-'
+
searchModel
.
sdate
.
split
(
"-"
)[
1
]
+
'-'
+
searchModel
.
sdate
.
split
(
"-"
)[
0
]
+
'&endDate='
+
searchModel
.
edate
.
split
(
"-"
)[
2
]
+
'-'
+
searchModel
.
edate
.
split
(
"-"
)[
1
]
+
'-'
+
searchModel
.
edate
.
split
(
"-"
)[
0
]
+
'&startTime='
+
searchModel
.
stime
+
':00'
+
'&endTime='
+
searchModel
.
etime
+
':00'
).
subscribe
((
response
:
any
)
=>
{
this
.
http
.
get
(
this
.
url
+
'/limits?roomlimit='
+
searchModel
.
roomlimit
+
'&startDate='
+
searchModel
.
sdate
.
split
(
"-"
)[
2
]
+
'-'
+
searchModel
.
sdate
.
split
(
"-"
)[
1
]
+
'-'
+
searchModel
.
sdate
.
split
(
"-"
)[
0
]
+
'&endDate='
+
searchModel
.
edate
.
split
(
"-"
)[
2
]
+
'-'
+
searchModel
.
edate
.
split
(
"-"
)[
1
]
+
'-'
+
searchModel
.
edate
.
split
(
"-"
)[
0
]
+
'&startTime='
+
searchModel
.
stime
+
':00'
+
'&endTime='
+
searchModel
.
etime
+
':00'
).
subscribe
((
response
:
any
)
=>
{
console
.
log
(
response
);
console
.
log
(
response
);
this
.
listRoomSearch
=
response
;
this
.
listRoomSearch
=
response
;
},
error
=>
{
},
error
=>
{
...
...
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