Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
apaas-ui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gzga-jzapi
apaas-ui
Commits
b361dc6b
Commit
b361dc6b
authored
Oct 24, 2020
by
徐一鸣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
开发文档接口调试
parent
e7ec996a
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
378 additions
and
132 deletions
+378
-132
src/components/side-nav-bar.vue
src/components/side-nav-bar.vue
+80
-16
src/pages/technical-support/doc-manage/detail.vue
src/pages/technical-support/doc-manage/detail.vue
+63
-21
src/pages/technical-support/doc-manage/list.vue
src/pages/technical-support/doc-manage/list.vue
+139
-59
src/pages/technical-support/doc/detail.vue
src/pages/technical-support/doc/detail.vue
+31
-21
src/pages/technical-support/doc/index.vue
src/pages/technical-support/doc/index.vue
+61
-10
src/router/index.js
src/router/index.js
+4
-5
No files found.
src/components/side-nav-bar.vue
View file @
b361dc6b
<
template
>
<
template
>
<div
class=
"side_nav_bar"
>
<div
class=
"side_nav_bar
apaas_scroll
"
>
<h3
class=
"side_nav_bar_title"
@
click=
"titleAction"
>
<h3
class=
"side_nav_bar_title"
@
click=
"titleAction"
>
<img
:src=
"titleIcon"
width=
"20"
style=
"margin-right: 10px;"
/>
<img
:src=
"titleIcon"
width=
"20"
style=
"margin-right: 10px;"
/>
<span
v-text=
"title"
></span>
<span
v-text=
"title"
></span>
</h3>
</h3>
<ul
class=
"side_nav_bar_list"
>
<ul
class=
"side_nav_bar_list"
>
<!-- active-class="current" -->
<!-- active-class="current" -->
<router-link
<template
v-for=
"(nav, index) in navList"
>
tag=
"li"
<li
v-if=
"nav.children && nav.children.length"
:key=
"'nav_' + index"
>
v-for=
"(nav, index) in navList"
<a
class=
"text_clip toggle_bar"
@
click.prevent=
"toggleNav(nav)"
>
:class=
"
{ current: $route.path.indexOf(nav.path) > -1 }"
{{
nav
.
name
}}
:key="'nav' + index"
:to="nav.path"
<i
>
:class=
"nav.open ? 'el-icon-arrow-down' : 'el-icon-arrow-right'"
<span
v-text=
"nav.name"
></span>
></i>
</router-link>
</a>
<ul
class=
"second_list"
v-show=
"nav.open"
>
<li
v-for=
"(v, i) in nav.children"
:key=
"'nav_' + index + 'v_' + i"
>
<router-link
class=
"text_clip"
:class=
"
{ current: $route.path.indexOf(v.path) > -1 }"
:to="v.path"
>
{{
v
.
name
}}
</router-link>
</li>
</ul>
</li>
<li
v-else-if=
"nav.disabled"
:key=
"'nav_' + index"
>
<a
class=
"disabled text_clip"
>
{{
nav
.
name
}}
</a>
</li>
<li
v-else
:key=
"'nav_' + index"
>
<router-link
class=
"text_clip"
:class=
"
{ current: $route.path.indexOf(nav.path) > -1 }"
:to="nav.path"
>
{{
nav
.
name
}}
</router-link>
</li>
</
template
>
</ul>
</ul>
</div>
</div>
</template>
</template>
...
@@ -41,8 +68,8 @@ export default {
...
@@ -41,8 +68,8 @@ export default {
},
},
imgSrc
:
{
imgSrc
:
{
type
:
String
,
type
:
String
,
default
:
"
tool_fuwu
"
default
:
"
tool_fuwu
"
,
}
}
,
},
},
methods
:
{
methods
:
{
titleAction
()
{
titleAction
()
{
...
@@ -50,6 +77,9 @@ export default {
...
@@ -50,6 +77,9 @@ export default {
this
.
$router
.
push
(
this
.
titlePath
);
this
.
$router
.
push
(
this
.
titlePath
);
}
}
},
},
toggleNav
(
nav
)
{
this
.
$set
(
nav
,
"
open
"
,
!
nav
.
open
);
},
},
},
};
};
</
script
>
</
script
>
...
@@ -57,6 +87,8 @@ export default {
...
@@ -57,6 +87,8 @@ export default {
<
style
scoped
>
<
style
scoped
>
.side_nav_bar
{
.side_nav_bar
{
background-color
:
#0d1847
;
background-color
:
#0d1847
;
overflow-x
:
hidden
;
overflow-y
:
auto
;
}
}
.side_nav_bar_title
{
.side_nav_bar_title
{
height
:
40px
;
height
:
40px
;
...
@@ -73,16 +105,48 @@ export default {
...
@@ -73,16 +105,48 @@ export default {
font-size
:
16px
;
font-size
:
16px
;
color
:
#c3caf8
;
color
:
#c3caf8
;
}
}
.side_nav_bar_list
>
li
{
.side_nav_bar_list
>
li
>
a
{
display
:
block
;
padding
:
12px
10px
12px
42px
;
padding
:
12px
10px
12px
42px
;
border-left
:
5px
solid
#0d1847
;
border-left
:
5px
solid
#0d1847
;
font-size
:
14px
;
font-size
:
14px
;
font-weight
:
bold
;
line-height
:
24px
;
line-height
:
24px
;
color
:
#6573ae
;
color
:
#e6ebfe
;
text-decoration
:
none
;
cursor
:
pointer
;
cursor
:
pointer
;
user-select
:
none
;
}
.side_nav_bar_list
>
li
>
a
.disabled
{
opacity
:
0.5
;
cursor
:
not-allowed
;
}
.side_nav_bar_list
>
li
>
a
:hover
,
.side_nav_bar_list
>
li
>
a
.current
{
border-left
:
5px
solid
#e56600
;
background-color
:
#182665
;
color
:
#e6ebfe
;
}
.toggle_bar
{
padding-right
:
30px
!important
;
position
:
relative
;
}
.toggle_bar
>
i
{
position
:
absolute
;
top
:
16px
;
right
:
8px
;
}
.second_list
>
li
>
a
{
display
:
block
;
padding
:
12px
10px
12px
56px
;
border-left
:
5px
solid
#0d1847
;
font-size
:
14px
;
line-height
:
24px
;
color
:
#6573ae
;
text-decoration
:
none
;
}
}
.s
ide_nav_bar_list
>
li
:hover
,
.s
econd_list
>
li
>
a
:hover
,
.s
ide_nav_bar_list
>
li
.current
{
.s
econd_list
>
li
>
a
.current
{
border-left
:
5px
solid
#e56600
;
border-left
:
5px
solid
#e56600
;
background-color
:
#182665
;
background-color
:
#182665
;
color
:
#e6ebfe
;
color
:
#e6ebfe
;
...
...
src/pages/technical-support/doc-manage/detail.vue
View file @
b361dc6b
...
@@ -9,43 +9,77 @@
...
@@ -9,43 +9,77 @@
开发文档
开发文档
</el-breadcrumb-item>
</el-breadcrumb-item>
<el-breadcrumb-item>
<el-breadcrumb-item>
文档编辑
文档编辑
-
{{
title
}}
</el-breadcrumb-item>
</el-breadcrumb-item>
</el-breadcrumb>
</el-breadcrumb>
</div>
</div>
<div
class=
"editpage"
>
<div
class=
"editpage"
>
<wang-e
v-model=
"editstr"
></wang-e>
<wang-e
v-model=
"content"
></wang-e>
<div
class=
"apaas_button"
style=
"overflow:hidden;padding-top:30px;border-top:1px solid #e3e5ef;box-sizing:border-box;"
>
<div
class=
"apaas_button"
>
<el-button
style=
"float:right;margin:0 30px;"
type=
"primary"
>
保存
</el-button>
<el-button
type=
"defalut"
size=
"mini"
@
click=
"cancelAction"
>
<el-button
style=
"float:right"
>
取消
</el-button>
取消
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"submitAction"
>
保存
</el-button>
</div>
</div>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
wangE
from
'
@/components/wangE
'
import
wangE
from
"
@/components/wangE
"
;
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
editstr
:
''
,
title
:
""
,
content
:
""
,
};
};
},
},
components
:{
components
:
{
wangE
wangE
,
},
computed
:
{
},
},
created
()
{
created
()
{
if
(
this
.
$route
.
params
.
id
)
{
if
(
this
.
$route
.
params
.
id
)
{
// 请求详情
this
.
$http
}
else
{
.
get
(
"
/apaas/support/document/get
"
,
{
// error
params
:
{
id
:
this
.
$route
.
params
.
id
,
},
})
.
then
(({
data
})
=>
{
if
(
data
.
success
===
1
)
{
this
.
title
=
data
.
data
.
title
;
this
.
content
=
data
.
data
.
content
;
}
});
}
}
},
},
methods
:
{},
methods
:
{
cancelAction
()
{
this
.
$router
.
push
(
"
/technical_support/doc_manage
"
);
},
submitAction
()
{
this
.
$http
.
put
(
"
/apaas/support/document/put
"
,
{
id
:
parseFloat
(
this
.
$route
.
params
.
id
),
content
:
this
.
content
,
})
.
then
(({
data
})
=>
{
if
(
data
.
success
===
1
)
{
this
.
$message
.
success
(
"
保存成功
"
);
this
.
$router
.
push
(
"
/technical_support/doc_manage
"
)
}
else
{
this
.
$message
.
error
(
data
.
errMsg
||
"
保存失败
"
);
}
})
.
catch
((
error
)
=>
{
console
.
log
(
error
);
this
.
$message
.
error
(
"
保存失败
"
);
});
},
},
};
};
</
script
>
</
script
>
...
@@ -60,17 +94,25 @@ export default {
...
@@ -60,17 +94,25 @@ export default {
background-color
:
#fff
;
background-color
:
#fff
;
border-radius
:
10px
;
border-radius
:
10px
;
}
}
.editpage
{
.editpage
{
background-color
:
#fff
;
background-color
:
#fff
;
height
:
calc
(
100%
-
45px
);
height
:
calc
(
100%
-
45px
);
margin-bottom
:
20px
;
margin-bottom
:
20px
;
box-shadow
:
0px
3px
6px
0px
box-shadow
:
0px
3px
6px
0px
#f4f7fc
;
#f4f7fc
;
border-radius
:
12px
;
border-radius
:
12px
;
}
}
.editpage
.wangeditor_class
{
.editpage
.wangeditor_class
{
height
:
calc
(
100%
-
100px
);
height
:
calc
(
100%
-
100px
);
padding
:
0
20px
;
padding
:
0
20px
;
box-sizing
:
border-box
;
box-sizing
:
border-box
;
}
}
.apaas_button
{
border-top
:
1px
solid
#e3e5ef
;
box-sizing
:
border-box
;
text-align
:
right
;
padding-top
:
30px
;
}
.apaas_button
.el-button
+
.el-button
{
margin-right
:
30px
;
}
</
style
>
</
style
>
src/pages/technical-support/doc-manage/list.vue
View file @
b361dc6b
This diff is collapsed.
Click to expand it.
src/pages/technical-support/doc/detail.vue
View file @
b361dc6b
This diff is collapsed.
Click to expand it.
src/pages/technical-support/doc/index.vue
View file @
b361dc6b
...
@@ -5,10 +5,10 @@
...
@@ -5,10 +5,10 @@
imgSrc=
"tool_ic_kaifawendang"
imgSrc=
"tool_ic_kaifawendang"
:nav-list=
"navList"
:nav-list=
"navList"
:title-path=
"navList[0] && navList[0].path"
:title-path=
"navList[0] && navList[0].path"
style=
"width: 2
0
0px;"
style=
"width: 2
5
0px;"
></side-nav-bar>
></side-nav-bar>
<div
class=
"main_container"
>
<div
class=
"main_container"
>
<router-view
/>
<router-view
:key=
"$route.params.type + $route.params.id"
/>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
...
@@ -23,28 +23,41 @@ export default {
...
@@ -23,28 +23,41 @@ export default {
data
:
()
=>
({
data
:
()
=>
({
navList
:
[],
navList
:
[],
}),
}),
watch
:
{
/*
watch: {
"$route.fullPath"(path) {
"$route.fullPath"(path) {
this.initNavList();
this.initNavList();
},
},
},
},
*/
methods
:
{
methods
:
{
initNavList
()
{
initNavList
()
{
this
.
$api
.
general
.
getNowMenu
({
teamName
:
"
APAAS3
"
}).
then
((
response
)
=>
{
this
.
$api
.
general
.
getNowMenu
({
teamName
:
"
APAAS3
"
}).
then
(({
data
})
=>
{
if
(
response
.
data
.
success
==
1
)
{
if
(
data
.
success
==
1
)
{
let
arr
=
response
.
data
.
data
[
0
].
Child
;
let
menu
=
data
.
data
[
0
].
Child
;
let
nav
=
[];
let
activePath
=
""
;
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
menu
.
length
;
i
++
)
{
let
first
=
arr
[
i
];
let
first
=
menu
[
i
];
if
(
first
.
visit_url
==
"
/technical_support
"
)
{
if
(
first
.
visit_url
==
"
/technical_support
"
)
{
for
(
let
j
=
0
;
j
<
first
.
Child
.
length
;
j
++
)
{
for
(
let
j
=
0
;
j
<
first
.
Child
.
length
;
j
++
)
{
let
second
=
first
.
Child
[
j
];
let
second
=
first
.
Child
[
j
];
if
(
second
.
visit_url
==
"
/technical_support/doc
"
)
{
if
(
second
.
visit_url
==
"
/technical_support/doc
"
)
{
this
.
navList
=
second
.
Child
.
map
((
item
)
=>
({
let
paths
=
[
"
/technical_support/doc/introductory
"
,
"
/technical_support/doc/notice
"
,
"
/technical_support/doc/trem
"
,
"
/technical_support/doc/standard
"
,
"
/technical_support/doc/guide
"
,
"
/technical_support/doc/api
"
,
"
/technical_support/doc/questions
"
,
];
nav
=
second
.
Child
.
map
((
item
,
index
)
=>
({
name
:
item
.
menu_name
,
name
:
item
.
menu_name
,
path
:
item
.
visit_url
,
path
:
item
.
visit_url
,
style
:
paths
.
indexOf
(
item
.
visit_url
),
}));
}));
break
;
break
;
}
}
...
@@ -52,6 +65,44 @@ export default {
...
@@ -52,6 +65,44 @@ export default {
break
;
break
;
}
}
}
}
Promise
.
all
(
nav
.
map
((
item
,
index
)
=>
{
return
this
.
$http
.
get
(
"
/apaas/support/document/menus
"
,
{
params
:
{
style
:
item
.
style
},
});
})
).
then
((
responses
)
=>
{
responses
.
forEach
(({
data
},
index
)
=>
{
let
list
=
data
.
data
||
[];
let
children
=
list
.
map
((
v
)
=>
({
name
:
v
.
title
,
path
:
nav
[
index
].
path
+
"
/
"
+
v
.
id
,
}));
if
(
children
.
length
===
0
)
{
this
.
$set
(
nav
[
index
],
"
disabled
"
,
true
);
}
else
{
if
(
activePath
===
""
)
{
activePath
=
children
[
0
].
path
;
}
this
.
$set
(
nav
[
index
],
"
path
"
,
children
[
0
].
path
);
if
(
children
.
length
>
1
)
{
this
.
$set
(
nav
[
index
],
"
children
"
,
children
);
this
.
$set
(
nav
[
index
],
"
open
"
,
true
);
}
}
});
this
.
navList
=
nav
;
if
(
activePath
&&
this
.
$route
.
params
.
id
===
undefined
)
{
this
.
$router
.
push
(
activePath
);
}
else
{
this
.
$message
.
error
(
"
您尚未创建任何文档
"
);
}
});
}
}
});
});
},
},
...
...
src/router/index.js
View file @
b361dc6b
...
@@ -147,17 +147,16 @@ export default new Router({
...
@@ -147,17 +147,16 @@ export default new Router({
{
{
path
:
"
/technical_support
"
,
path
:
"
/technical_support
"
,
name
:
"
technicalSupport
"
,
name
:
"
technicalSupport
"
,
redirect
:
"
/technical_support/doc
/
"
,
redirect
:
"
/technical_support/doc
"
,
component
:
()
=>
import
(
"
@/pages/technical-support/index
"
),
component
:
()
=>
import
(
"
@/pages/technical-support/index
"
),
children
:
[
children
:
[
{
{
path
:
"
/technical_support/doc
/
"
,
path
:
"
/technical_support/doc
"
,
name
:
"
technicalSupportDoc
"
,
name
:
"
technicalSupportDoc
"
,
redirect
:
"
/technical_support/doc/introductory
"
,
component
:
()
=>
import
(
"
@/pages/technical-support/doc/index
"
),
component
:
()
=>
import
(
"
@/pages/technical-support/doc/index
"
),
children
:
[
children
:
[
{
{
path
:
"
/technical_support/doc/:type
"
,
path
:
"
/technical_support/doc/:type
/:id
"
,
name
:
"
technicalSupportDocDetail
"
,
name
:
"
technicalSupportDocDetail
"
,
component
:
()
=>
component
:
()
=>
import
(
"
@/pages/technical-support/doc/detail
"
),
import
(
"
@/pages/technical-support/doc/detail
"
),
...
@@ -165,7 +164,7 @@ export default new Router({
...
@@ -165,7 +164,7 @@ export default new Router({
],
],
},
// 开发文档
},
// 开发文档
{
{
path
:
"
/technical_support/doc_manage
/
"
,
path
:
"
/technical_support/doc_manage
"
,
name
:
"
technicalSupportDoc
"
,
name
:
"
technicalSupportDoc
"
,
redirect
:
"
/technical_support/doc_manage/list
"
,
redirect
:
"
/technical_support/doc_manage/list
"
,
component
:
()
=>
import
(
"
@/pages/technical-support/doc-manage/index
"
),
component
:
()
=>
import
(
"
@/pages/technical-support/doc-manage/index
"
),
...
...
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