From c98368f88242be7cb9bc7e8b4de6e6821503e79c Mon Sep 17 00:00:00 2001 From: DESKTOP-D5ILJ4S\flr_3 Date: Mon, 16 Jul 2018 10:22:18 +0700 Subject: [PATCH] โชวแท็ป + ปุ่มค้นหา --- src/app/dashboard/dashboard.component.html | 43 ++++++++++++++++++++++++++++--------------- src/app/dashboard/dashboard.component.ts | 207 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 221 insertions(+), 29 deletions(-) diff --git a/src/app/dashboard/dashboard.component.html b/src/app/dashboard/dashboard.component.html index e717080..fd68f19 100644 --- a/src/app/dashboard/dashboard.component.html +++ b/src/app/dashboard/dashboard.component.html @@ -13,7 +13,7 @@ {{resultNum7}} - +
@@ -42,7 +42,8 @@
- +

+

@@ -59,7 +60,7 @@
-
{{item.type}}
+
{{item.type | textshort}}
{{item.STATUS}}
{{item.custgroupName}} @@ -150,7 +151,8 @@
- +

+

@@ -167,7 +169,8 @@
-
{{item.STATUS}}
+
{{item.type | textshort}}
+
{{item.STATUS}}
{{item.custgroupName}}
@@ -254,7 +257,8 @@
- +

+

@@ -271,7 +275,8 @@
-
{{item.STATUS}}
+
{{item.type | textshort}}
+
{{item.STATUS}}
{{item.custgroupName}}
@@ -358,7 +363,8 @@
- +

+

@@ -375,7 +381,8 @@
-
{{item.STATUS}}
+
{{item.type | textshort}}
+
{{item.STATUS}}
{{item.custgroupName}}
@@ -462,7 +469,8 @@
- +

+

@@ -479,7 +487,8 @@
-
{{item.STATUS}}
+
{{item.type | textshort}}
+
{{item.STATUS}}
{{item.custgroupName}}
@@ -566,7 +575,8 @@
- +

+

@@ -583,7 +593,8 @@
-
{{item.STATUS}}
+
{{item.type | textshort}}
+
{{item.STATUS}}
{{item.custgroupName}}
@@ -673,7 +684,7 @@


- +

@@ -730,6 +741,8 @@ +

