Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
court-inner
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
莫晓莉
court-inner
Commits
6501eb38
Commit
6501eb38
authored
Oct 15, 2021
by
莫晓莉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新闻附件上传提交审核成功
parent
f877712e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
116 additions
and
70 deletions
+116
-70
src/api/manage/manage.js
+10
-0
src/views/manage/index.vue
+106
-70
No files found.
src/api/manage/manage.js
View file @
6501eb38
...
...
@@ -159,3 +159,13 @@ export const findNews = (data) => {
})
}
//删除附件
export
const
delFile
=
(
data
)
=>
{
return
request
({
url
:
'websiteCluster/website/delFile'
,
method
:
'POST'
,
data
})
}
src/views/manage/index.vue
View file @
6501eb38
...
...
@@ -89,17 +89,17 @@
<el-table-column
prop=
"clickCount"
label=
"点击次数"
>
width=
"50"
>
</el-table-column>
<el-table-column
prop=
"commentCount"
label=
"评论(条)"
>
width=
"50"
>
</el-table-column>
<el-table-column
prop=
"adviceCount"
label=
"建议(条)"
>
width=
"50"
>
</el-table-column>
<el-table-column
prop=
"publish"
...
...
@@ -124,7 +124,7 @@
</el-table-column>
<el-table-column
label=
"操作"
width=
"120"
>
>
<
template
slot-scope=
"scope"
>
<el-button
@
click=
"logDetailEvent(scope.row.newsId)"
...
...
@@ -337,9 +337,9 @@
<el-form-item
align=
"center"
>
<!-- // 然后是publish ,点击发布的话是1,提交审核是4,保存是5 -->
<
el-button
type=
"primary"
@
click=
"createNewsEvent('1')"
>
发布
</el-button
>
<el-button
type=
"primary"
@
click=
"createNewsEvent('4')"
>
提交审核
</el-button>
<el-button
type=
"primary"
>
建议
</el-button>
<
!-- <el-button type="primary" @click="createNewsEvent('1')">发布</el-button> --
>
<
!-- <
el-button type="primary" @click="createNewsEvent('4')">提交审核</el-button>
<el-button type="primary" >建议</el-button>
-->
<el-button
type=
"primary"
@
click=
"createNewsEvent('5')"
>
保存
</el-button>
<el-button>
取消
</el-button>
</el-form-item>
...
...
@@ -701,7 +701,6 @@
<el-form-item
label=
"格式"
>
<el-select
v-model=
"newsFormEdit.geshi"
placeholder=
"请选择格式"
>
<el-option
label=
"普通格式"
value=
"普通格式"
></el-option>
<!--<el-option label="区域二" value="beijing"></el-option>-->
</el-select>
<span
class=
"ml-15"
>
提示:在word文档中编辑好后,复制黏贴到编辑框
</span>
</el-form-item>
...
...
@@ -766,12 +765,7 @@
</el-button>
</el-upload>
</el-form-item>
<el-form-item
label=
"今日头条"
>
<!-- <el-checkbox-group v-model="newsForm.isTop">
<el-checkbox label="置于头条" name="isTop"></el-checkbox>
</el-checkbox-group> -->
<el-form-item
label=
"今日头条"
>
<el-checkbox
v-model=
"newsFormEdit.isTop"
true-label=
"1"
...
...
@@ -811,11 +805,12 @@
<vue-ueditor-wrap
v-model=
"newsFormEdit.content"
:config=
"myConfig"
></vue-ueditor-wrap>
</div>
<el-form-item
align=
"center"
>
<el-button
type=
"primary"
@
click=
"updateNews('1')"
>
修改
</el-button>
<el-button
type=
"primary"
>
提交审核
</el-button>
<!-- //创建未提交审核即保存为5,提交审核为4,审核不通过为3,通过已发布为1 -->
<!-- <el-button type="primary" @click="updateNews('1')">修改</el-button> -->
<el-button
type=
"primary"
@
click=
"updateNews('4')"
>
提交审核
</el-button>
<el-button
type=
"primary"
>
建议
</el-button>
<el-button
type=
"primary"
>
保存
</el-button>
<el-button
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"updateNews('5')"
>
保存
</el-button>
<el-button
@
click=
"handleCloseEdit"
>
关闭
</el-button>
</el-form-item>
</el-form>
</el-dialog>
...
...
@@ -921,8 +916,6 @@
<!-- <el-checkbox-group v-model="newsForm.isTop">
<el-checkbox label="置于头条" name="isTop"></el-checkbox>
</el-checkbox-group> -->
<el-checkbox
disabled
v-model=
"newsFormEdit.isTop"
...
...
@@ -963,7 +956,7 @@
<vue-ueditor-wrap
v-model=
"newsFormEdit.content"
:config=
"myConfig"
vue-ueditor-wrap
></vue-ueditor-wrap>
</div>
<el-form-item
align=
"center"
>
<!-- //创建未提交审核为5,提交审核为4,审核不通过为3,通过已发布为1 -->
<!-- //创建未提交审核
保存
为5,提交审核为4,审核不通过为3,通过已发布为1 -->
<el-button
type=
"primary"
@
click=
"updateNews('1')"
>
通过
</el-button>
<el-button
@
click=
"updateNews('3')"
>
不通过
</el-button>
</el-form-item>
...
...
@@ -1031,12 +1024,11 @@
:visible
.
sync=
"logVisible"
width=
"40%"
:before-close=
"handleCloseLog"
>
<div>
日志列表
<div
style=
"height:50vh;overflow-y:auto;white-space:pre-line;"
v-html=
"logDetailData"
>
</div>
<span
slot=
"footer"
class=
"dialog-footer"
>
<
el-button
@
click=
"handleCloseLeave"
>
取 消
</el-button
>
<el-button
type=
"primary"
>
确 定
</el-button>
<
!-- <el-button @click="handleCloseLog">取 消</el-button> --
>
<el-button
type=
"primary"
@
click=
"handleCloseLog"
>
关闭
</el-button>
</span>
</el-dialog>
...
...
@@ -1064,6 +1056,7 @@ import {
adviceDetail
,
//建议详情
logDetail
,
//日志详情
findNews
,
//搜索信息
delFile
,
//删除附件
}
from
"@/api/manage/manage"
;
import
{
removeToken
}
from
"@/utils/auth"
;
import
{
getInfo
,
logout
}
from
"@/api/login"
;
...
...
@@ -1078,6 +1071,7 @@ export default {
},
data
()
{
return
{
delFileList
:[],
//删除附件
userInfo
:{},
//用户信息
// selectData:'',//所属部门
logVisible
:
false
,
//日志弹窗
...
...
@@ -1540,28 +1534,29 @@ export default {
//上传附件--编辑
uploadSuccessEdit
(
file
,
list
)
{
this
.
fileListEdit
=
list
;
console
.
log
(
'fileList----'
,
this
.
fileListEdit
);
// this.addFileListEdit=list;
console
.
log
(
'编辑新增----'
,
this
.
list
);
},
handleRemoveEdit
(
file
,
list
){
console
.
log
(
'fileListHandleRemove----'
,
list
);
this
.
fileListEdit
=
list
;
// for (var j = 0; j
<
this
.
fileListEdit
.
length
;
j
++
)
{
// // 含 status: ready 表示该附件为新增
附件
// if (this.fileListEdit[j].status == 'ready'
) {
// if (this.fileListEdit[j].uid == file.uid) {
// this.fileListEdit.splice(j, 1
)
// console.log('-=-==-==-=-=-==-=--删除新增附件', this.fileList)
// break
// }
// } else if (this.fileListEdit[j].status == 'success'
) {
// if (this.fileListEdit[j].id == file.id) {
// this.fileListEdit.splice(j, 1
)
// console.log('-=-==-==-=-=-==-=--删除原附件', this.fileListEdit
)
// this.delFileList.push(file.id)
// break
//
}
//
}
// }
console
.
log
(
'fileListHandleRemove----'
,
list
);
for
(
var
j
=
0
;
j
<
this
.
fileListEdit
.
length
;
j
++
)
{
// 含 status: ready 表示该附件为新增附件
if
(
this
.
fileListEdit
[
j
].
status
==
'ready'
)
{
//新上传的
附件
if
(
this
.
fileListEdit
[
j
].
uid
==
file
.
uid
)
{
this
.
fileListEdit
.
splice
(
j
,
1
)
console
.
log
(
'-=-==-==-=-=-==-=--删除新增附件'
,
this
.
fileListEdit
)
break
}
}
else
if
(
this
.
fileListEdit
[
j
].
status
==
'success'
)
{
//原来的附件
if
(
this
.
fileListEdit
[
j
].
id
==
file
.
id
)
{
this
.
fileListEdit
.
splice
(
j
,
1
)
console
.
log
(
'-=-==-==-=-=-==-=--删除原附件'
,
this
.
fileListEdit
)
this
.
delFileList
.
push
(
file
.
id
)
break
}
}
}
},
// 发布新闻
createNewsEvent
(
num
){
...
...
@@ -1612,36 +1607,52 @@ export default {
});
return
;
}
if
(
this
.
newsFormEdit
.
labelDept
==
null
){
this
.
$message
({
message
:
'请输入选择所属部门!'
,
type
:
'warning'
});
return
;
}
let
formData
=
new
FormData
();
if
(
this
.
activeName
=
'third'
){
//创建未提交审核为5,提交审核为4,审核不通过为3,通过已发布为1
// formData.append('publish',num);
this
.
newsFormEdit
.
publish
=
num
;
};
if
(
this
.
newsFormEdit
.
clickCount
==
null
){
console
.
log
(
'111'
)
this
.
newsFormEdit
.
clickCount
=
0
;
}
// if(this.newsFormEdit.fileList==null){
// this.newsFormEdit.fileList=[];
// }
if
(
this
.
newsFormEdit
.
labelDept
==
0
){
this
.
newsFormEdit
.
labelDept
=
0
;
}
for
(
let
key
in
this
.
newsFormEdit
){
formData
.
append
(
key
,
this
.
newsFormEdit
[
key
])
}
// formData.append('content', this.htmlContent);
// this.fileList.forEach(item=>{
// formData.append('fileList', item.raw)
// })
// if (this.delFileList.length != 0) {
// for (var i = 0; i
<
this
.
delFileList
.
length
;
i
++
)
{
// noteFileDelete(this.delFileList[i]).then((res) => {
// if (res.success) {
// console.log('-=-=-=-=-=-=-=-=-==-===-=-=删除附件', res)
// }
// })
// }
// }
console
.
log
(
'-=-=-=-=-=-=-=--=需提交的附件列表1'
,
this
.
fileListEdit
)
console
.
log
(
'-=-=-=-=-=-=-=-=-==-===-=-=提交删除附件集合'
,
this
.
delFileList
)
//调用删除附件接口
if
(
this
.
delFileList
.
length
!=
0
)
{
console
.
log
(
'-=-=-=-=-=-=-=-=-==-===-=-=删除附件集合'
,
this
.
delFileList
)
var
delFileList
=
{};
delFileList
.
delFileList
=
this
.
delFileList
;
delFile
(
JSON
.
stringify
(
delFileList
)).
then
((
res
)
=>
{
if
(
res
.
success
)
{
console
.
log
(
'-=-=-=-=-=-=-=-=-==-===-=-=删除附件接口'
,
res
)
}
})
}
console
.
log
(
'-=-=-=-=-=-=-=--=需提交保存的附件列表'
,
this
.
fileListEdit
);
this
.
fileListEdit
=
[...
new
Set
(
this
.
fileListEdit
)]
this
.
fileListEdit
.
forEach
((
item
)
=>
{
if
(
item
.
raw
)
{
formData
.
append
(
'fileList'
,
item
.
raw
)
console
.
log
(
11111
)
}
else
{
formData
.
append
(
'fileList'
,
item
)
console
.
log
(
2222
)
}
console
.
log
(
'-=-=-=-=-=-=-=--=需提交的附件列表'
,
formData
.
get
(
'fileList'
))
...
...
@@ -1650,22 +1661,47 @@ export default {
// formData.append('publish',num);// 然后是publish ,点击发布的话是1,提交审核是4,保存是5
console
.
log
(
'formData=='
,
formData
);
// console.log('formData==',formData);
updateNews
(
formData
).
then
(
res
=>
{
//
<!--
//创建未提交审核保存为5,提交审核为4,审核不通过为3,通过已发布为1 -->
var
msg
=
'修改保存成功!'
;
if
(
num
==
'4'
){
this
.
activeName
=
'third'
;
//刷新列表
this
.
getManageList
();
msg
=
'提交审核成功!'
;
//关闭弹窗
this
.
editVisible
=
false
;
}
if
(
num
==
'1'
||
num
==
'3'
){
this
.
activeName
=
'first'
;
// this.getAssInfoList();//获取审核列表
this
.
getManageList
();
this
.
auditVisible
=
false
;
//关闭弹窗
msg
=
'审核完毕!'
;
}
if
(
num
==
'5'
){
this
.
activeName
=
'first'
;
this
.
getAssInfoList
();
//获取审核列表
//关闭弹窗
this
.
editVisible
=
false
;
}
if
(
res
.
success
){
this
.
$message
({
message
:
'修改信息成功!'
,
message
:
msg
,
type
:
'success'
});
}
//关闭弹窗
this
.
editVisible
=
false
;
//刷新列表
this
.
getManageList
();
})
},
// handleClick(tab, event) {
// console.log(tab, event);
// }
handleNodeClick
(
param
)
{
console
.
log
(
'点击的栏目'
,
param
);
let
{
boardId
,
boardName
}
=
param
;
...
...
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