From a3a8c23b196980732a795713a5eb5fe0c7075bf9 Mon Sep 17 00:00:00 2001 From: fengxiang <110431245@qq.com> Date: Wed, 11 Jul 2018 21:47:13 +0800 Subject: [PATCH] Revert "提交" --- src/app/routes/pro/profile/basic/basic.component.ts | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 45 insertions(+), 0 deletions(-) diff --git a/src/app/routes/pro/profile/basic/basic.component.ts b/src/app/routes/pro/profile/basic/basic.component.ts new file mode 100644 index 0000000..597778c --- /dev/null +++ b/src/app/routes/pro/profile/basic/basic.component.ts @@ -0,0 +1,45 @@ +import { Component } from '@angular/core'; +import { NzMessageService } from 'ng-zorro-antd'; +import { _HttpClient } from '@delon/theme'; +import { SimpleTableColumn } from '@delon/abc'; +import { tap } from 'rxjs/operators'; + +@Component({ + selector: 'pro-profile-basic', + templateUrl: './basic.component.html', +}) +export class ProProfileBaseComponent { + basicNum = 0; + amountNum = 0; + goods = this.http.get('/profile/goods').pipe( + tap((list: any[]) => { + list.forEach(item => { + this.basicNum += Number(item.num); + this.amountNum += Number(item.amount); + }); + }), + ); + goodsColumns: SimpleTableColumn[] = [ + { + title: '������������', + index: 'id', + type: 'link', + click: (item: any) => this.msg.success(`show ${item.id}`), + }, + { title: '������������', index: 'name' }, + { title: '������������', index: 'barcode' }, + { title: '������', index: 'price', type: 'currency' }, + { title: '���������������', index: 'num', className: 'text-right' }, + { title: '������', index: 'amount', type: 'currency' }, + ]; + progress = this.http.get('/profile/progress'); + progressColumns: SimpleTableColumn[] = [ + { title: '������', index: 'time' }, + { title: '������������', index: 'rate' }, + { title: '������', render: 'status' }, + { title: '���������ID', index: 'operator' }, + { title: '������', index: 'cost' }, + ]; + + constructor(private http: _HttpClient, private msg: NzMessageService) {} +} -- Gitblit v1.8.0