56 lines
1.7 KiB
TypeScript
56 lines
1.7 KiB
TypeScript
import { Component, inject } from '@angular/core';
|
|
import { MatDialog, MatDialogModule } from '@angular/material/dialog';
|
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
import { HotToastService } from '@ngxpert/hot-toast';
|
|
import { ICellRendererAngularComp } from 'ag-grid-angular';
|
|
import { ICellRendererParams } from 'ag-grid-community';
|
|
import { ApiService } from '../../../api.service';
|
|
import { SystemManagerComponent } from '../../../../modules/system/components/system-manager/system-manager.component';
|
|
|
|
@Component({
|
|
selector: 'app-ag-system-manager',
|
|
standalone: true,
|
|
imports: [MatDialogModule, MatTooltipModule],
|
|
templateUrl: './ag-system-manager.component.html',
|
|
styleUrl: './ag-system-manager.component.scss'
|
|
})
|
|
export class AgSystemManagerComponent implements ICellRendererAngularComp {
|
|
|
|
private api: ApiService = inject(ApiService);
|
|
private dialog: MatDialog = inject(MatDialog);
|
|
private toast = inject(HotToastService);
|
|
|
|
params!: ICellRendererParams<any, any, any>;
|
|
system: any;
|
|
|
|
agInit(params: ICellRendererParams<any, any, any>): void {
|
|
this.params = params;
|
|
this.system = params.data;
|
|
}
|
|
refresh(params: ICellRendererParams<any, any, any>): boolean {
|
|
return false;
|
|
}
|
|
|
|
|
|
openManager() {
|
|
const ref = this.dialog.open(SystemManagerComponent, {
|
|
data: this.system,
|
|
autoFocus: false,
|
|
maxHeight: "calc(100vh - 24px)",
|
|
maxWidth: "calc(100vw - 24px)",
|
|
width: "50vw",
|
|
minWidth: "300px",
|
|
height: "70vh",
|
|
disableClose: true
|
|
})
|
|
|
|
// ref.afterClosed().subscribe({
|
|
// next: n => {
|
|
// if (n) {
|
|
// this.deleteThisKey();
|
|
// }
|
|
// }
|
|
// })
|
|
}
|
|
}
|