Sfoglia il codice sorgente

分页记住选择指定列值数据问题修正

RuoYi 5 anni fa
parent
commit
81ec67d4ea

File diff suppressed because it is too large
+ 0 - 0
ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/bootstrap-table.min.js


+ 7 - 2
ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js

@@ -155,6 +155,7 @@
             		if ($.common.isNotEmpty($.table._option.rememberSelected) && $.table._option.rememberSelected) {
             			func = $.inArray(e.type, ['check', 'check-all']) > -1 ? 'union' : 'difference';
             			selectionIds = _[func](selectionIds, rowIds);
+            			selectionRows = _[func](selectionRows, rows);
             		}
             	});
             	// 图片预览事件
@@ -365,7 +366,9 @@
         	        return row[column];
         	    });
             	if ($.common.isNotEmpty($.table._option.rememberSelected) && $.table._option.rememberSelected) {
-            		rows = rows.concat(selectionIds);
+            		rows = $.map(selectionRows, function (row) {
+                        return row[column];
+                    });
             	}
             	return $.common.uniqueFn(rows);
             },
@@ -388,7 +391,9 @@
         	        return row[$.table._option.columns[1].field];
         	    });
             	if ($.common.isNotEmpty($.table._option.rememberSelected) && $.table._option.rememberSelected) {
-            		rows = rows.concat(selectionIds);
+            		rows = $.map(selectionRows, function (row) {
+                        return row[$.table._option.columns[1].field];
+                    });
             	}
             	return $.common.uniqueFn(rows);
             },

+ 2 - 1
ruoyi-admin/src/main/resources/templates/demo/table/remember.html

@@ -81,7 +81,8 @@
         
         // 选中数据
         function checkItem(){
-        	var arrays = $.table.selectColumns("userId");
+        	// var arrays = $.table.selectColumns("userId");
+        	var arrays = $.table.selectColumns("userCode");
         	alert(arrays);
         }
     </script>

Some files were not shown because too many files changed in this diff