Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pilot
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
조 지현
pilot
Commits
ae4d5541
Commit
ae4d5541
authored
1 year ago
by
조 지현
Browse files
Options
Downloads
Patches
Plain Diff
getTable replace .forEach to for...of
parent
ce265d53
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/views/Summery.vue
+15
-14
15 additions, 14 deletions
src/views/Summery.vue
with
15 additions
and
14 deletions
src/views/Summery.vue
+
15
−
14
View file @
ae4d5541
...
...
@@ -14,13 +14,15 @@ export default {
// 파이프라인 리스트 호출한 결과값을 data 파일에 저장
this
.
pipelineList
=
(
await
pipeline
()).
data
.
data
;
// 유아이 추출할때 사용할 코드
//
필터
유아이 추출할때 사용할 코드
// 데이터 파일 list 에 map 을 돌려서 그 안에 key 값을 추출
// map object 형으로 한번에 추출하기
const
getName
=
this
.
pipelineList
.
map
((
item
)
=>
item
.
name
);
console
.
log
(
getName
);
const
getKey
=
this
.
pipelineList
.
map
((
item
)
=>
item
.
key
);
console
.
log
(
getKey
)
// const getName = this.pipelineList.map((item)=>item.name);
// console.log(getName);
// const getKey = this.pipelineList.map((item)=>item.key);
// console.log(getKey)
const
[
names
,
keys
]
=
this
.
pipelineList
.
map
(
item
=>
[
item
.
name
,
item
.
key
]);
console
.
log
(
names
,
keys
)
...
...
@@ -28,15 +30,14 @@ export default {
},
async
getTable
(){
// pipelineList 에서 key 값을 뽑아내서
this
.
pipelineList
.
map
((
item
)
=>
item
.
key
)
// key 를 넣어 매치시켜 불러온 table data 를 response 에 받음
.
forEach
(
async
(
pipelineKey
)
=>
{
const
response
=
(
await
table
(
pipelineKey
)).
data
.
data
// 테이블 배열을 1차원으로 정렬해준다.
response
.
forEach
(
item
=>
this
.
tableList
.
push
(
item
))
// 테이블 배열을 2차원으로 정렬한다.
// this.tableList.push(response)
})
// 이터레이터 문법 for ... of 사용
for
(
const
pipelineKey
of
this
.
pipelineList
.
map
((
item
)
=>
item
.
key
))
{
const
response
=
(
await
table
(
pipelineKey
)).
data
.
data
// 테이블 배열을 1차원으로 정렬해준다.
response
.
forEach
(
item
=>
this
.
tableList
.
push
(
item
))
// 테이블 배열을 2차원으로 정렬한다.
// this.tableList.push(response)
}
}
},
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment