行表达式

展开 层次号 标签

      行表达式
        1  行过滤
            1.1  示例
                1.1.1  数字
                    1.1.1.1  列值不是数字
行表达式
isNaN(#{某列} - 1)
                    1.1.1.2  比较数字
行表达式
#{数字列1} != 0 || #{数字列1} < #{数字列2}
                    1.1.1.3  比较统计值
行表达式
#{数字列} < #{数字列-均值}
                1.1.2  时间
                    1.1.2.1  列值的时间值
行表达式
if (#{时间列} != null)
   new Date(#{时间列}.getTime()
else
   -1;
                    1.1.2.2  时间点
行表达式
#{时间列} == '2016-05-19 11:34:28'
                    1.1.2.3  匹配时间
行表达式
if (#{时间列} != null)
   #{时间列}.startsWith('2016-05-19 09')
else
   undefined;
                    1.1.2.4  比较时间
行表达式
if (#{时间列} != null)
   new Date(#{时间列}).getTime()  > new Date('2016/05/19 09:23:12').getTime()
else
   undefined;
                    1.1.2.5  格式化时间
行表达式
function formatDate(date) {
     var y = date.getFullYear();
     var m = date.getMonth() + 1;
     m = m < 10 ? ('0' + m) : m;
     var d = date.getDate();
     d = d < 10 ? ('0' + d) : d;
     var h =date.getHours();
     h = h < 10 ? ('0' + h) : h;
     var M =date.getMinutes();
     M = M < 10 ? ('0' + M) : M;
     var s =date.getSeconds();
     s = s < 10 ? ('0' + s) : s;
     return y + '-' + m + '-' + d + ' ' + h + ':' + M + ':' + s;
}
if (#{时间列} != null)
   formatDate(new Date(#{时间列}));
else
   null;
                    1.1.2.6  是否为星期日
行表达式
if (#{时间列} != null)
   new Date(#{时间列}).getDay() == 0
else
   undefined;
                1.1.3  字符串
                    1.1.3.1  列值为empty
行表达式
#{字符串列} == ''
                    1.1.3.2  列值不为null
行表达式
#{字符串列} != null
                    1.1.3.3  字串长度
行表达式
if ( #{字符串列} != null ) 
    #{字符串列}.length
else
    -1
                    1.1.3.4  包含子串
行表达式
if ( #{字符串列} != null ) 
    #{字符串列}.search(/昔去雪如花/ig)
else
    -1
                    1.1.3.5  子串位置
行表达式
if ( #{字符串列} != null ) 
    #{字符串列}.indexOf('今来花似雪')
else
    -1
                    1.1.3.6  比较
行表达式
#{字符串列} === '只恐夜深花睡去'
                    1.1.3.7  替换首个
行表达式
if ( #{字符串列} != null ) 
    #{字符串列}.replace("敲门", "推门");
else
   null
                    1.1.3.8  替换所有
行表达式
if ( #{字符串列} != null ) 
    #{字符串列}.replace(/怨年华/g, "鸟惊心");
else
   null
                    1.1.3.9  开始于
行表达式
if ( #{字符串列} != null ) 
    #{字符串列}.startsWith('君不见')
else
   undefined
                    1.1.3.10  结尾于
行表达式
if ( #{字符串列} != null ) 
    #{字符串列}.endsWith('需尽欢')
else
   undefined
                    1.1.3.11  特定值
行表达式
var array = [ 'A', 'B', 'C', 'D' ];
array.includes(#{字符串列})