diff --git a/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js b/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js index 38189a66..7a405bb6 100644 --- a/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js +++ b/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js @@ -245,9 +245,9 @@ } }, // 搜索-默认第一个form - search: function(formId, data) { + search: function(formId, tableId, data) { var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId; - var params = $.btTable.bootstrapTable('getOptions'); + var params = $.common.isEmpty(tableId) ? $.btTable.bootstrapTable('getOptions') : $("#" + tableId).bootstrapTable('getOptions'); params.queryParams = function(params) { var search = $.common.formToJSON(currentId); if($.common.isNotEmpty(data)){ @@ -262,7 +262,11 @@ search.isAsc = params.order; return search; } - $.btTable.bootstrapTable('refresh', params); + if($.common.isNotEmpty(tableId)){ + $("#" + tableId).bootstrapTable('refresh', params); + } else{ + $.btTable.bootstrapTable('refresh', params); + } }, // 导出数据 exportExcel: function(formId) { @@ -478,11 +482,15 @@ // 表单封装处理 form: { // 表单重置 - reset: function(formId) { + reset: function(formId, tableId) { var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId; $("#" + currentId)[0].reset(); if ($.table._option.type == table_type.bootstrapTable) { - $.btTable.bootstrapTable('refresh'); + if($.common.isEmpty(tableId)){ + $.btTable.bootstrapTable('refresh'); + } else{ + $("#" + tableId).bootstrapTable('refresh'); + } } }, // 获取选中复选框项 diff --git a/ruoyi-admin/src/main/resources/templates/demo/table/curd.html b/ruoyi-admin/src/main/resources/templates/demo/table/curd.html index 529ae320..f769dafc 100644 --- a/ruoyi-admin/src/main/resources/templates/demo/table/curd.html +++ b/ruoyi-admin/src/main/resources/templates/demo/table/curd.html @@ -15,7 +15,7 @@ 根据值删除行 - + 删除所有行 diff --git a/ruoyi-admin/src/main/resources/templates/demo/table/multi.html b/ruoyi-admin/src/main/resources/templates/demo/table/multi.html index 43331e02..70842e5a 100644 --- a/ruoyi-admin/src/main/resources/templates/demo/table/multi.html +++ b/ruoyi-admin/src/main/resources/templates/demo/table/multi.html @@ -4,15 +4,71 @@ -
-
+
+ -
+
+ +
+
+
+
+
+ +
+
+
+ +
-
+
@@ -23,12 +79,9 @@ $(function() { var options = { - id: "bootstrap-table-1", + id: "bootstrap-table1", + toolbar: "toolbar1", url: prefix + "/list", - createUrl: prefix + "/add", - updateUrl: prefix + "/edit/{id}", - removeUrl: prefix + "/remove", - exportUrl: prefix + "/export", showSearch: false, showRefresh: false, showToggle: false, @@ -73,8 +126,8 @@ align: 'center', formatter: function(value, row, index) { var actions = []; - actions.push('编辑 '); - actions.push('删除'); + actions.push('编辑 '); + actions.push('删除'); return actions.join(''); } }] @@ -82,21 +135,16 @@ $.table.init(options); }); - function queryParams(params) { - var search = $.table.queryParams(params); - search.userName = '测试1'; - return search; - } $(function() { var options = { - id: "bootstrap-table-2", + id: "bootstrap-table2", + toolbar: "toolbar2", url: prefix + "/list", showSearch: false, showRefresh: false, showToggle: false, showColumns: false, - queryParams: queryParams, columns: [{ checkbox: true }, @@ -137,8 +185,8 @@ align: 'center', formatter: function(value, row, index) { var actions = []; - actions.push('编辑 '); - actions.push('删除'); + actions.push('编辑 '); + actions.push('删除'); return actions.join(''); } }] diff --git a/ruoyi-admin/src/main/resources/templates/monitor/operlog/operlog.html b/ruoyi-admin/src/main/resources/templates/monitor/operlog/operlog.html index 3cef2bb7..bad0f1f2 100644 --- a/ruoyi-admin/src/main/resources/templates/monitor/operlog/operlog.html +++ b/ruoyi-admin/src/main/resources/templates/monitor/operlog/operlog.html @@ -151,7 +151,7 @@ function searchPre() { var data = {}; data.businessTypes = $.common.join($('#businessTypes').selectpicker('val')); - $.table.search('operlog-form', data); + $.table.search('operlog-form', 'bootstrap-table', data); } function resetPre() {