12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- 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<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() 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();
- }
- }
- }
|