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
4c209615
Commit
4c209615
authored
Oct 14, 2021
by
莫晓莉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
栏目
parent
0e1aa75a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
8 deletions
+64
-8
src/views/manage/index.vue
+64
-8
No files found.
src/views/manage/index.vue
View file @
4c209615
...
@@ -752,12 +752,13 @@
...
@@ -752,12 +752,13 @@
class=
"upload-demo"
class=
"upload-demo"
ref=
"fileUpload"
ref=
"fileUpload"
multiple
multiple
:file-list=
"fileList"
:file-list=
"fileList
Edit
"
:auto-upload=
"false"
:auto-upload=
"false"
action=
"#"
action=
"#"
name=
"fileList"
name=
"fileList"
:show-file-list=
"true"
:show-file-list=
"true"
:on-change=
"uploadSuccess"
:on-change=
"uploadSuccessEdit"
:on-remove=
"handleRemoveEdit"
>
>
<el-button
class=
"area-btn"
>
<el-button
class=
"area-btn"
>
浏览文件
浏览文件
...
@@ -1476,10 +1477,37 @@ export default {
...
@@ -1476,10 +1477,37 @@ export default {
this
.
fileList
=
list
;
this
.
fileList
=
list
;
console
.
log
(
'fileList----'
,
this
.
fileList
);
console
.
log
(
'fileList----'
,
this
.
fileList
);
},
},
handleRemove
(
file
,
list
){
handleRemove
(
file
,
list
){
console
.
log
(
'fileListHandleRemove----'
,
list
);
console
.
log
(
'fileListHandleRemove----'
,
list
);
this
.
fileList
=
list
;
this
.
fileList
=
list
;
},
},
//上传附件--编辑
uploadSuccessEdit
(
file
,
list
)
{
this
.
fileListEdit
=
list
;
console
.
log
(
'fileList----'
,
this
.
fileListEdit
);
},
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
// }
// }
// }
},
// 发布新闻
// 发布新闻
createNewsEvent
(
num
){
createNewsEvent
(
num
){
// params.publish=num;// 然后是publish ,点击发布的话是1,提交审核是4,保存是5
// params.publish=num;// 然后是publish ,点击发布的话是1,提交审核是4,保存是5
...
@@ -1502,6 +1530,7 @@ export default {
...
@@ -1502,6 +1530,7 @@ export default {
this
.
fileList
.
forEach
(
item
=>
{
this
.
fileList
.
forEach
(
item
=>
{
formData
.
append
(
'fileList'
,
item
.
raw
)
formData
.
append
(
'fileList'
,
item
.
raw
)
})
})
formData
.
append
(
'publish'
,
num
);
// 然后是publish ,点击发布的话是1,提交审核是4,保存是5
formData
.
append
(
'publish'
,
num
);
// 然后是publish ,点击发布的话是1,提交审核是4,保存是5
...
@@ -1533,8 +1562,29 @@ export default {
...
@@ -1533,8 +1562,29 @@ export default {
formData
.
append
(
key
,
this
.
newsFormEdit
[
key
])
formData
.
append
(
key
,
this
.
newsFormEdit
[
key
])
}
}
// formData.append('content', this.htmlContent);
// formData.append('content', this.htmlContent);
this
.
fileList
.
forEach
(
item
=>
{
// this.fileList.forEach(item=>{
formData
.
append
(
'fileList'
,
item
.
raw
)
// 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
)
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'
))
})
})
formData
.
append
(
'publish'
,
num
);
// 然后是publish ,点击发布的话是1,提交审核是4,保存是5
formData
.
append
(
'publish'
,
num
);
// 然后是publish ,点击发布的话是1,提交审核是4,保存是5
...
@@ -1543,10 +1593,14 @@ export default {
...
@@ -1543,10 +1593,14 @@ export default {
updateNews
(
formData
).
then
(
res
=>
{
updateNews
(
formData
).
then
(
res
=>
{
if
(
res
.
success
){
if
(
res
.
success
){
this
.
$message
({
this
.
$message
({
message
:
'
添加
信息成功!'
,
message
:
'
修改
信息成功!'
,
type
:
'success'
type
:
'success'
});
});
}
}
//关闭弹窗
this
.
editVisible
=
false
;
//刷新列表
this
.
getManageList
();
})
})
},
},
// handleClick(tab, event) {
// handleClick(tab, event) {
...
@@ -1603,11 +1657,13 @@ export default {
...
@@ -1603,11 +1657,13 @@ export default {
let
{
newsDetail
,
attachList
}
=
res
.
data
;
let
{
newsDetail
,
attachList
}
=
res
.
data
;
// this.newsListDetail=res.data;
// this.newsListDetail=res.data;
this
.
newsFormEdit
=
newsDetail
;
this
.
newsFormEdit
=
newsDetail
;
this
.
fileList
=
attachList
;
this
.
fileListEdit
=
attachList
;
console
.
log
(
'新闻详情this.fileList==='
,
this
.
fileListEdit
);
if
(
attachList
.
length
>
0
)
{
if
(
attachList
.
length
>
0
)
{
//显示已上传附件列表
//显示已上传附件列表
for
(
let
i
=
0
;
i
<
this
.
fileList
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
this
.
fileList
Edit
.
length
;
i
++
)
{
this
.
fileList
[
i
].
name
=
this
.
fileLis
t
[
i
].
attachName
this
.
fileList
Edit
[
i
].
name
=
this
.
fileListEdi
t
[
i
].
attachName
}
}
}
}
}
}
...
...
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