From 2d4cbcc4f92edbc4f926d9710bdda64520039c2b Mon Sep 17 00:00:00 2001
From: fengxiang <110431245@qq.com>
Date: Fri, 05 Jan 2018 11:21:44 +0800
Subject: [PATCH] Merge branch 'develop' of http://blit.7drlb.com:8888/r/screen-frontend into develop
---
src/app/core/pipe/tyep-handle.pipe.ts | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/app/core/pipe/tyep-handle.pipe.ts b/src/app/core/pipe/tyep-handle.pipe.ts
index a9a8ab3..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) {
+ 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{
+ private transformHandle(value: any, type: Types, format: any): any {
switch (type) {
case Types.Date:
return this.dateService.date_format(value, format);
}
}
-}
\ No newline at end of file
+}
--
Gitblit v1.8.0