Update admin.js

This commit is contained in:
Anyon 2022-05-24 15:40:37 +08:00
parent f75e698e35
commit f67c691055

View File

@ -705,10 +705,14 @@ $(function () {
$table.bind('reload render reloadData', function (evt, opts) { $table.bind('reload render reloadData', function (evt, opts) {
data = $.extend({}, data, (opts = opts || {}).where || {}); data = $.extend({}, data, (opts = opts || {}).where || {});
opts = bindData($.extend({}, opts, {loading: true})); opts = bindData($.extend({}, opts, {loading: true}));
if (evt.type.indexOf('reload') > -1 && layui.table.reloadData) { if (evt.type.indexOf('reload') > -1) {
layui.table.reloadData(table.id, (opts.page || {}).curr || 1); if (layui.table.reloadData) {
layui.table.reloadData(table.id, (opts.page || {}).curr || 1);
} else {
layui.table.reload(table.id, opts);
}
} else { } else {
layui.table.reload(table.id, opts); layui.table.render(table.id, opts);
} }
}).bind('row sort tool edit radio toolbar checkbox rowDouble', function (evt, call) { }).bind('row sort tool edit radio toolbar checkbox rowDouble', function (evt, call) {
layui.table.on(evt.type + '(' + table.dataset.id + ')', call) layui.table.on(evt.type + '(' + table.dataset.id + ')', call)