|
|
@ -2,6 +2,8 @@ import { Component, OnInit } from '@angular/core'; |
|
|
|
import {FormBuilder, FormGroup} from '@angular/forms'; |
|
|
|
import {FormBuilder, FormGroup} from '@angular/forms'; |
|
|
|
import {UserService} from '../../../services/user.service'; |
|
|
|
import {UserService} from '../../../services/user.service'; |
|
|
|
import {NzMessageService} from 'ng-zorro-antd'; |
|
|
|
import {NzMessageService} from 'ng-zorro-antd'; |
|
|
|
|
|
|
|
import {IconService} from '../../../services/icon.service'; |
|
|
|
|
|
|
|
import {CommonsService} from '../../../services/commons.service'; |
|
|
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
@Component({ |
|
|
|
selector: 'app-user-list', |
|
|
|
selector: 'app-user-list', |
|
|
@ -17,11 +19,15 @@ export class UserListComponent implements OnInit { |
|
|
|
pageSize = 10; // 条码
|
|
|
|
pageSize = 10; // 条码
|
|
|
|
loading = true; |
|
|
|
loading = true; |
|
|
|
regTime; |
|
|
|
regTime; |
|
|
|
|
|
|
|
|
|
|
|
constructor( |
|
|
|
constructor( |
|
|
|
private form: FormBuilder, |
|
|
|
private form: FormBuilder, |
|
|
|
private user: UserService, |
|
|
|
private user: UserService, |
|
|
|
private message: NzMessageService |
|
|
|
private iconService: IconService, |
|
|
|
) { } |
|
|
|
private message: NzMessageService, |
|
|
|
|
|
|
|
private common: CommonsService |
|
|
|
|
|
|
|
) { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
ngOnInit(): void { |
|
|
|
this.init(); |
|
|
|
this.init(); |
|
|
@ -30,6 +36,7 @@ export class UserListComponent implements OnInit { |
|
|
|
public init(): void { |
|
|
|
public init(): void { |
|
|
|
this.searchForm = this.form.group({ |
|
|
|
this.searchForm = this.form.group({ |
|
|
|
name: [null], |
|
|
|
name: [null], |
|
|
|
|
|
|
|
status: [null], |
|
|
|
phone: [null], |
|
|
|
phone: [null], |
|
|
|
regTime: [null], |
|
|
|
regTime: [null], |
|
|
|
}); |
|
|
|
}); |
|
|
@ -40,8 +47,8 @@ export class UserListComponent implements OnInit { |
|
|
|
public getRequest(reset: boolean = false, whereObject: object) { |
|
|
|
public getRequest(reset: boolean = false, whereObject: object) { |
|
|
|
|
|
|
|
|
|
|
|
if (whereObject['regTime'] != null && whereObject['regTime'].length !== 0) { |
|
|
|
if (whereObject['regTime'] != null && whereObject['regTime'].length !== 0) { |
|
|
|
whereObject['regTimeStart'] = whereObject['regTime'][0]; |
|
|
|
whereObject['regTimeStart'] = whereObject['regTime'][0].getTime(); |
|
|
|
whereObject['regTimeEnd'] = whereObject['regTime'][1]; |
|
|
|
whereObject['regTimeEnd'] = whereObject['regTime'][1].getTime(); |
|
|
|
} |
|
|
|
} |
|
|
|
this.loading = false; |
|
|
|
this.loading = false; |
|
|
|
if (reset) { |
|
|
|
if (reset) { |
|
|
@ -65,4 +72,18 @@ export class UserListComponent implements OnInit { |
|
|
|
this.searchForm.reset(); |
|
|
|
this.searchForm.reset(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public getForbiddenUser(id, status: any): void { |
|
|
|
|
|
|
|
const message = (status === 1 ? '是否禁用当前用户' : '是否启用当前用户'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.common.showConfirm(message, data => { |
|
|
|
|
|
|
|
if (data) { |
|
|
|
|
|
|
|
this.user.forbiddenUser(id, dataUser => { |
|
|
|
|
|
|
|
console.log(dataUser); |
|
|
|
|
|
|
|
this.getRequest(false , this.searchForm.value); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|