提交修改

pull/1/head
yuanye 4 years ago
parent a27ab17c17
commit beb234c28d
  1. 11
      src/app/admin/merchant/merchant-routing.module.ts
  2. 14
      src/app/admin/merchant/merchant.module.ts
  3. 22
      src/app/admin/user/user-list/user-list.component.html
  4. 29
      src/app/admin/user/user-list/user-list.component.ts
  5. 2
      src/app/services/icon.service.ts
  6. 12
      src/app/services/user.service.ts

@ -0,0 +1,11 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
const routes: Routes = [];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class MerchantRoutingModule { }

@ -0,0 +1,14 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { MerchantRoutingModule } from './merchant-routing.module';
@NgModule({
declarations: [],
imports: [
CommonModule,
MerchantRoutingModule
]
})
export class MerchantModule { }

@ -22,6 +22,17 @@
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">用户状态</nz-form-label>
<nz-form-control [nzSpan]="16">
<nz-select nzShowSearch nzAllowClear formControlName="status" nzPlaceHolder="请选择用户状态">
<nz-option nzLabel="禁用" nzValue="0"></nz-option>
<nz-option nzLabel="正常" nzValue="1"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8"> <div nz-col nzSpan="8">
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="6">注册时间</nz-form-label> <nz-form-label [nzSpan]="6">注册时间</nz-form-label>
@ -65,7 +76,7 @@
<th nzWidth="50px">性别</th> <th nzWidth="50px">性别</th>
<th nzWidth="50px">金币数量</th> <th nzWidth="50px">金币数量</th>
<th nzWidth="100px">注册时间</th> <th nzWidth="100px">注册时间</th>
<th nzWidth="50px">状态</th> <th nzWidth="50px" [nzSortFn]="true">状态</th>
<th nzWidth="80px" nzRight="0px">操作</th> <th nzWidth="80px" nzRight="0px">操作</th>
</tr> </tr>
</thead> </thead>
@ -82,12 +93,15 @@
<td>{{data.regTime | date: 'yyyy-MM-dd HH:mm'}}</td> <td>{{data.regTime | date: 'yyyy-MM-dd HH:mm'}}</td>
<td>{{data.status ===1 ? '正常' : '禁用'}}</td> <td>{{data.status ===1 ? '正常' : '禁用'}}</td>
<td nzRight="0px" class="table-td-operation"> <td nzRight="0px" class="table-td-operation">
<!-- <a (click)='getDetails(data.id)'><i nz-icon nzType="search" nzTheme="outline" nz-tooltip="详情"></i></a>--> <a ><i nz-icon [nzIconfont]="'icon-dingdanxiangqing_icon'" nz-tooltip="订单列表"></i></a>
<nz-divider nzType="vertical"></nz-divider>
<!-- <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" (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 (click)='getForbiddenUser(data.id , data.status)'><i nz-icon nzType="{{data.status === 1 ? 'stop': 'check-circle'}}" nzTheme="outline" nz-tooltip="{{data.status === 1 ? '禁用': '启用'}}"></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>--> <!-- <a *ngIf="data.status !== 2 && data.status !== 3 " (click)='getDelete(data.id)'><i nz-icon nzType="delete" nzTheme="outline" nz-tooltip="删除"></i></a>-->
</td> </td>
</tr>
</tbody> </tbody>
</nz-table> </nz-table>
</div> </div>

@ -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);
});
}
});
}
} }

@ -12,7 +12,7 @@ export class IconService {
constructor(private iconService: NzIconService) { constructor(private iconService: NzIconService) {
this.iconService.fetchFromIconfont({ this.iconService.fetchFromIconfont({
scriptUrl: 'https://at.alicdn.com/t/font_2413274_o08racrjdz.js' scriptUrl: 'https://at.alicdn.com/t/font_2413274_zk7ae4qcrvg.js'
}); });
} }
} }

@ -48,4 +48,16 @@ export class UserService {
}); });
} }
/**
*
*
* @param userId id
* @param callBack
*/
public forbiddenUser(userId: number, callBack) {
this.http.get(environment.baseUrl + 'highUser/forbiddenUser?userId=' + userId).subscribe(data => {
callBack(data);
});
}
} }

Loading…
Cancel
Save