mirror of https://gitee.com/karson/fastadmin.git
parent
d0f71f4f1d
commit
f9b29e4fad
|
|
@ -9,7 +9,7 @@
|
||||||
"jquery": "^2.1.4",
|
"jquery": "^2.1.4",
|
||||||
"bootstrap": "^3.3.7",
|
"bootstrap": "^3.3.7",
|
||||||
"font-awesome": "^4.6.1",
|
"font-awesome": "^4.6.1",
|
||||||
"bootstrap-table": "fastadmin-bootstraptable#~1.11.3",
|
"bootstrap-table": "fastadmin-bootstraptable#~1.11.5",
|
||||||
"jstree": "~3.3.2",
|
"jstree": "~3.3.2",
|
||||||
"moment": "^2.20.1",
|
"moment": "^2.20.1",
|
||||||
"toastr": "~2.1.3",
|
"toastr": "~2.1.3",
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -14,10 +14,16 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
|
||||||
titleForm: '', //为空则不显示标题,不定义默认显示:普通搜索
|
titleForm: '', //为空则不显示标题,不定义默认显示:普通搜索
|
||||||
idTable: 'commonTable',
|
idTable: 'commonTable',
|
||||||
showExport: true,
|
showExport: true,
|
||||||
exportDataType: "all",
|
exportDataType: "auto",
|
||||||
exportTypes: ['json', 'xml', 'csv', 'txt', 'doc', 'excel'],
|
exportTypes: ['json', 'xml', 'csv', 'txt', 'doc', 'excel'],
|
||||||
exportOptions: {
|
exportOptions: {
|
||||||
fileName: 'export_' + Moment().format("YYYY-MM-DD"),
|
fileName: 'export_' + Moment().format("YYYY-MM-DD"),
|
||||||
|
preventInjection: false,
|
||||||
|
mso: {
|
||||||
|
onMsoNumberFormat: function (cell, row, col) {
|
||||||
|
return !isNaN($(cell).text()) ? '\\@' : '';
|
||||||
|
},
|
||||||
|
},
|
||||||
ignoreColumn: [0, 'operate'] //默认不导出第一列(checkbox)与操作(operate)列
|
ignoreColumn: [0, 'operate'] //默认不导出第一列(checkbox)与操作(operate)列
|
||||||
},
|
},
|
||||||
pageSize: localStorage.getItem("pagesize") || 10,
|
pageSize: localStorage.getItem("pagesize") || 10,
|
||||||
|
|
@ -237,6 +243,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
var exportDataType = options.exportDataType;
|
||||||
// 处理选中筛选框后按钮的状态统一变更
|
// 处理选中筛选框后按钮的状态统一变更
|
||||||
table.on('check.bs.table uncheck.bs.table check-all.bs.table uncheck-all.bs.table post-body.bs.table', function (e) {
|
table.on('check.bs.table uncheck.bs.table check-all.bs.table uncheck-all.bs.table post-body.bs.table', function (e) {
|
||||||
var allIds = table.bootstrapTable("getData").map(function (item) {
|
var allIds = table.bootstrapTable("getData").map(function (item) {
|
||||||
|
|
@ -262,6 +269,10 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
|
||||||
options.selectedIds = selectedIds;
|
options.selectedIds = selectedIds;
|
||||||
options.selectedData = selectedData;
|
options.selectedData = selectedData;
|
||||||
}
|
}
|
||||||
|
//如果导出类型为auto时则自动判断
|
||||||
|
if (exportDataType === 'auto') {
|
||||||
|
options.exportDataType = selectedIds.length > 0 ? 'selected' : 'all';
|
||||||
|
}
|
||||||
$(Table.config.disabledbtn, toolbar).toggleClass('disabled', !options.selectedIds.length);
|
$(Table.config.disabledbtn, toolbar).toggleClass('disabled', !options.selectedIds.length);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue