From 2589ef1cf031fed4f7348d0f53ff2383e196d8a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Wed, 29 Jun 2022 08:56:33 +0800 Subject: [PATCH] update --- examples/table-test.html | 2 +- gulpfile.js | 4 +--- src/modules/table.js | 5 ++++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/examples/table-test.html b/examples/table-test.html index 5085ee2a..fe7e75de 100644 --- a/examples/table-test.html +++ b/examples/table-test.html @@ -166,7 +166,7 @@ layui.use(['table', 'dropdown'], function(){ return td.find('select').val(); }} ,{field:'sign', title:'签名', minWidth: 200, style:'color: #5FB878', edit: 'textarea'} - ,{field: 'experience', title: '积分', width: 100, sort: true, align:'center', totalRow: !1 || '{{= d.TOTAL_NUMS }} 分 😊', templet: '
'} + ,{field: 'experience', title: '积分', width: 100, sort: true, align:'center', totalRow: !1 ? '{{=d.LAY_COL.field}}' : '{{= d.TOTAL_NUMS }} 分 😊', templet: ''} ,{field:'ip', title:'IP', width: 120, align: 'right'} ,{field:'checkin', title:'打卡', width: 100, sort: true, totalRow: '{{= parseInt(d.TOTAL_NUMS) }} 次'} ,{field:'joinTime', title:'加入时间', width: 120} diff --git a/gulpfile.js b/gulpfile.js index 4811bf36..867ae253 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,6 +1,4 @@ -/** - * Building Layui - */ +'use strict'; const pkg = require('./package.json'); const gulp = require('gulp'); diff --git a/src/modules/table.js b/src/modules/table.js index ddbeae35..dc2d7c6e 100644 --- a/src/modules/table.js +++ b/src/modules/table.js @@ -1139,7 +1139,9 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){ var text = item3.totalRowText || '' ,decimals = 'totalRowDecimals' in item3 ? item3.totalRowDecimals : 2 ,thisTotalNum = parseFloat(totalNums[field]).toFixed(decimals) - ,tplData = {} + ,tplData = { + LAY_COL: item3 + } ,getContent; tplData[field] = thisTotalNum; @@ -1180,6 +1182,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){ if(typeof totalRow === 'string'){ return laytpl(totalRow).render($.extend({ TOTAL_NUMS: totalNums[field] + ,LAY_COL: item3 }, item3)); } return content;