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,39 +5,37 @@ | ||
| 5 | <div class="portlet-body"> | 5 | <div class="portlet-body"> |
| 6 | <div class="tabbable-custom nav-justified"> | 6 | <div class="tabbable-custom nav-justified"> |
| 7 | <ul class="nav nav-tabs"> | 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 | </li> | 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 | </li> | 13 | </li> |
| 14 | <li class="sbold"> | 14 | <li class="sbold"> |
| 15 | <a href="#tab3" data-toggle="tab" aria-expanded="false">page 3</a> | 15 | <a href="#tab3" data-toggle="tab" aria-expanded="false">page 3</a> |
| 16 | </li> | 16 | </li> |
| 17 | </ul> | 17 | </ul> |
| 18 | <div class="tab-content"> | 18 | <div class="tab-content"> |
| 19 | - <div class="panel tab-pane" id="tab1"> | 19 | + <div class="panel tab-pane active" id="tab1"> |
| 20 | <div class="caption"> | 20 | <div class="caption"> |
| 21 | <h1 class="icon-bubble font-green-sharp"> | 21 | <h1 class="icon-bubble font-green-sharp"> |
| 22 | <span class="caption-subject font-green-sharp sbold font"> Active</span> | 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 | </h1> | 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 | <hr> | 33 | <hr> |
| 35 | <br> | 34 | <br> |
| 36 | </div> | 35 | </div> |
| 37 | <div class="panel-body"> | 36 | <div class="panel-body"> |
| 38 | <div class="row"> | 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 | <a class="dashboard-stat dashboard-stat-v2 red " | 39 | <a class="dashboard-stat dashboard-stat-v2 red " |
| 42 | href="{{item.link}}" | 40 | href="{{item.link}}" |
| 43 | target="_blank" | 41 | target="_blank" |
| @@ -78,16 +76,12 @@ | @@ -78,16 +76,12 @@ | ||
| 78 | <div class="caption"> | 76 | <div class="caption"> |
| 79 | <h1 class="icon-bubble font-grey-gallery"> | 77 | <h1 class="icon-bubble font-grey-gallery"> |
| 80 | <span class="caption-subject font-grey-gallery sbold font"> On Hold</span> | 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 | </h1> | 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 | <hr> | 85 | <hr> |
| 92 | <br> | 86 | <br> |
| 93 | </div> | 87 | </div> |
| @@ -127,10 +121,7 @@ | @@ -127,10 +121,7 @@ | ||
| 127 | </div> | 121 | </div> |
| 128 | 122 | ||
| 129 | </div> | 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 | <div class="panel tab-pane" id="tab3">page 3</div> | 125 | <div class="panel tab-pane" id="tab3">page 3</div> |
| 135 | </div> | 126 | </div> |
| 136 | </div> | 127 | </div> |
src/app/dashboard/dashboard.component.ts
| @@ -11,11 +11,8 @@ import { async } from 'rxjs/internal/scheduler/async'; | @@ -11,11 +11,8 @@ import { async } from 'rxjs/internal/scheduler/async'; | ||
| 11 | }) | 11 | }) |
| 12 | export class DashboardComponent implements OnInit { | 12 | export class DashboardComponent implements OnInit { |
| 13 | 13 | ||
| 14 | - Search = ''; | ||
| 15 | - | ||
| 16 | - | 14 | + FilterSearch = ''; |
| 17 | 15 | ||
| 18 | - | ||
| 19 | 16 | ||
| 20 | getColorDay(days){ | 17 | getColorDay(days){ |
| 21 | console.log(days) | 18 | console.log(days) |
src/app/dashboard/filter.pipe.ts
| @@ -5,18 +5,23 @@ import { Pipe, PipeTransform } from '@angular/core'; | @@ -5,18 +5,23 @@ import { Pipe, PipeTransform } from '@angular/core'; | ||
| 5 | }) | 5 | }) |
| 6 | export class FilterPipe implements PipeTransform { | 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 | if (value.length === 0) { | 10 | if (value.length === 0) { |
| 10 | return value; | 11 | return value; |
| 11 | } | 12 | } |
| 12 | 13 | ||
| 13 | const resultArray = []; | 14 | const resultArray = []; |
| 14 | for (const item of value) { | 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 | resultArray.push(item); | 20 | resultArray.push(item); |
| 17 | } | 21 | } |
| 18 | - | ||
| 19 | } | 22 | } |
| 23 | + | ||
| 24 | + | ||
| 20 | return resultArray; | 25 | return resultArray; |
| 21 | } | 26 | } |
| 22 | 27 |