diff --git a/src/app/dashboard/dashboard.component.ts b/src/app/dashboard/dashboard.component.ts index f8c1d3e..bcd15ed 100644 --- a/src/app/dashboard/dashboard.component.ts +++ b/src/app/dashboard/dashboard.component.ts @@ -70,7 +70,13 @@ export class DashboardComponent implements OnInit { resultNum7:number = 0; resultDataOnHold7: any; - Show: any = []; + Show1: any = []; + Show2: any = []; + Show3: any = []; + Show4: any = []; + Show5: any = []; + Show6: any = []; + Show7: any = []; ButtonValue = [ { @@ -201,13 +207,13 @@ export class DashboardComponent implements OnInit { name : 'web', valueN : 'web' }, + { + name : 'reset', + valueN : '' + }, ]; - - - - async ngOnInit() { //----------------------------1------------------------ // Active @@ -227,6 +233,7 @@ export class DashboardComponent implements OnInit { this.resultData[i].link = this._common.decodeURI(this.resultData[i].link); this.resultData[i].birth_date = this._common.convertDate(this.resultData[i].birth_date); this.resultNum = this.resultData.length; + this.Show1.push(this.resultData[i]); } } else { @@ -289,6 +296,7 @@ export class DashboardComponent implements OnInit { this.resultData2[i].link = this._common.decodeURI(this.resultData2[i].link); this.resultData2[i].birth_date = this._common.convertDate(this.resultData2[i].birth_date); this.resultNum2 = this.resultData2.length; + this.Show2.push(this.resultData2[i]); } } else { this.resultData2 = []; @@ -349,6 +357,7 @@ export class DashboardComponent implements OnInit { this.resultData3[i].link = this._common.decodeURI(this.resultData3[i].link); this.resultData3[i].birth_date = this._common.convertDate(this.resultData3[i].birth_date); this.resultNum3 = this.resultData3.length; + this.Show3.push(this.resultData3[i]); } } else { this.resultData3 = []; @@ -407,6 +416,7 @@ export class DashboardComponent implements OnInit { this.resultData4[i].link = this._common.decodeURI(this.resultData4[i].link); this.resultData4[i].birth_date = this._common.convertDate(this.resultData4[i].birth_date); this.resultNum4 = this.resultData4.length; + this.Show4.push(this.resultData4[i]); } } else { this.resultData4 = []; @@ -465,6 +475,7 @@ export class DashboardComponent implements OnInit { this.resultData5[i].link = this._common.decodeURI(this.resultData5[i].link); this.resultData5[i].birth_date = this._common.convertDate(this.resultData5[i].birth_date); this.resultNum5 = this.resultData5.length; + this.Show5.push(this.resultData5[i]); } } else { this.resultData5 = []; @@ -522,6 +533,7 @@ export class DashboardComponent implements OnInit { this.resultData6[i].link = this._common.decodeURI(this.resultData6[i].link); this.resultData6[i].birth_date = this._common.convertDate(this.resultData6[i].birth_date); this.resultNum6 = this.resultData6.length; + this.Show6.push(this.resultData6[i]); } } else { this.resultData6 = []; @@ -580,11 +592,11 @@ export class DashboardComponent implements OnInit { this.resultData7[i].link = this._common.decodeURI(this.resultData7[i].link); this.resultData7[i].birth_date = this._common.convertDate(this.resultData7[i].birth_date); this.resultNum7 = this.resultData7.length; - this.Show.push(this.resultData7[i]); + this.Show7.push(this.resultData7[i]); } // this.Show = Object.assign(this.resultData7); - console.log('hi',this.Show) + console.log('hi',this.Show7) } else { this.resultData7 = []; @@ -627,15 +639,15 @@ export class DashboardComponent implements OnInit { }, 600000); } - getButton(valueN){ + getButton1(valueN){ console.log(valueN); - if (this.Show.length === 0) { - return this.Show; + if (this.Show1.length === 0) { + return this.Show1; } const resultArray = []; - for (const item of this.Show) { + for (const item of this.Show1) { console.log('item: ', item); var st = ''; @@ -652,10 +664,177 @@ export class DashboardComponent implements OnInit { } - this.resultData7 = resultArray; - + this.resultData = resultArray; + } + + getButton2(valueN){ + console.log(valueN); + + if (this.Show2.length === 0) { + return this.Show2; + } + + const resultArray = []; + for (const item of this.Show2) { + console.log('item: ', item); + + var st = ''; + // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ; + if(item['type']){ + st = item['type'].toLowerCase(); + } + + var string2 = valueN.toLowerCase(); + if (st.indexOf(string2) > -1) { + console.log(st); + resultArray.push(item); + } + + } + + this.resultData2 = resultArray; + } + + getButton3(valueN){ + console.log(valueN); + + if (this.Show3.length === 0) { + return this.Show3; + } + + const resultArray = []; + for (const item of this.Show3) { + console.log('item: ', item); + + var st = ''; + // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ; + if(item['type']){ + st = item['type'].toLowerCase(); + } + var string2 = valueN.toLowerCase(); + if (st.indexOf(string2) > -1) { + console.log(st); + resultArray.push(item); + } + + } + + this.resultData3 = resultArray; } + + getButton4(valueN){ + console.log(valueN); + + if (this.Show4.length === 0) { + return this.Show4; + } + + const resultArray = []; + for (const item of this.Show4) { + console.log('item: ', item); + + var st = ''; + // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ; + if(item['type']){ + st = item['type'].toLowerCase(); + } + + var string2 = valueN.toLowerCase(); + if (st.indexOf(string2) > -1) { + console.log(st); + resultArray.push(item); + } + + } + + this.resultData4 = resultArray; + } + + getButton5(valueN){ + console.log(valueN); + + if (this.Show5.length === 0) { + return this.Show5; + } + + const resultArray = []; + for (const item of this.Show5) { + console.log('item: ', item); + + var st = ''; + // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ; + if(item['type']){ + st = item['type'].toLowerCase(); + } + + var string2 = valueN.toLowerCase(); + if (st.indexOf(string2) > -1) { + console.log(st); + resultArray.push(item); + } + + } + + this.resultData5 = resultArray; + } + + getButton6(valueN){ + console.log(valueN); + + if (this.Show6.length === 0) { + return this.Show6; + } + + const resultArray = []; + for (const item of this.Show6) { + console.log('item: ', item); + + var st = ''; + // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ; + if(item['type']){ + st = item['type'].toLowerCase(); + } + + var string2 = valueN.toLowerCase(); + if (st.indexOf(string2) > -1) { + console.log(st); + resultArray.push(item); + } + + } + + this.resultData6 = resultArray; + } + + getButton7(valueN){ + console.log(valueN); + + if (this.Show7.length === 0) { + return this.Show7; + } + + const resultArray = []; + for (const item of this.Show7) { + console.log('item: ', item); + + var st = ''; + // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ; + if(item['type']){ + st = item['type'].toLowerCase(); + } + + var string2 = valueN.toLowerCase(); + if (st.indexOf(string2) > -1) { + console.log(st); + resultArray.push(item); + } + + } + + this.resultData7 = resultArray; + } + /////////////Get data come to use////////////////////// @@ -988,7 +1167,7 @@ async getDataOnHold6() { for (const i in this.resultData7) { this.resultData7[i].link = this._common.decodeURI(this.resultData7[i].link); this.resultData7[i].birth_date = this._common.convertDate(this.resultData7[i].birth_date); - this.Show.push(this.resultData7[i]); + this.Show7.push(this.resultData7[i]); } } else { this.resultData7 = []; -- libgit2 0.21.2