Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
vridge-docs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
JIRA
JIRA
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Gyeongho Park
vridge-docs
Commits
7f195dc7
Commit
7f195dc7
authored
Feb 24, 2023
by
shj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IMPLEMENT] 인덱스 관리 dialog 구현
parent
68d538d8
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
324 additions
and
100 deletions
+324
-100
GuideTestController.java
...com/vazil/vridge/docs/controller/GuideTestController.java
+10
-10
GuideTestService.java
.../java/com/vazil/vridge/docs/service/GuideTestService.java
+22
-4
guide.scss
docs-front/assets/scss/guide.scss
+2
-2
tree.vue
docs-front/components/tree.vue
+15
-16
default.vue
docs-front/layouts/default.vue
+275
-68
No files found.
docs-back/src/main/java/com/vazil/vridge/docs/controller/GuideTestController.java
View file @
7f195dc7
...
@@ -23,6 +23,12 @@ public class GuideTestController {
...
@@ -23,6 +23,12 @@ public class GuideTestController {
GuideService
guideService
;
GuideService
guideService
;
GuideTestService
guideTestService
;
GuideTestService
guideTestService
;
@GetMapping
public
ResponseEntity
<?>
getGuide
(
@RequestParam
(
value
=
"guideId"
)
String
guideId
)
throws
Exception
{
return
new
ResponseEntity
<>(
guideTestService
.
findGuideById
(
guideId
),
HttpStatus
.
OK
);
}
@ApiOperation
(
value
=
"모든 가이드 목차 조회"
)
@ApiOperation
(
value
=
"모든 가이드 목차 조회"
)
@GetMapping
(
"/index"
)
@GetMapping
(
"/index"
)
public
ResponseEntity
<?>
findIndex
()
throws
Exception
{
public
ResponseEntity
<?>
findIndex
()
throws
Exception
{
...
@@ -45,8 +51,8 @@ public class GuideTestController {
...
@@ -45,8 +51,8 @@ public class GuideTestController {
}
}
@PutMapping
(
"/index"
)
@PutMapping
(
"/index"
)
public
ResponseEntity
<?>
updateGuideIndex
(
@RequestBody
Guide
guide
)
throws
Exception
{
public
ResponseEntity
<?>
updateGuideIndex
(
@RequestBody
Guide
Test
guide
)
throws
Exception
{
return
new
ResponseEntity
<>(
guideService
.
updateGuide
(
guide
),
HttpStatus
.
OK
);
return
new
ResponseEntity
<>(
guide
Test
Service
.
updateGuide
(
guide
),
HttpStatus
.
OK
);
}
}
...
@@ -56,16 +62,10 @@ public class GuideTestController {
...
@@ -56,16 +62,10 @@ public class GuideTestController {
}
}
@GetMapping
public
ResponseEntity
<?>
getGuide
(
@RequestParam
(
value
=
"guideId"
)
String
guideId
)
throws
Exception
{
return
new
ResponseEntity
<>(
guideTestService
.
findGuideById
(
guideId
),
HttpStatus
.
OK
);
}
@DeleteMapping
@DeleteMapping
public
ResponseEntity
<?>
deleteGuideIndex
(
@RequestParam
(
value
=
"guideId"
)
String
guideId
,
@RequestParam
(
value
=
"cascade"
,
required
=
false
)
boolean
cascade
)
throws
Exception
{
public
ResponseEntity
<?>
deleteGuideIndex
(
@RequestParam
(
value
=
"guideId"
)
String
guideId
)
throws
Exception
{
return
new
ResponseEntity
<>(
guideService
.
deleteGuide
(
guideId
,
cascade
),
HttpStatus
.
OK
);
return
new
ResponseEntity
<>(
guideTestService
.
deleteGuide
(
guideId
),
HttpStatus
.
OK
);
}
}
@PutMapping
@PutMapping
...
...
docs-back/src/main/java/com/vazil/vridge/docs/service/GuideTestService.java
View file @
7f195dc7
package
com
.
vazil
.
vridge
.
docs
.
service
;
package
com
.
vazil
.
vridge
.
docs
.
service
;
import
com.vazil.vridge.docs.model.Guide
;
import
com.vazil.vridge.docs.model.GuideTest
;
import
com.vazil.vridge.docs.model.GuideTest
;
import
com.vazil.vridge.docs.repository.GuideTestRepository
;
import
com.vazil.vridge.docs.repository.GuideTestRepository
;
import
com.vazil.vridge.docs.utils.TimeManager
;
import
com.vazil.vridge.docs.utils.TimeManager
;
...
@@ -100,6 +101,10 @@ public class GuideTestService {
...
@@ -100,6 +101,10 @@ public class GuideTestService {
@Transactional
@Transactional
public
GuideTest
createGuide
(
GuideTest
guide
)
throws
Exception
{
public
GuideTest
createGuide
(
GuideTest
guide
)
throws
Exception
{
// guide.setOrder(guide.getOrder() == null ? getLastOrder(guide.getParentId()) : 0);
// guide.setOrder(guide.getOrder() == null ? getLastOrder(guide.getParentId()) : 0);
// todo : 기존 인덱스와 위치가 중복될 경우, 기존 인덱스들 order + 1
guide
.
setLike
(
0
);
guide
.
setLike
(
0
);
guide
.
setView
(
0
);
guide
.
setView
(
0
);
guide
.
setCreateDate
(
TimeManager
.
now
());
guide
.
setCreateDate
(
TimeManager
.
now
());
...
@@ -108,11 +113,24 @@ public class GuideTestService {
...
@@ -108,11 +113,24 @@ public class GuideTestService {
@Transactional
@Transactional
public
GuideTest
updateGuide
(
GuideTest
guide
)
throws
Exception
{
public
GuideTest
updateGuide
(
GuideTest
guide
)
throws
Exception
{
GuideTest
savedGuide
=
repository
.
findById
(
guide
.
getId
()).
orElseThrow
(
NoSuchElementException:
:
new
);
GuideTest
db
=
repository
.
findById
(
guide
.
getId
()).
orElseThrow
(
NoSuchElementException:
:
new
);
// todo : 기존 인덱스와 위치가 중복될 경우, 기존 인덱스들 order + 1
savedGuide
.
setOrder
(
guide
.
getOrder
());
savedGuide
.
setUpdateDate
(
TimeManager
.
now
());
return
repository
.
save
(
savedGuide
);
db
.
setLocale
(
guide
.
getLocale
());
db
.
setTitle
(
guide
.
getTitle
());
db
.
setOrder
(
guide
.
getOrder
());
db
.
setPath
(
guide
.
getPath
());
db
.
setDepth
(
guide
.
getDepth
());
return
repository
.
save
(
db
);
}
@Transactional
public
String
deleteGuide
(
String
guideId
)
throws
Exception
{
GuideTest
db
=
repository
.
findById
(
guideId
).
orElseThrow
(
NoSuchElementException:
:
new
);
repository
.
delete
(
db
);
return
db
.
getId
();
}
}
}
}
docs-front/assets/scss/guide.scss
View file @
7f195dc7
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
padding-right
:
240px
;
padding-right
:
240px
;
}
}
.guide-wrap
{
.guide-wrap
{
min-height
:
10
0vh
!
important
;
min-height
:
9
0vh
!
important
;
max-width
:
1280px
!
important
;
max-width
:
1280px
!
important
;
margin
:
0
auto
;
margin
:
0
auto
;
margin-top
:
36px
;
margin-top
:
36px
;
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
}
}
.guide-content
{
.guide-content
{
margin-top
:
20
0px
;
margin-top
:
13
0px
;
width
:
100%
!
important
;
width
:
100%
!
important
;
h2
{
h2
{
...
...
docs-front/components/tree.vue
View file @
7f195dc7
...
@@ -8,10 +8,10 @@
...
@@ -8,10 +8,10 @@
>
>
<v-list-item
<v-list-item
v-if=
"item.children.length === 0"
v-if=
"item.children.length === 0"
@
click=
"click
Child
Event(item)"
@
click=
"click
Item
Event(item)"
:ripple=
"false"
:ripple=
"false"
:
class=
"isActiveMenu(item.id) ? 'active' : ''
"
:
style=
"
{'border-left': depth !== 1
&&
'1px solid rgba(0,0,0,0.15)'}
"
:
style=
"isActiveMenu(item.id) ? 'border-left: 2px solid #1E88E5;' : 'border-left: 1px solid rgba(0,0,0,0.15);
'"
:
class="selectedItem === item ? 'active' : '
'"
>
>
<v-list-item-title
v-text=
"item.title"
/>
<v-list-item-title
v-text=
"item.title"
/>
</v-list-item>
</v-list-item>
...
@@ -20,9 +20,9 @@
...
@@ -20,9 +20,9 @@
v-else
v-else
v-model=
"item.active"
v-model=
"item.active"
:ripple=
"false"
:ripple=
"false"
:class=
"isActiveMenu(item.id) ? 'active' : ''"
:sub-group=
"depth > 1 ? true : false"
:sub-group=
"depth > 1 ? true : false"
:style=
"isActiveMenu(item.id) ? 'border-left: 2px solid #1E88E5;' : 'border-left: 1px solid rgba(0,0,0,0.15);'"
:class=
"selectedItem === item ? 'active' : ''"
:style=
"
{'border-left': depth !== 1
&&
'1px solid rgba(0,0,0,0.15)'}"
prepend-icon=""
prepend-icon=""
>
>
<template
v-slot:appendIcon
>
<template
v-slot:appendIcon
>
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
<
template
v-slot:activator
>
<
template
v-slot:activator
>
<v-list-item-content
<v-list-item-content
v-if=
"item"
v-if=
"item"
@
click=
"click
Parent
Event(item)"
@
click=
"click
Item
Event(item)"
active-class=
"active"
active-class=
"active"
>
>
<v-list-item-title
v-text=
"item.title"
/>
<v-list-item-title
v-text=
"item.title"
/>
...
@@ -42,8 +42,8 @@
...
@@ -42,8 +42,8 @@
<tree
<tree
:items=
"item.children"
:items=
"item.children"
:depth=
"depth+1"
:depth=
"depth+1"
@
clickParentEvent=
"clickParentEvent
"
:selectedItem=
"selectedItem
"
@
click
ChildEvent=
"clickChild
Event"
@
click
ItemEvent=
"clickItem
Event"
/>
/>
</v-list-group>
</v-list-group>
</div>
</div>
...
@@ -58,6 +58,9 @@ export default {
...
@@ -58,6 +58,9 @@ export default {
type
:
Array
,
type
:
Array
,
required
:
true
,
required
:
true
,
},
},
selectedItem
:
{
type
:
Object
,
},
depth
:
{
depth
:
{
type
:
[
String
,
Number
],
type
:
[
String
,
Number
],
default
:
1
default
:
1
...
@@ -67,15 +70,11 @@ export default {
...
@@ -67,15 +70,11 @@ export default {
active
:
[],
active
:
[],
}),
}),
methods
:
{
methods
:
{
clickParentEvent
(
item
){
clickItemEvent
(
item
){
this
.
$emit
(
'clickParentEvent'
,
item
)
this
.
$emit
(
'clickItemEvent'
,
item
)
},
clickChildEvent
(
item
){
this
.
$emit
(
'clickChildEvent'
,
item
)
},
},
isActiveMenu
(
id
)
{
return
this
.
$route
.
path
.
indexOf
(
id
)
>
-
1
},
},
watch
:
{
},
},
mounted
()
{
mounted
()
{
},
},
...
...
docs-front/layouts/default.vue
View file @
7f195dc7
This diff is collapsed.
Click to expand it.
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