agent-user-input.component.ts 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { Component, OnInit, Input } from '@angular/core';
  2. import { ModalController, IonHeader, IonContent, IonInput, IonToolbar, IonItem, IonButtons, IonButton, IonTitle } from '@ionic/angular/standalone';
  3. import { FormsModule, ReactiveFormsModule } from '@angular/forms';
  4. export interface AgentUserInputField{
  5. name:string, // 字段名称
  6. type:string, // 输入类型
  7. desc:string, // 字段说明
  8. }
  9. @Component({
  10. selector: 'agent-user-input',
  11. templateUrl: './agent-user-input.component.html',
  12. styleUrls: ['./agent-user-input.component.scss'],
  13. standalone: true,
  14. imports:[
  15. IonHeader,IonContent,IonInput,IonToolbar,IonItem,IonButtons,IonButton,
  16. IonTitle,
  17. FormsModule,ReactiveFormsModule,
  18. ]
  19. })
  20. export class AgentUserInputComponent implements OnInit {
  21. @Input()
  22. fieldsArray:AgentUserInputField[]=[]
  23. @Input()
  24. inputData:any = {}
  25. constructor(private modalCtrl: ModalController) {}
  26. ngOnInit(){
  27. }
  28. cancel() {
  29. return this.modalCtrl.dismiss(null, 'cancel');
  30. }
  31. confirm() {
  32. return this.modalCtrl.dismiss(this.inputData, 'confirm');
  33. }
  34. }