我们开发过程中会遇到需要下载多份Excel文件的情况,我们实现一份份下载是没有任何问题的,但是要同时实现多份下载的时候其实也可以,分别给与不同的下载按钮和请求方法也能实现,但是如果有几百个按钮就不现实了,所以再按照之前的方法区实现就实现不了了,那么我们可以转换思维,将这一份或者多份的Excel,Word的文档,先放置在一个临时目录中,我们将该临时目录打包成Zip文档进行下载即可!
需求如下(可多选,单选,每次以Zip的形式下载):
<style>
.account_select {
height: 300px;
width: 650px;
background-color: #efefef;
border: 1px solid #bbbbbb;
position: absolute;
top: 30%;
left: 25%;
text-align: center;
padding: 50px 0;
display: none;
}
.errorMs {
height: 300px;
width: 650px;
background-color: #efefef;
border: 1px solid #bbbbbb;
position: absolute;
top: 370px;
left: 750px;
text-align: center;
padding: 50px 0;
display: none;
}
</style>
<div class="account_select" id="account_select">
<div style="text-align: left;margin-left: 15px;margin-top: -25px;font-size: 35px;font-weight: bold;color: black;">
账单导出<span style="float: left;font-size: 1px;color: white">Y</span>
</div>
<p style="text-align: left;margin-left: 45px;margin-top: 10px;font-size: 15px;font-weight: bold;">请选择您要导出的用途:</p>
<label style="float: left;margin-left: 90px;margin-top: 25px;font-size: 25px;font-weight: bold;color: #0f91f5">
<input type="checkbox" name="totalAccount" value="1" style="width: 40px">总账单表
<input type="checkbox" name="totalAccount" value="2" style="width: 40px">财务报表
<input type="checkbox" name="totalAccount" value="3" style="width: 40px">中通对账表
</label>
<br>
<div style="margin-top: 80px;">
<input type="button"
style="float: right;position</