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; }