多单位版国产化地质资料管理系统
zhai
2025-12-18 3c6f6c1e3016e38146a4c46be6e7b625c35591f2
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
var wcp = wcp || {};
(function($) {
    if (!layer || !$) {
        return;
    }
 
    /* DEFAULTS *************************************************/
 
    wcp.libs = wcp.libs || {};
    wcp.libs.layer = {
        config : {
            'default' : {
                area: 'auto'
            },
            info : {
                icon : 6
            },
            success : {
                icon : 1
            },
            warn : {
                icon : 0
            },
            error : {
                icon : 2
            }
        }
    };
 
    /* MESSAGE **************************************************/
 
    var showMessage = function(type, message, title) {
        if (!title) {
            title = "提示"
        }
 
        var opts = $.extend(
            {},
            wcp.libs.layer.config['default'],
            wcp.libs.layer.config[type],
            {
                title : title,
                maxWidth : 800,
                maxHeight : 600
            }
        );
 
        return $.Deferred(function($dfd) {
            layer.alert(message, opts, function(index) {
                $dfd.resolve();
                layer.close(index);
            });
        });
    };
 
    wcp.message.info = function(message, title) {
        return showMessage('info', message, title);
    };
 
    wcp.message.success = function(message, title) {
        return showMessage('success', message, title);
    };
 
    wcp.message.warn = function(message, title) {
        return showMessage('warn', message, title);
    };
 
    wcp.message.error = function(message, title) {
        return showMessage('error', message, title);
    };
 
    wcp.message.confirm = function(message, callback) {
        var opts = $.extend(
            {},
            wcp.libs.layer.config['default']
        );
 
        return $.Deferred(function($dfd) {
            layer.confirm(message, opts, function(index) {
                callback;
                $dfd.resolve();
                layer.close(index);
            });
        });
    };
 
    var showNotification = function(type, message, title, options) {
        var opts = $.extend(
            {},
            wcp.libs.layer.config['default'],
            wcp.libs.layer.config[type]
        );
 
        return $.Deferred(function($dfd) {
            layer.msg(message, opts, function() {
                $dfd.resolve();
            });
        });
    };
 
    wcp.notify.success = function(message, title, options) {
        showNotification('success', message, title, options);
    };
 
    wcp.notify.info = function(message, title, options) {
        showNotification('info', message, title, options);
    };
 
    wcp.notify.warn = function(message, title, options) {
        showNotification('warning', message, title, options);
    };
 
    wcp.notify.error = function(message, title, options) {
        showNotification('error', message, title, options);
    };
 
})(jQuery);