Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
cms-admin
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
cms-admin
Commits
71df6dae
提交
71df6dae
authored
5月 14, 2021
作者:
pengxiaohui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
文章图文创建更新审核接口
上级
b251d2eb
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
123 行增加
和
51 行删除
+123
-51
contentManage.js
src/api/contentManage.js
+25
-1
index.vue
src/pages/content-manage/article/index.vue
+49
-25
index.vue
src/pages/content-manage/image-text/index.vue
+49
-25
没有找到文件。
src/api/contentManage.js
浏览文件 @
71df6dae
...
...
@@ -80,6 +80,15 @@ export function createArticle(data) {
export
function
updateArticle
(
id
,
data
)
{
return
httpRequest
.
put
(
`/api/cms/admin/v1/article/
${
id
}
/update`
,
data
)
}
/**
* 审核文章
* @param {string} id
* @param {number} data.audit_status 2通过 3驳回
* @param {string} data.audit_remarks 审核说明
*/
export
function
auditArticle
(
id
,
data
)
{
return
httpRequest
.
post
(
`/api/cms/admin/v1/article/
${
id
}
/audit`
,
data
)
}
/**
* 发布文章
* @param {string} id
...
...
@@ -122,6 +131,12 @@ export function batchDeleteArticle(data) {
export
function
getImgTextList
(
params
)
{
return
httpRequest
.
get
(
'/api/cms/admin/v1/img-texts'
,
{
params
})
}
/**
* 创建文章
*/
export
function
createImgText
(
data
)
{
return
httpRequest
.
post
(
'/api/cms/admin/v1/img-text/create'
,
data
)
}
/**
* 更新图文
* @param {string} id
...
...
@@ -130,6 +145,15 @@ export function getImgTextList(params) {
export
function
updateImgText
(
id
,
data
)
{
return
httpRequest
.
put
(
`/api/cms/admin/v1/img-text/
${
id
}
/update`
,
data
)
}
/**
* 审核图文
* @param {string} id
* @param {number} data.audit_status 2通过 3驳回
* @param {string} data.audit_remarks 审核说明
*/
export
function
auditImgText
(
id
,
data
)
{
return
httpRequest
.
post
(
`/api/cms/admin/v1/img-text/
${
id
}
/audit`
,
data
)
}
/**
* 发布图文
* @param {string} id
...
...
@@ -144,7 +168,7 @@ export function publishImgText(id, data) {
* @param {string} project_id 项目id
*/
export
function
getProjectContentTypeList
(
type
,
id
)
{
return
httpRequest
.
get
(
`/api/cms/admin/v1/type/
${
type
}
/project
/
${
id
}
`
)
return
httpRequest
.
get
(
`/api/cms/admin/v1/type/
${
type
}
/project
`
,
{
project_id
:
id
}
)
}
/**
* 置顶图文
...
...
src/pages/content-manage/article/index.vue
浏览文件 @
71df6dae
...
...
@@ -50,7 +50,7 @@
>
</
template
>
</table-list>
<el-drawer
:visible
.
sync=
"drawerVisible"
size=
"1100px"
:destroy-on-close=
"true"
>
<el-drawer
:visible
.
sync=
"drawerVisible"
size=
"1100px"
:destroy-on-close=
"true"
ref=
"articleDrawer"
>
<
template
slot=
"title"
>
<h5>
{{
drawTitle
}}
...
...
@@ -64,7 +64,7 @@
>
</h5>
</
template
>
<drawer-form
:options=
"drawFormOptions"
>
<drawer-form
:options=
"drawFormOptions"
@
drawFormSubmit=
"HandleDrawFormSubmit"
@
drawFormClose=
"$refs.articleDrawer.closeDrawer()"
>
<
template
#
form-item-review
>
<el-form-item>
<el-button
type=
"primary"
@
click=
"dialogVisible = true"
size=
"small"
>
审核
</el-button>
...
...
@@ -72,7 +72,7 @@
</
template
>
</drawer-form>
<el-dialog
title=
"审核文章"
:visible
.
sync=
"dialogVisible"
width=
"460px"
append-to-body
:destroy-on-close=
"true"
>
<
review-form
@
dialogClose=
"dialogVisible = false"
@
reviewSubmit=
"handleReview
Submit"
/>
<
audit-form
@
dialogClose=
"dialogVisible = false"
@
auditSubmit=
"handleAudit
Submit"
/>
</el-dialog>
</el-drawer>
</div>
...
...
@@ -80,7 +80,8 @@
<
script
>
import
DrawerForm
from
'../components/DrawerForm.vue'
import
TableList
from
'@/components/TableList'
import
{
getArticleList
,
publishArticle
,
topArticle
,
recommendArticle
,
batchDeleteArticle
}
from
'@/api/contentManage'
import
AuditForm
from
'../components/AuditForm.vue'
import
{
getArticleList
,
createArticle
,
updateArticle
,
auditArticle
,
publishArticle
,
topArticle
,
recommendArticle
,
batchDeleteArticle
}
from
'@/api/contentManage'
export
default
{
data
()
{
return
{
...
...
@@ -162,7 +163,7 @@ export default {
}
}
},
components
:
{
TableList
,
DrawerForm
},
components
:
{
TableList
,
DrawerForm
,
AuditForm
},
methods
:
{
// 审核状态
auditStatusText
(
value
)
{
...
...
@@ -229,32 +230,55 @@ export default {
handleDetails
(
val
)
{
this
.
drawItem
=
val
this
.
drawFormOptions
.
type
=
'details'
this
.
drawFormOptions
.
details
=
{
project_id
:
'111'
,
type_id
:
'111'
,
title
:
'3232'
,
uri
:
'https://www.baidu.com'
,
summary
:
'内容摘要'
,
remarks
:
'注意事项'
,
web_img_uri
:
'https://zj-images.oss-cn-beijing.aliyuncs.com/00d78a3a999f4b10000f2cd422232221.JPG'
,
mobile_terminal_img_uri
:
'https://zj-images.oss-cn-beijing.aliyuncs.com/00d78a3a999f4b10000f2cd422232221.JPG'
,
enclosure_uri
:
'https://zj-images.oss-cn-beijing.aliyuncs.com/00d78a3a999f4b10000f2cd422232221.JPG'
,
video_uri
:
'https://zj-images.oss-cn-beijing.aliyuncs.com/00d78a3a999f4b10000f2cd422232221.JPG'
,
start_time
:
'2021-01-01 08:33:22'
,
hasEndDate
:
1
,
end_time
:
'2021-01-05 08:33:22'
,
is_publish
:
1
,
is_top
:
1
,
weight
:
10
}
this
.
drawFormOptions
.
details
=
val
this
.
drawerVisible
=
true
},
handleReviewSubmit
(
val
)
{
console
.
log
(
val
)
HandleDrawFormSubmit
(
val
)
{
Object
.
keys
(
val
).
forEach
(
key
=>
{
if
(
val
[
key
]
===
''
)
delete
val
[
key
]
})
if
(
this
.
drawFormOptions
.
type
===
'create'
)
{
this
.
fetchCreateArticle
(
val
)
}
else
{
this
.
fetchUpdateArticle
(
val
)
}
},
handleAuditSubmit
(
val
)
{
auditArticle
(
this
.
drawItem
.
id
,
val
).
then
(
res
=>
{
if
(
res
.
code
===
0
&&
res
.
data
&&
res
.
data
.
status
)
{
this
.
$message
.
success
(
'审核文章成功'
)
this
.
$refs
.
tableList
.
refetch
()
this
.
dialogVisible
=
false
}
else
{
this
.
$message
.
error
(
res
.
message
||
'审核文章失败'
)
}
})
},
handleTabClick
()
{
// true 强制刷新
this
.
$refs
.
tableList
.
refetch
(
true
)
},
fetchCreateArticle
(
val
)
{
createArticle
(
val
).
then
(
res
=>
{
if
(
res
.
code
===
0
&&
res
.
data
&&
res
.
data
.
id
)
{
this
.
$message
.
success
(
'新建文章成功'
)
this
.
$refs
.
tableList
.
refetch
()
this
.
$refs
.
articleDrawer
.
closeDrawer
()
}
else
{
this
.
$message
.
error
(
res
.
message
||
'新建广告失败'
)
}
})
},
fetchUpdateArticle
(
val
)
{
updateArticle
(
this
.
drawItem
.
id
,
val
).
then
(
res
=>
{
if
(
res
.
code
===
0
&&
res
.
data
&&
res
.
data
.
status
)
{
this
.
$message
.
success
(
'更改文章成功'
)
this
.
$refs
.
tableList
.
refetch
()
this
.
$refs
.
articleDrawer
.
closeDrawer
()
}
else
{
this
.
$message
.
error
(
res
.
message
||
'更改文章失败'
)
}
})
}
}
}
...
...
src/pages/content-manage/image-text/index.vue
浏览文件 @
71df6dae
...
...
@@ -37,7 +37,7 @@
>
</
template
>
</table-list>
<el-drawer
:visible
.
sync=
"drawerVisible"
size=
"1100px"
:destroy-on-close=
"true"
>
<el-drawer
:visible
.
sync=
"drawerVisible"
size=
"1100px"
:destroy-on-close=
"true"
ref=
"imgTextDrawer"
>
<
template
slot=
"title"
>
<h5>
{{
drawTitle
}}
...
...
@@ -51,7 +51,7 @@
>
</h5>
</
template
>
<drawer-form
:options=
"drawFormOptions"
>
<drawer-form
:options=
"drawFormOptions"
@
drawFormSubmit=
"HandleDrawFormSubmit"
@
drawFormClose=
"$refs.imgTextDrawer.closeDrawer()"
>
<
template
#
form-item-review
>
<el-form-item>
<el-button
type=
"primary"
@
click=
"dialogVisible = true"
size=
"small"
>
审核
</el-button>
...
...
@@ -59,7 +59,7 @@
</
template
>
</drawer-form>
<el-dialog
title=
"审核列表"
:visible
.
sync=
"dialogVisible"
width=
"460px"
append-to-body
:destroy-on-close=
"true"
>
<
review-form
@
dialogClose=
"dialogVisible = false"
@
reviewSubmit=
"handleReview
Submit"
/>
<
audit-form
@
dialogClose=
"dialogVisible = false"
@
auditSubmit=
"handleAudit
Submit"
/>
</el-dialog>
</el-drawer>
</div>
...
...
@@ -67,7 +67,8 @@
<
script
>
import
DrawerForm
from
'../components/DrawerForm.vue'
import
TableList
from
'@/components/TableList'
import
{
getImgTextList
,
publishImgText
,
batchDeleteImgText
}
from
'@/api/contentManage'
import
AuditForm
from
'../components/AuditForm.vue'
import
{
getImgTextList
,
createImgText
,
updateImgText
,
auditImgText
,
publishImgText
,
batchDeleteImgText
}
from
'@/api/contentManage'
export
default
{
data
()
{
return
{
...
...
@@ -148,7 +149,7 @@ export default {
}
}
},
components
:
{
TableList
,
DrawerForm
},
components
:
{
TableList
,
DrawerForm
,
AuditForm
},
methods
:
{
// 审核状态
auditStatusText
(
value
)
{
...
...
@@ -194,32 +195,55 @@ export default {
handleDetails
(
val
)
{
this
.
drawItem
=
val
this
.
drawFormOptions
.
type
=
'details'
this
.
drawFormOptions
.
details
=
{
project_id
:
'111'
,
type_id
:
'111'
,
title
:
'3232'
,
uri
:
'https://www.baidu.com'
,
summary
:
'内容摘要'
,
remarks
:
'注意事项'
,
web_img_uri
:
'https://zj-images.oss-cn-beijing.aliyuncs.com/00d78a3a999f4b10000f2cd422232221.JPG'
,
mobile_terminal_img_uri
:
'https://zj-images.oss-cn-beijing.aliyuncs.com/00d78a3a999f4b10000f2cd422232221.JPG'
,
enclosure_uri
:
'https://zj-images.oss-cn-beijing.aliyuncs.com/00d78a3a999f4b10000f2cd422232221.JPG'
,
video_uri
:
'https://zj-images.oss-cn-beijing.aliyuncs.com/00d78a3a999f4b10000f2cd422232221.JPG'
,
start_time
:
'2021-01-01 08:33:22'
,
hasEndDate
:
1
,
end_time
:
'2021-01-05 08:33:22'
,
is_publish
:
1
,
is_top
:
1
,
weight
:
10
}
this
.
drawFormOptions
.
details
=
val
this
.
drawerVisible
=
true
},
handleReviewSubmit
(
val
)
{
console
.
log
(
val
)
HandleDrawFormSubmit
(
val
)
{
Object
.
keys
(
val
).
forEach
(
key
=>
{
if
(
val
[
key
]
===
''
)
delete
val
[
key
]
})
if
(
this
.
drawFormOptions
.
type
===
'create'
)
{
this
.
fetchCreateArticle
(
val
)
}
else
{
this
.
fetchUpdateArticle
(
val
)
}
},
handleAuditSubmit
(
val
)
{
auditImgText
(
this
.
drawItem
.
id
,
val
).
then
(
res
=>
{
if
(
res
.
code
===
0
&&
res
.
data
&&
res
.
data
.
status
)
{
this
.
$message
.
success
(
'审核图文成功'
)
this
.
$refs
.
tableList
.
refetch
()
this
.
dialogVisible
=
false
}
else
{
this
.
$message
.
error
(
res
.
message
||
'审核图文失败'
)
}
})
},
handleTabClick
()
{
// true 强制刷新
this
.
$refs
.
tableList
.
refetch
(
true
)
},
fetchCreateArticle
(
val
)
{
createImgText
(
val
).
then
(
res
=>
{
if
(
res
.
code
===
0
&&
res
.
data
&&
res
.
data
.
id
)
{
this
.
$message
.
success
(
'新建图文成功'
)
this
.
$refs
.
tableList
.
refetch
()
this
.
$refs
.
imgTextDrawer
.
closeDrawer
()
}
else
{
this
.
$message
.
error
(
res
.
message
||
'新建图文失败'
)
}
})
},
fetchUpdateArticle
(
val
)
{
updateImgText
(
this
.
drawItem
.
id
,
val
).
then
(
res
=>
{
if
(
res
.
code
===
0
&&
res
.
data
&&
res
.
data
.
status
)
{
this
.
$message
.
success
(
'更改图文成功'
)
this
.
$refs
.
tableList
.
refetch
()
this
.
$refs
.
imgTextDrawer
.
closeDrawer
()
}
else
{
this
.
$message
.
error
(
res
.
message
||
'更改图文失败'
)
}
})
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论