Commit 2ea88fab281087f6f1fb7393e2935a2b2499b306

Authored by trainee
1 parent 347ce73a
Exists in master

บึ้มๆ

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