From c271b1a8cf49364a9ba5eaea3b16e2d6855278ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A6=BE=E5=87=A0=E6=B5=B7?= Date: Tue, 30 Jun 2020 18:12:23 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E5=86=99=E9=80=9A=E7=94=A8=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common-table/common-table.component.html | 25 +++++++++++++++++++ .../common-table/common-table.component.less | 0 .../common-table/common-table.component.ts | 19 ++++++++++++++ .../common-table/common-table.module.ts | 17 +++++++++++++ .../admin/components/common-table/data.d.ts | 15 +++++++++++ 5 files changed, 76 insertions(+) create mode 100644 src/app/view/admin/components/common-table/common-table.component.html create mode 100644 src/app/view/admin/components/common-table/common-table.component.less create mode 100644 src/app/view/admin/components/common-table/common-table.component.ts create mode 100644 src/app/view/admin/components/common-table/common-table.module.ts create mode 100644 src/app/view/admin/components/common-table/data.d.ts diff --git a/src/app/view/admin/components/common-table/common-table.component.html b/src/app/view/admin/components/common-table/common-table.component.html new file mode 100644 index 0000000..f2c6b45 --- /dev/null +++ b/src/app/view/admin/components/common-table/common-table.component.html @@ -0,0 +1,25 @@ + + + + + {{headData.fieldName}} + + + + + + + + {{headData.fieldName}} + + + + {{action.name}} + + + + + + + diff --git a/src/app/view/admin/components/common-table/common-table.component.less b/src/app/view/admin/components/common-table/common-table.component.less new file mode 100644 index 0000000..e69de29 diff --git a/src/app/view/admin/components/common-table/common-table.component.ts b/src/app/view/admin/components/common-table/common-table.component.ts new file mode 100644 index 0000000..f4beb4e --- /dev/null +++ b/src/app/view/admin/components/common-table/common-table.component.ts @@ -0,0 +1,19 @@ +import {Component, Input, OnInit} from '@angular/core'; +import {Data} from './data'; + +@Component({ + selector: 'app-common-table', + templateUrl: './common-table.component.html', + styleUrls: ['./common-table.component.less'] +}) +export class CommonTableComponent implements OnInit { + + constructor() { + } + + @Input() data: Data[] + + ngOnInit(): void { + } + +} diff --git a/src/app/view/admin/components/common-table/common-table.module.ts b/src/app/view/admin/components/common-table/common-table.module.ts new file mode 100644 index 0000000..298ce25 --- /dev/null +++ b/src/app/view/admin/components/common-table/common-table.module.ts @@ -0,0 +1,17 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {CommonTableComponent} from './common-table.component'; +import {NzTableModule} from "ng-zorro-antd"; + + +@NgModule({ + declarations: [ + CommonTableComponent + ], + imports: [ + CommonModule, + NzTableModule + ] +}) +export class CommonTableModule { +} diff --git a/src/app/view/admin/components/common-table/data.d.ts b/src/app/view/admin/components/common-table/data.d.ts new file mode 100644 index 0000000..6c8ccd5 --- /dev/null +++ b/src/app/view/admin/components/common-table/data.d.ts @@ -0,0 +1,15 @@ +export class Data { + fieldName: string; + fieldValue: string; + show: boolean; + bindData?: T; + isActionColumns: boolean; + action: { + name: string, + color: string, + order: number, + fontSize: string, + click: (data: T) => void, + hover: (data: T) => void; + }[] +}