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
85b53eab
Commit
85b53eab
authored
May 15, 2025
by
DESKTOP-E0VCCBD\zedan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
fa100049
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
42 deletions
+56
-42
home-common.component.html
...src/app/DPU/common/home-common/home-common.component.html
+32
-42
home-common.component.ts
...e/src/app/DPU/common/home-common/home-common.component.ts
+24
-0
No files found.
Web-Manage/src/app/DPU/common/home-common/home-common.component.html
View file @
85b53eab
...
@@ -69,6 +69,37 @@
...
@@ -69,6 +69,37 @@
</label>
</label>
</div>
</div>
</div>
<!-- Dropdown Checkbox -->
<div
class=
"relative inline-block"
(
clickOutside
)="
isDropdownOpen1 =
false"
>
<!-- Dropdown button -->
<button
(
click
)="
toggleDropdown1
()"
class=
"border rounded px-4 py-2 bg-white shadow w-48 text-left"
>
{{ getSelected() }}
</button>
<!-- Dropdown content -->
<div
*
ngIf=
"isDropdownOpen1"
class=
"absolute z-10 mt-1 w-48 bg-white border rounded shadow"
>
<label
*
ngFor=
"let item of equipmentList"
class=
"flex items-center px-4 py-2 hover:bg-gray-100"
>
<input
type=
"checkbox"
[
value
]="
item
"
[(
ngModel
)]="
itemSelection
[
item
.
equipmentName
]"
class=
"mr-2"
/>
{{ item.equipmentName }}
</label>
</div>
</div>
</div>
</div>
...
@@ -80,6 +111,7 @@
...
@@ -80,6 +111,7 @@
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"xxxl:col-span-6 col-span-12"
>
<div
class=
"xxxl:col-span-6 col-span-12"
>
<div
class=
"grid grid-cols-12 gap-x-6"
>
<div
class=
"grid grid-cols-12 gap-x-6"
>
<div
class=
"xxl:col-span-4 md:col-span-6 col-span-12"
>
<div
class=
"xxl:col-span-4 md:col-span-6 col-span-12"
>
...
@@ -234,13 +266,6 @@
...
@@ -234,13 +266,6 @@
<div
class=
"box-title"
>
อุปกรณ์ที่ยืม
</div>
<div
class=
"box-title"
>
อุปกรณ์ที่ยืม
</div>
<div>
<div>
<div
class=
"flex gap-4 flex-wrap"
>
<div
class=
"flex gap-4 flex-wrap"
>
<select>
<option
value=
""
>
ALL
</option>
<option
value=
""
>
จอบ
</option>
<option
value=
""
>
เสียม
</option>
<option
value=
""
>
ตะปู
</option>
<option
value=
""
>
เครื่องขุด
</option>
</select>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -297,24 +322,6 @@
...
@@ -297,24 +322,6 @@
<div
class=
"box-header justify-between items-center flex-wrap gap-4"
>
<div
class=
"box-header justify-between items-center flex-wrap gap-4"
>
<div
class=
"box-title"
>
จำนวนอุปกรณ์คงเหลือ
</div>
<div
class=
"box-title"
>
จำนวนอุปกรณ์คงเหลือ
</div>
<div
class=
"flex gap-4 flex-wrap"
>
<div
class=
"flex gap-4 flex-wrap"
>
<!-- Select: เดือน -->
<select>
<option
value=
""
>
ALL
</option>
<option
value=
""
>
มกราคม
</option>
<option
value=
""
>
กุมภาพันธ์
</option>
<option
value=
""
>
มีนาคม
</option>
<option
value=
""
>
เมษายน
</option>
</select>
<!-- Select: โปรเจค -->
<select>
<option
value=
""
>
โปรเจคทั้งหมด
</option>
<option
value=
""
>
DPU001
</option>
<option
value=
""
>
DPU002
</option>
<option
value=
""
>
DPU003
</option>
<option
value=
""
>
DPU004
</option>
</select>
<div
<div
class=
"inline-flex rounded-md shadow-sm"
class=
"inline-flex rounded-md shadow-sm"
role=
"group"
role=
"group"
...
@@ -379,23 +386,6 @@
...
@@ -379,23 +386,6 @@
<div
class=
"box-header justify-between items-center flex-wrap gap-4"
>
<div
class=
"box-header justify-between items-center flex-wrap gap-4"
>
<div
class=
"box-title"
>
จำนวนอุปกรณ์ทั้งหมด
</div>
<div
class=
"box-title"
>
จำนวนอุปกรณ์ทั้งหมด
</div>
<div
class=
"flex gap-4 flex-wrap"
>
<div
class=
"flex gap-4 flex-wrap"
>
<!-- Select: เดือน -->
<select>
<option
value=
""
>
ALL
</option>
<option
value=
""
>
มกราคม
</option>
<option
value=
""
>
กุมภาพันธ์
</option>
<option
value=
""
>
มีนาคม
</option>
<option
value=
""
>
เมษายน
</option>
</select>
<!-- Select: โปรเจค -->
<select>
<option
value=
""
>
โปรเจคทั้งหมด
</option>
<option
value=
""
>
DPU001
</option>
<option
value=
""
>
DPU002
</option>
<option
value=
""
>
DPU003
</option>
<option
value=
""
>
DPU004
</option>
</select>
<div
<div
class=
"inline-flex rounded-md shadow-sm"
class=
"inline-flex rounded-md shadow-sm"
...
...
Web-Manage/src/app/DPU/common/home-common/home-common.component.ts
View file @
85b53eab
...
@@ -46,10 +46,13 @@ export class HomeCommonComponent {
...
@@ -46,10 +46,13 @@ export class HomeCommonComponent {
someSelected
=
false
;
someSelected
=
false
;
startDate
:
string
=
''
;
startDate
:
string
=
''
;
endDate
:
string
=
''
;
endDate
:
string
=
''
;
itmes
:
string
=
''
;
selectedProjects
:
string
[]
=
[];
selectedProjects
:
string
[]
=
[];
selectedEquipmentType
:
string
=
'ALL'
;
selectedEquipmentType
:
string
=
'ALL'
;
isDropdownOpen
=
false
;
isDropdownOpen
=
false
;
isDropdownOpen1
=
false
;
projectSelection
:
{
[
key
:
string
]:
boolean
}
=
{};
projectSelection
:
{
[
key
:
string
]:
boolean
}
=
{};
itemSelection
:
{
[
key
:
string
]:
boolean
}
=
{};
confirmPassword
=
""
confirmPassword
=
""
dashbordList
:
string
[]
=
[];
dashbordList
:
string
[]
=
[];
equipmentList
:
EquipmentModel
[]
=
[]
equipmentList
:
EquipmentModel
[]
=
[]
...
@@ -843,6 +846,10 @@ export class HomeCommonComponent {
...
@@ -843,6 +846,10 @@ export class HomeCommonComponent {
this
.
isDropdownOpen
=
!
this
.
isDropdownOpen
;
this
.
isDropdownOpen
=
!
this
.
isDropdownOpen
;
}
}
toggleDropdown1
()
{
this
.
isDropdownOpen1
=
!
this
.
isDropdownOpen1
;
}
getSelectedLabel
():
string
{
getSelectedLabel
():
string
{
const
selectedIds
=
Object
.
keys
(
this
.
projectSelection
).
filter
(
const
selectedIds
=
Object
.
keys
(
this
.
projectSelection
).
filter
(
...
@@ -860,6 +867,23 @@ export class HomeCommonComponent {
...
@@ -860,6 +867,23 @@ export class HomeCommonComponent {
return
selectedNames
.
join
(
', '
);
return
selectedNames
.
join
(
', '
);
}
}
getSelected
():
string
{
const
selectedIds
=
Object
.
keys
(
this
.
itemSelection
).
filter
(
id
=>
this
.
itemSelection
[
id
]
);
if
(
selectedIds
.
length
===
0
)
return
'เลือกอุปกรณ์'
;
if
(
selectedIds
.
length
===
this
.
equipmentList
.
length
)
return
'อุปกรณ์ทั้งหมด'
;
const
selectedNames
=
this
.
equipmentList
.
filter
(
equipmentList
=>
selectedIds
.
includes
(
equipmentList
.
equipmentName
))
.
map
(
equipmentList
=>
equipmentList
.
equipmentName
);
return
selectedNames
.
join
(
', '
);
}
ngOnInit
():
void
{
ngOnInit
():
void
{
this
.
userService
.
getLists
().
subscribe
(
result
=>
{
this
.
userService
.
getLists
().
subscribe
(
result
=>
{
...
...
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