mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
修改引入方案
This commit is contained in:
parent
964719ac62
commit
f768073b07
@ -74,19 +74,13 @@ require.config({
|
|||||||
'jquery.autocompleter': ['plugs/jquery/autocompleter.min'],
|
'jquery.autocompleter': ['plugs/jquery/autocompleter.min'],
|
||||||
},
|
},
|
||||||
shim: {
|
shim: {
|
||||||
|
'excel': {deps: [baseRoot + 'plugs/layui_exts/excel.js']},
|
||||||
'websocket': {deps: [baseRoot + 'plugs/socket/swfobject.min.js']},
|
'websocket': {deps: [baseRoot + 'plugs/socket/swfobject.min.js']},
|
||||||
'jquery.ztree': {deps: ['jquery', 'css!' + baseRoot + 'plugs/ztree/zTreeStyle/zTreeStyle.css']},
|
'jquery.ztree': {deps: ['jquery', 'css!' + baseRoot + 'plugs/ztree/zTreeStyle/zTreeStyle.css']},
|
||||||
'jquery.autocompleter': {deps: ['jquery', 'css!' + baseRoot + 'plugs/jquery/autocompleter.css']},
|
'jquery.autocompleter': {deps: ['jquery', 'css!' + baseRoot + 'plugs/jquery/autocompleter.css']},
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/*! 注册 layui 组件 */
|
|
||||||
layui.config({
|
|
||||||
base: baseRoot + 'plugs/layui_exts/',
|
|
||||||
}).extend({
|
|
||||||
excel: 'excel',
|
|
||||||
});
|
|
||||||
|
|
||||||
/*! 注册 jquery 组件 */
|
/*! 注册 jquery 组件 */
|
||||||
define('jquery', [], function () {
|
define('jquery', [], function () {
|
||||||
return layui.$;
|
return layui.$;
|
||||||
|
@ -5,9 +5,7 @@ define(function () {
|
|||||||
if (name.substr(-5).toLowerCase() !== '.xlsx') {
|
if (name.substr(-5).toLowerCase() !== '.xlsx') {
|
||||||
name += '.xlsx';
|
name += '.xlsx';
|
||||||
}
|
}
|
||||||
layui.use('excel', function () {
|
layui.excel.exportExcel(data, name, 'xlsx')
|
||||||
layui.excel.exportExcel(data, name, 'xlsx')
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! 绑定导出的事件 */
|
/*! 绑定导出的事件 */
|
||||||
@ -160,8 +158,7 @@ define(function () {
|
|||||||
/*! 表格单元内容转换 */
|
/*! 表格单元内容转换 */
|
||||||
excel.read.CellToValue = function (v) {
|
excel.read.CellToValue = function (v) {
|
||||||
if (typeof v !== 'undefined' && /^\d+\.\d{12}$/.test(v)) {
|
if (typeof v !== 'undefined' && /^\d+\.\d{12}$/.test(v)) {
|
||||||
var time = XLSX.SSF.parse_date_code(v);
|
return LAY_EXCEL.dateCodeFormat(v, 'YYYY-MM-DD HH:ii:ss');
|
||||||
return time.y + '-' + time.m + '-' + time.d + ' ' + time.H + ':' + time.M + ':' + time.S;
|
|
||||||
} else {
|
} else {
|
||||||
return typeof v !== 'undefined' ? v : '';
|
return typeof v !== 'undefined' ? v : '';
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user