标签:cost 代码 temp let hat over ips ret icon
在项目里table开启合计功能,但是并未进行数据计算,后来发现是field写错了的问题,上代码
for(var i = 0; i < that.checkboxAll.data.length; i++) { var $data = that.checkboxAll.data[i]; if($data.visible) { const val = $data.value; th.push({ field: val, //field是表格数据列的唯一标识,就是这里之前写错了,导致table合计无法实现 title: ‘<span class="layui-icon-tips" layui-tip-data=" ‘ + that.checkboxAll.data[i].des + ‘ "> ‘ + that.checkboxAll.data[i].label + ‘ </span>‘, templet: function(d) { var RMBhtml = ‘‘, percentHTML = ‘‘; if(val == ‘cost‘ || val == ‘transactiontotal‘ || val == ‘cpc‘) { RMBhtml = ‘¥ ‘ } if(val == ‘ctr‘ || val == ‘cvr‘||val == ‘coverage‘) { percentHTML = ‘%‘; } return RMBhtml + (d[val] || 0.00) + percentHTML; }, unresize: true, totalRow: true, }) } }
标签:cost 代码 temp let hat over ips ret icon
原文地址:https://www.cnblogs.com/feijiediyimei/p/10021667.html