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
9d20005a
Commit
9d20005a
authored
5 years ago
by
JunGu Kang
Browse files
Options
Downloads
Patches
Plain Diff
Add Program Registration View
parent
feb8367e
Branches
#14
Branches containing commit
No related tags found
2 merge requests
!37
Deploy
,
!17
#14 Add Program Registration View
Pipeline
#4200
passed
5 years ago
Stage: lint
Stage: test
Stage: build
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/router/index.js
+5
-0
5 additions, 0 deletions
src/router/index.js
src/views/ProgramCreate.vue
+110
-0
110 additions, 0 deletions
src/views/ProgramCreate.vue
src/views/TraineeDetail.vue
+13
-2
13 additions, 2 deletions
src/views/TraineeDetail.vue
with
128 additions
and
2 deletions
src/router/index.js
+
5
−
0
View file @
9d20005a
...
@@ -23,6 +23,11 @@ const routes = [
...
@@ -23,6 +23,11 @@ const routes = [
name
:
'
ProgramList
'
,
name
:
'
ProgramList
'
,
component
:
()
=>
import
(
'
@/views/ProgramList.vue
'
),
component
:
()
=>
import
(
'
@/views/ProgramList.vue
'
),
},
},
{
path
:
'
/program/create
'
,
name
:
'
ProgramCreate
'
,
component
:
()
=>
import
(
'
@/views/ProgramCreate.vue
'
),
},
{
{
path
:
'
/program/:id
'
,
path
:
'
/program/:id
'
,
name
:
'
ProgramDetail
'
,
name
:
'
ProgramDetail
'
,
...
...
This diff is collapsed.
Click to expand it.
src/views/ProgramCreate.vue
0 → 100644
+
110
−
0
View file @
9d20005a
<
template
>
<div
class=
"program-detail"
>
<v-card
:loading=
"isProcessing"
>
<v-card-title>
프로그램 생성
</v-card-title>
<v-card-text>
<v-alert
v-if=
"error.isError"
dense
text
type=
"error"
>
{{
error
.
message
}}
</v-alert>
<v-text-field
label=
"프로그램 이름"
v-model=
"program.title"
></v-text-field>
<v-text-field
label=
"소요시간(분)"
v-model=
"program.durationTime"
></v-text-field>
<v-textarea
auto-grow
label=
"프로그램 소개"
v-model=
"program.detail"
></v-textarea>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn
color=
"error"
outlined
@
click=
"cancel"
>
<v-icon
left
>
mdi-delete
</v-icon>
취소
</v-btn>
<v-btn
color=
"primary"
outlined
@
click=
"createProgram"
>
<v-icon
left
>
mdi-content-save
</v-icon>
저장
</v-btn>
</v-card-actions>
</v-card>
</div>
</
template
>
<
script
>
import
APISetting
from
'
@/settings/api
'
;
export
default
{
name
:
'
ProgramDetail
'
,
data
:
()
=>
({
isProcessing
:
false
,
error
:
{
isError
:
false
,
message
:
''
,
},
showDatePicker
:
false
,
program
:
{
title
:
''
,
durationTime
:
''
,
detail
:
''
,
},
}),
methods
:
{
createProgram
()
{
this
.
error
.
isError
=
false
;
this
.
error
.
message
=
''
;
this
.
isProcessing
=
true
;
fetch
(
APISetting
.
endpoints
.
program
.
list
,
APISetting
.
settings
.
post
(
this
.
program
))
.
then
((
res
)
=>
{
if
([
201
,
400
,
500
].
includes
(
res
.
status
))
return
Promise
.
all
([
res
.
json
(),
res
]);
throw
new
Error
(
'
알 수 없는 응답입니다.
'
);
})
.
then
((
values
)
=>
{
const
[
json
,
res
]
=
values
;
if
(
res
.
status
!==
201
)
throw
new
Error
(
json
.
message
);
this
.
$router
.
push
(
'
/program
'
);
})
.
catch
((
e
)
=>
{
this
.
error
.
message
=
e
.
message
;
this
.
error
.
isError
=
true
;
})
.
finally
(()
=>
{
this
.
isProcessing
=
false
;
});
},
cancel
()
{
this
.
$router
.
push
(
'
/program
'
);
},
},
};
</
script
>
This diff is collapsed.
Click to expand it.
src/views/TraineeDetail.vue
+
13
−
2
View file @
9d20005a
...
@@ -63,11 +63,17 @@
...
@@ -63,11 +63,17 @@
></v-text-field>
></v-text-field>
</v-card-text>
</v-card-text>
<v-card-actions>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn
<v-btn
color=
"error"
color=
"error"
outlined
outlined
@
click=
"deleteTrainee(id)"
@
click=
"deleteTrainee(id)"
>
>
<v-icon
left
>
mdi-delete
</v-icon>
삭제
삭제
</v-btn>
</v-btn>
<v-btn
<v-btn
...
@@ -75,6 +81,11 @@
...
@@ -75,6 +81,11 @@
outlined
outlined
@
click=
"updateTrainee(id)"
@
click=
"updateTrainee(id)"
>
>
<v-icon
left
>
mdi-content-save
</v-icon>
저장
저장
</v-btn>
</v-btn>
</v-card-actions>
</v-card-actions>
...
@@ -146,7 +157,7 @@ export default {
...
@@ -146,7 +157,7 @@ export default {
fetch
(
APISetting
.
endpoints
.
trainee
.
detail
(
id
),
APISetting
.
settings
.
put
(
this
.
trainee
))
fetch
(
APISetting
.
endpoints
.
trainee
.
detail
(
id
),
APISetting
.
settings
.
put
(
this
.
trainee
))
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
if
(
res
.
status
===
404
)
return
Promise
.
all
([
null
,
res
]);
if
(
res
.
status
===
404
)
return
Promise
.
all
([
null
,
res
]);
if
([
200
,
400
,
404
,
500
].
includes
(
res
.
status
))
return
Promise
.
all
([
res
.
json
(),
res
]);
if
([
200
,
400
,
500
].
includes
(
res
.
status
))
return
Promise
.
all
([
res
.
json
(),
res
]);
throw
new
Error
(
'
알 수 없는 응답입니다.
'
);
throw
new
Error
(
'
알 수 없는 응답입니다.
'
);
})
})
.
then
((
values
)
=>
{
.
then
((
values
)
=>
{
...
@@ -171,7 +182,7 @@ export default {
...
@@ -171,7 +182,7 @@ export default {
fetch
(
APISetting
.
endpoints
.
trainee
.
detail
(
id
),
APISetting
.
settings
.
delete
)
fetch
(
APISetting
.
endpoints
.
trainee
.
detail
(
id
),
APISetting
.
settings
.
delete
)
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
if
([
204
,
404
].
includes
(
res
.
status
))
return
Promise
.
all
([
null
,
res
]);
if
([
204
,
404
].
includes
(
res
.
status
))
return
Promise
.
all
([
null
,
res
]);
if
([
204
,
400
,
404
,
500
].
includes
(
res
.
status
))
return
Promise
.
all
([
res
.
json
(),
res
]);
if
([
400
,
500
].
includes
(
res
.
status
))
return
Promise
.
all
([
res
.
json
(),
res
]);
// If response status is not equal to 204, 400, 404, or 500, go to catch.
// If response status is not equal to 204, 400, 404, or 500, go to catch.
throw
new
Error
(
'
알 수 없는 응답입니다.
'
);
throw
new
Error
(
'
알 수 없는 응답입니다.
'
);
})
})
...
...
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