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
36bf0afe
Commit
36bf0afe
authored
Nov 25, 2021
by
Chanachai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updata--ปุ๋มเพิ่มรายการ
parent
d052fac9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
119 additions
and
99 deletions
+119
-99
sidebar.component.ts
src/app/components/sidebar/sidebar.component.ts
+0
-56
equipment.component.html
src/app/pages/equipment/equipment.component.html
+71
-42
equipment.component.ts
src/app/pages/equipment/equipment.component.ts
+48
-1
No files found.
src/app/components/sidebar/sidebar.component.ts
View file @
36bf0afe
...
...
@@ -36,62 +36,6 @@ export const ROUTES: RouteInfo[] = [
icon
:
"icon-bag-16"
,
class
:
""
},
{
path
:
"/dashboard"
,
title
:
"Dashboard"
,
rtlTitle
:
""
,
icon
:
"icon-chart-pie-36"
,
class
:
""
},
{
path
:
"/icons"
,
title
:
"Icons"
,
rtlTitle
:
""
,
icon
:
"icon-atom"
,
class
:
""
},
{
path
:
"/maps"
,
title
:
"Maps"
,
rtlTitle
:
""
,
icon
:
"icon-pin"
,
class
:
""
},
{
path
:
"/notifications"
,
title
:
"Notifications"
,
rtlTitle
:
""
,
icon
:
"icon-bell-55"
,
class
:
""
},
{
path
:
"/user"
,
title
:
"User Profile"
,
rtlTitle
:
""
,
icon
:
"icon-single-02"
,
class
:
""
},
{
path
:
"/tables"
,
title
:
"Table List"
,
rtlTitle
:
""
,
icon
:
"icon-puzzle-10"
,
class
:
""
},
{
path
:
"/typography"
,
title
:
"Typography"
,
rtlTitle
:
""
,
icon
:
"icon-align-center"
,
class
:
""
},
{
path
:
"/rtl"
,
title
:
"RTL Support"
,
rtlTitle
:
""
,
icon
:
"icon-world"
,
class
:
""
}
];
@
Component
({
...
...
src/app/pages/equipment/equipment.component.html
View file @
36bf0afe
...
...
@@ -11,54 +11,82 @@
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-12"
>
<div
class=
"card"
>
<div
class=
"card-body"
>
<div
ngbDropdown
class=
"d-inline-block"
>
<button
class=
"btn btn-outline-primary"
id=
"dropdownBasic1"
ngbDropdownToggle
>
หมวดหมู่
</button>
<div
ngbDropdownMenu
aria-labelledby=
"dropdownBasic1"
>
<button
ngbDropdownItem
>
ยืมอุปกรณ์
</button>
<button
ngbDropdownItem
>
ยืมรถ
</button>
<button
ngbDropdownItem
>
จองห้อง
</button>
<ul
class=
"nav nav-tabs"
id=
"myTab"
role=
"tablist"
>
<li
class=
"nav-item"
>
<a
class=
"nav-link active"
id=
"ยืมอุปกรณ์IT-tab"
data-toggle=
"tab"
href=
"#ยืมอุปกรณ์IT"
role=
"tab"
aria-controls=
"ยืมอุปกรณ์IT"
aria-selected=
"true"
>
ยืมอุปกรณ์IT
</a>
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
id=
"จองห้อง-รถ-tab"
data-toggle=
"tab"
href=
"#จองห้อง-รถ"
role=
"tab"
aria-controls=
"จองห้อง-รถ"
aria-selected=
"false"
>
จองห้อง-รถ
</a>
</li>
<div
class=
"col-sm-4"
>
<form
class=
"form-inline my-2 my-lg-0"
>
<input
class=
"form-control mr-sm-2"
type=
"search"
placeholder=
"Search"
aria-label=
"Search"
>
<button
class=
"btn btn-outline-success my-2 my-sm-0"
type=
"submit"
>
Search
</button>
</form>
</div>
</ul>
<div
class=
"tab-content"
id=
"myTabContent"
>
<div
class=
"tab-pane fade show active"
id=
"home"
role=
"tabpanel"
aria-labelledby=
"home-tab"
>
<div
class=
"row"
>
<div
class=
"col-sm-12"
>
<div
class=
"card"
>
<div
class=
"card-body"
>
<ng-template
#
content
let-modal
>
<div
class=
"modal-header"
>
<h4
class=
"modal-title"
id=
"modal-basic-title"
>
เพิ่มรายการ
</h4>
<button
type=
"button"
class=
"close"
aria-label=
"Close"
(
click
)="
modal
.
dismiss
('
Cross
click
')"
>
<span
aria-hidden=
"true"
>
×
</span>
</button>
</div>
<div
class=
"modal-body"
>
<form>
<div
class=
"form-group"
>
<label
for=
"exampleFormControlFile"
>
แนบไฟล์รูปภาพ
</label>
<input
type=
"file"
class=
"form-control-file"
id=
"exampleFormControlFile"
>
</div>
</form>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-outline-dark"
(
click
)="
modal
.
close
('
Save
click
')"
>
Save
</button>
</div>
</ng-template>
<button
class=
"btn btn-lg btn-outline-primary"
(
click
)="
open
(
content
)"
>
เพิ่มรายการ
</button>
<div
class=
"card"
style=
"width: 50rem;"
>
<div
class=
"mx-auto"
style=
"width: 200px;"
>
<img
src=
"assets\img\mo1.jpg"
class=
"nav justify-content-center"
alt=
"..."
>
</div>
</div>
</div>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"card"
style=
"width: 50rem;"
>
<div
class=
"mx-auto"
style=
"width: 200px;"
>
<img
src=
"assets\img\mo1.jpg"
class=
"nav justify-content-center"
alt=
"..."
>
<div
class=
"d-flex justify-content-between p-2"
>
<ngb-pagination
[
collectionSize
]="
collectionSize
"
[(
page
)]="
page
"
[
pageSize
]="
pageSize
"
(
pageChange
)="
refreshCountries
()"
>
</ngb-pagination>
<select
class=
"custom-select"
style=
"width: auto"
[(
ngModel
)]="
pageSize
"
(
ngModelChange
)="
refreshCountries
()"
>
<option
[
ngValue
]="
10
"
>
10 items per page
</option>
<option
[
ngValue
]="
50
"
>
50 items per page
</option>
<option
[
ngValue
]="
100
"
>
100 items per page
</option>
</select>
</div>
</div>
<nav
aria-label=
"Page navigation example"
>
<ul
class=
"pagination justify-content-end"
>
<li
class=
"page-item disabled"
>
<a
class=
"page-link"
href=
"#"
tabindex=
"-1"
aria-disabled=
"true"
>
Back
</a>
</li>
<li
class=
"page-item"
><a
class=
"page-link"
href=
"#"
>
1
</a></li>
<li
class=
"page-item"
><a
class=
"page-link"
href=
"#"
>
2
</a></li>
<li
class=
"page-item"
><a
class=
"page-link"
href=
"#"
>
3
</a></li>
<li
class=
"page-item"
><a
class=
"page-link"
href=
"#"
>
4
</a></li>
<li
class=
"page-item"
><a
class=
"page-link"
href=
"#"
>
5
</a></li>
<li
class=
"page-item"
>
<a
class=
"page-link"
href=
"#"
>
Next
</a>
</li>
</ul>
</nav>
</div>
<div
class=
"col-sm-6"
>
<div
class=
" card-body"
>
<div
class=
" nav justify-content-center"
>
<h4
class=
" title"
>
รายละเอียดอุปกรณ์
</h4>
<div
class=
"d-grid gap-2 a-md-flex justify-content-md-end"
>
<button
class=
"btn btn-primary"
type=
"button"
>
ยืม
</button>
<button
class=
"btn btn-primary"
type=
"button"
>
ยกเลิก
</button>
</div>
<p
class=
"card-text"
>
....
</p>
</div>
</div>
<div
class=
"d-grid gap-2 a-md-flex justify-content-md-end"
>
<button
class=
"btn btn-primary"
type=
"button"
>
ยืม
</button>
<button
class=
"btn btn-primary"
type=
"button"
>
ยกเลิก
</button>
</div>
</div>
</div>
<div
class=
"tab-pane fade"
id=
"profile"
role=
"tabpanel"
aria-labelledby=
"profile-tab"
>
...
</div>
<div
class=
"tab-pane fade"
id=
"contact"
role=
"tabpanel"
aria-labelledby=
"contact-tab"
>
...
</div>
</div>
</div>
\ No newline at end of file
src/app/pages/equipment/equipment.component.ts
View file @
36bf0afe
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
NgbModal
,
ModalDismissReasons
}
from
'@ng-bootstrap/ng-bootstrap'
;
interface
Country
{
id
?:
number
;
equip
:
string
;
name
:
string
;
sdate
:
string
;
edate
:
string
;
}
const
COUNTRIES
:
Country
[]
=
[
{
equip
:
'string'
,
name
:
'ray'
,
sdate
:
'string'
,
edate
:
'string'
}
];
@
Component
({
selector
:
'app-equipment'
,
...
...
@@ -6,10 +25,38 @@ import { Component, OnInit } from '@angular/core';
styleUrls
:
[
'./equipment.component.scss'
]
})
export
class
EquipmentComponent
implements
OnInit
{
page
=
1
;
pageSize
=
10
;
collectionSize
=
COUNTRIES
.
length
;
countries
:
Country
[];
closeResult
=
''
;
constructor
()
{
}
constructor
(
private
modalService
:
NgbModal
)
{
}
ngOnInit
():
void
{
}
open
(
content
)
{
this
.
modalService
.
open
(
content
,
{
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
.
countries
=
COUNTRIES
.
map
((
country
,
i
)
=>
({
id
:
i
+
1
,
...
country
}))
.
slice
((
this
.
page
-
1
)
*
this
.
pageSize
,
(
this
.
page
-
1
)
*
this
.
pageSize
+
this
.
pageSize
);
}
}
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