Commit c98368f88242be7cb9bc7e8b4de6e6821503e79c
1 parent
604c53f4
Exists in
master
โชวแท็ป + ปุ่มค้นหา
Showing
2 changed files
with
221 additions
and
29 deletions
Show diff stats
src/app/dashboard/dashboard.component.html
| ... | ... | @@ -13,7 +13,7 @@ |
| 13 | 13 | <span class="badge"> {{resultNum7}} </span> |
| 14 | 14 | </a> |
| 15 | 15 | </li> |
| 16 | - <!--<li class="sbold"> | |
| 16 | + <li class="sbold"> | |
| 17 | 17 | <a href="#tab2" data-toggle="tab" aria-expanded="false">RND <span class="badge"> {{resultNum2}} </span></a> |
| 18 | 18 | </li> |
| 19 | 19 | <li class="sbold"> |
| ... | ... | @@ -27,7 +27,7 @@ |
| 27 | 27 | </li> |
| 28 | 28 | <li class="sbold"> |
| 29 | 29 | <a href="#tab6" data-toggle="tab" aria-expanded="false">CUS <span class="badge"> {{resultNum6}} </span></a> |
| 30 | - </li>--> | |
| 30 | + </li> | |
| 31 | 31 | </ul> |
| 32 | 32 | <div class="tab-content"> |
| 33 | 33 | <div class="panel tab-pane active" id="tab1"> |
| ... | ... | @@ -42,7 +42,8 @@ |
| 42 | 42 | <input type="text" placeholder="Search.." class="form-control sbold font" [(ngModel)]="FilterSearch"> |
| 43 | 43 | </div> |
| 44 | 44 | </div> |
| 45 | - | |
| 45 | + <br><br> | |
| 46 | + <button *ngFor="let name of ButtonValue" (click)="getButton1(name.valueN)">{{ name.name }}</button> | |
| 46 | 47 | <hr> |
| 47 | 48 | <br> |
| 48 | 49 | </div> |
| ... | ... | @@ -59,7 +60,7 @@ |
| 59 | 60 | <table> |
| 60 | 61 | <tr> |
| 61 | 62 | <div class="details" style="width: calc(100% - 50px);"> |
| 62 | - <div style="text-align: right; margin-top: -60px; color: black;">{{item.type}}</div> | |
| 63 | + <div style="text-align: right; margin-top: -60px; color: black;">{{item.type | textshort}}</div> | |
| 63 | 64 | <div style="text-align: right; color: black;">{{item.STATUS}}</div> |
| 64 | 65 | <div class="number" style=" color: black; display: block; text-align: right; margin-top: -7px;"> |
| 65 | 66 | <span data-counter="counterup" data-value="">{{item.custgroupName}}</span> |
| ... | ... | @@ -150,7 +151,8 @@ |
| 150 | 151 | <input type="text" placeholder="Search.." class="form-control sbold font" [(ngModel)]="FilterSearch"> |
| 151 | 152 | </div> |
| 152 | 153 | </div> |
| 153 | - | |
| 154 | + <br><br> | |
| 155 | + <button *ngFor="let name of ButtonValue" (click)="getButton2(name.valueN)">{{ name.name }}</button> | |
| 154 | 156 | <hr> |
| 155 | 157 | <br> |
| 156 | 158 | </div> |
| ... | ... | @@ -167,7 +169,8 @@ |
| 167 | 169 | <table> |
| 168 | 170 | <tr> |
| 169 | 171 | <div class="details" style="width: calc(100% - 50px);"> |
| 170 | - <div style="text-align: right; margin-top: -50px; color: black;">{{item.STATUS}}</div> | |
| 172 | + <div style="text-align: right; margin-top: -60px; color: black;">{{item.type | textshort}}</div> | |
| 173 | + <div style="text-align: right; color: black;">{{item.STATUS}}</div> | |
| 171 | 174 | <div class="number" style=" color: black; display: block; text-align: right;"> |
| 172 | 175 | <span data-counter="counterup" data-value="">{{item.custgroupName}}</span> |
| 173 | 176 | </div> |
| ... | ... | @@ -254,7 +257,8 @@ |
| 254 | 257 | <input type="text" placeholder="Search.." class="form-control sbold font" [(ngModel)]="FilterSearch"> |
| 255 | 258 | </div> |
| 256 | 259 | </div> |
| 257 | - | |
| 260 | + <br><br> | |
| 261 | + <button *ngFor="let name of ButtonValue" (click)="getButton3(name.valueN)">{{ name.name }}</button> | |
| 258 | 262 | <hr> |
| 259 | 263 | <br> |
| 260 | 264 | </div> |
| ... | ... | @@ -271,7 +275,8 @@ |
| 271 | 275 | <table> |
| 272 | 276 | <tr> |
| 273 | 277 | <div class="details" style="width: calc(100% - 50px);"> |
| 274 | - <div style="text-align: right; margin-top: -50px; color: black;">{{item.STATUS}}</div> | |
| 278 | + <div style="text-align: right; margin-top: -60px; color: black;">{{item.type | textshort}}</div> | |
| 279 | + <div style="text-align: right; color: black;">{{item.STATUS}}</div> | |
| 275 | 280 | <div class="number" style=" color: black; display: block; text-align: right;"> |
| 276 | 281 | <span data-counter="counterup" data-value="">{{item.custgroupName}}</span> |
| 277 | 282 | </div> |
| ... | ... | @@ -358,7 +363,8 @@ |
| 358 | 363 | <input type="text" placeholder="Search.." class="form-control sbold font" [(ngModel)]="FilterSearch"> |
| 359 | 364 | </div> |
| 360 | 365 | </div> |
| 361 | - | |
| 366 | + <br><br> | |
| 367 | + <button *ngFor="let name of ButtonValue" (click)="getButton4(name.valueN)">{{ name.name }}</button> | |
| 362 | 368 | <hr> |
| 363 | 369 | <br> |
| 364 | 370 | </div> |
| ... | ... | @@ -375,7 +381,8 @@ |
| 375 | 381 | <table> |
| 376 | 382 | <tr> |
| 377 | 383 | <div class="details" style="width: calc(100% - 50px);"> |
| 378 | - <div style="text-align: right; margin-top: -50px; color: black;">{{item.STATUS}}</div> | |
| 384 | + <div style="text-align: right; margin-top: -60px; color: black;">{{item.type | textshort}}</div> | |
| 385 | + <div style="text-align: right; color: black;">{{item.STATUS}}</div> | |
| 379 | 386 | <div class="number" style=" color: black; display: block; text-align: right;"> |
| 380 | 387 | <span data-counter="counterup" data-value="">{{item.custgroupName}}</span> |
| 381 | 388 | </div> |
| ... | ... | @@ -462,7 +469,8 @@ |
| 462 | 469 | <input type="text" placeholder="Search.." class="form-control sbold font" [(ngModel)]="FilterSearch"> |
| 463 | 470 | </div> |
| 464 | 471 | </div> |
| 465 | - | |
| 472 | + <br><br> | |
| 473 | + <button *ngFor="let name of ButtonValue" (click)="getButton5(name.valueN)">{{ name.name }}</button> | |
| 466 | 474 | <hr> |
| 467 | 475 | <br> |
| 468 | 476 | </div> |
| ... | ... | @@ -479,7 +487,8 @@ |
| 479 | 487 | <table> |
| 480 | 488 | <tr> |
| 481 | 489 | <div class="details" style="width: calc(100% - 50px);"> |
| 482 | - <div style="text-align: right; margin-top: -50px; color: black;">{{item.STATUS}}</div> | |
| 490 | + <div style="text-align: right; margin-top: -60px; color: black;">{{item.type | textshort}}</div> | |
| 491 | + <div style="text-align: right; color: black;">{{item.STATUS}}</div> | |
| 483 | 492 | <div class="number" style=" color: black; display: block; text-align: right;"> |
| 484 | 493 | <span data-counter="counterup" data-value="">{{item.custgroupName}}</span> |
| 485 | 494 | </div> |
| ... | ... | @@ -566,7 +575,8 @@ |
| 566 | 575 | <input type="text" placeholder="Search.." class="form-control sbold font" [(ngModel)]="FilterSearch"> |
| 567 | 576 | </div> |
| 568 | 577 | </div> |
| 569 | - | |
| 578 | + <br><br> | |
| 579 | + <button *ngFor="let name of ButtonValue" (click)="getButton6(name.valueN)">{{ name.name }}</button> | |
| 570 | 580 | <hr> |
| 571 | 581 | <br> |
| 572 | 582 | </div> |
| ... | ... | @@ -583,7 +593,8 @@ |
| 583 | 593 | <table> |
| 584 | 594 | <tr> |
| 585 | 595 | <div class="details" style="width: calc(100% - 50px);"> |
| 586 | - <div style="text-align: right; margin-top: -50px; color: black;">{{item.STATUS}}</div> | |
| 596 | + <div style="text-align: right; margin-top: -60px; color: black;">{{item.type | textshort}}</div> | |
| 597 | + <div style="text-align: right; color: black;">{{item.STATUS}}</div> | |
| 587 | 598 | <div class="number" style=" color: black; display: block; text-align: right;"> |
| 588 | 599 | <span data-counter="counterup" data-value="">{{item.custgroupName}}</span> |
| 589 | 600 | </div> |
| ... | ... | @@ -673,7 +684,7 @@ |
| 673 | 684 | </div> |
| 674 | 685 | </div> |
| 675 | 686 | <br><br> |
| 676 | - <button *ngFor="let name of ButtonValue" (click)="getButton(name.valueN)">{{ name.name }}</button> | |
| 687 | + <button *ngFor="let name of ButtonValue" (click)="getButton7(name.valueN)">{{ name.name }}</button> | |
| 677 | 688 | <hr> |
| 678 | 689 | |
| 679 | 690 | <br> |
| ... | ... | @@ -730,6 +741,8 @@ |
| 730 | 741 | <input type="text" placeholder="Search.." class="form-control sbold font" [(ngModel)]="FilterSearchOnHold"> |
| 731 | 742 | </div> |
| 732 | 743 | </div> |
| 744 | + <!-- <br><br> | |
| 745 | + <button *ngFor="let name of ButtonValue" (click)="getButton(name.valueN)">{{ name.name }}</button> --> | |
| 733 | 746 | <hr> |
| 734 | 747 | <br> |
| 735 | 748 | </div> | ... | ... |
src/app/dashboard/dashboard.component.ts
| ... | ... | @@ -70,7 +70,13 @@ export class DashboardComponent implements OnInit { |
| 70 | 70 | resultNum7:number = 0; |
| 71 | 71 | resultDataOnHold7: any; |
| 72 | 72 | |
| 73 | - Show: any = []; | |
| 73 | + Show1: any = []; | |
| 74 | + Show2: any = []; | |
| 75 | + Show3: any = []; | |
| 76 | + Show4: any = []; | |
| 77 | + Show5: any = []; | |
| 78 | + Show6: any = []; | |
| 79 | + Show7: any = []; | |
| 74 | 80 | |
| 75 | 81 | ButtonValue = [ |
| 76 | 82 | { |
| ... | ... | @@ -201,13 +207,13 @@ export class DashboardComponent implements OnInit { |
| 201 | 207 | name : 'web', |
| 202 | 208 | valueN : 'web' |
| 203 | 209 | }, |
| 210 | + { | |
| 211 | + name : 'reset', | |
| 212 | + valueN : '' | |
| 213 | + }, | |
| 204 | 214 | ]; |
| 205 | 215 | |
| 206 | 216 | |
| 207 | - | |
| 208 | - | |
| 209 | - | |
| 210 | - | |
| 211 | 217 | async ngOnInit() { |
| 212 | 218 | //----------------------------1------------------------ |
| 213 | 219 | // Active |
| ... | ... | @@ -227,6 +233,7 @@ export class DashboardComponent implements OnInit { |
| 227 | 233 | this.resultData[i].link = this._common.decodeURI(this.resultData[i].link); |
| 228 | 234 | this.resultData[i].birth_date = this._common.convertDate(this.resultData[i].birth_date); |
| 229 | 235 | this.resultNum = this.resultData.length; |
| 236 | + this.Show1.push(this.resultData[i]); | |
| 230 | 237 | } |
| 231 | 238 | |
| 232 | 239 | } else { |
| ... | ... | @@ -289,6 +296,7 @@ export class DashboardComponent implements OnInit { |
| 289 | 296 | this.resultData2[i].link = this._common.decodeURI(this.resultData2[i].link); |
| 290 | 297 | this.resultData2[i].birth_date = this._common.convertDate(this.resultData2[i].birth_date); |
| 291 | 298 | this.resultNum2 = this.resultData2.length; |
| 299 | + this.Show2.push(this.resultData2[i]); | |
| 292 | 300 | } |
| 293 | 301 | } else { |
| 294 | 302 | this.resultData2 = []; |
| ... | ... | @@ -349,6 +357,7 @@ export class DashboardComponent implements OnInit { |
| 349 | 357 | this.resultData3[i].link = this._common.decodeURI(this.resultData3[i].link); |
| 350 | 358 | this.resultData3[i].birth_date = this._common.convertDate(this.resultData3[i].birth_date); |
| 351 | 359 | this.resultNum3 = this.resultData3.length; |
| 360 | + this.Show3.push(this.resultData3[i]); | |
| 352 | 361 | } |
| 353 | 362 | } else { |
| 354 | 363 | this.resultData3 = []; |
| ... | ... | @@ -407,6 +416,7 @@ export class DashboardComponent implements OnInit { |
| 407 | 416 | this.resultData4[i].link = this._common.decodeURI(this.resultData4[i].link); |
| 408 | 417 | this.resultData4[i].birth_date = this._common.convertDate(this.resultData4[i].birth_date); |
| 409 | 418 | this.resultNum4 = this.resultData4.length; |
| 419 | + this.Show4.push(this.resultData4[i]); | |
| 410 | 420 | } |
| 411 | 421 | } else { |
| 412 | 422 | this.resultData4 = []; |
| ... | ... | @@ -465,6 +475,7 @@ export class DashboardComponent implements OnInit { |
| 465 | 475 | this.resultData5[i].link = this._common.decodeURI(this.resultData5[i].link); |
| 466 | 476 | this.resultData5[i].birth_date = this._common.convertDate(this.resultData5[i].birth_date); |
| 467 | 477 | this.resultNum5 = this.resultData5.length; |
| 478 | + this.Show5.push(this.resultData5[i]); | |
| 468 | 479 | } |
| 469 | 480 | } else { |
| 470 | 481 | this.resultData5 = []; |
| ... | ... | @@ -522,6 +533,7 @@ export class DashboardComponent implements OnInit { |
| 522 | 533 | this.resultData6[i].link = this._common.decodeURI(this.resultData6[i].link); |
| 523 | 534 | this.resultData6[i].birth_date = this._common.convertDate(this.resultData6[i].birth_date); |
| 524 | 535 | this.resultNum6 = this.resultData6.length; |
| 536 | + this.Show6.push(this.resultData6[i]); | |
| 525 | 537 | } |
| 526 | 538 | } else { |
| 527 | 539 | this.resultData6 = []; |
| ... | ... | @@ -580,11 +592,11 @@ export class DashboardComponent implements OnInit { |
| 580 | 592 | this.resultData7[i].link = this._common.decodeURI(this.resultData7[i].link); |
| 581 | 593 | this.resultData7[i].birth_date = this._common.convertDate(this.resultData7[i].birth_date); |
| 582 | 594 | this.resultNum7 = this.resultData7.length; |
| 583 | - this.Show.push(this.resultData7[i]); | |
| 595 | + this.Show7.push(this.resultData7[i]); | |
| 584 | 596 | } |
| 585 | 597 | |
| 586 | 598 | // this.Show = Object.assign(this.resultData7); |
| 587 | - console.log('hi',this.Show) | |
| 599 | + console.log('hi',this.Show7) | |
| 588 | 600 | |
| 589 | 601 | } else { |
| 590 | 602 | this.resultData7 = []; |
| ... | ... | @@ -627,15 +639,15 @@ export class DashboardComponent implements OnInit { |
| 627 | 639 | }, 600000); |
| 628 | 640 | } |
| 629 | 641 | |
| 630 | - getButton(valueN){ | |
| 642 | + getButton1(valueN){ | |
| 631 | 643 | console.log(valueN); |
| 632 | 644 | |
| 633 | - if (this.Show.length === 0) { | |
| 634 | - return this.Show; | |
| 645 | + if (this.Show1.length === 0) { | |
| 646 | + return this.Show1; | |
| 635 | 647 | } |
| 636 | 648 | |
| 637 | 649 | const resultArray = []; |
| 638 | - for (const item of this.Show) { | |
| 650 | + for (const item of this.Show1) { | |
| 639 | 651 | console.log('item: ', item); |
| 640 | 652 | |
| 641 | 653 | var st = ''; |
| ... | ... | @@ -652,10 +664,177 @@ export class DashboardComponent implements OnInit { |
| 652 | 664 | |
| 653 | 665 | } |
| 654 | 666 | |
| 655 | - this.resultData7 = resultArray; | |
| 656 | - | |
| 667 | + this.resultData = resultArray; | |
| 668 | + } | |
| 669 | + | |
| 670 | + getButton2(valueN){ | |
| 671 | + console.log(valueN); | |
| 672 | + | |
| 673 | + if (this.Show2.length === 0) { | |
| 674 | + return this.Show2; | |
| 675 | + } | |
| 676 | + | |
| 677 | + const resultArray = []; | |
| 678 | + for (const item of this.Show2) { | |
| 679 | + console.log('item: ', item); | |
| 680 | + | |
| 681 | + var st = ''; | |
| 682 | + // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ; | |
| 683 | + if(item['type']){ | |
| 684 | + st = item['type'].toLowerCase(); | |
| 685 | + } | |
| 686 | + | |
| 687 | + var string2 = valueN.toLowerCase(); | |
| 688 | + if (st.indexOf(string2) > -1) { | |
| 689 | + console.log(st); | |
| 690 | + resultArray.push(item); | |
| 691 | + } | |
| 692 | + | |
| 693 | + } | |
| 694 | + | |
| 695 | + this.resultData2 = resultArray; | |
| 696 | + } | |
| 697 | + | |
| 698 | + getButton3(valueN){ | |
| 699 | + console.log(valueN); | |
| 700 | + | |
| 701 | + if (this.Show3.length === 0) { | |
| 702 | + return this.Show3; | |
| 703 | + } | |
| 704 | + | |
| 705 | + const resultArray = []; | |
| 706 | + for (const item of this.Show3) { | |
| 707 | + console.log('item: ', item); | |
| 708 | + | |
| 709 | + var st = ''; | |
| 710 | + // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ; | |
| 711 | + if(item['type']){ | |
| 712 | + st = item['type'].toLowerCase(); | |
| 713 | + } | |
| 657 | 714 | |
| 715 | + var string2 = valueN.toLowerCase(); | |
| 716 | + if (st.indexOf(string2) > -1) { | |
| 717 | + console.log(st); | |
| 718 | + resultArray.push(item); | |
| 719 | + } | |
| 720 | + | |
| 721 | + } | |
| 722 | + | |
| 723 | + this.resultData3 = resultArray; | |
| 658 | 724 | } |
| 725 | + | |
| 726 | + getButton4(valueN){ | |
| 727 | + console.log(valueN); | |
| 728 | + | |
| 729 | + if (this.Show4.length === 0) { | |
| 730 | + return this.Show4; | |
| 731 | + } | |
| 732 | + | |
| 733 | + const resultArray = []; | |
| 734 | + for (const item of this.Show4) { | |
| 735 | + console.log('item: ', item); | |
| 736 | + | |
| 737 | + var st = ''; | |
| 738 | + // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ; | |
| 739 | + if(item['type']){ | |
| 740 | + st = item['type'].toLowerCase(); | |
| 741 | + } | |
| 742 | + | |
| 743 | + var string2 = valueN.toLowerCase(); | |
| 744 | + if (st.indexOf(string2) > -1) { | |
| 745 | + console.log(st); | |
| 746 | + resultArray.push(item); | |
| 747 | + } | |
| 748 | + | |
| 749 | + } | |
| 750 | + | |
| 751 | + this.resultData4 = resultArray; | |
| 752 | + } | |
| 753 | + | |
| 754 | + getButton5(valueN){ | |
| 755 | + console.log(valueN); | |
| 756 | + | |
| 757 | + if (this.Show5.length === 0) { | |
| 758 | + return this.Show5; | |
| 759 | + } | |
| 760 | + | |
| 761 | + const resultArray = []; | |
| 762 | + for (const item of this.Show5) { | |
| 763 | + console.log('item: ', item); | |
| 764 | + | |
| 765 | + var st = ''; | |
| 766 | + // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ; | |
| 767 | + if(item['type']){ | |
| 768 | + st = item['type'].toLowerCase(); | |
| 769 | + } | |
| 770 | + | |
| 771 | + var string2 = valueN.toLowerCase(); | |
| 772 | + if (st.indexOf(string2) > -1) { | |
| 773 | + console.log(st); | |
| 774 | + resultArray.push(item); | |
| 775 | + } | |
| 776 | + | |
| 777 | + } | |
| 778 | + | |
| 779 | + this.resultData5 = resultArray; | |
| 780 | + } | |
| 781 | + | |
| 782 | + getButton6(valueN){ | |
| 783 | + console.log(valueN); | |
| 784 | + | |
| 785 | + if (this.Show6.length === 0) { | |
| 786 | + return this.Show6; | |
| 787 | + } | |
| 788 | + | |
| 789 | + const resultArray = []; | |
| 790 | + for (const item of this.Show6) { | |
| 791 | + console.log('item: ', item); | |
| 792 | + | |
| 793 | + var st = ''; | |
| 794 | + // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ; | |
| 795 | + if(item['type']){ | |
| 796 | + st = item['type'].toLowerCase(); | |
| 797 | + } | |
| 798 | + | |
| 799 | + var string2 = valueN.toLowerCase(); | |
| 800 | + if (st.indexOf(string2) > -1) { | |
| 801 | + console.log(st); | |
| 802 | + resultArray.push(item); | |
| 803 | + } | |
| 804 | + | |
| 805 | + } | |
| 806 | + | |
| 807 | + this.resultData6 = resultArray; | |
| 808 | + } | |
| 809 | + | |
| 810 | + getButton7(valueN){ | |
| 811 | + console.log(valueN); | |
| 812 | + | |
| 813 | + if (this.Show7.length === 0) { | |
| 814 | + return this.Show7; | |
| 815 | + } | |
| 816 | + | |
| 817 | + const resultArray = []; | |
| 818 | + for (const item of this.Show7) { | |
| 819 | + console.log('item: ', item); | |
| 820 | + | |
| 821 | + var st = ''; | |
| 822 | + // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ; | |
| 823 | + if(item['type']){ | |
| 824 | + st = item['type'].toLowerCase(); | |
| 825 | + } | |
| 826 | + | |
| 827 | + var string2 = valueN.toLowerCase(); | |
| 828 | + if (st.indexOf(string2) > -1) { | |
| 829 | + console.log(st); | |
| 830 | + resultArray.push(item); | |
| 831 | + } | |
| 832 | + | |
| 833 | + } | |
| 834 | + | |
| 835 | + this.resultData7 = resultArray; | |
| 836 | + } | |
| 837 | + | |
| 659 | 838 | /////////////Get data come to use////////////////////// |
| 660 | 839 | |
| 661 | 840 | |
| ... | ... | @@ -988,7 +1167,7 @@ async getDataOnHold6() { |
| 988 | 1167 | for (const i in this.resultData7) { |
| 989 | 1168 | this.resultData7[i].link = this._common.decodeURI(this.resultData7[i].link); |
| 990 | 1169 | this.resultData7[i].birth_date = this._common.convertDate(this.resultData7[i].birth_date); |
| 991 | - this.Show.push(this.resultData7[i]); | |
| 1170 | + this.Show7.push(this.resultData7[i]); | |
| 992 | 1171 | } |
| 993 | 1172 | } else { |
| 994 | 1173 | this.resultData7 = []; | ... | ... |