UI
This commit is contained in:
@ -1,25 +1,29 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { STColumn, STComponent, STData } from '@delon/abc/st';
|
||||
import { SFComponent, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
|
||||
import { NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { SFSchemaEnum, SFSelectWidgetSchema } from '@delon/form';
|
||||
import { SearchDrawerService } from '@shared';
|
||||
import { of } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { BasicTableComponent } from 'src/app/routes/commom';
|
||||
import { VehicleService } from '../../../vehicle/services/vehicle.service';
|
||||
@Component({
|
||||
selector: 'app-Vehicle-components-list',
|
||||
templateUrl: './list.component.html'
|
||||
templateUrl: './list.component.html',
|
||||
styleUrls: ['../../../commom/less/commom-table.less']
|
||||
})
|
||||
export class VehicleComponentsListComponent implements OnInit {
|
||||
_$expand = false;
|
||||
|
||||
ui!: SFUISchema;
|
||||
schema!: SFSchema;
|
||||
export class VehicleComponentsListComponent extends BasicTableComponent implements OnInit {
|
||||
columns!: STColumn[];
|
||||
@ViewChild('st', { static: false }) st!: STComponent;
|
||||
@ViewChild('sf', { static: false }) sf!: SFComponent;
|
||||
|
||||
constructor(public service: VehicleService, private modal: NzModalService, private router: Router, private ar: ActivatedRoute) {}
|
||||
constructor(
|
||||
public service: VehicleService,
|
||||
private router: Router,
|
||||
private ar: ActivatedRoute,
|
||||
public searchDrawerService: SearchDrawerService
|
||||
) {
|
||||
super(searchDrawerService);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询参数
|
||||
@ -37,6 +41,10 @@ export class VehicleComponentsListComponent implements OnInit {
|
||||
return params;
|
||||
}
|
||||
|
||||
search() {
|
||||
this.st?.load(1);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.initSF();
|
||||
this.initST();
|
||||
@ -109,10 +117,7 @@ export class VehicleComponentsListComponent implements OnInit {
|
||||
ui: {
|
||||
widget: 'dict-select',
|
||||
params: { dictKey: 'car:model' },
|
||||
containsAllLabel: true,
|
||||
visibleIf: {
|
||||
expand: (value: boolean) => value
|
||||
}
|
||||
containsAllLabel: true
|
||||
}
|
||||
},
|
||||
carLength: {
|
||||
@ -121,20 +126,12 @@ export class VehicleComponentsListComponent implements OnInit {
|
||||
ui: {
|
||||
widget: 'dict-select',
|
||||
params: { dictKey: 'car:length' },
|
||||
containsAllLabel: true,
|
||||
visibleIf: {
|
||||
expand: (value: boolean) => value
|
||||
}
|
||||
containsAllLabel: true
|
||||
}
|
||||
},
|
||||
carLoad: {
|
||||
title: '载重',
|
||||
type: 'string',
|
||||
ui: {
|
||||
visibleIf: {
|
||||
expand: (value: boolean) => value
|
||||
}
|
||||
}
|
||||
type: 'string'
|
||||
},
|
||||
isSelf: {
|
||||
type: 'string',
|
||||
@ -145,10 +142,7 @@ export class VehicleComponentsListComponent implements OnInit {
|
||||
],
|
||||
ui: {
|
||||
widget: 'select',
|
||||
allowClear: true,
|
||||
visibleIf: {
|
||||
expand: (value: boolean) => value
|
||||
}
|
||||
allowClear: true
|
||||
}
|
||||
},
|
||||
driverLicenseStatus: {
|
||||
@ -162,10 +156,7 @@ export class VehicleComponentsListComponent implements OnInit {
|
||||
default: '',
|
||||
ui: {
|
||||
widget: 'select',
|
||||
allowClear: true,
|
||||
visibleIf: {
|
||||
expand: (value: boolean) => value
|
||||
}
|
||||
allowClear: true
|
||||
}
|
||||
},
|
||||
roadTransportStatus: {
|
||||
@ -178,12 +169,9 @@ export class VehicleComponentsListComponent implements OnInit {
|
||||
],
|
||||
ui: {
|
||||
widget: 'select',
|
||||
allowClear: true,
|
||||
visibleIf: {
|
||||
expand: (value: boolean) => value
|
||||
}
|
||||
allowClear: true
|
||||
}
|
||||
},
|
||||
}
|
||||
// isSelfs: {
|
||||
// type: 'string',
|
||||
// title: '是否入网',
|
||||
@ -216,7 +204,6 @@ export class VehicleComponentsListComponent implements OnInit {
|
||||
// },
|
||||
}
|
||||
};
|
||||
this.ui = { '*': { spanLabelFixed: 130, grid: { span: 8, gutter: 4 }, enter: () => this.st.load() } };
|
||||
}
|
||||
|
||||
initST() {
|
||||
@ -292,20 +279,9 @@ export class VehicleComponentsListComponent implements OnInit {
|
||||
}
|
||||
];
|
||||
}
|
||||
expandToggle() {
|
||||
this._$expand = !this._$expand;
|
||||
this.sf?.setValue('/expand', this._$expand);
|
||||
}
|
||||
creat() {
|
||||
this.router.navigate(['./new'], { relativeTo: this.ar });
|
||||
}
|
||||
/**
|
||||
* 重置表单
|
||||
*/
|
||||
resetSF() {
|
||||
this.sf.reset();
|
||||
this._$expand = false;
|
||||
}
|
||||
// 导出
|
||||
exportFire() {
|
||||
let params = Object.assign({}, this.reqParams || {});
|
||||
|
||||
Reference in New Issue
Block a user