bootstrap Table 导出时时间格式显示秒 科学计数法显示

使用bootstrap Table自带的原生导出方法,当字段是时间时,会自动显示到分钟隐藏秒,历时两天终于找到了方法

参考链接:https://ask.fastadmin.net/question/1346.html

方法api说明: https://github.com/hhurz/tableExport.jquery.plugin

 exportOptions: {
                	ignoreColumn: [],//忽略列索引
                	fileName:enterpriseName+'-'+deviceName+' '+startTimeName,//表格名称
                	worksheetName:'历史数据', //工作区名称
                	type: 'excel', 
                    onMsoNumberFormat: function(cell, row, col) {//科学技术法数字转换为文本,时间格式转换为文本可以显示秒
                          return (row > 0 && col == 0) ? '\@' : '';
                     }
}

  在exportOptions中增加红色部分即可。

原文地址:https://www.cnblogs.com/webttt/p/11641309.html