Selaa lähdekoodia

修复rememberSelected属性设置为true时保留选中状态

RuoYi 6 vuotta sitten
vanhempi
commit
0bf1717b65

+ 6 - 0
ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js

@@ -98,6 +98,12 @@
                     if ($.common.isNotEmpty($.table._option.sidePagination) && $.table._option.sidePagination == 'client') {
                     	return res.rows;
                     } else {
+                    	if ($.common.isNotEmpty($.table._option.rememberSelected) && $.table._option.rememberSelected) {
+                    		var column = $.common.isEmpty($.table._option.uniqueId) ? $.table._option.columns[1].field : $.table._option.uniqueId;
+                    		$.each(res.rows, function(i, row) {
+                                row.state = $.inArray(row[column], selectionIds) !== -1;
+                            })
+                    	}
                         return { rows: res.rows, total: res.total };
                     }
                 } else {

+ 1 - 0
ruoyi-admin/src/main/resources/templates/monitor/logininfor/logininfor.html

@@ -73,6 +73,7 @@
 		        showPageGo: true,
 		        rememberSelected: true,
 		        columns: [{
+		        	field: 'state',
 		            checkbox: true
 		        },
 		        {

+ 1 - 0
ruoyi-admin/src/main/resources/templates/monitor/operlog/operlog.html

@@ -81,6 +81,7 @@
 		        showPageGo: true,
 		        rememberSelected: true,
 		        columns: [{
+		        	field: 'state',
 		            checkbox: true
 		        },
 		        {

+ 1 - 0
ruoyi-admin/src/main/resources/templates/system/role/selectUser.html

@@ -57,6 +57,7 @@
 		        clickToSelect: true,
 		        rememberSelected: true,
 		        columns: [{
+		        	field: 'state',
 		            checkbox: true
 		        },
 		        {