edit
This commit is contained in:
@ -0,0 +1,40 @@
|
||||
import { AfterViewInit, Component, OnInit } from '@angular/core';
|
||||
import { fromEvent } from 'rxjs';
|
||||
import { debounceTime } from 'rxjs/operators';
|
||||
|
||||
@Component({
|
||||
template: ''
|
||||
})
|
||||
export class BasicTableComponent implements AfterViewInit {
|
||||
scrollY = '400px';
|
||||
|
||||
constructor() {}
|
||||
|
||||
ngAfterViewInit(): void {
|
||||
setTimeout(() => {
|
||||
this.getScrollY();
|
||||
}, 100);
|
||||
fromEvent(window, 'resize')
|
||||
.pipe(debounceTime(100))
|
||||
.subscribe(event => {
|
||||
this.getScrollY();
|
||||
});
|
||||
}
|
||||
|
||||
getScrollY() {
|
||||
const windowHeight = window.innerHeight || Math.max(document.documentElement.clientHeight, document.body.clientHeight);
|
||||
const header = document.getElementsByTagName('layout-pro-header')?.[0];
|
||||
if (windowHeight && header) {
|
||||
let scrollY = windowHeight - header.clientHeight - 35 - 49;
|
||||
const headerWrapper = document.getElementsByTagName('page-header-wrapper')?.[0];
|
||||
if (headerWrapper) {
|
||||
scrollY -= headerWrapper.clientHeight;
|
||||
}
|
||||
const tabset = document.getElementsByTagName('nz-tabset')?.[0];
|
||||
if (tabset) {
|
||||
scrollY -= tabset.clientHeight;
|
||||
}
|
||||
this.scrollY = scrollY + 'px';
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -6,6 +6,7 @@ import { ShipperBaseService } from '@shared';
|
||||
import { NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { fromEvent, of } from 'rxjs';
|
||||
import { debounceTime, map } from 'rxjs/operators';
|
||||
import { BasicTableComponent } from 'src/app/routes/commom/components/basic-table/basic-table.component';
|
||||
import { OneCarOrderCancelConfirmComponent } from '../../modal/vehicle/cancel-confirm/cancel-confirm.component';
|
||||
import { VehicleConfirReceiptComponent } from '../../modal/vehicle/confir-receipt/confir-receipt.component';
|
||||
import { VehicleFreightPeopleComponent } from '../../modal/vehicle/freight-people/freight-people.component';
|
||||
@ -20,7 +21,7 @@ import { OrderManagementService } from '../../services/order-management.service'
|
||||
templateUrl: './vehicle.component.html',
|
||||
styleUrls: ['../../../commom/less/commom-table.less']
|
||||
})
|
||||
export class OrderManagementVehicleComponent implements OnInit {
|
||||
export class OrderManagementVehicleComponent extends BasicTableComponent implements OnInit {
|
||||
ui: SFUISchema = {};
|
||||
schema: SFSchema = {};
|
||||
auditMany = false;
|
||||
@ -67,7 +68,6 @@ export class OrderManagementVehicleComponent implements OnInit {
|
||||
};
|
||||
resourceStatus: any;
|
||||
|
||||
scrollY = '400px';
|
||||
visible = false;
|
||||
constructor(
|
||||
public service: OrderManagementService,
|
||||
@ -75,7 +75,9 @@ export class OrderManagementVehicleComponent implements OnInit {
|
||||
public shipperservice: ShipperBaseService,
|
||||
public router: Router,
|
||||
public ar: ActivatedRoute
|
||||
) {}
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询参数
|
||||
@ -145,32 +147,6 @@ export class OrderManagementVehicleComponent implements OnInit {
|
||||
this.initST();
|
||||
this.initSTFloat();
|
||||
this.initSTFloatView();
|
||||
|
||||
setTimeout(() => {
|
||||
this.getScrollY();
|
||||
}, 100);
|
||||
fromEvent(window, 'resize')
|
||||
.pipe(debounceTime(100))
|
||||
.subscribe(event => {
|
||||
this.getScrollY();
|
||||
});
|
||||
}
|
||||
|
||||
getScrollY() {
|
||||
const windowHeight = window.innerHeight || Math.max(document.documentElement.clientHeight, document.body.clientHeight);
|
||||
const header = document.getElementsByTagName('layout-pro-header')?.[0];
|
||||
if (windowHeight && header) {
|
||||
let scrollY = windowHeight - header.clientHeight - 35 - 49;
|
||||
const headerWrapper = document.getElementsByTagName('page-header-wrapper')?.[0];
|
||||
if (headerWrapper) {
|
||||
scrollY -= headerWrapper.clientHeight;
|
||||
}
|
||||
const tabset = document.getElementsByTagName('nz-tabset')?.[0];
|
||||
if (tabset) {
|
||||
scrollY -= tabset.clientHeight;
|
||||
}
|
||||
this.scrollY = scrollY + 'px';
|
||||
}
|
||||
}
|
||||
|
||||
search() {
|
||||
|
||||
@ -4,13 +4,14 @@ import { SharedModule } from '@shared';
|
||||
// dashboard pages
|
||||
import { DashboardComponent } from './dashboard/dashboard.component';
|
||||
import { RouteRoutingModule } from './routes-routing.module';
|
||||
import { BasicTableComponent } from './commom/components/basic-table/basic-table.component';
|
||||
|
||||
const COMPONENTS = [DashboardComponent];
|
||||
const COMPONENTS_NOROUNT: Array<Type<void>> = [];
|
||||
|
||||
@NgModule({
|
||||
imports: [SharedModule, RouteRoutingModule],
|
||||
declarations: [...COMPONENTS, ...COMPONENTS_NOROUNT],
|
||||
declarations: [...COMPONENTS, ...COMPONENTS_NOROUNT, BasicTableComponent],
|
||||
entryComponents: COMPONENTS_NOROUNT
|
||||
})
|
||||
export class RoutesModule {}
|
||||
|
||||
Reference in New Issue
Block a user