From b8e2e1524169d0008accf22f2e796495ad45a378 Mon Sep 17 00:00:00 2001
From: xufenglei <xufenglei>
Date: Thu, 04 Jan 2018 16:06:40 +0800
Subject: [PATCH] 账户管理
---
src/app/routes/users/installer/installer.component.ts | 28 +++++++++++++++++++---------
1 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/src/app/routes/users/installer/installer.component.ts b/src/app/routes/users/installer/installer.component.ts
index 70b7daa..d1cacb7 100644
--- a/src/app/routes/users/installer/installer.component.ts
+++ b/src/app/routes/users/installer/installer.component.ts
@@ -2,9 +2,9 @@
import { NzMessageService } from 'ng-zorro-antd';
import { ModalHelper } from '@delon/theme';
import { HttpClient } from '@angular/common/http';
-import * as moment from 'moment';
import { UserInstallerEditComponent } from './edit/edit.component';
import { environment } from '../../../../environments/environment';
+import { DateService } from '../../../core/services/date.service';
@Component({
selector: 'app-installer',
@@ -31,6 +31,7 @@
constructor(
public http: HttpClient,
+ public dateSrv: DateService,
public msgSrv: NzMessageService,
private modalHelper: ModalHelper) {}
@@ -42,7 +43,7 @@
if (reload) {
this.q.pi = 1;
}
- this.http.get(environment.SERVER_BASH_URL + '/user/operate_user', this.q).subscribe((res: any) => {
+ this.http.get(environment.SERVER_BASH_URL + '/operateUser/list', {params: this.q}).subscribe((res: any) => {
// let data = res.data;
// const total = res.total;
//
@@ -67,8 +68,10 @@
// this.data = data.slice(start, start + this.q.ps);
// this.total = total;
- this.data = res.data;
- this.total = res.total;
+ this.data = res.data.data;
+ this.total = res.data.total;
+ this.dataChange(this.data);
+
});
}
@@ -88,7 +91,7 @@
}
delete(user) {
- this.http.delete(environment.SERVER_BASH_URL + '/user/operate_user/' + user.id).subscribe((res: any) => {
+ this.http.post(environment.SERVER_BASH_URL + '/operateUser/operateUser/id',user).subscribe((res: any) => {
this.msgSrv.success('���������������������������');
this.load(true);
});
@@ -99,15 +102,18 @@
this.selectedRows.forEach(i => {
ids.push(i.id);
});
- console.log(ids);
- this.http.post(environment.SERVER_BASH_URL + '/user/operate_user/deleteList', ids).subscribe((res: any) => {
+ this.http.post(environment.SERVER_BASH_URL + '/operateUser/operateUsers/ids', ids).subscribe((res: any) => {
this.load(true);
});
}
checkAll(value: boolean) {
this.curRows.forEach(i => {
- i.checked = value;
+ if (i.isDelete == '1') {
+ i.checked = false;
+ } else {
+ i.checked = value;
+ }
});
this.refreshStatus();
}
@@ -128,7 +134,7 @@
sort(field: string, value: any) {
this.sortMap = {};
this.sortMap[field] = value;
- this.q.sorter = value ? `${field}_${value}` : '';
+ this.q.sorter = value ? `${field} ${value}` : '';
this.load(true);
}
@@ -136,4 +142,8 @@
for (const item of ls) item.value = false;
this.load(true);
}
+
+ format_date(date) {
+ return this.dateSrv.date_format(date, 'YYYY-MM-DD');
+ }
}
--
Gitblit v1.8.0