沈斌
2017-12-15 f9b157566af34b8dc28ba10b34d025ac04f3168b
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
<div class="content__title">
    <h1>
        Tables
        <small>Native support</small>
    </h1>
</div>
<div nz-row [nzGutter]="16">
    <div nz-col [nzMd]="12">
        <nz-card nzTitle="Basic">
            <nz-table [nzDataSource]="data" [nzPageSize]="10">
                <thead nz-thead>
                    <tr>
                        <th nz-th><span>Name</span></th>
                        <th nz-th><span>Age</span></th>
                        <th nz-th><span>Address</span></th>
                        <th nz-th><span>Action</span></th>
                    </tr>
                </thead>
                <tbody nz-tbody>
                    <tr nz-tbody-tr *ngFor="let data of data">
                        <td nz-td>{{data.name}}</td>
                        <td nz-td>{{data.age}}</td>
                        <td nz-td>{{data.address}}</td>
                        <td nz-td>
                            <span>
                                <a>Action</a>
                                <span nz-table-divider></span>
                                <a>Delete</a>
                                <span nz-table-divider></span>
                                <nz-dropdown>
                                    <a class="ant-dropdown-link" nz-dropdown>
                                        More<i class="anticon anticon-down"></i>
                                    </a>
                                    <ul nz-menu>
                                        <li nz-menu-item>1st menu item</li>
                                        <li nz-menu-item>2st menu item</li>
                                        <li nz-menu-item>3st menu item</li>
                                    </ul>
                                </nz-dropdown>
                            </span>
                        </td>
                    </tr>
                </tbody>
            </nz-table>
        </nz-card>
    </div>
    <div nz-col [nzMd]="12">
        <nz-card nzTitle="Sort">
            <nz-table [nzDataSource]="data" [nzPageSize]="10">
                <thead nz-thead>
                    <tr>
                        <th nz-th><span>Name</span></th>
                        <th nz-th><span>Age<nz-table-sort [(nzValue)]="ageSort" (nzValueChange)="ageSortChange($event)"></nz-table-sort></span></th>
                        <th nz-th><span>Address</span></th>
                    </tr>
                </thead>
                <tbody nz-tbody>
                    <tr nz-tbody-tr *ngFor="let data of data">
                        <td nz-td>{{data.name}}</td>
                        <td nz-td>{{data.age}}</td>
                        <td nz-td>{{data.address}}</td>
                    </tr>
                </tbody>
            </nz-table>
        </nz-card>
    </div>
</div>
<div nz-row [nzGutter]="16">
    <div nz-col [nzMd]="12">
        <nz-card nzTitle="Selection">
            <nz-table [nzDataSource]="data" [nzPageSize]="10" (nzDataChange)="_displayDataChange($event)" (nzPageIndexChange)="_refreshStatus()" (nzPageSizeChange)="_refreshStatus()">
                <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>Name</span></th>
                        <th nz-th><span>Age</span></th>
                        <th nz-th><span>Address</span></th>
                    </tr>
                </thead>
                <tbody nz-tbody>
                    <tr nz-tbody-tr *ngFor="let data of data">
                        <td nz-td [nzCheckbox]="true">
                            <label nz-checkbox [(ngModel)]="data.checked" (ngModelChange)="_refreshStatus($event)">
                            </label>
                        </td>
                        <td nz-td>{{data.name}}</td>
                        <td nz-td>{{data.age}}</td>
                        <td nz-td>{{data.address}}</td>
                    </tr>
                </tbody>
            </nz-table>
        </nz-card>
    </div>
    <div nz-col [nzMd]="12">
        <nz-card nzTitle="Ajax">
            <nz-table #nzTable2
                [nzAjaxData]="_ajaxDataSet"
                [nzShowSizeChanger]="true"
                [nzLoading]="_ajaxLoading"
                [nzTotal]="_total"
                [(nzPageIndex)]="_current"
                (nzPageIndexChange)="_ajaxRefreshData()"
                [(nzPageSize)]="_pageSize"
                (nzPageSizeChange)="_ajaxRefreshData()">
                <thead nz-thead>
                <tr>
                    <th nz-th><span>Name</span></th>
                    <th nz-th><span>Age</span></th>
                    <th nz-th><span>Email</span></th>
                </tr>
                </thead>
                <tbody nz-tbody>
                <tr nz-tbody-tr *ngFor="let i of nzTable2.data">
                    <td nz-td>
                        <a>{{i.name.first}} {{i.name.last}}</a>
                    </td>
                    <td nz-td>{{i.gender}}</td>
                    <td nz-td>{{i.email}}</td>
                </tr>
                </tbody>
            </nz-table>
        </nz-card>
    </div>
