import { Component, EventEmitter, Input, OnInit, Output } from "@angular/core"; @Component({ selector: "app-dialog-delete", templateUrl: "./dialog-delete.component.html", styleUrls: ["./dialog-delete.component.less"], }) export class DialogDeleteComponent implements OnInit { @Output() hideDelModalEvent = new EventEmitter(); @Output() confirmDelEvent = new EventEmitter(); @Output() cancelDelEvent = new EventEmitter(); @Input() btnLoading: boolean = false; @Input() cancenlLoading: boolean = false; @Input() delModal: boolean = false; @Input() content: string = "您确定要删除吗?"; @Input() tips: string = ""; @Input() confirmTxt: string = "确定"; @Input() cancelTxt: string = "取消"; @Input() isChecked: boolean = false; constructor() {} isRemandClean:boolean = true; ngOnInit() {} // 隐藏 hideDelModal(e: string) { this.hideDelModalEvent.emit(e); } // 确认删除 confirmDel() { this.confirmDelEvent.emit(this.isChecked ? this.isRemandClean : false); } cancel(type: string) { if (type == "cancel") { //取消 this.hideDelModal("cancel"); } else if (type == "no") { //否 this.cancelDelEvent.emit(); } } }