沈斌
2017-12-20 cd4992acac988e83a115f75a62e1f29d1c772009
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<pro-header [title]="'安装用户列表'"></pro-header>
<nz-card [nzBordered]="false">
  <form nz-form (ngSubmit)="load(true)" [nzLayout]="'inline'">
    <div nz-row [nzGutter]="24">
      <div nz-col [nzSpan]="8" class="mb-md">
        <div nz-form-item class="d-flex">
          <div nz-form-label><label for="u_name">姓名</label></div>
          <div nz-form-control class="flex-1">
            <nz-input [(ngModel)]="q.u_name" name="u_name" [nzSize]="'large'" [nzPlaceHolder]="'请输入姓名'" nzId="u_name"></nz-input>
          </div>
        </div>
      </div>
      <div nz-col [nzSpan]="8" class="mb-md">
        <div nz-form-item class="d-flex">
          <div nz-form-label><label for="u_mobile">账号</label></div>
          <div nz-form-control class="flex-1">
            <nz-input [(ngModel)]="q.u_mobile" name="u_mobile" [nzSize]="'large'" [nzPlaceHolder]="'请输入账号'" nzId="u_mobile"></nz-input>
          </div>
        </div>
      </div>
      <div nz-col [nzSpan]="8" class="mb-md">
        <button nz-button type="submit" [nzType]="'primary'" [nzLoading]="loading" [nzSize]="'large'">查询</button>
        <button nz-button type="reset" (click)="load(true)" [nzSize]="'large'" class="mx-sm">重置</button>
      </div>
    </div>
  </form>
  <div class="mb-md">
    <button nz-button (click)="add()" [nzType]="'primary'" [nzSize]="'large'">
      <i class="anticon anticon-plus"></i><span>新建</span>
    </button>
    <ng-container *ngIf="selectedRows.length > 0">
      &nbsp;<button nz-button [nzSize]="'large'" (click)="remove()">批量删除</button>
    </ng-container>
  </div>
  <div class="mb-md">
    <nz-alert [nzType]="'info'" [nzShowIcon]="true">
        <span alert-body>
            已选择 <strong class="text-primary">{{selectedRows.length}}</strong> 项
        </span>
    </nz-alert>
  </div>
  <nz-table #nzTable
            [nzDataSource]="data"
            [nzLoading]="http.loading"
            [nzTotal]="total"
            [(nzPageIndex)]="q.pi"
            [nzPageSize]="q.ps"
            [nzShowTotal]="true"
            (nzPageIndexChange)="load()"
            (nzDataChange)="dataChange($event)">
    <thead nz-thead>
    <tr>
      <th nz-th [nzCheckbox]="true">
        <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>
        <nz-table-sort [(nzValue)]="sortMap.updatedAt" (nzValueChange)="sort('expireTime', $event)"></nz-table-sort>
      </th>
      <th nz-th><span>操作</span></th>
    </tr>
    </thead>
    <tbody nz-tbody>
    <tr nz-tbody-tr *ngFor="let i of nzTable.data">
      <td nz-td [nzCheckbox]="true">
        <label nz-checkbox [(ngModel)]="i.checked" (ngModelChange)="refreshStatus($event)">
        </label>
      </td>
      <td nz-td>{{i.name}}</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.organizationId}}</td>
      <td nz-td>{{format_date(i.createTime)}}</td>
      <td nz-td>{{format_date(i.expireTime)}}</td>
      <td nz-td>
        <a (click)="edit(i)">编辑</a>
        <span nz-table-divider></span>
          <nz-popconfirm [nzTitle]="'确定要删除该用户吗?'" [nzOkText]="'Yes'" [nzCancelText]="'No'" (nzOnConfirm)="delete(i)" >
            <a nz-popconfirm>删除</a>
          </nz-popconfirm>
      </td>
    </tr>
    </tbody>
  </nz-table>
</nz-card>