沈斌
2017-12-15 f9b157566af34b8dc28ba10b34d025ac04f3168b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import { Component, OnInit } from '@angular/core';
import { NzMessageService, NzNotificationService, NzModalService } from 'ng-zorro-antd';
 
@Component({
    selector: 'app-notification',
    templateUrl: './notification.component.html'
})
export class NotificationComponent {
    constructor(
        private msg: NzMessageService,
        private ntf: NzNotificationService
    ) { }
 
    marks = {
        0: 'naver'
    };
 
    notify = {
        type: 'info',
        title: 'Notification Title',
        content: `This is the content of the notification.
        This is the content of the notification. This is the content of the notification.`,
        duration: 5
    };
 
    percent = 0;
 
    // =====Message=====
 
    message = {
        type: 'info',
        content: 'This is a message!',
        duration: 2
    };
 
    createMessage() {
        this.msg.create(
            this.message.type,
            this.message.content,
            {
                nzDuration: this.message.duration * 1000
            }
        );
    }
 
    clearMessage() {
        this.msg.remove();
    }
 
 
    createNotify() {
        this.ntf.create(
            this.notify.type,
            this.notify.title,
            this.notify.content,
            {
                nzDuration: this.notify.duration * 1000
            }
        );
    }
 
    clearNotify() {
        this.ntf.remove();
    }
 
    // Popconfirm
    popConfirm() {
        this.msg.success('Next step.');
    }
 
    popCancel() {
        this.msg.error('Click on No');
    }
 
    // Progress Bar
    decline() {
        this.percent = this.percent - 10;
        if (this.percent < 0) {
          this.percent = 0;
        }
    }
 
    increase() {
        this.percent = this.percent + 10;
        if (this.percent > 100) {
          this.percent = 100;
        }
    }
}