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
b4e64e7e
Commit
b4e64e7e
authored
May 15, 2025
by
DESKTOP-E0VCCBD\zedan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
85b53eab
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
28 deletions
+41
-28
home-common.component.html
...src/app/DPU/common/home-common/home-common.component.html
+2
-2
home-common.component.ts
...e/src/app/DPU/common/home-common/home-common.component.ts
+24
-25
home-installer.component.ts
...any-management/home-installer/home-installer.component.ts
+15
-1
No files found.
Web-Manage/src/app/DPU/common/home-common/home-common.component.html
View file @
b4e64e7e
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
<div
class=
"flex items-center gap-2"
>
<div
class=
"flex items-center gap-2"
>
<label
for=
"startDate"
class=
"whitespace-nowrap"
>
Start Date:
</label>
<label
for=
"startDate"
class=
"whitespace-nowrap"
>
Start Date:
</label>
<input
<input
type=
"date"
[(
ngModel
)]="
startDate
"
type=
"date"
[(
ngModel
)]="
startDate
"
id=
"startDate"
id=
"startDate"
name=
"startDate"
name=
"startDate"
class=
"border rounded px-2 py-1"
class=
"border rounded px-2 py-1"
...
@@ -104,7 +104,7 @@
...
@@ -104,7 +104,7 @@
</div>
</div>
</div>
</div>
<div
class=
"flex flex-wrap gap-2"
>
<div
class=
"flex flex-wrap gap-2"
>
<a
href=
"javascript:void(0);"
class=
"hs-dropdown-toggle ti-btn ti-btn-primary-full me-2"
(
click
)="
applyFilters
()"
<a
href=
"javascript:void(0);"
class=
"hs-dropdown-toggle ti-btn ti-btn-primary-full me-2"
(
click
)="
getDashbord
()"
data-hs-overlay=
"#modal-detail"
><i
class=
"font-semibold align-middle"
></i>
Apply
data-hs-overlay=
"#modal-detail"
><i
class=
"font-semibold align-middle"
></i>
Apply
</a>
</a>
</div>
</div>
...
...
Web-Manage/src/app/DPU/common/home-common/home-common.component.ts
View file @
b4e64e7e
...
@@ -44,9 +44,10 @@ export class HomeCommonComponent {
...
@@ -44,9 +44,10 @@ export class HomeCommonComponent {
rawData
:
any
[];
rawData
:
any
[];
allSelected
=
false
;
allSelected
=
false
;
someSelected
=
false
;
someSelected
=
false
;
startDate
:
string
=
''
;
today
=
new
Date
();
endDate
:
string
=
''
;
startDate
:
string
=
''
itmes
:
string
=
''
;
endDate
:
string
=
''
itmes
:
string
=
''
;
selectedProjects
:
string
[]
=
[];
selectedProjects
:
string
[]
=
[];
selectedEquipmentType
:
string
=
'ALL'
;
selectedEquipmentType
:
string
=
'ALL'
;
isDropdownOpen
=
false
;
isDropdownOpen
=
false
;
...
@@ -54,7 +55,7 @@ export class HomeCommonComponent {
...
@@ -54,7 +55,7 @@ export class HomeCommonComponent {
projectSelection
:
{
[
key
:
string
]:
boolean
}
=
{};
projectSelection
:
{
[
key
:
string
]:
boolean
}
=
{};
itemSelection
:
{
[
key
:
string
]:
boolean
}
=
{};
itemSelection
:
{
[
key
:
string
]:
boolean
}
=
{};
confirmPassword
=
""
confirmPassword
=
""
dashbordList
:
string
[]
=
[];
dashbordList
:
string
[]
=
[];
equipmentList
:
EquipmentModel
[]
=
[]
equipmentList
:
EquipmentModel
[]
=
[]
projectList
:
ProjectModel
[]
=
[]
projectList
:
ProjectModel
[]
=
[]
itemsList
:
UserProfileModel
[]
=
[]
itemsList
:
UserProfileModel
[]
=
[]
...
@@ -67,7 +68,7 @@ export class HomeCommonComponent {
...
@@ -67,7 +68,7 @@ export class HomeCommonComponent {
pageIndex
=
0
;
pageIndex
=
0
;
uploaderProfile
:
FileUploader
|
undefined
;
uploaderProfile
:
FileUploader
|
undefined
;
uploadErrorMsg
:
string
=
""
;
uploadErrorMsg
:
string
=
""
;
dashboardModel
:
DashboardModel
dashboardModel
:
DashboardModel
get
searchTerm
():
string
{
get
searchTerm
():
string
{
return
this
.
_searchTerm
;
return
this
.
_searchTerm
;
}
}
...
@@ -157,7 +158,7 @@ export class HomeCommonComponent {
...
@@ -157,7 +158,7 @@ export class HomeCommonComponent {
type
:
'datetime'
,
type
:
'datetime'
,
},
},
};
};
constructor
(
private
el
:
ElementRef
,
private
renderer
:
Renderer2
,
private
cdr
:
ChangeDetectorRef
,
private
userService
:
UserService
,
public
translate
:
TranslateService
,
private
tokenService
:
TokenService
,
private
ProjectService
:
ProjectService
,
private
EquipmentService
:
EquipmentService
,
private
DashboardService
:
DashboardService
)
{
constructor
(
private
el
:
ElementRef
,
private
renderer
:
Renderer2
,
private
cdr
:
ChangeDetectorRef
,
private
userService
:
UserService
,
public
translate
:
TranslateService
,
private
tokenService
:
TokenService
,
private
ProjectService
:
ProjectService
,
private
EquipmentService
:
EquipmentService
,
private
DashboardService
:
DashboardService
)
{
...
@@ -833,6 +834,14 @@ export class HomeCommonComponent {
...
@@ -833,6 +834,14 @@ export class HomeCommonComponent {
};
};
}
}
formatDateToYYYYMMDD
(
date
:
Date
):
string
{
const
year
=
date
.
getFullYear
();
const
month
=
(
date
.
getMonth
()
+
1
).
toString
().
padStart
(
2
,
'0'
);
// เพิ่ม 1 เพราะเดือนเริ่มที่ 0
const
day
=
date
.
getDate
().
toString
().
padStart
(
2
,
'0'
);
return
`
${
year
}
-
${
month
}
-
${
day
}
`
;
}
onProjectCheckboxChange
(
event
:
any
)
{
onProjectCheckboxChange
(
event
:
any
)
{
const
value
=
event
.
target
.
value
;
const
value
=
event
.
target
.
value
;
...
@@ -846,8 +855,8 @@ export class HomeCommonComponent {
...
@@ -846,8 +855,8 @@ export class HomeCommonComponent {
this
.
isDropdownOpen
=
!
this
.
isDropdownOpen
;
this
.
isDropdownOpen
=
!
this
.
isDropdownOpen
;
}
}
toggleDropdown1
()
{
toggleDropdown1
()
{
this
.
isDropdownOpen1
=
!
this
.
isDropdownOpen1
;
this
.
isDropdownOpen1
=
!
this
.
isDropdownOpen1
;
}
}
...
@@ -896,11 +905,15 @@ export class HomeCommonComponent {
...
@@ -896,11 +905,15 @@ export class HomeCommonComponent {
this
.
EquipmentService
.
getLists
().
subscribe
(
result
=>
{
this
.
EquipmentService
.
getLists
().
subscribe
(
result
=>
{
this
.
equipmentList
=
result
this
.
equipmentList
=
result
})
})
this
.
getDashbord
const
today
=
new
Date
();
const
firstDay
=
new
Date
(
today
.
getFullYear
(),
today
.
getMonth
(),
1
);
this
.
startDate
=
this
.
formatDateToYYYYMMDD
(
firstDay
);
this
.
endDate
=
this
.
formatDateToYYYYMMDD
(
today
);
this
.
getDashbord
()
}
}
getDashbord
(){
getDashbord
()
{
this
.
DashboardService
.
getDashboard
().
subscribe
(
result
=>
{
this
.
DashboardService
.
getDashboard
(
this
.
startDate
,
this
.
endDate
).
subscribe
(
result
=>
{
this
.
dashboardModel
=
result
this
.
dashboardModel
=
result
console
.
log
(
this
.
dashboardModel
)
console
.
log
(
this
.
dashboardModel
)
})
})
...
@@ -990,20 +1003,6 @@ export class HomeCommonComponent {
...
@@ -990,20 +1003,6 @@ export class HomeCommonComponent {
}
}
applyFilters
()
{
const
selectedProjects
=
Object
.
keys
(
this
.
projectSelection
).
filter
(
p
=>
this
.
projectSelection
[
p
]);
const
filteredData
=
this
.
rawData
.
filter
(
item
=>
{
return
(
!
this
.
startDate
||
item
.
date
>=
this
.
startDate
)
&&
(
!
this
.
endDate
||
item
.
date
<=
this
.
endDate
)
&&
(
selectedProjects
.
length
===
0
||
selectedProjects
.
includes
(
item
.
project_name
))
&&
(
this
.
selectedEquipmentType
===
'ALL'
||
item
.
equipment_type
===
this
.
selectedEquipmentType
);
});
}
updatePagedItems
()
{
updatePagedItems
()
{
const
startIndex
=
this
.
pageIndex
*
10
;
const
startIndex
=
this
.
pageIndex
*
10
;
const
endIndex
=
startIndex
+
10
;
const
endIndex
=
startIndex
+
10
;
...
...
Web-Manage/src/app/DPU/company-management/home-installer/home-installer.component.ts
View file @
b4e64e7e
...
@@ -918,12 +918,26 @@ public series: ApexAxisChartSeries = [];
...
@@ -918,12 +918,26 @@ public series: ApexAxisChartSeries = [];
this
.
EquipmentService
.
getLists
().
subscribe
(
result
=>
{
this
.
EquipmentService
.
getLists
().
subscribe
(
result
=>
{
this
.
equipmentList
=
result
this
.
equipmentList
=
result
})
})
this
.
DashboardService
.
getDashboard
().
subscribe
(
result
=>
{
const
today
=
new
Date
();
const
firstDay
=
new
Date
(
today
.
getFullYear
(),
today
.
getMonth
(),
1
);
this
.
startDate
=
this
.
formatDateToYYYYMMDD
(
firstDay
);
this
.
endDate
=
this
.
formatDateToYYYYMMDD
(
today
);
this
.
getDashbord
()
}
getDashbord
()
{
this
.
DashboardService
.
getDashboard
(
this
.
startDate
,
this
.
endDate
).
subscribe
(
result
=>
{
this
.
dashboardModel
=
result
this
.
dashboardModel
=
result
console
.
log
(
this
.
dashboardModel
)
console
.
log
(
this
.
dashboardModel
)
})
})
}
}
formatDateToYYYYMMDD
(
date
:
Date
):
string
{
const
year
=
date
.
getFullYear
();
const
month
=
(
date
.
getMonth
()
+
1
).
toString
().
padStart
(
2
,
'0'
);
// เพิ่ม 1 เพราะเดือนเริ่มที่ 0
const
day
=
date
.
getDate
().
toString
().
padStart
(
2
,
'0'
);
return
`
${
year
}
-
${
month
}
-
${
day
}
`
;
}
filter
(
v
:
string
)
{
filter
(
v
:
string
)
{
return
this
.
itemsList
?.
filter
(
return
this
.
itemsList
?.
filter
(
...
...
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