edit
This commit is contained in:
		@ -9,8 +9,8 @@
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <st #st [data]="url" [columns]="columns" bordered size="small"
 | 
			
		||||
        [req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
 | 
			
		||||
        [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, 200, 300, 500, 1000] }"
 | 
			
		||||
        [loading]="service.http.loading" [scroll]="{ x:'756px',y: '400px' }" (change)="stChange($event)"></st>
 | 
			
		||||
        [loading]="service.http.loading" [scroll]="{ x:'860px',y: '400px' }"></st>
 | 
			
		||||
</div>
 | 
			
		||||
@ -1,14 +1,13 @@
 | 
			
		||||
import { Component, OnInit, ViewChild } from '@angular/core';
 | 
			
		||||
import { Router } from '@angular/router';
 | 
			
		||||
import { STComponent, STColumn, STChange } from '@delon/abc/st';
 | 
			
		||||
import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st';
 | 
			
		||||
import { SFComponent, SFDateWidgetSchema, SFSchema } from '@delon/form';
 | 
			
		||||
import { NzModalService } from 'ng-zorro-antd/modal';
 | 
			
		||||
import { TicketService } from '../../../services/ticket.service';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'app-transaction-details',
 | 
			
		||||
  templateUrl: './transaction-details.component.html',
 | 
			
		||||
  styleUrls: ['./transaction-details.component.less']
 | 
			
		||||
  templateUrl: './transaction-details.component.html'
 | 
			
		||||
})
 | 
			
		||||
export class TransactionDetailsComponent implements OnInit {
 | 
			
		||||
  data = [];
 | 
			
		||||
@ -41,11 +40,7 @@ export class TransactionDetailsComponent implements OnInit {
 | 
			
		||||
        ],
 | 
			
		||||
        ui: {
 | 
			
		||||
          widget: 'select',
 | 
			
		||||
          placeholder: '请选择',
 | 
			
		||||
          change: (i: any) => {
 | 
			
		||||
            this.sf.value.receiveName = i;
 | 
			
		||||
            this.sf?.setValue('/receiveName', i);
 | 
			
		||||
          }
 | 
			
		||||
          placeholder: '请选择'
 | 
			
		||||
        },
 | 
			
		||||
        default: ''
 | 
			
		||||
      },
 | 
			
		||||
@ -53,8 +48,7 @@ export class TransactionDetailsComponent implements OnInit {
 | 
			
		||||
        title: '交易时间',
 | 
			
		||||
        type: 'string',
 | 
			
		||||
        ui: {
 | 
			
		||||
          widget: 'date',
 | 
			
		||||
          mode: 'range',
 | 
			
		||||
          widget: 'sl-from-to-search',
 | 
			
		||||
          format: 'yyyy-MM-dd'
 | 
			
		||||
        } as SFDateWidgetSchema
 | 
			
		||||
      }
 | 
			
		||||
@ -67,13 +61,14 @@ export class TransactionDetailsComponent implements OnInit {
 | 
			
		||||
 | 
			
		||||
  ngOnInit(): void {}
 | 
			
		||||
 | 
			
		||||
  stChange(e: STChange): void {
 | 
			
		||||
    switch (e.type) {
 | 
			
		||||
      case 'filter':
 | 
			
		||||
        this.st.load();
 | 
			
		||||
        break;
 | 
			
		||||
  beforeReq = (requestOptions: STRequestOptions) => {
 | 
			
		||||
    if (this.sf) {
 | 
			
		||||
      Object.assign(requestOptions.body, {
 | 
			
		||||
        ...this.sf.value
 | 
			
		||||
      });
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
    return requestOptions;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * 重置表单
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user