电子档案文件导出修改

This commit is contained in:
zzyuan 2025-01-17 18:52:37 +08:00
parent 48b9317066
commit b9474a15d1
1 changed files with 29 additions and 19 deletions

View File

@ -123,7 +123,7 @@
</el-breadcrumb>
</el-row>
<el-table v-loading="loading" v-if="showType==1" :data="tableDataList" @selection-change="handleSelectionChange" row-key="detailsId">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column type="selection" width="55" align="center" :selectable="selectable" :reserve-selection="true"/>
<el-table-column label="序号" align="center" width="80" type="index">
<template slot-scope="scope">
<span>{{(queryParams.pageNum - 1) * 10 + scope.$index + 1}}</span>
@ -643,7 +643,15 @@ export default {
this.ids = selection.map((item) => item);
this.single = selection.length != 1;
this.multiple = !selection.length;
},
},
//
selectable(row) {
if (row.docType != '文件夹') {
return true;
} else {
return true;
}
},
//******************
handleView(row) {
console.log(row)
@ -780,26 +788,28 @@ export default {
/** 导出按钮作 */
handleExport() {
let arr=[]
this.ids.forEach(item=>{
let errorList = []
this.ids.forEach(item=>{
console.log(item)
if(item.docType=='文件夹'){
errorList.push(item.detailsId)
}
arr.push(item.detailsId)
})
downloadFileApi({'ids':arr.join(',')}).then((res) => {
downloadFile({
fileName: "文件档案下载.zip",
fileData: res,
fileType: "text/html;charset=UTF-8",
});
});
// this.download(
// "/material/archives/download",
// {'ids':arr.join(',')},
// `_${new Date().getTime()}.zip`
// );
console.log(errorList.length)
if(errorList.length==0){
downloadFileApi({'ids':arr.join(',')}).then((res) => {
downloadFile({
fileName: "文件档案下载.zip",
fileData: res,
fileType: "text/html;charset=UTF-8",
});
})
}else{
this.$modal.msgError("所选文件中包含文件夹,文件夹不能下载");
}
},
//
changeShowType(val){
this.showType=val;