Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
beyond-clouds-front
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
beyond-clouds-front
Commits
5dabf285
Commit
5dabf285
authored
Feb 10, 2020
by
yanju
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of coding.yundingshuyuan.com:pigbigbig/beyond-clouds-front
parents
3872a944
0ba564f5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
111 additions
and
44 deletions
+111
-44
components/common/cropper/src/cropper.vue
+5
-1
components/pc/select/selectCard.vue
+13
-15
pages/blog/release/index.vue
+93
-28
pages/project/release/index.vue
+0
-0
No files found.
components/common/cropper/src/cropper.vue
View file @
5dabf285
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
:canMove=
"option.canMove"
:canMove=
"option.canMove"
:canMoveBox=
"option.canMoveBox"
:canMoveBox=
"option.canMoveBox"
:original=
"option.original"
:original=
"option.original"
:autoCrop=
"
option.
autoCrop"
:autoCrop=
"autoCrop"
:fixed=
"option.fixed"
:fixed=
"option.fixed"
:fixedNumber=
"[cropperW, cropperH]"
:fixedNumber=
"[cropperW, cropperH]"
:centerBox=
"option.centerBox"
:centerBox=
"option.centerBox"
...
@@ -83,6 +83,10 @@
...
@@ -83,6 +83,10 @@
type
:
Number
,
type
:
Number
,
default
:
1
,
default
:
1
,
},
},
autoCrop
:{
type
:
Boolean
,
default
:
1
,
},
addImg
:
Function
addImg
:
Function
},
},
computed
:{
computed
:{
...
...
components/pc/select/selectCard.vue
View file @
5dabf285
<
template
>
<
template
>
<div>
<div>
<div
class=
"select-container"
v-if=
"selectType === '1'"
style=
"
height: 100
px;"
>
<div
class=
"select-container"
v-if=
"selectType === '1'"
style=
"
min-height: 100px;width: 354
px;"
>
<div
class=
"select-container__input-box"
>
<div
class=
"select-container__input-box"
>
<div>
<div>
<!--@focus="handleShow"-->
<!--@focus="handleShow"-->
...
@@ -9,8 +9,8 @@
...
@@ -9,8 +9,8 @@
@
blur=
"isShow=false"
@
blur=
"isShow=false"
@
keyup
.
enter=
"handleSearch"
@
keyup
.
enter=
"handleSearch"
v-model=
"value.tag"
v-model=
"value.tag"
ref=
"tag"
>
>
<span>
{{
list
.
length
?
list
.
length
:
0
}}
</span>
<transition
name=
"fade"
>
<transition
name=
"fade"
>
<div
class=
"label-list__wrap"
v-if=
"isShow || isShow2"
@
mouseleave=
"isShow2=false"
>
<div
class=
"label-list__wrap"
v-if=
"isShow || isShow2"
@
mouseleave=
"isShow2=false"
>
<div
class=
"label-list"
>
<div
class=
"label-list"
>
...
@@ -41,9 +41,9 @@
...
@@ -41,9 +41,9 @@
>
</label-wrap>
>
</label-wrap>
</div>
</div>
</div>
</div>
<div
class=
"select-container"
v-if=
"selectType === '2'"
style=
"width: 196px"
>
<div
class=
"select-container"
v-if=
"selectType === '2'"
style=
"width: 196px"
@
mouseleave=
"isShow=false"
>
<div
class=
"input-box"
@
click=
"handleShow"
>
<div
class=
"input-box"
@
click=
"handleShow"
>
<input
type=
"text"
v-model=
"value.tag"
disabled=
"true"
:placeholder=
"placeholder
"
>
<input
type=
"text"
v-model=
"value.tag"
:placeholder=
"placeholder"
ref=
"select
"
>
<div
class=
"icon-box"
>
<div
class=
"icon-box"
>
<yun-icon
name=
"down_arrow"
size=
"10px"
color=
"#999"
></yun-icon>
<yun-icon
name=
"down_arrow"
size=
"10px"
color=
"#999"
></yun-icon>
</div>
</div>
...
@@ -82,7 +82,6 @@ export default {
...
@@ -82,7 +82,6 @@ export default {
tag
:
'web'
tag
:
'web'
}],
}],
searchList
:
[],
searchList
:
[],
arr
:
[],
result
:
[],
result
:
[],
value
:
{
value
:
{
tagId
:
''
,
tagId
:
''
,
...
@@ -124,6 +123,7 @@ export default {
...
@@ -124,6 +123,7 @@ export default {
// 删除选中的标签
// 删除选中的标签
handleDelete
(
index
){
handleDelete
(
index
){
this
.
result
.
splice
(
index
,
1
);
this
.
result
.
splice
(
index
,
1
);
this
.
$emit
(
'handleTag'
,
this
.
result
);
},
},
// 回车后,进行搜索
// 回车后,进行搜索
async
handleSearch
(){
async
handleSearch
(){
...
@@ -154,9 +154,9 @@ export default {
...
@@ -154,9 +154,9 @@ export default {
},
},
// 点击 标签 自动选择
// 点击 标签 自动选择
handleTags
(){
handleTags
(){
this
.
arr
.
push
(
this
.
value
);
this
.
result
.
push
(
this
.
value
);
let
map
=
new
Map
();
let
map
=
new
Map
();
for
(
let
item
of
this
.
arr
)
{
for
(
let
item
of
this
.
result
)
{
console
.
log
(
item
);
console
.
log
(
item
);
if
(
!
map
.
has
(
item
.
tag
))
{
if
(
!
map
.
has
(
item
.
tag
))
{
map
.
set
(
item
.
tag
,
item
)
map
.
set
(
item
.
tag
,
item
)
...
@@ -182,8 +182,13 @@ export default {
...
@@ -182,8 +182,13 @@ export default {
tagName
:
value
,
tagName
:
value
,
tagType
:
0
tagType
:
0
}).
then
(
res
=>
{
}).
then
(
res
=>
{
console
.
log
(
res
);
if
(
res
.
code
===
0
)
{
if
(
res
.
code
===
0
)
{
let
obj
=
{
tagId
:
res
.
data
.
tagId
,
tag
:
res
.
data
.
tagName
};
this
.
result
.
push
(
obj
);
this
.
$popupbox
.
close
();
this
.
$message
({
this
.
$message
({
type
:
'success'
,
type
:
'success'
,
message
:
'标签创建成功'
message
:
'标签创建成功'
...
@@ -221,13 +226,6 @@ export default {
...
@@ -221,13 +226,6 @@ export default {
background-color
:
#F4F8FA
;
background-color
:
#F4F8FA
;
@include
border-radius(4*$length);
@include
border-radius(4*$length);
}
}
>
span
{
position
:
absolute
;
right
:
16
*$
length
;
top
:
14
*$
length
;
@extend
%cursorPointer;
@include
fontStyle(14,19,500,#666,left);
}
.label-list
{
.label-list
{
position
:
absolute
;
position
:
absolute
;
top
:
56
*$
length
;
top
:
56
*$
length
;
...
...
pages/blog/release/index.vue
View file @
5dabf285
...
@@ -64,7 +64,7 @@
...
@@ -64,7 +64,7 @@
<span>
*
</span>
<span>
*
</span>
<select-card
selectType=
"1"
@
handleTag=
"handleTagList"
></select-card>
<select-card
selectType=
"1"
@
handleTag=
"handleTagList"
></select-card>
</div>
</div>
<select-card
selectType=
"2"
:class-list=
"classList"
@
handleClass=
"handleQuestionClass"
placeholder=
"请选择问题分类"
></select-card>
<select-card
selectType=
"2"
:class-list=
"classList
.title
"
@
handleClass=
"handleQuestionClass"
placeholder=
"请选择问题分类"
></select-card>
</div>
</div>
<div
class=
"choose-container"
>
<div
class=
"choose-container"
>
<div
class=
"input-box__wrap"
>
<div
class=
"input-box__wrap"
>
...
@@ -103,17 +103,18 @@
...
@@ -103,17 +103,18 @@
</div>
</div>
<div
class=
"blog-release__footer"
>
<div
class=
"blog-release__footer"
>
<p
class=
"footer__left"
>
上传封面
<p
class=
"footer__left"
>
上传封面
<img
:src=
"
imgSrc
"
alt=
""
>
<img
:src=
"
this.userCover
"
alt=
""
>
<input
type=
"file"
@
change=
"
changeToUploadCov
er(e)"
placeholder=
"上传项目封面图"
accept=
"image/png,image/gif,image/jpeg"
>
<input
type=
"file"
@
change=
"
(e)=>openCropp
er(e)"
placeholder=
"上传项目封面图"
accept=
"image/png,image/gif,image/jpeg"
>
</p>
</p>
<div
class=
"footer__right"
>
<div
class=
"footer__right"
>
<p>
已自动存为草稿
</p>
<p>
已自动存为草稿
</p>
<button
class=
"preview"
@
click=
"readScreen"
>
预览
</button>
<button
class=
"preview"
@
click=
"readScreen"
>
预览
</button>
<button
class=
"submit"
v-on:click=
"
postBlog
"
>
提交
</button>
<button
class=
"submit"
v-on:click=
"
dataPost
"
>
提交
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</card-container>
</card-container>
<yun-cropper
:type=
"1"
:autoCrop=
"false"
:file=
"addFile"
v-on:listenCropperPic=
"getCroppedPic"
></yun-cropper>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
...
@@ -170,13 +171,17 @@
...
@@ -170,13 +171,17 @@
way
:
''
,
way
:
''
,
comment
:
''
,
comment
:
''
,
reprint
:
''
,
reprint
:
''
,
imgSrc
:
''
,
lastSaveTime
:
new
Date
(),
lastSaveTime
:
new
Date
(),
blogClass
:
''
,
blogClass
:
''
,
addFile
:{},
userCover
:
''
,
cover
:
''
,
originLink
:
''
,
originLink
:
''
,
blogAbstract
:
''
,
//
blogAbstract:'',
questionClass
:
''
,
questionClass
:
''
,
classList
:
[
'web'
,
'java'
,
'javascript'
]
img
:
""
,
//classList: [{id:1,title:"web"}, {id:2,title:"java"},{id:3,title:"javascript"}]
classList
:[
"web"
,
"java"
,
"javascript"
]
}
}
},
},
methods
:
{
methods
:
{
...
@@ -185,15 +190,15 @@
...
@@ -185,15 +190,15 @@
},
},
// 获得下拉框得内容
// 获得下拉框得内容
handleBlogClass
(
value
)
{
handleBlogClass
(
value
)
{
this
.
blogClass
=
value
;
this
.
blogClass
=
value
.
tag
;
if
(
value
==
"web"
){
if
(
value
.
tag
=
==
"web"
){
this
.
blogClass
=
1
this
.
blogClass
=
1
;
}
else
if
(
value
==
"java"
){
}
else
if
(
value
.
tag
=
==
"java"
){
this
.
blogClass
=
2
this
.
blogClass
=
2
}
else
if
(
value
==
"javascript"
){
}
else
if
(
value
.
tag
=
==
"javascript"
){
this
.
blogClass
=
3
this
.
blogClass
=
3
}
}
console
.
log
(
this
.
blogClass
)
;
console
.
log
(
this
.
blogClass
)
},
},
handleQuestionClass
(
value
)
{
handleQuestionClass
(
value
)
{
this
.
class
=
value
;
this
.
class
=
value
;
...
@@ -204,14 +209,63 @@
...
@@ -204,14 +209,63 @@
console
.
log
(
tagList
);
console
.
log
(
tagList
);
},
},
postBlog
(){
//this.handleTag();
openCropper
(
e
){
this
.
$axios
.
$post
(
config
.
api
.
post
.
Blog
.
release
,{
this
.
addFile
=
e
.
target
.
files
[
0
];
},
getCroppedPic
(
pic
){
if
(
pic
){
this
.
userCover
=
pic
;
console
.
log
(
this
.
cover
)
//this.dataPostSaveUserInfo(1);
}
},
dataPost
()
{
this
.
cover
=
this
.
userCover
;
if
(
this
.
originLink
.
slice
(
0
,
12
)
===
"https://www."
||
this
.
originLink
.
length
===
0
)
{
if
(
this
.
originLink
.
length
===
0
)
{
this
.
originLink
=
"null"
;
}
if
(
this
.
cover
===
''
)
{
this
.
dataPostSaveUserInfo
(
2
)
}
else
{
this
.
dataPostSaveUserInfo
(
1
)
}
}
else
{
this
.
$message
({
message
:
"请输入开头为https://www.的有效网址"
,
type
:
'warning'
})
}
},
dataPostSaveUserInfo
(
type
){
let
userInfo1
=
{
allowComment
:
this
.
allowComment
,
//评论权限
allowComment
:
this
.
allowComment
,
//评论权限
allowForward
:
this
.
allowForward
,
//转载权限
allowForward
:
this
.
allowForward
,
//转载权限
blogAbstract
:
this
.
blogAbstract
,
blogAbstract
:
this
.
blogAbstract
,
//摘要
content
:
this
.
content
,
content
:
this
.
content
,
//内容
blogTitle
:
this
.
blogTitle
,
blogTitle
:
this
.
blogTitle
,
//标题
categoryId
:
this
.
blogClass
,
//文章类型
cover
:
this
.
cover
,
//封面图
originLink
:
this
.
originLink
,
tagIds
:
[
"Java"
//标签id
],
topicIds
:
[
"Java"
//话题id
],
viewPrivileges
:
this
.
way
//1公开,0私有
};
let
userInfo2
=
{
allowComment
:
this
.
allowComment
,
//评论权限
allowForward
:
this
.
allowForward
,
//转载权限
blogAbstract
:
this
.
blogAbstract
,
//摘要
content
:
this
.
content
,
//内容
blogTitle
:
this
.
blogTitle
,
//标题
categoryId
:
this
.
blogClass
,
//文章类型
categoryId
:
this
.
blogClass
,
//文章类型
cover
:
"string"
,
//封面图
cover
:
"string"
,
//封面图
originLink
:
this
.
originLink
,
originLink
:
this
.
originLink
,
...
@@ -222,23 +276,33 @@
...
@@ -222,23 +276,33 @@
"Java"
//话题id
"Java"
//话题id
],
],
viewPrivileges
:
this
.
way
//1公开,0私有
viewPrivileges
:
this
.
way
//1公开,0私有
}).
then
((
response
)
=>
{
};
//处理response
this
.
$axios
.
$post
(
config
.
api
.
post
.
Blog
.
release
,
type
===
1
?
userInfo1
:
userInfo2
).
then
((
response
)
=>
{
if
(
response
.
code
===
0
)
{
if
(
response
.
code
===
0
){
let
user
=
{
userAvatar
:
this
.
userAvatar
}
this
.
$store
.
commit
(
'userProfile/setUser'
,
user
);
this
.
$message
({
this
.
$message
({
type
:
'success'
,
message
:
response
.
msg
,
message
:
'提交成功!
'
type
:
'success
'
})
;
})
}
else
{
}
else
{
this
.
$message
({
this
.
$message
({
message
:
"提交失败 "
+
response
.
data
.
errMsg
,
message
:
response
.
data
.
errMsg
,
type
:
'
error
'
type
:
'
warning
'
})
})
}
}
})
})
},
},
imgAdd
(
pos
,
file
)
{
imgAdd
(
pos
,
file
)
{
//添加图片,pos为位置
//添加图片,pos为位置
// 第一步.将图片上传到服务器.
// 第一步.将图片上传到服务器.
...
@@ -257,7 +321,8 @@
...
@@ -257,7 +321,8 @@
* 2. 通过$refs获取: html声明ref : `<mavon-editor ref=md ></mavon-editor>,`$vm`为 `this.$refs.md`
* 2. 通过$refs获取: html声明ref : `<mavon-editor ref=md ></mavon-editor>,`$vm`为 `this.$refs.md`
*
*
*/
*/
$vm
.
$img2Url
(
pos
,
url
);
//$vm.$img2Url(pos, url);
console
.
log
(
url
)
})
})
},
},
imgDel
(
pos
,
url
)
{
//删除图片,并不是修改就会触发,仅支持工具栏操作
imgDel
(
pos
,
url
)
{
//删除图片,并不是修改就会触发,仅支持工具栏操作
...
...
pages/project/release/index.vue
View file @
5dabf285
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