|
@@ -1,31 +1,39 @@
|
1
|
|
-import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
|
1
|
+import { Component, EventEmitter, Input, OnInit, Output } from "@angular/core";
|
2
|
2
|
|
3
|
3
|
@Component({
|
4
|
|
- selector: 'app-dialog-delete',
|
5
|
|
- templateUrl: './dialog-delete.component.html',
|
6
|
|
- styleUrls: ['./dialog-delete.component.less']
|
|
4
|
+ selector: "app-dialog-delete",
|
|
5
|
+ templateUrl: "./dialog-delete.component.html",
|
|
6
|
+ styleUrls: ["./dialog-delete.component.less"],
|
7
|
7
|
})
|
8
|
8
|
export class DialogDeleteComponent implements OnInit {
|
9
|
9
|
@Output() hideDelModalEvent = new EventEmitter<any>();
|
10
|
10
|
@Output() confirmDelEvent = new EventEmitter<any>();
|
|
11
|
+ @Output() cancelDelEvent = new EventEmitter<any>();
|
11
|
12
|
@Input() btnLoading: boolean = false;
|
12
|
13
|
@Input() cancenlLoading: boolean = false;
|
13
|
14
|
@Input() delModal: boolean = false;
|
14
|
|
- @Input() content: string = '您确定要删除吗?';
|
15
|
|
- @Input() tips: string = '';
|
16
|
|
- @Input() confirmTxt: string = '确定';
|
17
|
|
- @Input() cancelTxt: string = '取消';
|
18
|
|
- constructor() { }
|
|
15
|
+ @Input() content: string = "您确定要删除吗?";
|
|
16
|
+ @Input() tips: string = "";
|
|
17
|
+ @Input() confirmTxt: string = "确定";
|
|
18
|
+ @Input() cancelTxt: string = "取消";
|
|
19
|
+ constructor() {}
|
19
|
20
|
|
20
|
|
- ngOnInit() {
|
21
|
|
- }
|
|
21
|
+ ngOnInit() {}
|
22
|
22
|
// 隐藏
|
23
|
|
- hideDelModal(e:string) {
|
|
23
|
+ hideDelModal(e: string) {
|
24
|
24
|
this.hideDelModalEvent.emit(e);
|
25
|
25
|
}
|
26
|
26
|
// 确认删除
|
27
|
27
|
confirmDel() {
|
28
|
28
|
this.confirmDelEvent.emit();
|
29
|
29
|
}
|
30
|
|
-
|
|
30
|
+ cancel(type: string) {
|
|
31
|
+ if (type == "cancel") {
|
|
32
|
+ //取消
|
|
33
|
+ this.hideDelModal("cancel");
|
|
34
|
+ } else if (type == "no") {
|
|
35
|
+ //否
|
|
36
|
+ this.cancelDelEvent.emit();
|
|
37
|
+ }
|
|
38
|
+ }
|
31
|
39
|
}
|