沈斌
2017-12-19 c5b814dcf5ae60e89169dadf6cb039261bb23a23
updates
4 files modified
63 ■■■■■ changed files
src/app/routes/users/installer/edit/edit.component.html 32 ●●●●● patch | view | raw | blame | history
src/app/routes/users/installer/edit/edit.component.ts 10 ●●●● patch | view | raw | blame | history
src/app/routes/users/installer/installer.component.html 14 ●●●●● patch | view | raw | blame | history
src/app/routes/users/installer/installer.component.ts 7 ●●●●● patch | view | raw | blame | history
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">
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];
      });
    }
  }
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>
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;