contract-file.component.ts 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import { Component, OnInit, ViewChild } from '@angular/core';
  2. import { _HttpClient, ModalHelper } from '@delon/theme';
  3. import { STColumn, STComponent } from '@delon/abc';
  4. import { SFSchema } from '@delon/form';
  5. import { NzDrawerService } from 'ng-zorro-antd';
  6. import { ContractManagementContractFileAddComponent } from './add/add.component';
  7. import { I18NService } from '@core';
  8. @Component({
  9. selector: 'app-contract-management-contract-file',
  10. templateUrl: './contract-file.component.html',
  11. })
  12. export class ContractManagementContractFileComponent implements OnInit {
  13. url = `/user`;
  14. searchSchema: SFSchema = {
  15. properties: {
  16. no: {
  17. type: 'string',
  18. title: '编号'
  19. }
  20. }
  21. };
  22. @ViewChild('st') st: STComponent;
  23. columns: STColumn[] = [
  24. { title: '编号', index: 'no' },
  25. { title: '调用次数', type: 'number', index: 'callNo' },
  26. { title: '头像', type: 'img', width: '50px', index: 'avatar' },
  27. { title: '时间', type: 'date', index: 'updatedAt' },
  28. {
  29. title: '',
  30. buttons: [
  31. // { text: '查看', click: (item: any) => `/form/${item.id}` },
  32. // { text: '编辑', type: 'static', component: FormEditComponent, click: 'reload' },
  33. ]
  34. }
  35. ];
  36. constructor(private nzDrawerService:NzDrawerService,private i18NService:I18NService) { }
  37. ngOnInit() { }
  38. add() {
  39. const drawerRef = this.nzDrawerService.create({
  40. nzTitle: this.i18NService.fanyi("button.add"),//新增标题
  41. nzContent: ContractManagementContractFileAddComponent,
  42. nzWidth: window.innerWidth,
  43. nzBodyStyle: { height: 'calc(100% - 55px)', overflow: 'auto', 'padding-bottom': '53px' }
  44. // nzContentParams: {
  45. // //模板id
  46. // quotationId: item.id
  47. // }
  48. });
  49. //关闭抽屉的回调
  50. drawerRef.afterClose.subscribe((isRefresh) => {
  51. if (isRefresh) {//刷新list列表
  52. // this.getList();
  53. }
  54. });
  55. }
  56. }