Commit 53e0945fa17ccc8e9d3cf22eb96c63e7f78ca9c6
1 parent
c946cc15
Exists in
master
เสริจได้แล้ว active
Showing
3 changed files
with
30 additions
and
37 deletions
Show diff stats
src/app/dashboard/dashboard.component.html
... | ... | @@ -5,39 +5,37 @@ |
5 | 5 | <div class="portlet-body"> |
6 | 6 | <div class="tabbable-custom nav-justified"> |
7 | 7 | <ul class="nav nav-tabs"> |
8 | - <li class=" sbold font"> | |
9 | - <a href="#tab1" data-toggle="tab" aria-expanded="false">Active</a> | |
8 | + <li class="active sbold font"> | |
9 | + <a href="#tab1" data-toggle="tab" aria-expanded="true">Active</a> | |
10 | 10 | </li> |
11 | - <li class="active sbold"> | |
12 | - <a href="#tab2" data-toggle="tab" aria-expanded="true">page 2</a> | |
11 | + <li class="sbold"> | |
12 | + <a href="#tab2" data-toggle="tab" aria-expanded="false">page 2</a> | |
13 | 13 | </li> |
14 | 14 | <li class="sbold"> |
15 | 15 | <a href="#tab3" data-toggle="tab" aria-expanded="false">page 3</a> |
16 | 16 | </li> |
17 | 17 | </ul> |
18 | 18 | <div class="tab-content"> |
19 | - <div class="panel tab-pane" id="tab1"> | |
19 | + <div class="panel tab-pane active" id="tab1"> | |
20 | 20 | <div class="caption"> |
21 | 21 | <h1 class="icon-bubble font-green-sharp"> |
22 | 22 | <span class="caption-subject font-green-sharp sbold font"> Active</span> |
23 | - <!-- <input type="text" placeholder="Search.." class="form-control sbold font"> --> | |
23 | + <div class="input-icon right" style="margin-left: 820px; margin-top: -20px;" > | |
24 | + <i class="icon-magnifier"> | |
25 | + </i> | |
26 | + <input | |
27 | + type="text" | |
28 | + placeholder="Search.." | |
29 | + class="form-control sbold font" | |
30 | + [(ngModel)]="FilterSearch"> | |
31 | + </div> | |
24 | 32 | </h1> |
25 | - | |
26 | - <div class="input-group" style="float: right; margin-top: 11px;"> | |
27 | - <div class="input-icon right"> | |
28 | - <i class="icon-magnifier"> | |
29 | - </i> | |
30 | - <input type="text" placeholder="Search.." class="form-control sbold font" [(ngModel)]="FilterSearch"> | |
31 | - </div> | |
32 | - </div> | |
33 | - | |
34 | 33 | <hr> |
35 | 34 | <br> |
36 | 35 | </div> |
37 | 36 | <div class="panel-body"> |
38 | 37 | <div class="row"> |
39 | - <!-- <div class="col-lg-4 col-md-3 col-sm-6 col-xs-12" *ngFor="let item of resultData"> --> | |
40 | - <div class="col-lg-4 col-md-3 col-sm-6 col-xs-12" *ngFor="let item of resultData | filter:FilterSearch: 'team'"> | |
38 | + <div class="col-lg-4 col-md-3 col-sm-6 col-xs-12" *ngFor="let item of resultData | filter:FilterSearch: '' "> | |
41 | 39 | <a class="dashboard-stat dashboard-stat-v2 red " |
42 | 40 | href="{{item.link}}" |
43 | 41 | target="_blank" |
... | ... | @@ -78,16 +76,12 @@ |
78 | 76 | <div class="caption"> |
79 | 77 | <h1 class="icon-bubble font-grey-gallery"> |
80 | 78 | <span class="caption-subject font-grey-gallery sbold font"> On Hold</span> |
79 | + <div class="input-icon right" style="margin-left: 820px; margin-top: -20px;" > | |
80 | + <i class="icon-magnifier"> | |
81 | + </i> | |
82 | + <input type="text" placeholder="Search.." class="form-control sbold font"> | |
83 | + </div> | |
81 | 84 | </h1> |
82 | - | |
83 | - <div class="input-group" style="float: right; margin-top: 11px;"> | |
84 | - <div class="input-icon right"> | |
85 | - <i class="icon-magnifier"> | |
86 | - </i> | |
87 | - <input type="text" placeholder="Search.." class="form-control sbold font" [(ngModel)]="FilterSearch"> | |
88 | - </div> | |
89 | - </div> | |
90 | - | |
91 | 85 | <hr> |
92 | 86 | <br> |
93 | 87 | </div> |
... | ... | @@ -127,10 +121,7 @@ |
127 | 121 | </div> |
128 | 122 | |
129 | 123 | </div> |
130 | - <div class="panel tab-pane active" id="tab2"> | |
131 | - <input #box type="text" placeholder="Search.." class="form-control sbold font" (keyup)="onKey($event)"><br><br> | |
132 | - <p>{{box.value}}</p> | |
133 | - </div> | |
124 | + <div class="panel tab-pane" id="tab2">page 2</div> | |
134 | 125 | <div class="panel tab-pane" id="tab3">page 3</div> |
135 | 126 | </div> |
136 | 127 | </div> | ... | ... |
src/app/dashboard/dashboard.component.ts
src/app/dashboard/filter.pipe.ts
... | ... | @@ -5,18 +5,23 @@ import { Pipe, PipeTransform } from '@angular/core'; |
5 | 5 | }) |
6 | 6 | export class FilterPipe implements PipeTransform { |
7 | 7 | |
8 | - transform(value: any, filterString: string, propName: string): any { | |
8 | + transform(value: any, filterString: string, propName: any): any { | |
9 | + console.log('propName: ', propName); | |
9 | 10 | if (value.length === 0) { |
10 | 11 | return value; |
11 | 12 | } |
12 | 13 | |
13 | 14 | const resultArray = []; |
14 | 15 | for (const item of value) { |
15 | - if (item[propName] === filterString) { | |
16 | + console.log('item: ', item); | |
17 | + var string1 = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase(); | |
18 | + var string2 = filterString.toLowerCase(); | |
19 | + if (string1.indexOf(string2) > -1) { | |
16 | 20 | resultArray.push(item); |
17 | 21 | } |
18 | - | |
19 | 22 | } |
23 | + | |
24 | + | |
20 | 25 | return resultArray; |
21 | 26 | } |
22 | 27 | ... | ... |