diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 9661b1d..33bdb19 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -89,6 +89,7 @@ import {UsertimeGraphComponent} from "./pages/internal-components/usertime.graph import {VipGraphComponents} from "./pages/internal-components/vip.graph.components"; import {ConnectionsGraphComponent} from "./pages/internal-components/connections.graph.component"; import {DoxingGraphComponent} from "./pages/internal-components/doxing.graph.component"; +import {FilterMatChipReportId} from "./pages/internal-components/search-filters/FilterMatChipReportId"; registerLocaleData(localeRu, "ru") @@ -123,6 +124,7 @@ registerLocaleData(localeRu, "ru") FilterMatChipActiveBan, FilterMatChipAdmins, FilterMatChipKillFeed, + FilterMatChipReportId, //dialogs BanViewDialog, NewsViewDialog, diff --git a/src/app/entities/search/ReportSearchFilter.ts b/src/app/entities/search/ReportSearchFilter.ts new file mode 100644 index 0000000..96f41e3 --- /dev/null +++ b/src/app/entities/search/ReportSearchFilter.ts @@ -0,0 +1,35 @@ +import {SearchFilter} from "./SearchFilter"; +import {MatPaginator} from "@angular/material/paginator"; +import {ParamMap} from "@angular/router"; + +export class ReportSearchFilter extends SearchFilter { + ids: number[]|null = []; + + + override createQuery(paginator: MatPaginator | undefined): { [p: string]: any } { + let q:{[param: string]: any} = super.createQuery(paginator); + q["ids"] = this.ids?this.ids.join(","):null; + return q; + } + + override fromQuery(param: ParamMap, paginator: MatPaginator | undefined) { + try {if (param.get("ids")) { // @ts-ignore + this.ids = param.get("ids")?.split(",");}}catch (e) {} + + super.fromQuery(param, paginator); + } + + addReportIdToSearch(id: number) { + if (this.ids == null) + this.ids = []; + if (this.ids.indexOf(id) == -1) + this.ids.push(id) + this.updated = true; + } + + removeReportIdFromSearch(id: number) { + if (this.ids == null) return; + this.ids = this.ids.filter(v => v !== id); + this.updated = true; + } +} diff --git a/src/app/pages/internal-components/search-filters/FilterMatChipReportId.ts b/src/app/pages/internal-components/search-filters/FilterMatChipReportId.ts new file mode 100644 index 0000000..33c260b --- /dev/null +++ b/src/app/pages/internal-components/search-filters/FilterMatChipReportId.ts @@ -0,0 +1,22 @@ +import {Component, Input} from "@angular/core"; +import {ReportSearchFilter} from "../../../entities/search/ReportSearchFilter"; + +@Component({ + selector: "app-filter-mat-chip-reportid", + template: ` +
| ID | + {{row.id}}
+ |
+ Кто пожаловался | {{row.a_nickname}}
@@ -127,7 +138,7 @@ import {AuthDialogRequest} from "../internal-components/dialogs/AuthDialogReques
`
})
export class ReportSearchTable extends AbstractSearchTable |
|---|