/**
* 下载模板
*/
Productmessage.btnDownload = function () {
var date = new Date();
var yearMonthDate = date.getFullYear().toString() + (date.getMonth() + 1).toString() + date.getDate().toString() + date.getHours().toString() + date.getMinutes().toString() + date.getSeconds().toString();
//导出表格
var template = table.render({
elem: '#data_template',
url: Feng.ctxPath + '/productmessage/downloadTemplate',
page: false,
limit: "",//不限制数量
title: '基础通信信息设备导入模板' + yearMonthDate,
cols: ProductmessageTemplate.initAllColumn(),
parseData: function(res){ //res 即为原始返回的数据,将原始数据解析成 table 组件所规定的数据
var productmessageList = res.data;
},
done: function (res, curr, count) {
var exportData=res.data;
//指定后缀名为xlsx,即使用户另存为xls文件,也能上传识别;如果指定为xls文件,则只有另存为xlsx文件,上传才能识别
table.exportFile(template.config.id, exportData, 'xlsx');
}
});
};
springboot+layui使用easypoi导入数据识别xls最好的办法,就是下载模板时指定后缀名为xlsx,不能指定为xls
最新推荐文章于 2024-06-22 14:05:55 发布