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 index 5aa02aa..6fbb235 100644 --- a/src/app/view/admin/components/common-table/common-table.component.html +++ b/src/app/view/admin/components/common-table/common-table.component.html @@ -36,9 +36,14 @@ - + {{action.name}} 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 index e0e3016..be65f87 100644 --- a/src/app/view/admin/components/common-table/common-table.component.ts +++ b/src/app/view/admin/components/common-table/common-table.component.ts @@ -32,7 +32,7 @@ export class CommonTableComponent implements OnInit, OnChanges { dataList: PageList = new PageList(); ngOnInit(): void { - this.getData(); + if (!this.template) this.template = {} this.data.forEach(dat => { if (!dat.action) return; dat.action.forEach(act => { @@ -40,7 +40,9 @@ export class CommonTableComponent implements OnInit, OnChanges { act.hover = () => null; } }) - }) + }); + if (!this.request) return + this.getData(); } getData = () => { 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 index 4244f58..c371954 100644 --- a/src/app/view/admin/components/common-table/common-table.module.ts +++ b/src/app/view/admin/components/common-table/common-table.module.ts @@ -4,7 +4,7 @@ import {CommonTableComponent} from './common-table.component'; import { NzCardModule, NzDividerModule, - NzIconModule, NzOutletModule, + NzIconModule, NzOutletModule, NzPopconfirmModule, NzTableModule, NzToolTipModule, NzTypographyModule @@ -26,7 +26,8 @@ import { NzToolTipModule, NzCardModule, NzIconModule, - NzOutletModule + NzOutletModule, + NzPopconfirmModule ] }) export class CommonTableModule { diff --git a/src/app/view/admin/components/common-table/data.ts b/src/app/view/admin/components/common-table/data.ts index 421f3bb..4eb528f 100644 --- a/src/app/view/admin/components/common-table/data.ts +++ b/src/app/view/admin/components/common-table/data.ts @@ -17,6 +17,7 @@ export class Data { color?: string, order?: number, fontSize?: string, + needConfirm?: boolean, click: (data: T) => void, hover?: (data: T) => void | null; }[] = []