mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
修改Excel导出
This commit is contained in:
parent
dd1e390e3e
commit
7b395cf553
@ -73,11 +73,11 @@
|
|||||||
|
|
||||||
// 设置表格内容
|
// 设置表格内容
|
||||||
data.forEach(function (item, index) {
|
data.forEach(function (item, index) {
|
||||||
data[index] = [item.username, item.node, item.geoip, item.geoisp, item.action, item.content, item.create_at];
|
data[index] = [item.id, item.username, item.node, item.geoip, item.geoisp, item.action, item.content, item.create_at];
|
||||||
});
|
});
|
||||||
|
|
||||||
// 设置表头内容
|
// 设置表头内容
|
||||||
data.unshift(['操作账号', '访问节点', '访问IP地址', '访问地理区域', '访问操作', '操作内容', '操作时间']);
|
data.unshift(['ID', '操作账号', '访问节点', '访问IP地址', '访问地理区域', '访问操作', '操作内容', '操作时间']);
|
||||||
|
|
||||||
// 自动计算列序号
|
// 自动计算列序号
|
||||||
var lastCol = layui.excel.numToTitle((function (count, idx) {
|
var lastCol = layui.excel.numToTitle((function (count, idx) {
|
||||||
@ -120,7 +120,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 设置表格行宽高,需要设置最后的行或列宽高,否则部分不生效 ???
|
// 设置表格行宽高,需要设置最后的行或列宽高,否则部分不生效 ???
|
||||||
var rowsC = {1: 40}, colsC = {'A': 160};
|
var rowsC = {1: 40}, colsC = {A: 60, B: 100};
|
||||||
rowsC[data.length] = 33, colsC[lastCol] = 160;
|
rowsC[data.length] = 33, colsC[lastCol] = 160;
|
||||||
this.options.extend = {
|
this.options.extend = {
|
||||||
'!rows': layui.excel.makeRowConfig(rowsC, 33), // 设置每行高度,默认 33
|
'!rows': layui.excel.makeRowConfig(rowsC, 33), // 设置每行高度,默认 33
|
||||||
|
@ -17,7 +17,7 @@ define(function () {
|
|||||||
/*! 绑定导出的事件 */
|
/*! 绑定导出的事件 */
|
||||||
Excel.prototype.bind = function (done, filename) {
|
Excel.prototype.bind = function (done, filename) {
|
||||||
var that = this;
|
var that = this;
|
||||||
this.options = {writeOpt: {bookSST: true}};
|
this.options = {}; // {writeOpt: {bookSST: true}};
|
||||||
$('body').off('click', '[data-form-export]').on('click', '[data-form-export]', function () {
|
$('body').off('click', '[data-form-export]').on('click', '[data-form-export]', function () {
|
||||||
var form = $(this).parents('form');
|
var form = $(this).parents('form');
|
||||||
var name = this.dataset.filename || filename;
|
var name = this.dataset.filename || filename;
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user