From c5b814dcf5ae60e89169dadf6cb039261bb23a23 Mon Sep 17 00:00:00 2001
From: 沈斌 <bluelazysb@hotmail.com>
Date: Tue, 19 Dec 2017 16:26:41 +0800
Subject: [PATCH] updates
---
src/app/routes/users/installer/edit/edit.component.ts | 10 ++--
src/app/routes/users/installer/installer.component.html | 14 +++----
src/app/routes/users/installer/edit/edit.component.html | 32 ++++++---------
src/app/routes/users/installer/installer.component.ts | 7 ++-
4 files changed, 28 insertions(+), 35 deletions(-)
diff --git a/src/app/routes/users/installer/edit/edit.component.html b/src/app/routes/users/installer/edit/edit.component.html
index 0cbf353..42e42ae 100644
--- a/src/app/routes/users/installer/edit/edit.component.html
+++ b/src/app/routes/users/installer/edit/edit.component.html
@@ -7,25 +7,9 @@
<div nz-form-control nz-col [nzSpan]="8">
<input nz-input [(ngModel)]="user.name" name="name" maxlength="30" required />
</div>
- <div nz-form-label nz-col [nzSpan]="4"><label>������</label></div>
- <div nz-form-control nz-col [nzSpan]="8">
- <nz-select [(ngModel)]="user.sex" name="sex" required [nzAllowClear]="false">
- <nz-option
- *ngFor="let i of gender"
- [nzLabel]="i"
- [nzValue]="i">
- </nz-option>
- </nz-select>
- </div>
- </div>
- <div nz-form-item nz-row class="mb-sm">
<div nz-form-label nz-col [nzSpan]="4"><label>������</label></div>
<div nz-form-control nz-col [nzSpan]="8">
<input nz-input [(ngModel)]="user.mobile" name="mobile" maxlength="11" required />
- </div>
- <div nz-form-label nz-col [nzSpan]="4"><label>������</label></div>
- <div nz-form-control nz-col [nzSpan]="8">
- <input nz-input [(ngModel)]="user.password" name="password" maxlength="50" required />
</div>
</div>
<div nz-form-item nz-row class="mb-sm">
@@ -41,11 +25,21 @@
<div nz-form-item nz-row class="mb-sm">
<div nz-form-label nz-col [nzSpan]="4"><label>������</label></div>
<div nz-form-control nz-col [nzSpan]="8">
- <input nz-input [(ngModel)]="user.organization" name="organization" maxlength="50" placeholder="50���������" />
+ <input nz-input [(ngModel)]="user.organizationId" name="organizationId" maxlength="50" placeholder="50���������" />
</div>
- <div nz-form-label nz-col [nzSpan]="4"><label>������</label></div>
+ <div nz-form-label nz-col [nzSpan]="4"><label>������</label></div>
<div nz-form-control nz-col [nzSpan]="8">
- <input nz-input [(ngModel)]="user.nickname" name="nickname" maxlength="20" placeholder="20���������" />
+ <input nz-input [(ngModel)]="user.password" name="password" maxlength="50" placeholder="50���������" />
+ </div>
+ </div>
+ <div nz-form-item nz-row class="mb-sm">
+ <div nz-form-label nz-col [nzSpan]="4"><label>������������</label></div>
+ <div nz-form-control nz-col [nzSpan]="8">
+ <input nz-input [(ngModel)]="user.createTime" name="createTime" maxlength="20" required />
+ </div>
+ <div nz-form-label nz-col [nzSpan]="4"><label>������������</label></div>
+ <div nz-form-control nz-col [nzSpan]="8">
+ <input nz-input [(ngModel)]="user.expireTime" name="expireTime" maxlength="20" required />
</div>
</div>
<div class="modal-footer">
diff --git a/src/app/routes/users/installer/edit/edit.component.ts b/src/app/routes/users/installer/edit/edit.component.ts
index 09ed0b9..a13483d 100644
--- a/src/app/routes/users/installer/edit/edit.component.ts
+++ b/src/app/routes/users/installer/edit/edit.component.ts
@@ -1,8 +1,7 @@
import { NzModalSubject, NzMessageService } from 'ng-zorro-antd';
-import { HttpClient } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
-import { _HttpClient } from '@delon/theme';
import { ModalHelper } from '@delon/theme';
+import { HttpClient } from '@angular/common/http';
@Component({
selector: 'app-edit',
@@ -12,17 +11,18 @@
export class UserInstallerEditComponent implements OnInit {
user: any;
- gender: string[] = [ '���', '���' ];
constructor(
private modalHelper: ModalHelper,
private subject: NzModalSubject,
public msgSrv: NzMessageService,
- public http: _HttpClient) { }
+ public http: HttpClient) { }
ngOnInit() {
if (this.user.id > 0) {
- this.http.get('./assets/pois.json').subscribe(res => this.user = res.data[0]);
+ this.http.get('http://localhost:8001/user/operate_user/' + this.user.id).subscribe((res: any) => {
+ this.user = res.data[0];
+ });
}
}
diff --git a/src/app/routes/users/installer/installer.component.html b/src/app/routes/users/installer/installer.component.html
index 413e329..e0e3db3 100644
--- a/src/app/routes/users/installer/installer.component.html
+++ b/src/app/routes/users/installer/installer.component.html
@@ -53,16 +53,15 @@
<label nz-checkbox [(ngModel)]="allChecked" [nzIndeterminate]="indeterminate" (ngModelChange)="checkAll($event)"></label>
</th>
<th nz-th><span>������</span></th>
- <th nz-th><span>������</span></th>
<th nz-th><span>������</span></th>
<th nz-th><span>������������</span></th>
<th nz-th><span>���������</span></th>
<th nz-th><span>������</span></th>
<th nz-th><span>������</span></th>
- <th nz-th><span>������</span></th>
+ <th nz-th><span>������������</span></th>
<th nz-th>
- <span>������</span>
- <nz-table-sort [(nzValue)]="sortMap.updatedAt" (nzValueChange)="sort('updatedAt',$event)"></nz-table-sort>
+ <span>������������</span>
+ <nz-table-sort [(nzValue)]="sortMap.updatedAt" (nzValueChange)="sort('expireTime',$event)"></nz-table-sort>
</th>
<th nz-th><span>������</span></th>
</tr>
@@ -74,14 +73,13 @@
</label>
</td>
<td nz-td>{{i.name}}</td>
- <td nz-td>{{i.sex}}</td>
<td nz-td>{{i.mobile}}</td>
<td nz-td>{{i.email}}</td>
<td nz-td>{{i.weixin}}</td>
<td nz-td>{{i.password}}</td>
- <td nz-td>{{i.organization}}</td>
- <td nz-td>{{i.nickname}}</td>
- <td nz-td>{{i.updatedAt | _date}}</td>
+ <td nz-td>{{i.organizationId}}</td>
+ <td nz-td>{{i.createTime | _date}}</td>
+ <td nz-td>{{i.expireTime | _date}}</td>
<td nz-td>
<a (click)="edit(i)">������</a>
<span nz-table-divider></span>
diff --git a/src/app/routes/users/installer/installer.component.ts b/src/app/routes/users/installer/installer.component.ts
index f7ac49c..844a329 100644
--- a/src/app/routes/users/installer/installer.component.ts
+++ b/src/app/routes/users/installer/installer.component.ts
@@ -1,7 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { NzMessageService } from 'ng-zorro-antd';
import { ModalHelper } from '@delon/theme';
-import { _HttpClient } from '@delon/theme';
+import { HttpClient } from '@angular/common/http';
import { getInstaller, deleteInstaller } from '../../../../../_mock/installer.service';
import * as moment from 'moment';
import { UserInstallerEditComponent } from './edit/edit.component';
@@ -29,7 +29,7 @@
sortMap: any = {};
constructor(
- public http: _HttpClient,
+ public http: HttpClient,
public msgSrv: NzMessageService,
private modalHelper: ModalHelper) {}
@@ -41,7 +41,8 @@
if (reload) {
this.q.pi = 1;
}
- this.http.get('./assets/users-installer-data.json', this.q).subscribe((res: any) => {
+ this.http.get('http://localhost:8001/user/operate_user', this.q).subscribe((res: any) => {
+
let data = res.data;
const total = res.total;
--
Gitblit v1.8.0