Commit 2ea88fab281087f6f1fb7393e2935a2b2499b306
1 parent
347ce73a
Exists in
master
บึ้มๆ
Showing
2 changed files
with
52 additions
and
37 deletions
Show diff stats
src/app/dashboard/dashboard.component.html
| ... | ... | @@ -935,14 +935,13 @@ |
| 935 | 935 | </div> |
| 936 | 936 | <br> |
| 937 | 937 | <br> |
| 938 | - <button type="button" class="btn btn-circle button " *ngFor="let name of ButtonValue" (click)="getButton9(name.valueN);getButton9Onhold(name.valueN);" | |
| 939 | - style="margin-left: 5px; margin-top: 2px;"><div *ngIf = "ButtonValue">{{NumType9}}</div> {{ name.name }} | |
| 940 | - </button> | |
| 941 | - <!-- <button type="button" class="btn btn-circle button " *ngFor="let name of ButtonValue" (click)="getButton9(name.valueN);getButton9Onhold(name.valueN);" | |
| 942 | - style="margin-left: 5px; margin-top: 2px;"><div>{{NumType9}}</div> {{ name.name }} | |
| 938 | + <!-- <button type="button" class="btn btn-circle button " *ngFor="let name of ButtonValue" (click)="getButton9(name.valueN);getButton9Onhold(name.valueN);" | |
| 939 | + style="margin-left: 5px; margin-top: 2px;"> {{ name.name }} | |
| 943 | 940 | </button> --> |
| 941 | + <button type="button" class="btn btn-circle button " *ngFor="let name of ButtonValue" (click)="getButton9(name.valueN);getButton9Onhold(name.valueN);" | |
| 942 | + style="margin-left: 5px; margin-top: 2px;"> {{ name.name }} | |
| 943 | + </button> | |
| 944 | 944 | <hr> |
| 945 | - <p *ngFor="let tt of Type9; let i = index">{{i}} {{tt}}</p> | |
| 946 | 945 | <hr> |
| 947 | 946 | <div *ngIf="showSecret1"> |
| 948 | 947 | <p style="text-align: left; font-size: 30px;"> 0 Tricket</p> | ... | ... |
src/app/dashboard/dashboard.component.ts
| ... | ... | @@ -3,6 +3,7 @@ import { ActivatedRoute, Router } from '@angular/router'; |
| 3 | 3 | import { ApiService } from '../services/api.service'; |
| 4 | 4 | import { CommonService } from '../services/common/common.service'; |
| 5 | 5 | import { async } from 'rxjs/internal/scheduler/async'; |
| 6 | +import { delay } from '../../../node_modules/rxjs/operators'; | |
| 6 | 7 | |
| 7 | 8 | @Component({ |
| 8 | 9 | selector: 'app-dashboard', |
| ... | ... | @@ -71,8 +72,6 @@ export class DashboardComponent implements OnInit { |
| 71 | 72 | resultData9: any; |
| 72 | 73 | resultNum9: number = 0; |
| 73 | 74 | resultDataOnHold9: any; |
| 74 | - Type9: any = []; | |
| 75 | - NumType9: number = 0; | |
| 76 | 75 | |
| 77 | 76 | Show1: any = []; |
| 78 | 77 | Show1Onhold: any = []; |
| ... | ... | @@ -103,7 +102,8 @@ export class DashboardComponent implements OnInit { |
| 103 | 102 | { |
| 104 | 103 | id: 1, |
| 105 | 104 | name: 'ACC', |
| 106 | - valueN: 'acc' | |
| 105 | + valueN: 'acc', | |
| 106 | + num : 0 | |
| 107 | 107 | }, |
| 108 | 108 | { |
| 109 | 109 | id: 2, |
| ... | ... | @@ -258,7 +258,7 @@ export class DashboardComponent implements OnInit { |
| 258 | 258 | { |
| 259 | 259 | id: 32, |
| 260 | 260 | name: 'WEB', |
| 261 | - valueN: 'web' | |
| 261 | + valueN: 'web' | |
| 262 | 262 | } |
| 263 | 263 | ]; |
| 264 | 264 | |
| ... | ... | @@ -266,6 +266,12 @@ export class DashboardComponent implements OnInit { |
| 266 | 266 | showSecret1: boolean = false; |
| 267 | 267 | showSecret2: boolean = false; |
| 268 | 268 | |
| 269 | + // summary:any = {}; | |
| 270 | + // summary = {}; | |
| 271 | + Type9: any = []; | |
| 272 | + NumType9: number = 0; | |
| 273 | + ShowType: any = []; | |
| 274 | + | |
| 269 | 275 | // onToggleDetails() { |
| 270 | 276 | // // this.showSecret = !this.showSecret; |
| 271 | 277 | // if(this.ShowNull.length === 0){ |
| ... | ... | @@ -300,7 +306,7 @@ export class DashboardComponent implements OnInit { |
| 300 | 306 | this.showSecret = !this.showSecret; |
| 301 | 307 | } |
| 302 | 308 | } catch (error) { |
| 303 | - console.log(error); | |
| 309 | + // console.log(error); | |
| 304 | 310 | } |
| 305 | 311 | |
| 306 | 312 | setInterval(async () => { |
| ... | ... | @@ -330,7 +336,7 @@ export class DashboardComponent implements OnInit { |
| 330 | 336 | this.resultDataOnHold = []; |
| 331 | 337 | } |
| 332 | 338 | } catch (error) { |
| 333 | - console.log(error); | |
| 339 | + // console.log(error); | |
| 334 | 340 | } |
| 335 | 341 | |
| 336 | 342 | setInterval(async () => { |
| ... | ... | @@ -363,7 +369,7 @@ export class DashboardComponent implements OnInit { |
| 363 | 369 | this.resultData2 = []; |
| 364 | 370 | } |
| 365 | 371 | } catch (error) { |
| 366 | - console.log(error); | |
| 372 | + // console.log(error); | |
| 367 | 373 | } |
| 368 | 374 | |
| 369 | 375 | setInterval(async () => { |
| ... | ... | @@ -393,7 +399,7 @@ export class DashboardComponent implements OnInit { |
| 393 | 399 | this.resultDataOnHold2 = []; |
| 394 | 400 | } |
| 395 | 401 | } catch (error) { |
| 396 | - console.log(error); | |
| 402 | + // console.log(error); | |
| 397 | 403 | } |
| 398 | 404 | |
| 399 | 405 | setInterval(async () => { |
| ... | ... | @@ -425,7 +431,7 @@ export class DashboardComponent implements OnInit { |
| 425 | 431 | this.resultData3 = []; |
| 426 | 432 | } |
| 427 | 433 | } catch (error) { |
| 428 | - console.log(error); | |
| 434 | + // console.log(error); | |
| 429 | 435 | } |
| 430 | 436 | |
| 431 | 437 | setInterval(async () => { |
| ... | ... | @@ -455,7 +461,7 @@ export class DashboardComponent implements OnInit { |
| 455 | 461 | this.resultDataOnHold3 = []; |
| 456 | 462 | } |
| 457 | 463 | } catch (error) { |
| 458 | - console.log(error); | |
| 464 | + // console.log(error); | |
| 459 | 465 | } |
| 460 | 466 | |
| 461 | 467 | setInterval(async () => { |
| ... | ... | @@ -485,7 +491,7 @@ export class DashboardComponent implements OnInit { |
| 485 | 491 | this.resultData4 = []; |
| 486 | 492 | } |
| 487 | 493 | } catch (error) { |
| 488 | - console.log(error); | |
| 494 | + // console.log(error); | |
| 489 | 495 | } |
| 490 | 496 | |
| 491 | 497 | setInterval(async () => { |
| ... | ... | @@ -515,7 +521,7 @@ export class DashboardComponent implements OnInit { |
| 515 | 521 | this.resultDataOnHold4 = []; |
| 516 | 522 | } |
| 517 | 523 | } catch (error) { |
| 518 | - console.log(error); | |
| 524 | + // console.log(error); | |
| 519 | 525 | } |
| 520 | 526 | |
| 521 | 527 | setInterval(async () => { |
| ... | ... | @@ -545,7 +551,7 @@ export class DashboardComponent implements OnInit { |
| 545 | 551 | this.resultData5 = []; |
| 546 | 552 | } |
| 547 | 553 | } catch (error) { |
| 548 | - console.log(error); | |
| 554 | + // console.log(error); | |
| 549 | 555 | } |
| 550 | 556 | |
| 551 | 557 | setInterval(async () => { |
| ... | ... | @@ -575,7 +581,7 @@ export class DashboardComponent implements OnInit { |
| 575 | 581 | this.resultDataOnHold5 = []; |
| 576 | 582 | } |
| 577 | 583 | } catch (error) { |
| 578 | - console.log(error); | |
| 584 | + // console.log(error); | |
| 579 | 585 | } |
| 580 | 586 | |
| 581 | 587 | setInterval(async () => { |
| ... | ... | @@ -604,7 +610,7 @@ export class DashboardComponent implements OnInit { |
| 604 | 610 | this.resultData6 = []; |
| 605 | 611 | } |
| 606 | 612 | } catch (error) { |
| 607 | - console.log(error); | |
| 613 | + // console.log(error); | |
| 608 | 614 | } |
| 609 | 615 | |
| 610 | 616 | setInterval(async () => { |
| ... | ... | @@ -634,7 +640,7 @@ export class DashboardComponent implements OnInit { |
| 634 | 640 | this.resultDataOnHold6 = []; |
| 635 | 641 | } |
| 636 | 642 | } catch (error) { |
| 637 | - console.log(error); | |
| 643 | + // console.log(error); | |
| 638 | 644 | } |
| 639 | 645 | |
| 640 | 646 | setInterval(async () => { |
| ... | ... | @@ -667,7 +673,7 @@ export class DashboardComponent implements OnInit { |
| 667 | 673 | this.resultData7 = []; |
| 668 | 674 | } |
| 669 | 675 | } catch (error) { |
| 670 | - console.log(error); | |
| 676 | + // console.log(error); | |
| 671 | 677 | } |
| 672 | 678 | |
| 673 | 679 | setInterval(async () => { |
| ... | ... | @@ -697,7 +703,7 @@ export class DashboardComponent implements OnInit { |
| 697 | 703 | this.resultDataOnHold7 = []; |
| 698 | 704 | } |
| 699 | 705 | } catch (error) { |
| 700 | - console.log(error); | |
| 706 | + // console.log(error); | |
| 701 | 707 | } |
| 702 | 708 | |
| 703 | 709 | setInterval(async () => { |
| ... | ... | @@ -731,7 +737,7 @@ try { |
| 731 | 737 | this.resultData8 = []; |
| 732 | 738 | } |
| 733 | 739 | } catch (error) { |
| 734 | - console.log(error); | |
| 740 | + // console.log(error); | |
| 735 | 741 | } |
| 736 | 742 | |
| 737 | 743 | setInterval(async () => { |
| ... | ... | @@ -760,7 +766,7 @@ try { |
| 760 | 766 | this.resultDataOnHold8 = []; |
| 761 | 767 | } |
| 762 | 768 | } catch (error) { |
| 763 | - console.log(error); | |
| 769 | + // console.log(error); | |
| 764 | 770 | } |
| 765 | 771 | |
| 766 | 772 | setInterval(async () => { |
| ... | ... | @@ -776,23 +782,33 @@ setInterval(async () => { |
| 776 | 782 | }; |
| 777 | 783 | const response = await this._apiService.post('dynamic', data9); |
| 778 | 784 | if (response !== null) { |
| 785 | + var t9 =[]; | |
| 779 | 786 | this.resultData9 = response; |
| 780 | 787 | this.resultData9.link = decodeURIComponent(decodeURIComponent(this.resultData9.link)); |
| 781 | 788 | console.log('link: ', this.resultData9.link); |
| 782 | 789 | // tslint:disable-next-line:forin |
| 783 | - for (const i in this.resultData9) { | |
| 784 | - this.resultData9[i].link = this._common.decodeURI(this.resultData9[i].link); | |
| 785 | - this.resultData9[i].birth_date = this._common.convertDate(this.resultData9[i].birth_date); | |
| 790 | + this.resultData9 = this.resultData9.map(r => { | |
| 791 | + console.log(r) | |
| 792 | + // t9: r.type | |
| 793 | + r.link = this._common.decodeURI(r.link); | |
| 794 | + r.birth_date = this._common.convertDate(r.birth_date); | |
| 786 | 795 | this.resultNum9 = this.resultData9.length; |
| 787 | - this.Show9.push(this.resultData9[i]); | |
| 788 | - console.log('show',this.Show9); | |
| 789 | - this.Type9.push(this.resultData9[i].type); | |
| 790 | - } | |
| 796 | + this.Show9.push(r); | |
| 797 | + this.Type9.push(r.type); | |
| 798 | + t9.push(r.type); | |
| 799 | + r.t9 = t9; | |
| 800 | + return r; | |
| 801 | + }) | |
| 802 | + | |
| 803 | + | |
| 804 | + console.log("t99:", t9); | |
| 791 | 805 | } else { |
| 792 | 806 | this.resultData9 = []; |
| 793 | 807 | } |
| 808 | + // if(summary){ | |
| 809 | + // } | |
| 794 | 810 | } catch (error) { |
| 795 | - console.log(error); | |
| 811 | + // console.log(error); | |
| 796 | 812 | } |
| 797 | 813 | |
| 798 | 814 | setInterval(async () => { |
| ... | ... | @@ -822,7 +838,7 @@ try { |
| 822 | 838 | this.resultDataOnHold9 = []; |
| 823 | 839 | } |
| 824 | 840 | } catch (error) { |
| 825 | - console.log(error); | |
| 841 | + // console.log(error); | |
| 826 | 842 | } |
| 827 | 843 | |
| 828 | 844 | setInterval(async () => { |
| ... | ... | @@ -1436,7 +1452,7 @@ setInterval(async () => { |
| 1436 | 1452 | if (response !== null) { |
| 1437 | 1453 | this.resultDataOnHold = response; |
| 1438 | 1454 | this.resultDataOnHold.link = decodeURIComponent(decodeURIComponent(this.resultDataOnHold.link)); |
| 1439 | - console.log('link: ', this.resultDataOnHold.link); | |
| 1455 | + // console.log('link: ', this.resultDataOnHold.link); | |
| 1440 | 1456 | // tslint:disable-next-line:forin |
| 1441 | 1457 | for (const i in this.resultDataOnHold) { |
| 1442 | 1458 | this.resultDataOnHold[i].link = this._common.decodeURI(this.resultDataOnHold[i].link); |
| ... | ... | @@ -1446,7 +1462,7 @@ setInterval(async () => { |
| 1446 | 1462 | this.resultDataOnHold = []; |
| 1447 | 1463 | } |
| 1448 | 1464 | } catch (error) { |
| 1449 | - console.log(error); | |
| 1465 | + // console.log(error); | |
| 1450 | 1466 | } |
| 1451 | 1467 | } |
| 1452 | 1468 | ... | ... |