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 98ad2b780..b99ca2bab 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 @@ -142,6 +142,7 @@ var table = { responseHandler: $.table.responseHandler, // 在加载服务器发送来的数据之前处理函数 onLoadSuccess: $.table.onLoadSuccess, // 当所有数据被加载时触发处理函数 exportOptions: options.exportOptions, // 前端导出忽略列索引 + printPageBuilder: printPageBuilder, // 自定义打印页面模板 detailFormatter: options.detailFormatter, // 在行下面展示其他数据列表 }); }, diff --git a/ruoyi-admin/src/main/resources/templates/demo/table/print.html b/ruoyi-admin/src/main/resources/templates/demo/table/print.html index fbf1f49f7..2c8edc710 100644 --- a/ruoyi-admin/src/main/resources/templates/demo/table/print.html +++ b/ruoyi-admin/src/main/resources/templates/demo/table/print.html @@ -31,8 +31,10 @@ showRefresh: false, showToggle: false, showColumns: false, + printPageBuilder: printPageBuilder, columns: [{ - checkbox: true + checkbox: true, + printIgnore: true }, { field : 'userId', @@ -61,6 +63,7 @@ { title: '操作', align: 'center', + printIgnore: true, formatter: function(value, row, index) { var actions = []; actions.push('删除'); @@ -78,6 +81,50 @@ $.modal.msgSuccess('已删除!'); }); } + + // 自定义打印页面模板 + function printPageBuilder(table){ + return ` + + + + + + Print Table + +
${table}
+ + ` + } \ No newline at end of file