From 45d40501534b95bfd4a8f744b560651a87849fa4 Mon Sep 17 00:00:00 2001 From: fengxiang <110431245@qq.com> Date: Fri, 05 Jan 2018 11:21:37 +0800 Subject: [PATCH] 监控点 --- src/app/core/pipe/tyep-handle.pipe.ts | 17 ++++++++++------- 1 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/app/core/pipe/tyep-handle.pipe.ts b/src/app/core/pipe/tyep-handle.pipe.ts index 876b401..47acc5f 100644 --- a/src/app/core/pipe/tyep-handle.pipe.ts +++ b/src/app/core/pipe/tyep-handle.pipe.ts @@ -16,18 +16,21 @@ constructor(private dateService: DateService) { } - transform(value: any, col?: Column): any { + transform(value: any, col?: Column, row?: any ): any { const t = Types.Date; const type = col.type; - if(type!=null&&type.name!=null){ - value = this.transformHandle(value,type.name,type.format); + if ( value != null && value !== '' && type != null && type.name != null) { + value = this.transformHandle(value, type.name, type.format); + } + if (col.format !== null && col.format instanceof Function ) { + value = col.format(value, col, row); } return value; } - private transformHandle(value:any,type: Types,format:any):any{ - switch(type){ + private transformHandle(value: any, type: Types, format: any): any { + switch (type) { case Types.Date: - return this.dateService.date_format(value,format); + return this.dateService.date_format(value, format); } } -} \ No newline at end of file +} -- Gitblit v1.8.0