parent
975e9bac8d
commit
cda2afa74f
@ -0,0 +1,93 @@ |
|||||||
|
<!-- start 面包屑 --> |
||||||
|
<app-breadcrumb></app-breadcrumb> |
||||||
|
<!-- end 面包屑 --> |
||||||
|
|
||||||
|
<!--条件搜索--> |
||||||
|
<div class="inner-content"> |
||||||
|
<form nz-form [formGroup]="searchForm" (ngSubmit)="getRequest(true , searchForm.value)"> |
||||||
|
<div nz-row> |
||||||
|
<div nz-col nzSpan="8"> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label [nzSpan]="6">用户名称</nz-form-label> |
||||||
|
<nz-form-control [nzSpan]="16"> |
||||||
|
<input nz-input formControlName="name"/> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> |
||||||
|
</div> |
||||||
|
<div nz-col nzSpan="8"> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label [nzSpan]="6">电话</nz-form-label> |
||||||
|
<nz-form-control [nzSpan]="16"> |
||||||
|
<input nz-input formControlName="phone"/> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> |
||||||
|
</div> |
||||||
|
<div nz-col nzSpan="8"> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label [nzSpan]="6">注册时间</nz-form-label> |
||||||
|
<nz-form-control [nzSpan]="16"> |
||||||
|
<nz-range-picker [nzShowTime]="{ nzFormat: 'HH:mm' }" formControlName="regTime"></nz-range-picker> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div nz-row> |
||||||
|
<div nz-col nzSpan="24" class="search-button"> |
||||||
|
<button nz-button nzType="primary"><i nz-icon nzType="search" nzTheme="outline"></i>搜索</button> |
||||||
|
<button nz-button nzType="default" (click)="resetForm()"><i nz-icon nzType="reload" nzTheme="outline"></i>重置</button> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</form> |
||||||
|
</div> |
||||||
|
|
||||||
|
|
||||||
|
<div class="inner-content"> |
||||||
|
<span>共计 {{total}} 条数据</span> |
||||||
|
<nz-table |
||||||
|
#ajaxTable |
||||||
|
nzShowSizeChanger |
||||||
|
[nzFrontPagination]="false" |
||||||
|
[nzData]="requestData" |
||||||
|
[nzLoading]="loading" |
||||||
|
[nzTotal]="total" |
||||||
|
[(nzPageIndex)]="pageNum" |
||||||
|
[(nzPageSize)]="pageSize" |
||||||
|
[nzScroll]="{ x: '1200px' }" |
||||||
|
(nzPageIndexChange)="getRequest(false , searchForm.value)" |
||||||
|
(nzPageSizeChange)="getRequest(false , searchForm.value)"> |
||||||
|
<thead nzSingleSort> |
||||||
|
<tr> |
||||||
|
<th nzWidth="50px">编号</th> |
||||||
|
<th nzWidth="80px">用户名称</th> |
||||||
|
<th nzWidth="70px">用户头像</th> |
||||||
|
<th nzWidth="100px">用户电话</th> |
||||||
|
<th nzWidth="50px">性别</th> |
||||||
|
<th nzWidth="50px">金币数量</th> |
||||||
|
<th nzWidth="100px">注册时间</th> |
||||||
|
<th nzWidth="50px">状态</th> |
||||||
|
<th nzWidth="80px" nzRight="0px">操作</th> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
<tbody> |
||||||
|
<tr *ngFor="let data of ajaxTable.data; let i = index"> |
||||||
|
<td>{{i+1}}</td> |
||||||
|
<td>{{data.name}}</td> |
||||||
|
<td> |
||||||
|
<img class="head_img" src="{{data.headerImg}}" onerror="this.src='../../../../assets/admin/navigation/icon.png'" alt=""> |
||||||
|
</td> |
||||||
|
<td>{{data.phone}}</td> |
||||||
|
<td>{{data.sex}}</td> |
||||||
|
<td>{{data.gold}}</td> |
||||||
|
<td>{{data.regTime | date: 'yyyy-MM-dd HH:mm'}}</td> |
||||||
|
<td>{{data.status ===1 ? '正常' : '禁用'}}</td> |
||||||
|
<td nzRight="0px" class="table-td-operation"> |
||||||
|
<!-- <a (click)='getDetails(data.id)'><i nz-icon nzType="search" nzTheme="outline" nz-tooltip="详情"></i></a>--> |
||||||
|
<!-- <a *ngIf="data.status !== 2" (click)="getEdit(data.id)"><i nz-icon nzType="form" nzTheme="outline" nz-tooltip="修改"></i></a>--> |
||||||
|
<!-- <a *ngIf="data.status !== 2 && data.status !== 3 " (click)='getAudit(data.id)'><i nz-icon nzType="audit" nzTheme="outline" nz-tooltip="提交审核"></i></a>--> |
||||||
|
<!-- <a *ngIf="data.status !== 2 && data.status !== 3 " (click)='getDelete(data.id)'><i nz-icon nzType="delete" nzTheme="outline" nz-tooltip="删除"></i></a>--> |
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
</tbody> |
||||||
|
</nz-table> |
||||||
|
</div> |
@ -0,0 +1,4 @@ |
|||||||
|
.head_img { |
||||||
|
height: 60px; |
||||||
|
width: 60px; |
||||||
|
} |
@ -0,0 +1,68 @@ |
|||||||
|
import { Component, OnInit } from '@angular/core'; |
||||||
|
import {FormBuilder, FormGroup} from '@angular/forms'; |
||||||
|
import {UserService} from '../../../services/user.service'; |
||||||
|
import {NzMessageService} from 'ng-zorro-antd'; |
||||||
|
|
||||||
|
@Component({ |
||||||
|
selector: 'app-user-list', |
||||||
|
templateUrl: './user-list.component.html', |
||||||
|
styleUrls: ['./user-list.component.scss'] |
||||||
|
}) |
||||||
|
export class UserListComponent implements OnInit { |
||||||
|
|
||||||
|
searchForm: FormGroup; // 搜索框
|
||||||
|
requestData = []; // 列表数据
|
||||||
|
total: number; // 页码
|
||||||
|
pageNum = 1; // 页码
|
||||||
|
pageSize = 10; // 条码
|
||||||
|
loading = true; |
||||||
|
regTime; |
||||||
|
constructor( |
||||||
|
private form: FormBuilder, |
||||||
|
private user: UserService, |
||||||
|
private message: NzMessageService |
||||||
|
) { } |
||||||
|
|
||||||
|
ngOnInit(): void { |
||||||
|
this.init(); |
||||||
|
} |
||||||
|
|
||||||
|
public init(): void { |
||||||
|
this.searchForm = this.form.group({ |
||||||
|
name: [null], |
||||||
|
phone: [null], |
||||||
|
regTime: [null], |
||||||
|
}); |
||||||
|
this.getRequest(true , this.searchForm.value); |
||||||
|
} |
||||||
|
|
||||||
|
// 查询列表
|
||||||
|
public getRequest(reset: boolean = false , whereObject: object) { |
||||||
|
|
||||||
|
if (whereObject['regTime'] != null && whereObject['regTime'].length !== 0) { |
||||||
|
whereObject['regTimeStart'] = whereObject['regTime'][0]; |
||||||
|
whereObject['regTimeEnd'] = whereObject['regTime'][1]; |
||||||
|
} |
||||||
|
this.loading = false; |
||||||
|
if (reset) { |
||||||
|
this.pageNum = 1; |
||||||
|
} |
||||||
|
whereObject['pageNum'] = this.pageNum; |
||||||
|
whereObject['pageSize'] = this.pageSize; |
||||||
|
this.user.getListUser( whereObject, data => { |
||||||
|
console.log(data); |
||||||
|
if (data['return_code'] === '000000') { |
||||||
|
this.requestData = data['return_data'].list; |
||||||
|
this.total = data['return_data'].total; |
||||||
|
} else { |
||||||
|
this.message.error(data['return_msg']); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
// 重置
|
||||||
|
public resetForm(): void { |
||||||
|
this.searchForm.reset(); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,14 @@ |
|||||||
|
import { NgModule } from '@angular/core'; |
||||||
|
import { Routes, RouterModule } from '@angular/router'; |
||||||
|
import {UserListComponent} from './user-list/user-list.component'; |
||||||
|
|
||||||
|
|
||||||
|
const routes: Routes = [ |
||||||
|
{ path: 'user-list', component: UserListComponent }, |
||||||
|
]; |
||||||
|
|
||||||
|
@NgModule({ |
||||||
|
imports: [RouterModule.forChild(routes)], |
||||||
|
exports: [RouterModule] |
||||||
|
}) |
||||||
|
export class UserRoutingModule { } |
@ -0,0 +1,24 @@ |
|||||||
|
import { NgModule } from '@angular/core'; |
||||||
|
import { CommonModule } from '@angular/common'; |
||||||
|
|
||||||
|
import { UserRoutingModule } from './user-routing.module'; |
||||||
|
import { UserListComponent } from './user-list/user-list.component'; |
||||||
|
import {NgZorroAntdModule} from 'ng-zorro-antd'; |
||||||
|
import {SeparateModule} from '../../common/separate/separate.module'; |
||||||
|
import {FormsModule, ReactiveFormsModule} from '@angular/forms'; |
||||||
|
import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module'; |
||||||
|
|
||||||
|
|
||||||
|
@NgModule({ |
||||||
|
declarations: [UserListComponent], |
||||||
|
imports: [ |
||||||
|
CommonModule, |
||||||
|
UserRoutingModule, |
||||||
|
NgZorroAntdModule, |
||||||
|
SeparateModule, |
||||||
|
ReactiveFormsModule, |
||||||
|
FormsModule, |
||||||
|
BreadcrumbModule |
||||||
|
] |
||||||
|
}) |
||||||
|
export class UserModule { } |
@ -1,2 +1,3 @@ |
|||||||
export * from './commons/times.pipe'; |
export * from './commons/times.pipe'; |
||||||
export * from './commons/textarea.pipe'; |
export * from './commons/textarea.pipe'; |
||||||
|
export * from './system.pipe'; |
||||||
|
@ -0,0 +1,21 @@ |
|||||||
|
import { Pipe, PipeTransform } from '@angular/core'; |
||||||
|
|
||||||
|
@Pipe({ |
||||||
|
name: 'system' |
||||||
|
}) |
||||||
|
export class SystemPipe implements PipeTransform { |
||||||
|
|
||||||
|
transform(value: number): string { |
||||||
|
switch (value) { |
||||||
|
case 0: |
||||||
|
return '超级管理员'; |
||||||
|
case 1: |
||||||
|
return '区域账号'; |
||||||
|
case 2: |
||||||
|
return '商户账号'; |
||||||
|
case 3: |
||||||
|
return '门店账号'; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 71 KiB |
Before Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 7.6 KiB |
Loading…
Reference in new issue