电子档案文件导出修改

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