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
7863658f
Commit
7863658f
authored
Nov 27, 2024
by
Natthaphat Pankiang
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bu6,bu7
parent
673f4a0f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
114 additions
and
84 deletions
+114
-84
section-registration.component.html
.../section-registration/section-registration.component.html
+1
-1
sub-department-four.component.html
...it/sub-department-four/sub-department-four.component.html
+0
-0
sub-department-four.component.ts
...unit/sub-department-four/sub-department-four.component.ts
+52
-37
sub-department-one.component.html
...unit/sub-department-one/sub-department-one.component.html
+3
-3
sub-department-three.component.html
.../sub-department-three/sub-department-three.component.html
+0
-0
sub-department-three.component.ts
...it/sub-department-three/sub-department-three.component.ts
+52
-37
sub-department-two.component.html
...unit/sub-department-two/sub-department-two.component.html
+6
-6
No files found.
src/app/components/company-registration/branch-business-unit/section-registration/section-registration.component.html
View file @
7863658f
...
...
@@ -257,7 +257,7 @@
<div
class=
"relative w-full"
>
<div>
<div
class=
"relative flex rounded-md"
>
<input
type=
"text"
id=
"hs-leading-button-add-on-with-icon-and-button"
name=
"hs-leading-button-add-on-with-icon-and-button"
class=
"ti-form-input rounded-none ltr:rounded-r-md rtl:rounded-l-md focus:z-10"
value=
"01"
style=
"padding-right: 3.5rem;"
[(
ngModel
)]="
bu2
.
bu2id
"
>
<input
type=
"text"
id=
"hs-leading-button-add-on-with-icon-and-button"
name=
"hs-leading-button-add-on-with-icon-and-button"
class=
"ti-form-input rounded-none ltr:rounded-r-md rtl:rounded-l-md focus:z-10"
style=
"padding-right: 3.5rem;"
[(
ngModel
)]="
bu2
.
bu2id
"
>
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center pointer-events-none z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
<i
class=
"ti ti-circle-x text-red-500 cursor-pointer right-10"
></i>
<svg
class=
"h-3.5 w-3.5 text-gray-500 dark:text-white/70"
xmlns=
"http://www.w3.org/2000/svg"
width=
"16"
height=
"16"
fill=
"currentColor"
viewBox=
"0 0 16 16"
>
...
...
src/app/components/company-registration/branch-business-unit/sub-department-four/sub-department-four.component.html
View file @
7863658f
This diff is collapsed.
Click to expand it.
src/app/components/company-registration/branch-business-unit/sub-department-four/sub-department-four.component.ts
View file @
7863658f
import
{
Component
}
from
'@angular/core'
;
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Bu6Model
,
MyBu6Model
}
from
'src/app/shared/model/bu6.model'
;
import
{
Bu7Model
,
MyBu7Model
}
from
'src/app/shared/model/bu7.model'
;
import
{
Bu6Service
}
from
'src/app/shared/services/bu6.service'
;
import
{
Bu7Service
}
from
'src/app/shared/services/bu7.service'
;
@
Component
({
selector
:
'app-sub-department-four'
,
templateUrl
:
'./sub-department-four.component.html'
,
styleUrls
:
[
'./sub-department-four.component.scss'
]
})
export
class
SubDepartmentFourComponent
{
modalOptions
:
{
[
nameModal
:
string
]:
{
// ชื่อตรวจสอบการเปิดปิด
isModalOpen
:
boolean
;
// เปิด/ปิด
modalSize
:
string
;
// ขนาดของ Modal (s,m,l,vw10-vw100 )
backdropClose
:
boolean
;
// (คลิก Backdrop แล้ว true ปิด false ไม่ปิด )
}
}
=
{
"add"
:
{
isModalOpen
:
false
,
modalSize
:
'm'
,
backdropClose
:
true
,
},
"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
export
class
SubDepartmentFourComponent
implements
OnInit
{
currentPage
=
1
page
=
Array
.
from
({
length
:
1
},
(
_
,
i
)
=>
i
+
1
);
bu7List
:
Bu7Model
[]
=
[]
bu7
:
Bu7Model
=
new
MyBu7Model
({})
bu6
:
Bu6Model
=
new
MyBu6Model
({})
search
=
""
constructor
(
private
bu7Service
:
Bu7Service
,
private
bu6Service
:
Bu6Service
)
{
}
ngOnInit
():
void
{
this
.
getBu7List
()
}
closeModal
(
name
:
string
)
{
this
.
modalOptions
[
name
].
isModalOpen
=
false
;
// ตรวจสอบว่ามี Modal อื่นเปิดอยู่หรือไม่
if
(
!
this
.
isAnyModalOpen
())
{
document
.
body
.
style
.
overflow
=
''
;
// คืนค่าการ Scroll เฉพาะเมื่อ Modal ทั้งหมดปิดแล้ว
}
getBu7List
()
{
this
.
bu7Service
.
getList
().
subscribe
(
response
=>
{
this
.
bu7List
=
response
this
.
searchChange
()
})
}
isAnyModalOpen
():
boolean
{
// Logic ตรวจสอบว่า Modal อื่นยังเปิดอยู่หรือไม่
return
Object
.
values
(
this
.
modalOptions
).
some
(
modal
=>
modal
.
isModalOpen
);
// หากไม่มี Modal อื่นเปิด
searchChange
()
{
this
.
currentPage
=
1
this
.
page
=
Array
.
from
({
length
:
Math
.
ceil
(
this
.
bu7ListFilter
().
length
/
10
)
},
(
_
,
i
)
=>
i
+
1
);
}
bu7ListFilter
()
{
return
this
.
bu7List
.
filter
(
x
=>
x
.
bu7id
.
toLowerCase
().
includes
(
this
.
search
)
||
x
.
tdesc
.
toLowerCase
().
includes
(
this
.
search
)
||
x
.
edesc
.
toLowerCase
().
includes
(
this
.
search
))
}
selectBu7
(
bu7
:
Bu7Model
)
{
this
.
bu6Service
.
getById
(
bu7
.
parent
).
subscribe
(
response
=>
{
this
.
bu6
=
new
MyBu6Model
(
response
)
})
this
.
bu7
=
new
MyBu7Model
(
bu7
)
console
.
log
(
"5"
,
this
.
bu6
)
console
.
log
(
this
.
bu7
)
}
addBu7
()
{
// this.bu7Service.post(this.bu7).subscribe((response:any) => {
// if (response.success) {
// this.getBu7List()
// }
// })
}
deleteBu7
(
bu7
:
Bu7Model
)
{
// this.bu7Service.delete(new MyBu1Model(bu7)).subscribe((response:any) => {
// if (response.success) {
// this.getBu7List()
// }
// })
}
}
src/app/components/company-registration/branch-business-unit/sub-department-one/sub-department-one.component.html
View file @
7863658f
...
...
@@ -218,7 +218,7 @@
<div
class=
"max-h-full overflow-hidden ti-modal-content"
>
<div
class=
"ti-modal-header"
>
<h3
class=
"text-xxl font-bold text-primary"
>
แก้ไขข้อมูลทะเบียน
เเผนก
แก้ไขข้อมูลทะเบียน
ส่วนย่อย 1
</h3>
<div
class=
"flex justify-end"
>
<div
class=
"button-clear"
>
...
...
@@ -259,7 +259,7 @@
<div
class=
"relative w-full"
>
<div>
<div
class=
"relative flex rounded-md"
>
<input
type=
"text"
id=
"hs-leading-button-add-on-with-icon-and-button"
name=
"hs-leading-button-add-on-with-icon-and-button"
class=
"ti-form-input rounded-none ltr:rounded-r-md rtl:rounded-l-md focus:z-10"
style=
"padding-right: 3.5rem;"
[(
ngModel
)]="
bu3
.
bu3id
"
readonly
>
<input
type=
"text"
id=
"hs-leading-button-add-on-with-icon-and-button"
name=
"hs-leading-button-add-on-with-icon-and-button"
class=
"ti-form-input rounded-none ltr:rounded-r-md rtl:rounded-l-md focus:z-10"
style=
"padding-right: 3.5rem;"
[(
ngModel
)]="
bu3
.
bu3id
"
>
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center pointer-events-none z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
<i
class=
"ti ti-circle-x text-red-500 cursor-pointer right-10"
></i>
<svg
class=
"h-3.5 w-3.5 text-gray-500 dark:text-white/70"
xmlns=
"http://www.w3.org/2000/svg"
width=
"16"
height=
"16"
fill=
"currentColor"
viewBox=
"0 0 16 16"
>
...
...
@@ -270,7 +270,7 @@
</div>
</div>
<div
class=
"flex flex-col-6"
>
<input
type=
"text"
id=
"input-label"
class=
"ti-form-input w-full"
style=
"background-color: #B3B3B3; margin-left:10px;"
disabled
value=
"ฝ่าย"
[(
ngModel
)]="
bu3
.
tdesc
"
>
<input
type=
"text"
id=
"input-label"
class=
"ti-form-input w-full"
style=
"background-color: #B3B3B3; margin-left:10px;"
[(
ngModel
)]="
bu3
.
tdesc
"
readonly
>
</div>
</div>
</div>
...
...
src/app/components/company-registration/branch-business-unit/sub-department-three/sub-department-three.component.html
View file @
7863658f
This diff is collapsed.
Click to expand it.
src/app/components/company-registration/branch-business-unit/sub-department-three/sub-department-three.component.ts
View file @
7863658f
import
{
Component
,
EventEmitter
,
Input
,
Output
}
from
'@angular/core'
;
import
{
Component
,
EventEmitter
,
Input
,
OnInit
}
from
'@angular/core'
;
import
{
Bu5Model
,
MyBu5Model
}
from
'src/app/shared/model/bu5.model'
;
import
{
Bu6Model
,
MyBu6Model
}
from
'src/app/shared/model/bu6.model'
;
import
{
Bu5Service
}
from
'src/app/shared/services/bu5.service'
;
import
{
Bu6Service
}
from
'src/app/shared/services/bu6.service'
;
@
Component
({
selector
:
'app-sub-department-three'
,
templateUrl
:
'./sub-department-three.component.html'
,
styleUrls
:
[
'./sub-department-three.component.scss'
]
})
export
class
SubDepartmentThreeComponent
{
modalOptions
:
{
[
nameModal
:
string
]:
{
// ชื่อตรวจสอบการเปิดปิด
isModalOpen
:
boolean
;
// เปิด/ปิด
modalSize
:
string
;
// ขนาดของ Modal (s,m,l,vw10-vw100 )
backdropClose
:
boolean
;
// (คลิก Backdrop แล้ว true ปิด false ไม่ปิด )
}
}
=
{
"add"
:
{
isModalOpen
:
false
,
modalSize
:
'm'
,
backdropClose
:
true
,
},
"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
export
class
SubDepartmentThreeComponent
implements
OnInit
{
currentPage
=
1
page
=
Array
.
from
({
length
:
1
},
(
_
,
i
)
=>
i
+
1
);
bu6List
:
Bu6Model
[]
=
[]
bu6
:
Bu6Model
=
new
MyBu6Model
({})
bu5
:
Bu5Model
=
new
MyBu5Model
({})
search
=
""
constructor
(
private
bu6Service
:
Bu6Service
,
private
bu5Service
:
Bu5Service
)
{
}
ngOnInit
():
void
{
this
.
getBu6List
()
}
closeModal
(
name
:
string
)
{
this
.
modalOptions
[
name
].
isModalOpen
=
false
;
// ตรวจสอบว่ามี Modal อื่นเปิดอยู่หรือไม่
if
(
!
this
.
isAnyModalOpen
())
{
document
.
body
.
style
.
overflow
=
''
;
// คืนค่าการ Scroll เฉพาะเมื่อ Modal ทั้งหมดปิดแล้ว
}
getBu6List
()
{
this
.
bu6Service
.
getList
().
subscribe
(
response
=>
{
this
.
bu6List
=
response
this
.
searchChange
()
})
}
isAnyModalOpen
():
boolean
{
// Logic ตรวจสอบว่า Modal อื่นยังเปิดอยู่หรือไม่
return
Object
.
values
(
this
.
modalOptions
).
some
(
modal
=>
modal
.
isModalOpen
);
// หากไม่มี Modal อื่นเปิด
searchChange
()
{
this
.
currentPage
=
1
this
.
page
=
Array
.
from
({
length
:
Math
.
ceil
(
this
.
bu6ListFilter
().
length
/
10
)
},
(
_
,
i
)
=>
i
+
1
);
}
bu6ListFilter
()
{
return
this
.
bu6List
.
filter
(
x
=>
x
.
bu6id
.
toLowerCase
().
includes
(
this
.
search
)
||
x
.
tdesc
.
toLowerCase
().
includes
(
this
.
search
)
||
x
.
edesc
.
toLowerCase
().
includes
(
this
.
search
))
}
selectBu6
(
bu6
:
Bu6Model
)
{
this
.
bu5Service
.
getById
(
bu6
.
parent
).
subscribe
(
response
=>
{
this
.
bu5
=
new
MyBu5Model
(
response
)
})
this
.
bu6
=
new
MyBu6Model
(
bu6
)
console
.
log
(
"5"
,
this
.
bu5
)
console
.
log
(
this
.
bu6
)
}
addBu6
()
{
// this.bu6Service.post(this.bu6).subscribe((response:any) => {
// if (response.success) {
// this.getBu6List()
// }
// })
}
deleteBu6
(
bu6
:
Bu6Model
)
{
// this.bu6Service.delete(new MyBu1Model(bu6)).subscribe((response:any) => {
// if (response.success) {
// this.getBu6List()
// }
// })
}
}
src/app/components/company-registration/branch-business-unit/sub-department-two/sub-department-two.component.html
View file @
7863658f
...
...
@@ -120,7 +120,7 @@
<div
class=
"max-h-full overflow-hidden ti-modal-content"
>
<div
class=
"ti-modal-header"
>
<h3
class=
"text-xxl font-bold text-primary"
>
เพิ่มข้อมูลทะเบียนส่วนย่อย
1
เพิ่มข้อมูลทะเบียนส่วนย่อย
2
</h3>
<div
class=
"flex justify-end"
>
<div
class=
"button-clear"
>
...
...
@@ -177,7 +177,7 @@
</div>
</div>
</div>
<label
for=
"input-label"
class=
"ti-form-label mt-2rem"
>
ส่วนย่อย
1
</label>
<label
for=
"input-label"
class=
"ti-form-label mt-2rem"
>
ส่วนย่อย
2
</label>
<div
class=
"sm:grid grid-cols-2 gap-1"
>
<div
class=
"relative w-full"
>
<div>
...
...
@@ -218,7 +218,7 @@
<div
class=
"max-h-full overflow-hidden ti-modal-content"
>
<div
class=
"ti-modal-header"
>
<h3
class=
"text-xxl font-bold text-primary"
>
แก้ไขข้อมูลทะเบียน
เเผนก
แก้ไขข้อมูลทะเบียน
ส่วนย่อย 2
</h3>
<div
class=
"flex justify-end"
>
<div
class=
"button-clear"
>
...
...
@@ -259,7 +259,7 @@
<div
class=
"relative w-full"
>
<div>
<div
class=
"relative flex rounded-md"
>
<input
type=
"text"
id=
"hs-leading-button-add-on-with-icon-and-button"
name=
"hs-leading-button-add-on-with-icon-and-button"
class=
"ti-form-input rounded-none ltr:rounded-r-md rtl:rounded-l-md focus:z-10"
style=
"padding-right: 3.5rem;"
[(
ngModel
)]="
bu4
.
bu4id
"
readonly
>
<input
type=
"text"
id=
"hs-leading-button-add-on-with-icon-and-button"
name=
"hs-leading-button-add-on-with-icon-and-button"
class=
"ti-form-input rounded-none ltr:rounded-r-md rtl:rounded-l-md focus:z-10"
style=
"padding-right: 3.5rem;"
[(
ngModel
)]="
bu4
.
bu4id
"
>
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center pointer-events-none z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
<i
class=
"ti ti-circle-x text-red-500 cursor-pointer right-10"
></i>
<svg
class=
"h-3.5 w-3.5 text-gray-500 dark:text-white/70"
xmlns=
"http://www.w3.org/2000/svg"
width=
"16"
height=
"16"
fill=
"currentColor"
viewBox=
"0 0 16 16"
>
...
...
@@ -270,12 +270,12 @@
</div>
</div>
<div
class=
"flex flex-col-6"
>
<input
type=
"text"
id=
"input-label"
class=
"ti-form-input w-full"
style=
"background-color: #B3B3B3; margin-left:10px;"
disabled
value=
"ฝ่าย"
[(
ngModel
)]="
bu4
.
tdesc
"
>
<input
type=
"text"
id=
"input-label"
class=
"ti-form-input w-full"
style=
"background-color: #B3B3B3; margin-left:10px;"
[(
ngModel
)]="
bu4
.
tdesc
"
readonly
>
</div>
</div>
</div>
</div>
<label
for=
"input-label"
class=
"ti-form-label mt-2rem"
>
ส่วนย่อย
1
</label>
<label
for=
"input-label"
class=
"ti-form-label mt-2rem"
>
ส่วนย่อย
2
</label>
<div
class=
"sm:grid grid-cols-2 gap-1"
>
<div
class=
"relative w-full"
>
<input
type=
"text"
id=
"input-label"
class=
"ti-form-input w-full pr-10 "
style=
"background-color: #B3B3B3;"
[
value
]="
bu5
.
bu5id
"
>
...
...
Natthaphat Pankiang
@aotkub7735
mentioned in commit
bcfd375f
Nov 27, 2024
mentioned in commit
bcfd375f
mentioned in commit bcfd375f3219b782f937387139dad9459e5646a3
Toggle commit list
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