修改layui刷新

This commit is contained in:
Anyon 2022-05-24 15:37:38 +08:00
parent b973ca189d
commit f75e698e35
2 changed files with 5 additions and 39 deletions

View File

@ -51,36 +51,9 @@ window.jQuery = window.$ = window.jQuery || window.$ || layui.$;
/*! 配置 require 参数 */
require.config({
baseUrl: baseRoot, waitSeconds: 60, map: {'*': {css: baseRoot + 'plugs/require/css.js'}}, paths: {
'vue': ['plugs/vue/vue.min'],
'md5': ['plugs/jquery/md5.min'],
'json': ['plugs/jquery/json.min'],
'xlsx': ['plugs/jquery/xlsx.min'],
'excel': ['plugs/jquery/excel.xlsx'],
'base64': ['plugs/jquery/base64.min'],
'upload': [tapiRoot + '/api.upload/index?'],
'notify': ['plugs/notify/notify.min'],
'angular': ['plugs/angular/angular.min'],
'cropper': ['plugs/cropper/cropper.min'],
'echarts': ['plugs/echarts/echarts.min'],
'ckeditor4': ['plugs/ckeditor4/ckeditor'],
'ckeditor5': ['plugs/ckeditor5/ckeditor'],
'websocket': ['plugs/socket/websocket'],
'pcasunzips': ['plugs/jquery/pcasunzips'],
'sortablejs': ['plugs/sortable/sortable.min'],
'vue.sortable': ['plugs/sortable/vue.draggable.min'],
'jquery.ztree': ['plugs/ztree/ztree.all.min'],
'jquery.masonry': ['plugs/jquery/masonry.min'],
'jquery.cropper': ['plugs/cropper/cropper.min'],
'jquery.autocompleter': ['plugs/jquery/autocompleter.min'],
'vue': ['plugs/vue/vue.min'], 'md5': ['plugs/jquery/md5.min'], 'json': ['plugs/jquery/json.min'], 'xlsx': ['plugs/jquery/xlsx.min'], 'excel': ['plugs/jquery/excel.xlsx'], 'base64': ['plugs/jquery/base64.min'], 'upload': [tapiRoot + '/api.upload/index?'], 'notify': ['plugs/notify/notify.min'], 'angular': ['plugs/angular/angular.min'], 'cropper': ['plugs/cropper/cropper.min'], 'echarts': ['plugs/echarts/echarts.min'], 'ckeditor4': ['plugs/ckeditor4/ckeditor'], 'ckeditor5': ['plugs/ckeditor5/ckeditor'], 'websocket': ['plugs/socket/websocket'], 'pcasunzips': ['plugs/jquery/pcasunzips'], 'sortablejs': ['plugs/sortable/sortable.min'], 'vue.sortable': ['plugs/sortable/vue.draggable.min'], 'jquery.ztree': ['plugs/ztree/ztree.all.min'], 'jquery.masonry': ['plugs/jquery/masonry.min'], 'jquery.cropper': ['plugs/cropper/cropper.min'], 'jquery.autocompleter': ['plugs/jquery/autocompleter.min'],
}, shim: {
'excel': {deps: [baseRoot + 'plugs/layui_exts/excel.js']},
'notify': {deps: ['css!' + baseRoot + 'plugs/notify/light.css']},
'cropper': {deps: ['css!' + baseRoot + 'plugs/cropper/cropper.min.css']},
'websocket': {deps: [baseRoot + 'plugs/socket/swfobject.min.js']},
'ckeditor5': {deps: ['jquery', 'upload', 'css!' + baseRoot + 'plugs/ckeditor5/ckeditor.css']},
'vue.sortable': {deps: ['vue', 'sortablejs']},
'jquery.ztree': {deps: ['jquery', 'css!' + baseRoot + 'plugs/ztree/zTreeStyle/zTreeStyle.css']},
'jquery.autocompleter': {deps: ['jquery', 'css!' + baseRoot + 'plugs/jquery/autocompleter.css']},
'excel': {deps: [baseRoot + 'plugs/layui_exts/excel.js']}, 'notify': {deps: ['css!' + baseRoot + 'plugs/notify/light.css']}, 'cropper': {deps: ['css!' + baseRoot + 'plugs/cropper/cropper.min.css']}, 'websocket': {deps: [baseRoot + 'plugs/socket/swfobject.min.js']}, 'ckeditor5': {deps: ['jquery', 'upload', 'css!' + baseRoot + 'plugs/ckeditor5/ckeditor.css']}, 'vue.sortable': {deps: ['vue', 'sortablejs']}, 'jquery.ztree': {deps: ['jquery', 'css!' + baseRoot + 'plugs/ztree/zTreeStyle/zTreeStyle.css']}, 'jquery.autocompleter': {deps: ['jquery', 'css!' + baseRoot + 'plugs/jquery/autocompleter.css']},
}
});
@ -732,15 +705,8 @@ $(function () {
$table.bind('reload render reloadData', function (evt, opts) {
data = $.extend({}, data, (opts = opts || {}).where || {});
opts = bindData($.extend({}, opts, {loading: true}));
if (evt.type.indexOf('reload') > -1) {
var $next = $table.data('next');
if ($next && $next.page && $next.page.jump) {
$next.sort = $next.initSort = opts.initSort, $next.where = data;
if (opts.page && opts.page.curr) $next.page.curr = opts.page.curr || 1;
$next.page.jump({curr: $next.page.curr, limit: option.limit});
} else {
layui.table.reloadData(table.id, opts);
}
if (evt.type.indexOf('reload') > -1 && layui.table.reloadData) {
layui.table.reloadData(table.id, (opts.page || {}).curr || 1);
} else {
layui.table.reload(table.id, opts);
}

File diff suppressed because one or more lines are too long