edit
This commit is contained in:
@ -0,0 +1,16 @@
|
||||
<div nz-row nzGutter="8">
|
||||
<div nz-col nzSpan="19">
|
||||
<sf #sf [schema]="searchSchema" [ui]="{ '*': {grid: { span: 8 } }}" [compact]="true"
|
||||
[button]="'none'"></sf>
|
||||
</div>
|
||||
<div nz-col [nzSpan]="5" class="text-right mb-md">
|
||||
<button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st?.load(1)">查询</button>
|
||||
<button nz-button (click)="resetSF()">重置</button>
|
||||
</div>
|
||||
|
||||
<st #st [data]="service.$mock_url" [columns]="columns" bordered size="small"
|
||||
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, process: beforeReq }"
|
||||
[res]="{ reName: { list: 'data.records', total: 'data.total' } }"
|
||||
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100] }"
|
||||
[loading]="service.http.loading" [scroll]="{ x:'810px',y: '400px' }" (change)="stChange($event)"></st>
|
||||
</div>
|
||||
@ -0,0 +1,80 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st';
|
||||
import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form';
|
||||
import { NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { TicketService } from '../../../services/ticket.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-add-owner',
|
||||
templateUrl: './add-owner.component.html',
|
||||
styleUrls: ['./add-owner.component.less']
|
||||
})
|
||||
export class AddOwnerComponent implements OnInit {
|
||||
data = [];
|
||||
selectedData: any[] = [];
|
||||
@ViewChild('st', { static: true })
|
||||
st!: STComponent;
|
||||
@ViewChild('sf', { static: false })
|
||||
sf!: SFComponent;
|
||||
columns: STColumn[] = [
|
||||
{ title: '', index: 'key', type: 'checkbox' },
|
||||
{ title: '企业名称', index: 'no' },
|
||||
{ title: '联系人姓名', index: 'callNo' },
|
||||
{ title: '联系人手机号', index: 'callNo' },
|
||||
{ title: '认证状态', index: 'callNo' }
|
||||
];
|
||||
searchSchema: SFSchema = {
|
||||
properties: {
|
||||
params1: {
|
||||
title: '',
|
||||
type: 'string',
|
||||
ui: {
|
||||
placeholder: '请输入企业名称'
|
||||
}
|
||||
},
|
||||
params2: {
|
||||
title: '',
|
||||
type: 'string',
|
||||
ui: {
|
||||
placeholder: '请输入姓名'
|
||||
}
|
||||
},
|
||||
params3: {
|
||||
title: '',
|
||||
type: 'string',
|
||||
ui: {
|
||||
placeholder: '请输入手机号'
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
constructor(public service: TicketService, private nzModalService: NzModalService, private router: Router) {}
|
||||
|
||||
ngOnInit(): void {}
|
||||
|
||||
beforeReq = (requestOptions: STRequestOptions) => {
|
||||
if (this.sf) {
|
||||
Object.assign(requestOptions.body, {
|
||||
...this.sf.value
|
||||
});
|
||||
}
|
||||
return requestOptions;
|
||||
};
|
||||
|
||||
stChange(e: STChange): void {
|
||||
switch (e.type) {
|
||||
case 'checkbox':
|
||||
this.selectedData = e.checkbox!;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置表单
|
||||
*/
|
||||
resetSF() {
|
||||
this.sf.reset();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user