From a5263a18feed0aef6946898b60d971b79de0a7e6 Mon Sep 17 00:00:00 2001 From: zhouyuejun <505127606@qq.com> Date: Tue, 19 Feb 2019 10:28:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=86=E5=8F=B2=E6=95=B0=E6=8D=AE=E5=AE=9A?= =?UTF-8?q?=E4=BD=8D=E5=8A=9F=E8=83=BD=E9=87=8D=E7=BD=AE=E5=AE=9A=E4=BD=8D?= =?UTF-8?q?=E6=95=B0=E7=BB=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../historical-data.component.html | 4 ++-- .../historical-data/historical-data.component.ts | 15 +++++++++++++++ src/app/pages/main/main.component.ts | 5 +++++ .../seasonal-plan/seasonal-plan.component.ts | 5 +++++ 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/app/pages/historical-data/historical-data.component.html b/src/app/pages/historical-data/historical-data.component.html index f4f3d2a..30d9c99 100644 --- a/src/app/pages/historical-data/historical-data.component.html +++ b/src/app/pages/historical-data/historical-data.component.html @@ -3,7 +3,7 @@
- @@ -15,7 +15,7 @@ 查找定位 - +
diff --git a/src/app/pages/historical-data/historical-data.component.ts b/src/app/pages/historical-data/historical-data.component.ts index 7bc5450..f964e04 100644 --- a/src/app/pages/historical-data/historical-data.component.ts +++ b/src/app/pages/historical-data/historical-data.component.ts @@ -231,6 +231,11 @@ export class HistoricalDataComponent implements OnInit { $(".table-body tbody>tr").eq(0).find('td').each((index, element) => { $(".table-head table thead tr").eq(0).find('th').eq(index).attr('width', $(element).innerWidth() + 'px'); }) + if (this.tableBody.nativeElement.scrollHeight <= (this.tableBody.nativeElement.innerHeight || this.tableBody.nativeElement.clientHeight)) { + this.tableHead.nativeElement.style.overflowY = 'auto'; + } else { + this.tableHead.nativeElement.style.overflowY = 'scroll'; + } } return true; } @@ -284,6 +289,8 @@ export class HistoricalDataComponent implements OnInit { */ refresh() { this.operateSpinServiceService.showSpin(); + this.positionedArray = []; //定位数组为清空 + this.positionArrayIndex = 0; //定位元素Index归零 this.SEARCH = ''; //手动输入条件 this.FLT_POS = 1; //过滤还是定位 this.SEL_COL = ''; //选择列名 @@ -726,6 +733,14 @@ export class HistoricalDataComponent implements OnInit { } + /** + * 重置定位数组 + */ + resetPositionArray() { + this.positionedArray = []; + this.positionArrayIndex = 0; + } + /** * 选中某行 * @param i diff --git a/src/app/pages/main/main.component.ts b/src/app/pages/main/main.component.ts index 37a5a40..6ea5967 100644 --- a/src/app/pages/main/main.component.ts +++ b/src/app/pages/main/main.component.ts @@ -295,6 +295,11 @@ export class MainComponent implements OnInit { $(".table-body tbody>tr").eq(0).find('td').each((index, element) => { $(".table-head table thead tr").eq(0).find('th').eq(index).attr('width', $(element).innerWidth() + 'px'); }) + if (this.tableBody.nativeElement.scrollHeight <= (this.tableBody.nativeElement.innerHeight || this.tableBody.nativeElement.clientHeight)) { + this.tableHead.nativeElement.style.overflowY = 'auto'; + } else { + this.tableHead.nativeElement.style.overflowY = 'scroll'; + } } return true; } diff --git a/src/app/pages/seasonal-plan/seasonal-plan.component.ts b/src/app/pages/seasonal-plan/seasonal-plan.component.ts index ca72e67..28420ac 100644 --- a/src/app/pages/seasonal-plan/seasonal-plan.component.ts +++ b/src/app/pages/seasonal-plan/seasonal-plan.component.ts @@ -318,6 +318,11 @@ export class SeasonalPlanComponent implements OnInit { $(".table-body tbody>tr").eq(0).find('td').each((index, element) => { $(".table-head table thead tr").eq(0).find('th').eq(index).attr('width', $(element).innerWidth() + 'px'); }) + if (this.tableBody.nativeElement.scrollHeight <= (this.tableBody.nativeElement.innerHeight || this.tableBody.nativeElement.clientHeight)) { + this.tableHead.nativeElement.style.overflowY = 'auto'; + } else { + this.tableHead.nativeElement.style.overflowY = 'scroll'; + } } return true; }