Browse Source

fx

master
drfelfel 1 year ago
parent
commit
286c068112
2 changed files with 45 additions and 11 deletions
  1. +9
    -2
      src/routes/panel/volunteer/table/table.component.html
  2. +36
    -9
      src/routes/panel/volunteer/table/table.component.ts

+ 9
- 2
src/routes/panel/volunteer/table/table.component.html View File

@ -21,7 +21,12 @@
</button>
</mat-form-field>
<div class="flex-space"></div>
<button mat-raised-button color="green" (click)="Get()" *ngIf="this.size > 10">
<button
mat-raised-button
color="green"
(click)="Get()"
*ngIf="this.size > 10"
>
<mat-icon>cloud_download</mat-icon>
<span>بارگیری صفحات بعدی</span>
</button>
@ -58,7 +63,9 @@
<td mat-cell *matCellDef="let element" style="width: 25px">
<a
mat-icon-button
href="https://kateb.rayda.ir/register?admin=true&uid={{element.uid}}&token=test"
href="https://kateb.rayda.ir/register?admin=true&uid={{
element.uid
}}&token={{ element.uuid }}"
target="”_blank”"
>
<mat-icon>arrow_back</mat-icon>

+ 36
- 9
src/routes/panel/volunteer/table/table.component.ts View File

@ -14,12 +14,39 @@ export class TableComponent implements OnInit {
public data: MatTableDataSource<object> = new MatTableDataSource<object>();
public loading: boolean = false;
public search: string = '';
public size=0;
public page=0;
public size = 0;
public page = 0;
public uuid = "";
constructor(private excel: Excel, private rayconnect: Rayconnect, private cdr: ChangeDetectorRef) { }
ngOnInit(): void {
this.subscribe();
this.UUID()
}
async UUID() {
const data = await this.rayconnect.RequestBack({
scope: 'kateb',
uniqueID: 'profile',
TokenID: '*',
address: "volunteers/admin/expert/uuid",
info: {
method: "GET",
data: {
page: 0,
limit: 10
}
}
})
if (data['data']['uuid'])
this.uuid = data['data']['uuid']
}
subscribe() {
@ -31,8 +58,8 @@ export class TableComponent implements OnInit {
info: {
method: 'SUB',
data: {
page:0,
limit:10
page: 0,
limit: 10
}
}
}).then(res => {
@ -44,7 +71,7 @@ export class TableComponent implements OnInit {
}, (res => {
let list: object[] = res.data['list'];
let rendered = []
if(res.data['size']){
if (res.data['size']) {
this.size = res.data['size'];
}
for (let i in list) {
@ -59,7 +86,7 @@ export class TableComponent implements OnInit {
}
if(rendered.length > 0){
if (rendered.length > 0) {
this.data.connect().next(rendered)
}
}));
@ -71,7 +98,7 @@ export class TableComponent implements OnInit {
}
Get() {
if(this.size > (this.page+1) * 10){
if (this.size > (this.page + 1) * 10) {
this.page++;
this.rayconnect.RequestBack({
scope: 'kateb',
@ -81,8 +108,8 @@ export class TableComponent implements OnInit {
info: {
method: 'SUB',
data: {
page:this.page,
limit:10
page: this.page,
limit: 10
}
}
})

Loading…
Cancel
Save