</div>
<div nz-row [nzGutter]="16">
    <div nz-col [nzMd]="24">
        <nz-card nzTitle="Dynamic Settings">
            <form nz-form [nzLayout]="'inline'" class="mb-sm">
                <div nz-row nz-form-item>
                    <div nz-form-label>
                        <label>Bordered</label>
                    </div>
                    <div nz-form-control>
                        <nz-switch [(ngModel)]="_bordered" [ngModelOptions]="{standalone: true}"></nz-switch>
                    </div>
                </div>
                <div nz-row nz-form-item>
                    <div nz-form-label>
                        <label>Loading</label>
                    </div>
                    <div nz-form-control>
                        <nz-switch [(ngModel)]="_loading" [ngModelOptions]="{standalone: true}"></nz-switch>
                    </div>
                </div>
                <div nz-row nz-form-item>
                    <div nz-form-label>
                        <label>Pagination</label>
                    </div>
                    <div nz-form-control>
                        <nz-switch [(ngModel)]="_pagination" [ngModelOptions]="{standalone: true}"></nz-switch>
                    </div>
                </div>
                <div nz-row nz-form-item>
                    <div nz-form-label>
                        <label>Title</label>
                    </div>
                    <div nz-form-control>
                        <nz-switch [(ngModel)]="_title" [ngModelOptions]="{standalone: true}"></nz-switch>
                    </div>
                </div>
                <div nz-row nz-form-item>
                    <div nz-form-label>
                        <label>Column Header</label>
                    </div>
                    <div nz-form-control>
                        <nz-switch [(ngModel)]="_header" [ngModelOptions]="{standalone: true}"></nz-switch>
                    </div>
                </div>
                <div nz-row nz-form-item>
                    <div nz-form-label>
                        <label>Footer</label>
                    </div>
                    <div nz-form-control>
                        <nz-switch [(ngModel)]="_footer" [ngModelOptions]="{standalone: true}"></nz-switch>
                    </div>
                </div>
                <div nz-row nz-form-item>
                    <div nz-form-label>
                        <label>Size</label>
                    </div>
                    <div nz-form-control>
                        <nz-radio-group [(ngModel)]="_size" [ngModelOptions]="{standalone: true}">
                            <label nz-radio-button [nzValue]="'default'">
                                <span>Default</span>
                            </label>
                            <label nz-radio-button [nzValue]="'middle'">
                                <span>Middle</span>
                            </label>
                            <label nz-radio-button [nzValue]="'small'">
                                <span>Small</span>
                            </label>
                        </nz-radio-group>
                    </div>
                </div>
                <div nz-row nz-form-item>
                    <div nz-form-label>
                        <label>No Result</label>
                    </div>
                    <div nz-form-control>
                        <nz-switch [(ngModel)]="_noresult" (ngModelChange)="_toggleData()" [ngModelOptions]="{standalone: true}"></nz-switch>
                    </div>
                </div>
            </form>
            <nz-table
                #nzTable
                [nzDataSource]="_dataSet"
                [nzPageSize]="10"
                [nzBordered]="_bordered"
                [nzLoading]="_loading"
                [nzIsPagination]="_pagination"
                [nzShowFooter]="_footer"
                [nzShowTitle]="_title"
                [nzSize]="_size">
                <span nz-table-title>Here is Title</span>
                <thead nz-thead *ngIf="_header">
                    <tr>
                        <th nz-th><span>Name</span></th>
                        <th nz-th><span>Age</span></th>
                        <th nz-th><span>Address</span></th>
                        <th nz-th><span>Action</span></th>
                    </tr>
                </thead>
                <tbody nz-tbody>
                    <tr nz-tbody-tr *ngFor="let data of nzTable.data">
                        <td nz-td>{{data.name}}</td>
                        <td nz-td>{{data.age}}</td>
                        <td nz-td>{{data.address}}</td>
                        <td nz-td>
                            <span>
                                <a>Action 一 {{data.name}}</a>
                                <span nz-table-divider></span>
                                <nz-popconfirm [nzTitle]="'Are you sure?'" [nzOkText]="'ok'" [nzCancelText]="'cancel'" (nzOnConfirm)="confirm()" (nzOnCancel)="cancel()">
                                    <a nz-popconfirm>Delete</a>
                                </nz-popconfirm>
                                <span nz-table-divider></span>
                                <nz-dropdown>
                                    <a class="ant-dropdown-link" nz-dropdown>
                                        More actions <i class="anticon anticon-down"></i>
                                    </a>
                                    <ul nz-menu>
                                        <li nz-menu-item>1st menu item</li>
                                        <li nz-menu-item>2st menu item</li>
                                        <li nz-menu-item>3st menu item</li>
                                    </ul>
                                </nz-dropdown>
                            </span>
                        </td>
                    </tr>
                </tbody>
                <span nz-table-footer>Here is footer</span>
            </nz-table>
        </nz-card>
    </div>
</div>