layui.define(function(exports){ let functions = { initTableColumnsFilter: function (tableId, cols) { var local = layui.data('table-filter-' + tableId); layui.each(cols, function(index, item) { if (item.field !== 'undefined' && item.field in local) { item.hide = local[item.field]; } }); return cols; }, observerTableColumnFilter: function (that) { that.elem.next().on('mousedown', 'input[lay-filter="LAY_TABLE_TOOL_COLS"]+', function(){ var input = $(this).prev()[0]; layui.data ('table-filter-'+ that.id, { key: input.name, value: input.checked }); }); } // 其他公共方法... }; exports('functions', functions); });