100 lines
3.7 KiB
PHP
100 lines
3.7 KiB
PHP
var BASE_URL = document.scripts[document.scripts.length - 1].src.substring(0, document.scripts[document.scripts.length - 1].src.lastIndexOf("/") + 1);
|
|
window.BASE_URL = BASE_URL;
|
|
require.config({
|
|
urlArgs: "v=" + CONFIG.VERSION,
|
|
baseUrl: BASE_URL,
|
|
paths: {
|
|
"jquery": ["plugs/jquery-3.4.1/jquery-3.4.1.min"],
|
|
"jquery-particleground": ["plugs/jq-module/jquery.particleground.min"],
|
|
"echarts": ["plugs/echarts/echarts.min"],
|
|
"echarts-theme": ["plugs/echarts/echarts-theme"],
|
|
"easy-admin": ["plugs/easy-admin/easy-admin"],
|
|
"layuiall": ["plugs/layui-v2.8.x/layui.all"],
|
|
"layui": ["plugs/layui-v2.8.x/layui"],
|
|
"miniAdmin": ["plugs/lay-module/layuimini/miniAdmin"],
|
|
"miniMenu": ["plugs/lay-module/layuimini/miniMenu"],
|
|
"miniTab": ["plugs/lay-module/layuimini/miniTab"],
|
|
"miniTheme": ["plugs/lay-module/layuimini/miniTheme"],
|
|
"miniTongji": ["plugs/lay-module/layuimini/miniTongji"],
|
|
"treetable": ["plugs/lay-module/treetable-lay/treetable"],
|
|
"tableSelect": ["plugs/lay-module/tableSelect/tableSelect"],
|
|
"iconPickerFa": ["plugs/lay-module/iconPicker/iconPickerFa"],
|
|
"autocomplete": ["plugs/lay-module/autocomplete/autocomplete"],
|
|
"vue": ["plugs/vue-2.6.10/vue.min"],
|
|
"ckeditor": ["plugs/ckeditor4/ckeditor"],
|
|
}
|
|
});
|
|
|
|
// 路径配置信息
|
|
var PATH_CONFIG = {
|
|
iconLess: BASE_URL + "plugs/font-awesome-4.7.0/less/variables.less",
|
|
};
|
|
window.PATH_CONFIG = PATH_CONFIG;
|
|
|
|
// 初始化控制器对应的JS自动加载
|
|
if ("undefined" != typeof CONFIG.AUTOLOAD_JS && CONFIG.AUTOLOAD_JS) {
|
|
require([BASE_URL + CONFIG.CONTROLLER_JS_PATH], function (Controller) {
|
|
if (eval('Controller.' + CONFIG.ACTION)) {
|
|
eval('Controller.' + CONFIG.ACTION + '()');
|
|
}
|
|
});
|
|
}
|
|
|
|
// 快速时间范围选择
|
|
function getRangeShortcuts() {
|
|
return [
|
|
{
|
|
text: "上个月",
|
|
value: function () {
|
|
var value = [];
|
|
var date1 = new Date();
|
|
date1.setMonth(date1.getMonth() - 1);
|
|
date1.setDate(1);
|
|
date1.setHours(0, 0, 0, 0);
|
|
value.push(date1);
|
|
var date2 = new Date();
|
|
date2.setDate(1);
|
|
date2.setHours(0, 0, 0, 0);
|
|
date2 = date2.getTime() - 1;
|
|
value.push(new Date(date2));
|
|
return value;
|
|
}()
|
|
},
|
|
{
|
|
text: "这个月",
|
|
value: function () {
|
|
var value = [];
|
|
var date1 = new Date();
|
|
// date1.setMonth(date1.getMonth() - 1);
|
|
date1.setDate(1);
|
|
date1.setHours(0, 0, 0, 0);
|
|
value.push(date1);
|
|
var date2 = new Date();
|
|
date2.setMonth(date2.getMonth() + 1);
|
|
date2.setDate(1);
|
|
date2.setHours(0, 0, 0, 0);
|
|
date2 = date2.getTime() - 1;
|
|
value.push(new Date(date2));
|
|
return value;
|
|
}()
|
|
},
|
|
{
|
|
text: "下个月",
|
|
value: function () {
|
|
var value = [];
|
|
var date1 = new Date();
|
|
date1.setMonth(date1.getMonth() + 1);
|
|
date1.setDate(1);
|
|
date1.setHours(0, 0, 0, 0);
|
|
value.push(date1);
|
|
var date2 = new Date();
|
|
date2.setMonth(date2.getMonth() + 2);
|
|
date2.setDate(1);
|
|
date2.setHours(0, 0, 0, 0);
|
|
date2 = date2.getTime() - 1;
|
|
value.push(new Date(date2));
|
|
return value;
|
|
}()
|
|
}
|
|
]
|
|
} |