var checkPolicy = "${#escape(checkPolicy)}", "${#escape(rootPath)}" + "/policiesAndRegulations/countPoliciesAndRegulations.html"; //第一个ajax获取count总数 $.ajax({ type: "POST" , url: rootPath + "/policiesAndRegulations/countPoliciesAndRegulations.html" , data: {query: checkPolicy} , dataType: "json" , success: function (json) { "${#escape(json.data)}", "${#escape(rootPath)}" + "/policiesAndRegulations/queryPoliciesAndRegulations.html"; layui.use('table', function () { var table = layui.table; //执行一个table实例 table.render({ elem: '#demo' //指定原始表格元素选择器(推荐id选择器) , url: rootPath + "/policiesAndRegulations/queryPoliciesAndRegulations.html" //数据接口 , where: {query: checkPolicy} //传递额外参数 , page: true //开启分页 , limit: 10 //每页显示的数量 , cols: [[ //表头 {field: 'id', title: 'ID', hide: true} , {field: 'lawsName', title: '名称', templet: '

<p style="font-size: 16px;color:#337ab7;"><a style="color: #337ab7;" href="/IQuery/detail-{{d.id}}.html" target="_blank">{{d.lawsName}}

<p style="font-size: 14px;color:#727272;">{{# if(d.lawsCode && d.lawsCode !== "" ){ }}{{d.lawsCode}} {{# if(d.timeliness && d.timeliness !== "" ){ }}/ {{# } }}{{# } }}{{# if(d.timeliness && d.timeliness !== "" ){ }}{{d.timeliness}} {{# if(d.publishTime && d.publishTime !== "" ){ }}/ {{# } }}{{# } }}{{# if(d.publishTime && d.publishTime !== "" ){ }}{{d.publishTime}}发布 {{# if(d.implementationTime && d.implementationTime !== "" ){ }}/ {{# } }}{{# } }}{{# if(d.implementationTime && d.implementationTime !== "" ){ }}{{d.implementationTime}}实施{{# } }}

'}
]]
}); }); } });

使用 Layui Table 渲染政策法规数据 - 更高效的分页展示

原文地址: https://www.cveoy.top/t/topic/p2Tc 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录