Procházet zdrojové kódy

新增表格参数(通过自定义函数设置页脚样式footerStyle)

RuoYi před 4 roky
rodič
revize
947120d136

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

@@ -130,6 +130,7 @@ var table = {
                     onReorderRow: options.onReorderRow,                 // 当拖拽结束后处理函数
                     queryParams: options.queryParams,                   // 传递参数(*)
                     rowStyle: options.rowStyle,                         // 通过自定义函数设置行样式
+                    footerStyle: options.footerStyle,                   // 通过自定义函数设置页脚样式
                     columns: options.columns,                           // 显示列信息(*)
                     data: options.data,                                 // 被加载的数据
                     responseHandler: $.table.responseHandler,           // 在加载服务器发送来的数据之前处理函数

+ 12 - 0
ruoyi-admin/src/main/resources/templates/demo/table/footer.html

@@ -24,6 +24,7 @@
 		        showRefresh: false,
 		        showToggle: false,
 		        showColumns: false,
+		        footerStyle: footerStyle,
                 columns: [{
 		            checkbox: true
 		        },
@@ -78,6 +79,17 @@
             };
             $.table.init(options);
         });
+        
+        function footerStyle(column) {
+        	return {
+//         	    userBalance: {
+//         	        classes: 'class'
+//         	    },
+        	    userBalance: {
+        	        css: { color: 'red', 'font-weight': 'normal' }
+        	    }
+        	}[column.field]
+          }
     </script>
 </body>
 </html>