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
d543b54a
Commit
d543b54a
authored
Feb 11, 2020
by
yanju
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'xue' into 'master'
项目修改页面 See merge request pigbigbig/beyond-clouds-front!49
parents
63786dcd
fb0da700
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
83 additions
and
22 deletions
+83
-22
pages/project/release/index.vue
+83
-22
No files found.
pages/project/release/index.vue
View file @
d543b54a
...
...
@@ -104,6 +104,7 @@
>
<select-card
selectType=
"2"
v-if=
"false"
:class-list=
"classList"
@
handleClass=
"(val) => this.childClass = val.tag"
placeholder=
"请选择项目子类型"
></select-card>
...
...
@@ -138,7 +139,7 @@
</p>
<div
class=
"footer__right"
>
<p>
已自动存为草稿
</p>
<button
class=
"preview"
>
预览
</button>
<button
class=
"preview"
>
预览
</button>
<button
class=
"submit"
@
click=
"postProject"
>
提交
</button>
</div>
</div>
...
...
@@ -155,6 +156,34 @@ import SelectCard from "../../../components/pc/select/selectCard";
import
config
from
'../../../action/config'
;
export
default
{
async
asyncData
({
$axios
,
query
})
{
if
(
query
.
hasOwnProperty
(
'id'
))
{
const
response
=
await
$axios
.
$get
(
config
.
api
.
get
.
Project
.
detail
+
query
.
id
);
console
.
log
(
response
);
return
{
response
:
response
,
}
}
},
mounted
()
{
if
(
this
.
$route
.
query
.
id
)
{
this
.
imgSrc
=
this
.
response
.
data
.
cover
,
this
.
language
=
this
.
response
.
data
.
devLang
,
this
.
$refs
.
language
.
$refs
.
select
.
value
=
this
.
response
.
data
.
devLang
,
this
.
docLink
=
this
.
response
.
data
.
docLink
,
this
.
homeLink
=
this
.
response
.
data
.
homeLink
,
this
.
content
=
this
.
response
.
data
.
devLang
,
//内容
this
.
license
=
this
.
response
.
data
.
license
,
this
.
$refs
.
license
.
$refs
.
select
.
value
=
this
.
response
.
data
.
license
,
this
.
projectDescription
=
this
.
response
.
data
.
projectDescription
,
this
.
name
=
this
.
response
.
data
.
projectName
;
this
.
projectClass
=
this
.
response
.
data
.
projectType
,
this
.
$refs
.
projectClass
.
$refs
.
select
.
value
=
this
.
response
.
data
.
projectType
,
this
.
system
=
this
.
response
.
data
.
runtimePlatform
,
this
.
$refs
.
system
.
$refs
.
select
.
value
=
this
.
response
.
data
.
runtimePlatform
,
this
.
addressLink
=
this
.
response
.
data
.
sourceLink
}
},
components
:
{
SelectCard
,
CardContainer
},
data
()
{
return
{
...
...
@@ -356,34 +385,66 @@ export default {
}
}
},
//get修改信息
dataGetProject
(
id
)
{
this
.
$axios
.
$get
(
config
.
api
.
get
.
Project
.
list
+
id
,).
then
((
response
)
=>
{
this
.
projectList
=
response
.
data
.
dataList
;
// get修改信息
/* dataGetProject() {
this.$axios.$get(config.api.get.Project.detail+136,).then((response)=>{
//this.projectList=response.data.dataList;
//console.log(response);
this.imgSrc=response.data.cover,
this.language=response.data.devLang,
this.$refs.language.$refs.select.value=response.data.devLang,
this.docLink=response.data.docLink,
this.homeLink=response.data.homeLink,
this.content=response.data.devLang,//内容
this.license=response.data.license,
this.$refs.license.$refs.select.value=response.data.license,
this.projectDescription=response.data.projectDescription,
//this.projectDetail=response.data.content,
this.name=response.data.projectName;
// console.log(this.name)
this.projectClass=response.data.projectClass,
this.$refs.projectClass.$refs.select.value=response.data.projectClass,
this.system=response.data.runtimePlatform,
this.$refs.system.$refs.select.value=response.data.runtimePlatform,
this.addressLink=response.data.sourceLink
})
},
},*/
// 发布项目
async
postProject
()
{
let
projectRes
;
if
(
this
.
checkProject
())
{
if
(
this
.
$route
.
query
.
id
)
{
// 修改执行这个接口
projectRes
=
await
this
.
$axios
.
$put
(
config
.
api
.
put
.
Project
.
revise
,
{
"author"
:
this
.
author
,
"categoryId"
:
1
,
//项目类型
"cover"
:
this
.
imgSrc
,
//封面
"devLang"
:
this
.
language
,
//开发语言
"docLink"
:
this
.
docLink
,
//开发链接
"homeLink"
:
this
.
homeLink
,
//主页链接
"license"
:
this
.
license
,
//协议
"projectDescription"
:
this
.
projectDescription
,
//项目描述
"projectDetail"
:
this
.
projectDetail
,
//详情
"projectName"
:
this
.
name
,
//项目名称
"projectType"
:
this
.
projectClass
,
//项目类型
"runtimePlatform"
:
this
.
system
,
//项目运行平台
"sourceLink"
:
this
.
addressLink
//项目源码地址
projectRes
=
await
this
.
$axios
.
$put
(
config
.
api
.
put
.
Project
.
revise
+
this
.
$route
.
query
.
id
,
{
author
:
this
.
author
,
categoryId
:
1
,
cover
:
this
.
imgSrc
,
devLang
:
this
.
language
,
docLink
:
this
.
docLink
,
homeLink
:
this
.
homeLink
,
content
:
this
.
content
,
//内容
//contentHtml: this.blogDetail,// 内容的html
license
:
this
.
license
,
projectDescription
:
this
.
projectDescription
,
contentHtml
:
this
.
projectDetail
,
projectName
:
this
.
name
,
projectType
:
this
.
projectClass
,
runtimePlatform
:
this
.
system
,
sourceLink
:
this
.
addressLink
})
.
then
((
response
)
=>
{
if
(
response
.
code
===
0
)
{
this
.
$message
({
message
:
"修改项目成功"
,
type
:
'success'
});
this
.
$router
.
push
(
'/personal-center/home/project'
)
}
else
{
this
.
$message
({
message
:
response
.
msg
,
type
:
'warning'
})
}
})
}
else
{
projectRes
=
await
this
.
$axios
.
$post
(
config
.
api
.
post
.
Project
.
release
,
{
...
...
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