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
c103cc9a
Commit
c103cc9a
authored
Mar 14, 2022
by
Yang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
附件点击下载进行查看,附件上传格式限制
parent
e2f86dbe
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
127 additions
and
4 deletions
+127
-4
src/views/manage/index.vue
+127
-4
No files found.
src/views/manage/index.vue
View file @
c103cc9a
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
:data=
"manageList"
:data=
"manageList"
style=
"width: 100%"
style=
"width: 100%"
height=
"550"
height=
"550"
@
selection-change=
"handleSelectionChange1"
@
selection-change=
"handleSelectionChange1"
>
>
<el-table-column
type=
"selection"
width=
"55"
></el-table-column>
<el-table-column
type=
"selection"
width=
"55"
></el-table-column>
...
@@ -147,7 +148,8 @@
...
@@ -147,7 +148,8 @@
</el-select>
</el-select>
<span
class=
"ml-15"
>
提示:在word文档中编辑好后,复制黏贴到编辑框
</span>
<span
class=
"ml-15"
>
提示:在word文档中编辑好后,复制黏贴到编辑框
</span>
</el-form-item>
</el-form-item>
<el-form-item
label=
"所属栏目"
v-show=
"isShowColumn"
>
<!-- old --- v-show="isShowColumn" -->
<el-form-item
label=
"所属栏目"
>
<el-row>
<el-row>
<el-col
:span=
"6"
>
<el-col
:span=
"6"
>
<!-- 工作信息->最高人民法院简报 -->
<!-- 工作信息->最高人民法院简报 -->
...
@@ -195,6 +197,7 @@
...
@@ -195,6 +197,7 @@
:file-list=
"fileList"
:file-list=
"fileList"
:auto-upload=
"false"
:auto-upload=
"false"
action=
"#"
action=
"#"
accept=
".doc, .docx, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, .pdf, image/*, audio/*, video/*, .xls, .xlsx, .xml, .txt"
name=
"fileList"
name=
"fileList"
:show-file-list=
"true"
:show-file-list=
"true"
:on-change=
"uploadSuccess"
:on-change=
"uploadSuccess"
...
@@ -395,8 +398,8 @@
...
@@ -395,8 +398,8 @@
<!-- 创建未提交审核为5,提交审核为4,审核不通过为3,通过已发布为1 -->
<!-- 创建未提交审核为5,提交审核为4,审核不通过为3,通过已发布为1 -->
<el-button
type=
"primary"
size=
"mini"
@
click=
"sbBatch"
>
批量打开
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"sbBatch"
>
批量打开
</el-button>
<!-- 是否采用,3为采用,2为不采用即已阅 -->
<!-- 是否采用,3为采用,2为不采用即已阅 -->
<el-button
type=
"primary"
size=
"mini"
@
click=
"sbBatchUseOrNot(3)"
>
批量采用
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"sbBatchUseOrNot(3)"
v-if=
"reportRadio == '1'"
>
批量采用
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"sbBatchUseOrNot(2)"
>
批量不采用
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"sbBatchUseOrNot(2)"
v-if=
"reportRadio == '1'"
>
批量已阅
</el-button>
</el-row>
</el-row>
<div
style=
"margin-top: 10px"
>
<div
style=
"margin-top: 10px"
>
<el-pagination
<el-pagination
...
@@ -608,6 +611,7 @@
...
@@ -608,6 +611,7 @@
:show-file-list=
"true"
:show-file-list=
"true"
:on-change=
"uploadSuccessEdit"
:on-change=
"uploadSuccessEdit"
:on-remove=
"handleRemoveEdit"
:on-remove=
"handleRemoveEdit"
:on-preview=
"handlePreviewEdit"
>
>
<el-button
disabled
class=
"area-btn"
>
浏览文件
</el-button>
<el-button
disabled
class=
"area-btn"
>
浏览文件
</el-button>
</el-upload>
</el-upload>
...
@@ -703,8 +707,10 @@
...
@@ -703,8 +707,10 @@
action=
"#"
action=
"#"
name=
"fileList"
name=
"fileList"
:show-file-list=
"true"
:show-file-list=
"true"
accept=
".doc, .docx, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, .pdf, image/*, audio/*, video/*, .xls, .xlsx, .xml, .txt"
:on-change=
"uploadSuccessEdit"
:on-change=
"uploadSuccessEdit"
:on-remove=
"handleRemoveEdit"
:on-remove=
"handleRemoveEdit"
:on-preview=
"handlePreviewEdit"
>
>
<el-button
class=
"area-btn"
>
浏览文件
</el-button>
<el-button
class=
"area-btn"
>
浏览文件
</el-button>
</el-upload>
</el-upload>
...
@@ -837,10 +843,12 @@
...
@@ -837,10 +843,12 @@
:file-list=
"fileListEdit"
:file-list=
"fileListEdit"
:auto-upload=
"false"
:auto-upload=
"false"
action=
"#"
action=
"#"
accept=
".doc, .docx, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, .pdf, image/*, audio/*, video/*, .xls, .xlsx, .xml, .txt"
name=
"fileList"
name=
"fileList"
:show-file-list=
"true"
:show-file-list=
"true"
:on-change=
"uploadSuccessEdit"
:on-change=
"uploadSuccessEdit"
:on-remove=
"handleRemoveEdit"
:on-remove=
"handleRemoveEdit"
:on-preview=
"handlePreviewEdit"
>
>
<el-button
class=
"area-btn"
>
浏览文件
</el-button>
<el-button
class=
"area-btn"
>
浏览文件
</el-button>
</el-upload>
</el-upload>
...
@@ -1780,7 +1788,24 @@ export default {
...
@@ -1780,7 +1788,24 @@ export default {
//上传附件
//上传附件
uploadSuccess
(
file
,
list
)
{
uploadSuccess
(
file
,
list
)
{
let
fileSize
=
Number
(
file
.
size
/
1024
/
1024
);
if
(
fileSize
>
20
)
{
this
.
$msgbox
({
title
:
""
,
message
:
"文件大小不能超过20MB,请重新上传。"
,
type
:
"warning"
});
list
.
forEach
((
el
,
index
)
=>
{
if
(
file
.
uid
==
el
.
uid
){
list
.
splice
(
index
,
1
)
}
})
this
.
fileList
=
list
;
return
list
;
}
else
{
this
.
fileList
=
list
;
this
.
fileList
=
list
;
}
console
.
log
(
"fileList----"
,
this
.
fileList
);
console
.
log
(
"fileList----"
,
this
.
fileList
);
},
},
...
@@ -1790,9 +1815,26 @@ export default {
...
@@ -1790,9 +1815,26 @@ export default {
},
},
//上传附件--编辑
//上传附件--编辑
uploadSuccessEdit
(
file
,
list
)
{
uploadSuccessEdit
(
file
,
list
)
{
let
fileSize
=
Number
(
file
.
size
/
1024
/
1024
);
if
(
fileSize
>
20
)
{
this
.
$msgbox
({
title
:
""
,
message
:
"文件大小不能超过20MB,请重新上传。"
,
type
:
"warning"
});
list
.
forEach
((
el
,
index
)
=>
{
if
(
file
.
uid
==
el
.
uid
){
list
.
splice
(
index
,
1
)
}
})
this
.
fileListEdit
=
list
;
return
list
;
}
else
{
this
.
fileListEdit
=
list
;
this
.
fileListEdit
=
list
;
}
// this.addFileListEdit=list;
// this.addFileListEdit=list;
console
.
log
(
"编辑新增----"
,
this
.
lis
t
);
console
.
log
(
"编辑新增----"
,
this
.
fileListEdi
t
);
},
},
handleRemoveEdit
(
file
,
list
)
{
handleRemoveEdit
(
file
,
list
)
{
console
.
log
(
"fileListHandleRemove----"
,
list
);
console
.
log
(
"fileListHandleRemove----"
,
list
);
...
@@ -1816,6 +1858,54 @@ export default {
...
@@ -1816,6 +1858,54 @@ export default {
}
}
}
}
},
},
saveAs
(
blob
,
filename
)
{
if
(
window
.
navigator
.
msSaveOrOpenBlob
)
{
navigator
.
msSaveBlob
(
blob
,
filename
);
}
else
{
var
link
=
document
.
createElement
(
"a"
);
var
body
=
document
.
querySelector
(
"body"
);
link
.
href
=
window
.
URL
.
createObjectURL
(
blob
);
link
.
download
=
filename
;
// fix Firefox
link
.
style
.
display
=
"none"
;
body
.
appendChild
(
link
);
link
.
click
();
body
.
removeChild
(
link
);
window
.
URL
.
revokeObjectURL
(
link
.
href
);
}
},
download
(
url
,
filename
)
{
this
.
getBlob
(
url
,
blob
=>
{
this
.
saveAs
(
blob
,
filename
);
});
},
downloadFiles
(
file
)
{
this
.
download
(
file
.
downloadPath
,
file
.
attachName
);
},
getBlob
(
url
,
cb
)
{
var
xhr
=
new
XMLHttpRequest
();
xhr
.
open
(
"GET"
,
url
,
true
);
xhr
.
responseType
=
"blob"
;
xhr
.
onload
=
function
()
{
if
(
xhr
.
status
===
200
)
{
cb
(
xhr
.
response
);
}
};
xhr
.
send
();
},
// 点击已上传文件
handlePreviewEdit
(
file
){
this
.
downloadFiles
(
file
);
// // 创建a标签
// var link = document.createElement("a");
// // href链接
// link.setAttribute("download", file.attachName);
// // link.download = file.name; //下载后文件名
// link.setAttribute("href", file.downloadPath);
// link.setAttribute("target", "view_window");
// // 自执行点击事件
// link.click();
},
// 发布新闻
// 发布新闻
createNewsEvent
(
num
)
{
createNewsEvent
(
num
)
{
// params.publish=num;// 然后是publish ,点击发布的话是1,提交审核是4,保存是5
// params.publish=num;// 然后是publish ,点击发布的话是1,提交审核是4,保存是5
...
@@ -1827,6 +1917,22 @@ export default {
...
@@ -1827,6 +1917,22 @@ export default {
return
;
return
;
}
}
// 总文件大小不超过50M
var
allFileSize
=
0
;
this
.
fileList
.
forEach
(
el
=>
{
allFileSize
+=
el
.
size
;
})
let
fileSize
=
Number
(
allFileSize
/
1024
/
1024
);
if
(
fileSize
>
50
)
{
this
.
$msgbox
({
title
:
""
,
message
:
"总文件大小不能超过50MB,请重新选择。"
,
type
:
"warning"
});
return
}
// if(!this.newsForm.assUser){
// if(!this.newsForm.assUser){
// this.$message({
// this.$message({
// message: "请选择审核人",
// message: "请选择审核人",
...
@@ -1960,6 +2066,23 @@ export default {
...
@@ -1960,6 +2066,23 @@ export default {
// return;
// return;
// }
// }
this
.
fileListEdit
=
[...
new
Set
(
this
.
fileListEdit
)];
this
.
fileListEdit
=
[...
new
Set
(
this
.
fileListEdit
)];
var
allFileSize2
=
0
;
this
.
fileListEdit
.
forEach
(
el
=>
{
if
(
el
.
attachSize
){
allFileSize2
+=
el
.
attachSize
;
}
else
if
(
el
.
size
){
allFileSize2
+=
el
.
size
;
}
})
let
fileSize
=
Number
(
allFileSize2
/
1024
/
1024
);
if
(
fileSize
>
50
)
{
this
.
$msgbox
({
title
:
""
,
message
:
"总文件大小不能超过50MB,请重新选择。"
,
type
:
"warning"
});
return
}
this
.
fileListEdit
.
forEach
(
item
=>
{
this
.
fileListEdit
.
forEach
(
item
=>
{
if
(
item
.
raw
)
{
if
(
item
.
raw
)
{
formData
.
append
(
"fileList"
,
item
.
raw
);
formData
.
append
(
"fileList"
,
item
.
raw
);
...
...
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