Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BeMount
PersonalBlog
提交
1a113a92
P
PersonalBlog
项目概览
BeMount
/
PersonalBlog
通知
3
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PersonalBlog
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
1a113a92
编写于
4月 17, 2020
作者:
BeMount
💬
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(/style): 新增标签和更改样式
上级
7cf89898
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
95 addition
and
22 deletion
+95
-22
src/apis/articleManagement.js
src/apis/articleManagement.js
+27
-1
src/apis/markdownEditor.js
src/apis/markdownEditor.js
+19
-1
src/views/Home.vue
src/views/Home.vue
+1
-1
src/views/article-detail/articleDetail.vue
src/views/article-detail/articleDetail.vue
+4
-1
src/views/article-management/articleManagement.less
src/views/article-management/articleManagement.less
+3
-1
src/views/article-management/articleManagement.vue
src/views/article-management/articleManagement.vue
+22
-7
src/views/markdown-editor/markdown-editor.vue
src/views/markdown-editor/markdown-editor.vue
+19
-10
未找到文件。
src/apis/articleManagement.js
浏览文件 @
1a113a92
...
...
@@ -3,10 +3,36 @@ export const getAllArticleInfo = vm =>{
url
:
'
/article/getAllArticleInfo
'
,
method
:
'
get
'
}).
then
(
res
=>
{
res
.
data
.
articleInfo
.
forEach
(
element
=>
{
let
color
=
[
'
error
'
,
'
primary
'
,
'
success
'
,
'
yellow
'
,
'
orange
'
];
res
.
data
.
articleInfo
.
forEach
((
element
,
index
)
=>
{
vm
.
articles
.
push
(
element
);
// console.log(element);
if
(
element
.
tag
){
vm
.
tags
.
push
({
tagName
:
element
.
tag
,
tagColor
:
color
[
index
%
5
]});
}
});
// console.log(vm.tags);
}).
catch
(
error
=>
{
console
.
log
(
"
error
"
,
error
);
})
}
export
const
updateArticleList
=
(
vm
,
tag
)
=>
{
vm
.
$axios
.
request
({
url
:
'
/article/updateArticleList
'
,
method
:
'
get
'
,
params
:{
tag
}
}).
then
(
res
=>
{
vm
.
articles
.
splice
(
0
);
console
.
log
(
vm
.
articles
);
res
.
data
.
articleInfo
.
forEach
(
element
=>
{
vm
.
articles
.
push
(
element
);
})
// console.log(res);
}).
catch
(
error
=>
{
console
.
log
(
'
error
'
,
error
);
})
}
\ No newline at end of file
src/apis/markdownEditor.js
浏览文件 @
1a113a92
...
...
@@ -26,4 +26,22 @@ export const submitContent = vm =>{
}).
catch
(
error
=>
{
console
.
log
(
'
error
'
,
error
);
})
}
\ No newline at end of file
}
export
const
getAllTagInfo
=
vm
=>
{
vm
.
$axios
.
request
({
url
:
'
/article/getAllArticleInfo
'
,
method
:
'
get
'
}).
then
(
res
=>
{
res
.
data
.
articleInfo
.
forEach
((
element
,
index
)
=>
{
if
(
element
.
tag
){
vm
.
tags
.
push
(
element
.
tag
);
}
});
}).
catch
(
error
=>
{
console
.
log
(
"
error
"
,
error
);
})
}
src/views/Home.vue
浏览文件 @
1a113a92
...
...
@@ -177,7 +177,7 @@ export default {
}
.content{
height: calc(~"100vh - 50px");
min-
height: calc(~"100vh - 50px");
width: calc( ~"100wh-200px");
background-color: aliceblue;
}
...
...
src/views/article-detail/articleDetail.vue
浏览文件 @
1a113a92
<
template
>
<div
class=
"editor"
>
<div>
<span><Icon
type=
"md-arrow-back"
size=
'26'
style=
"margin-right:5px;color:#f40"
@
click=
"goBack"
/>
返回
</span>
<span
style=
"font-size:26px"
>
<!--
<Icon
type=
"md-arrow-round-back"
/>
-->
<Icon
type=
"ios-arrow-dropleft"
size=
'26'
style=
"margin-right:5px;color:rgb(73, 167, 231)"
@
click=
"goBack"
/>
返回
</span>
</div>
<Row
class=
"margin-top-20"
>
<Col
span =
24
>
...
...
src/views/article-management/articleManagement.less
浏览文件 @
1a113a92
.article-management{
margin:0 auto;
width:90%;
// min-height:120vh;
&-style{
background-color:rgb(241, 241, 241);
margin-
top:20
px;
margin-
bottom:15
px;
&-title{
height:20px;
...
...
@@ -17,6 +18,7 @@
}
&-detail{
margin-top:20px;
margin-left:90%;
}
}
...
...
src/views/article-management/articleManagement.vue
浏览文件 @
1a113a92
<
template
>
<div
class=
"article-management"
>
<div
v-for=
"(item, index) in articles"
:key=
"index"
>
<!-- 分类: -->
<Tag
size=
'large'
color=
"orange"
@
click.native =
"updateArticleList()"
>
全部
</Tag>
<span
v-for=
"(item, index) in tags"
:key=
"index + '-label'"
style=
"margin-top:10px;margin-left:5px;"
>
<Tag
:color=
'item.tagColor'
size=
'large'
@
click.native=
"updateArticleList(item.tagName)"
>
{{
item
.
tagName
}}
</Tag>
</span>
<div
v-for=
"(item, index) in articles"
:key=
"index"
>
<div
class =
"article-management-style"
>
<div
class=
"article-management-style-title"
>
<span><Icon
type=
"ios-leaf-outline"
size=
"30px"
/>
{{
item
.
title
}}
</span>
...
...
@@ -9,15 +16,18 @@
<div
class=
"article-management-style-description"
>
<span>
{{
item
.
description
}}
</span>
</div>
<div
class=
"article-management-style-detail"
>
<span>
<div
class=
"article-management-style-detail"
>
<span
>
<Icon
type=
"ios-folder-outline"
style=
"margin-right:5px"
size=
"26px"
/>
<a
href=
"javascript:void(0)"
style=
"margin-bottom:10px"
@
click=
"findArticleDetail(item.content)"
>
查看全文
</a>
<a
href=
"javascript:void(0)"
@
click=
"findArticleDetail(item.content)"
>
查看全文
</a>
</span>
</div>
</div>
</div>
<BackTop
:height=
'50'
></BackTop>
</div>
</
template
>
...
...
@@ -28,7 +38,8 @@ import * as articleManagementRequest from '@/apis/articleManagement.js';
export
default
{
data
(){
return
{
articles
:[]
articles
:[],
tags
:[]
}
},
created
(){
...
...
@@ -37,7 +48,11 @@ export default {
methods
:{
findArticleDetail
(
content
){
this
.
$router
.
push
({
name
:
'
articleDetailIndex
'
,
params
:{
content
:
content
}});
console
.
log
(
content
);
// console.log(content);
},
updateArticleList
(
tag
){
// console.log(tag);
articleManagementRequest
.
updateArticleList
(
this
,
tag
);
}
}
}
...
...
src/views/markdown-editor/markdown-editor.vue
浏览文件 @
1a113a92
...
...
@@ -21,21 +21,15 @@
<Input
v-model=
"articleForm.articleDescription"
maxlength=
"200"
show-word-limit
type=
"textarea"
placeholder=
"Enter something..."
style=
"width: 300px"
></Input>
</FormItem>
<FormItem
label =
"文章分类"
prop=
"articleCollection"
>
<RadioGroup
v-model=
"articleCollection"
>
<Radio
label=
"vue"
>
<span>
Vue
</span>
</Radio>
<Radio
label=
"js"
>
<span>
JS
</span>
</Radio>
<Radio
label=
"css"
>
<span>
CSS
</span>
<RadioGroup
v-model=
"articleCollection"
v-for =
"(item, index) in tags"
:key=
"index"
>
<Radio
:label=
"item"
>
<span>
{{
item
}}
</span>
</Radio>
</RadioGroup>
</FormItem>
<FormItem
label=
"新增标签"
>
<!--
<span>
新增标签
</span>
-->
<Input
v-model=
"newTag"
size=
'small'
style=
"width:
200px
"
></Input>
<Input
v-model=
"newTag"
size=
'small'
style=
"width:
150px"
@
on-blur=
"clearRadio
"
></Input>
</FormItem>
</Form>
</Col>
...
...
@@ -48,6 +42,7 @@
<
script
>
import
*
as
markdownEditorRequest
from
'
@/apis/markdownEditor.js
'
;
// import {getAllArticleInfo} from '@/apis/articleManagement.js';
export
default
{
name
:
'
markdown-editor
'
,
...
...
@@ -59,6 +54,7 @@ export default {
articleDescription
:
''
,
// articleCollection:''
},
tags
:[],
newTag
:
''
,
articleCollection
:
''
,
articleRules
:{
...
...
@@ -79,6 +75,15 @@ export default {
getHTMLCode
(
f
,
s
){
console
.
log
(
f
,
s
);
},
// 清空radiogroup
clearRadio
(){
if
(
this
.
newTag
){
this
.
articleCollection
=
''
;
}
},
// 发布文章
submitContent
(){
if
(
!
this
.
markdownContent
){
...
...
@@ -114,6 +119,10 @@ export default {
}
})
}
},
created
(){
// 获取所有taginfo
markdownEditorRequest
.
getAllTagInfo
(
this
);
}
};
</
script
>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录