电子档案文件导出修改

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,6 +643,14 @@ 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) {
@ -780,26 +788,28 @@ export default {
/** 导出按钮作 */ /** 导出按钮作 */
handleExport() { handleExport() {
let arr=[] let arr=[]
let errorList = []
this.ids.forEach(item=>{ this.ids.forEach(item=>{
console.log(item)
if(item.docType=='文件夹'){
errorList.push(item.detailsId)
}
arr.push(item.detailsId) arr.push(item.detailsId)
}) })
console.log(errorList.length)
if(errorList.length==0){
downloadFileApi({'ids':arr.join(',')}).then((res) => { downloadFileApi({'ids':arr.join(',')}).then((res) => {
downloadFile({ downloadFile({
fileName: "文件档案下载.zip", fileName: "文件档案下载.zip",
fileData: res, fileData: res,
fileType: "text/html;charset=UTF-8", fileType: "text/html;charset=UTF-8",
}); });
}); })
// this.download( }else{
// "/material/archives/download", this.$modal.msgError("所选文件中包含文件夹,文件夹不能下载");
// {'ids':arr.join(',')}, }
// `_${new Date().getTime()}.zip`
// );
}, },
// //
changeShowType(val){ changeShowType(val){
this.showType=val; this.showType=val;