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; + }[] +}