import { Component, EventEmitter, Input, OnInit, Output } from "@angular/core";
@Component({
  selector: "app-dialog-surgery",
  templateUrl: "./dialog-surgery.component.html",
  styleUrls: ["./dialog-surgery.component.less"],
})
export class DialogSurgeryComponent implements OnInit {
  @Output() hideDelModalEvent = new EventEmitter<any>();
  @Output() confirmDelEvent = new EventEmitter<any>();
  @Output() cancelDelEvent = new EventEmitter<any>();
  @Input() btnLoading: boolean = false;
  @Input() cancenlLoading: boolean = false;
  @Input() delModal: boolean = false;
  @Input() content: string = "";
  @Input() confirmTxt: string = "确定";
  @Input() cancelTxt: string = "取消";
  @Input() isShowConfirm: boolean = true;
  @Input() dataObj: object = {};
  constructor() {}

  ngOnInit() {}

  // 隐藏
  hideDelModal(e: string) {
    this.hideDelModalEvent.emit(e);
  }

  // 确认
  confirmDel() {
    this.confirmDelEvent.emit(this.dataObj);
  }

  // 取消
  cancel() {
    this.hideDelModal("cancel");
  }
}
