From e2298dc165bbe108b6ae6e7a54599629767515a0 Mon Sep 17 00:00:00 2001 From: Anyon Date: Fri, 15 Apr 2022 14:06:35 +0800 Subject: [PATCH] Update admin.js --- public/static/admin.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/static/admin.js b/public/static/admin.js index 9a2be6f16..209c727b9 100644 --- a/public/static/admin.js +++ b/public/static/admin.js @@ -688,8 +688,8 @@ $(function () { // 插件初始化参数 var option = params || {}, data = option.where || {}, sort = option.initSort || option.sort || {}; option.id = table.id, option.elem = table, option.url = params.url || table.dataset.url || location.href; - option.page = params.page !== false ? (params.page || true) : false, option.limit = params.limit || 20; - option.loading = params.loading !== false, option.autoSort = params.autoSort === true, option.cols = params.cols || [[]]; + option.limit = params.limit || 20, option.loading = params.loading !== false, option.autoSort = params.autoSort === true; + option.page = params.page !== false ? (params.page || true) : false, option.cols = params.cols || [[]], option.success = params.done || ''; // 初始化不显示头部 var cls = ['.layui-table-header', '.layui-table-fixed', '.layui-table-body', '.layui-table-page']; option.css = (option.css || '') + cls.join('{opacity:0}') + '{opacity:0}'; @@ -703,7 +703,7 @@ $(function () { } // 动态计算最大页数 option.done = function () { - typeof params.done === 'function' && params.done.call(this); + typeof option.success === 'function' && option.success.call(this); layui.sessionData('pages', {key: table.id, value: this.page.curr || 1}); $.form.reInit($table.next()).find('[data-load],[data-queue],[data-action],[data-iframe]').not('[data-table-id]').attr('data-table-id', table.id); (option.loading = this.loading = true) && $table.data('next', this).next().find(cls.join(',')).animate({opacity: 1});