Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
myAppraisal
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
myAppraisal
Commits
673f4a0f
Commit
673f4a0f
authored
Nov 27, 2024
by
LAPTOP-CV4JFSHE\kantavee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ส่วนย่อยที่1 เเละ ส่วนย่อยที่2 API
parent
f98e2989
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
100 additions
and
73 deletions
+100
-73
sub-department-one.component.html
...unit/sub-department-one/sub-department-one.component.html
+0
-0
sub-department-one.component.ts
...s-unit/sub-department-one/sub-department-one.component.ts
+48
-35
sub-department-two.component.html
...unit/sub-department-two/sub-department-two.component.html
+0
-0
sub-department-two.component.ts
...s-unit/sub-department-two/sub-department-two.component.ts
+51
-37
dashboard.module.ts
src/app/components/dashboard/dashboard.module.ts
+1
-1
bu5.service.ts
src/app/shared/services/bu5.service.ts
+0
-0
No files found.
src/app/components/company-registration/branch-business-unit/sub-department-one/sub-department-one.component.html
View file @
673f4a0f
This diff is collapsed.
Click to expand it.
src/app/components/company-registration/branch-business-unit/sub-department-one/sub-department-one.component.ts
View file @
673f4a0f
import
{
Component
,
EventEmitter
,
Input
,
Output
}
from
'@angular/core'
;
import
{
Component
,
EventEmitter
,
Input
,
Output
}
from
'@angular/core'
;
import
{
Bu3Model
,
MyBu3Model
}
from
'src/app/shared/model/bu3.model'
;
import
{
Bu4Model
,
MyBu4Model
}
from
'src/app/shared/model/bu4.model'
;
import
{
Bu3Service
}
from
'src/app/shared/services/bu3.service'
;
import
{
Bu4Service
}
from
'src/app/shared/services/bu4.service'
;
@
Component
({
@
Component
({
selector
:
'app-sub-department-one'
,
selector
:
'app-sub-department-one'
,
...
@@ -6,43 +10,52 @@ import { Component, EventEmitter, Input, Output } from '@angular/core';
...
@@ -6,43 +10,52 @@ import { Component, EventEmitter, Input, Output } from '@angular/core';
styleUrls
:
[
'./sub-department-one.component.scss'
]
styleUrls
:
[
'./sub-department-one.component.scss'
]
})
})
export
class
SubDepartmentOneComponent
{
export
class
SubDepartmentOneComponent
{
modalOptions
:
{
currentPage
=
1
[
nameModal
:
string
]:
{
// ชื่อตรวจสอบการเปิดปิด
page
=
Array
.
from
({
length
:
1
},
(
_
,
i
)
=>
i
+
1
);
isModalOpen
:
boolean
;
// เปิด/ปิด
bu4List
:
Bu4Model
[]
=
[]
modalSize
:
string
;
// ขนาดของ Modal (s,m,l,vw10-vw100 )
bu4
:
Bu4Model
=
new
MyBu4Model
({})
backdropClose
:
boolean
;
// (คลิก Backdrop แล้ว true ปิด false ไม่ปิด )
bu3
:
Bu3Model
=
new
MyBu3Model
({})
}
search
=
""
}
=
{
constructor
(
private
bu4Service
:
Bu4Service
,
"add"
:
{
private
bu3Service
:
Bu3Service
isModalOpen
:
false
,
)
{
}
modalSize
:
'm'
,
ngOnInit
():
void
{
backdropClose
:
true
,
this
.
getBu4List
()
},
"edit"
:
{
isModalOpen
:
false
,
modalSize
:
'm'
,
backdropClose
:
true
,
}
}
openModal
(
name
:
string
,
size
:
string
,
closeOnBackdrop
?:
boolean
)
{
this
.
modalOptions
[
name
].
modalSize
=
size
;
this
.
modalOptions
[
name
].
backdropClose
=
closeOnBackdrop
||
false
;
this
.
modalOptions
[
name
].
isModalOpen
=
true
;
document
.
body
.
style
.
overflow
=
'hidden'
;
// ล็อก Scroll
}
}
getBu4List
()
{
closeModal
(
name
:
string
)
{
this
.
bu4Service
.
getList
().
subscribe
(
response
=>
{
this
.
modalOptions
[
name
].
isModalOpen
=
false
;
this
.
bu4List
=
response
// ตรวจสอบว่ามี Modal อื่นเปิดอยู่หรือไม่
this
.
searchChange
()
if
(
!
this
.
isAnyModalOpen
())
{
})
document
.
body
.
style
.
overflow
=
''
;
// คืนค่าการ Scroll เฉพาะเมื่อ Modal ทั้งหมดปิดแล้ว
}
}
}
searchChange
()
{
isAnyModalOpen
():
boolean
{
this
.
currentPage
=
1
// Logic ตรวจสอบว่า Modal อื่นยังเปิดอยู่หรือไม่
this
.
page
=
Array
.
from
({
length
:
Math
.
ceil
(
this
.
bu4ListFilter
().
length
/
10
)
},
(
_
,
i
)
=>
i
+
1
);
return
Object
.
values
(
this
.
modalOptions
).
some
(
modal
=>
modal
.
isModalOpen
);
// หากไม่มี Modal อื่นเปิด
}
bu4ListFilter
()
{
return
this
.
bu4List
.
filter
(
x
=>
x
.
bu4id
.
toLowerCase
().
includes
(
this
.
search
)
||
x
.
tdesc
.
toLowerCase
().
includes
(
this
.
search
)
||
x
.
edesc
.
toLowerCase
().
includes
(
this
.
search
))
}
selectBu4
(
bu4
:
Bu4Model
)
{
this
.
bu3Service
.
getById
(
bu4
.
parent
).
subscribe
(
response
=>
{
this
.
bu3
=
response
})
this
.
bu4
=
new
MyBu4Model
(
bu4
)
}
addBu4
()
{
// this.bu4Service.post(this.bu4).subscribe((response:any) => {
// if (response.success) {
// this.getBu4List()
// }
// })
}
deleteBu4
(
bu4
:
Bu4Model
)
{
// this.bu4Service.delete(new MyBu4Model(bu4)).subscribe((response:any) => {
// if (response.success) {
// this.getBu4List()
// }
// })
}
}
}
}
...
...
src/app/components/company-registration/branch-business-unit/sub-department-two/sub-department-two.component.html
View file @
673f4a0f
This diff is collapsed.
Click to expand it.
src/app/components/company-registration/branch-business-unit/sub-department-two/sub-department-two.component.ts
View file @
673f4a0f
import
{
Component
,
EventEmitter
,
Input
,
Output
}
from
'@angular/core'
;
import
{
Component
,
EventEmitter
,
Input
,
OnInit
}
from
'@angular/core'
;
import
{
Bu4Model
,
MyBu4Model
}
from
'src/app/shared/model/bu4.model'
;
import
{
Bu5Model
,
MyBu5Model
}
from
'src/app/shared/model/bu5.model'
;
import
{
Bu4Service
}
from
'src/app/shared/services/bu4.service'
;
import
{
Bu5Service
}
from
'src/app/shared/services/bu5.service'
;
@
Component
({
@
Component
({
selector
:
'app-sub-department-two'
,
selector
:
'app-sub-department-two'
,
templateUrl
:
'./sub-department-two.component.html'
,
templateUrl
:
'./sub-department-two.component.html'
,
styleUrls
:
[
'./sub-department-two.component.scss'
]
styleUrls
:
[
'./sub-department-two.component.scss'
]
})
})
export
class
SubDepartmentTwoComponent
{
export
class
SubDepartmentTwoComponent
implements
OnInit
{
modalOptions
:
{
currentPage
=
1
[
nameModal
:
string
]:
{
// ชื่อตรวจสอบการเปิดปิด
page
=
Array
.
from
({
length
:
1
},
(
_
,
i
)
=>
i
+
1
);
isModalOpen
:
boolean
;
// เปิด/ปิด
bu5List
:
Bu5Model
[]
=
[]
modalSize
:
string
;
// ขนาดของ Modal (s,m,l,vw10-vw100 )
bu5
:
Bu5Model
=
new
MyBu5Model
({})
backdropClose
:
boolean
;
// (คลิก Backdrop แล้ว true ปิด false ไม่ปิด )
bu4
:
Bu4Model
=
new
MyBu4Model
({})
}
search
=
""
}
=
{
constructor
(
private
bu5Service
:
Bu5Service
,
"add"
:
{
private
bu4Service
:
Bu4Service
isModalOpen
:
false
,
)
{
}
modalSize
:
'm'
,
ngOnInit
():
void
{
backdropClose
:
true
,
this
.
getBu5List
()
},
"edit"
:
{
isModalOpen
:
false
,
modalSize
:
'm'
,
backdropClose
:
true
,
}
}
openModal
(
name
:
string
,
size
:
string
,
closeOnBackdrop
?:
boolean
)
{
this
.
modalOptions
[
name
].
modalSize
=
size
;
this
.
modalOptions
[
name
].
backdropClose
=
closeOnBackdrop
||
false
;
this
.
modalOptions
[
name
].
isModalOpen
=
true
;
document
.
body
.
style
.
overflow
=
'hidden'
;
// ล็อก Scroll
}
}
getBu5List
()
{
closeModal
(
name
:
string
)
{
this
.
bu5Service
.
getList
().
subscribe
(
response
=>
{
this
.
modalOptions
[
name
].
isModalOpen
=
false
;
this
.
bu5List
=
response
// ตรวจสอบว่ามี Modal อื่นเปิดอยู่หรือไม่
this
.
searchChange
()
if
(
!
this
.
isAnyModalOpen
())
{
})
document
.
body
.
style
.
overflow
=
''
;
// คืนค่าการ Scroll เฉพาะเมื่อ Modal ทั้งหมดปิดแล้ว
}
}
}
searchChange
()
{
isAnyModalOpen
():
boolean
{
this
.
currentPage
=
1
// Logic ตรวจสอบว่า Modal อื่นยังเปิดอยู่หรือไม่
this
.
page
=
Array
.
from
({
length
:
Math
.
ceil
(
this
.
bu5ListFilter
().
length
/
10
)
},
(
_
,
i
)
=>
i
+
1
);
return
Object
.
values
(
this
.
modalOptions
).
some
(
modal
=>
modal
.
isModalOpen
);
// หากไม่มี Modal อื่นเปิด
}
bu5ListFilter
()
{
return
this
.
bu5List
.
filter
(
x
=>
x
.
bu5id
.
toLowerCase
().
includes
(
this
.
search
)
||
x
.
tdesc
.
toLowerCase
().
includes
(
this
.
search
)
||
x
.
edesc
.
toLowerCase
().
includes
(
this
.
search
))
}
selectBu5
(
bu5
:
Bu5Model
)
{
this
.
bu4Service
.
getById
(
bu5
.
parent
).
subscribe
(
response
=>
{
this
.
bu4
=
response
})
this
.
bu5
=
new
MyBu5Model
(
bu5
)
}
addBu5
()
{
// this.bu5Service.post(this.bu5).subscribe((response:any) => {
// if (response.success) {
// this.getBu5List()
// }
// })
}
deleteBu5
(
bu5
:
Bu5Model
)
{
// this.bu5Service.delete(new MyBu5Model(bu5)).subscribe((response:any) => {
// if (response.success) {
// this.getBu5List()
// }
// })
}
}
}
}
src/app/components/dashboard/dashboard.module.ts
View file @
673f4a0f
...
@@ -44,7 +44,7 @@ import { FormsModule } from '@angular/forms';
...
@@ -44,7 +44,7 @@ import { FormsModule } from '@angular/forms';
import
{
Bu2Service
}
from
'src/app/shared/services/bu2.service'
;
import
{
Bu2Service
}
from
'src/app/shared/services/bu2.service'
;
import
{
Bu3Service
}
from
'src/app/shared/services/bu3.service'
;
import
{
Bu3Service
}
from
'src/app/shared/services/bu3.service'
;
import
{
Bu4Service
}
from
'src/app/shared/services/bu4.service'
;
import
{
Bu4Service
}
from
'src/app/shared/services/bu4.service'
;
import
{
Bu5Service
}
from
'src/app/shared/services/bu5service'
;
import
{
Bu5Service
}
from
'src/app/shared/services/bu5
.
service'
;
import
{
Bu6Service
}
from
'src/app/shared/services/bu6.service'
;
import
{
Bu6Service
}
from
'src/app/shared/services/bu6.service'
;
import
{
Bu7Service
}
from
'src/app/shared/services/bu7.service'
;
import
{
Bu7Service
}
from
'src/app/shared/services/bu7.service'
;
...
...
src/app/shared/services/bu5service.ts
→
src/app/shared/services/bu5
.
service.ts
View file @
673f4a0f
File moved
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