Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fitmin
web
Commits
3a6be635
Commit
3a6be635
authored
5 years ago
by
JunGu Kang
Browse files
Options
Downloads
Plain Diff
Merge branch '
#19
' into 'development'
#19
Add Trainer Field Component See merge request
!22
parents
14a7f602
1a342217
Branches
Branches containing commit
No related tags found
2 merge requests
!37
Deploy
,
!22
#19 Add Trainer Field Component
Pipeline
#4315
passed
5 years ago
Stage: lint
Stage: test
Stage: build
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/TrainerField.vue
+168
-0
168 additions, 0 deletions
src/components/TrainerField.vue
with
168 additions
and
0 deletions
src/components/TrainerField.vue
0 → 100644
+
168
−
0
View file @
3a6be635
<
template
>
<v-dialog
v-model=
"dialog"
>
<template
v-slot:activator=
"
{ on }"
>
<v-text-field
label=
"트레이너"
readonly
v-model=
"trainer.name"
v-on=
"on"
></v-text-field>
</
template
>
<v-card>
<v-card-title>
트레이너 선택
</v-card-title>
<v-card-text>
<v-row
justify=
"end"
>
<v-col
cols=
"12"
sm=
"4"
md=
"3"
lg=
"3"
xl=
"2"
>
<v-text-field
append-icon=
"mdi-magnify"
clearable
label=
"트레이너 검색"
v-model=
"trainerList.searchKeyword"
></v-text-field>
</v-col>
</v-row>
<v-data-table
:headers=
"trainerList.headers"
item-key=
"id"
:items=
"trainerList.data"
:loading=
"isProcessing"
loading-text=
"데이터를 불러오는 중입니다."
no-results-text=
"일치하는 트레이너를 찾지 못했습니다."
:search=
"trainerList.searchKeyword"
>
<
template
v-slot:item.action=
"{ item }"
>
<v-btn
color=
"success"
outlined
small
@
click=
"select(item)"
>
<v-icon
left
>
mdi-check
</v-icon>
선택
</v-btn>
</
template
>
</v-data-table>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn
color=
"secondary"
outlined
@
click=
"close()"
>
<v-icon
left
>
mdi-close
</v-icon>
닫기
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<
script
>
import
APISetting
from
'
@/settings/api
'
;
export
default
{
name
:
'
TrainerField
'
,
props
:
[
'
trainer
'
],
data
:
()
=>
({
isProcessing
:
false
,
error
:
{
isError
:
false
,
message
:
''
,
},
dialog
:
false
,
trainerList
:
{
headers
:
[
{
text
:
'
#
'
,
value
:
'
id
'
,
},
{
text
:
'
이름
'
,
value
:
'
name
'
,
},
{
text
:
'
닉네임
'
,
value
:
'
nickname
'
,
},
{
text
:
'
이메일
'
,
value
:
'
email
'
,
},
{
text
:
'
연락처
'
,
value
:
'
phone
'
,
},
{
text
:
'
소개
'
,
value
:
'
bio
'
,
},
{
text
:
''
,
value
:
'
action
'
,
sortable
:
false
,
},
],
data
:
[],
searchKeyword
:
''
,
},
}),
methods
:
{
getTrainerList
()
{
this
.
error
.
isError
=
false
;
this
.
error
.
message
=
''
;
this
.
isProcessing
=
true
;
fetch
(
APISetting
.
endpoints
.
trainer
.
list
,
APISetting
.
settings
.
get
)
.
then
((
res
)
=>
{
if
(
res
.
status
===
200
)
return
res
.
json
();
throw
new
Error
(
'
알 수 없는 응답입니다.
'
);
})
.
then
((
json
)
=>
{
this
.
trainerList
.
data
=
json
.
trainers
;
})
.
catch
((
e
)
=>
{
this
.
error
.
message
=
e
.
message
;
this
.
error
.
isError
=
true
;
})
.
finally
(()
=>
{
this
.
isProcessing
=
false
;
});
},
select
(
trainer
)
{
this
.
$emit
(
'
update:trainer
'
,
trainer
);
this
.
close
();
},
close
()
{
this
.
dialog
=
false
;
},
},
created
()
{
this
.
getTrainerList
();
},
};
</
script
>
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