wzp
2022-11-11 2f74eb23c0d2d4a246bc612c5c34bdfa8dea5603
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
<%@ Page Language="C#" masterpagefile="~/Main.master"  AutoEventWireup="true" CodeFile="GwBlackPool.aspx.cs" Inherits="_GwBlackPool" %>
 <asp:Content runat="server" ID="Content1" ContentPlaceHolderID="head">
    
    <script type="text/javascript">
        $(document).ready(function () {
            var pagination = new Pagination();
            pagination.setPageIndex(1);
            pagination.setPageSize(20);
 
            function loadPageList() {
                var poolName = $("#qpoolName").val();
                $.ajax({
                    url: "GwBlackMobile.ashx",
                    type: "POST",
                    data: { action: "loadGwBlackPool", poolName: poolName, pageIndex: pagination.getPageIndex(), pageSize: pagination.getPageSize() },
                    success: function (result) {
                        if (result.OK) {
                            $("#gwclientTable tbody").html(result.Message.Table);
                            pagination.setRecordCount(result.Message.TotalCount);
                            $("#pagination").html(pagination.getHtml());
                        } else {
                            mytek.alert(result.Message, result.False);
                        }
                    }
                });
            }
 
            function loadblackPoolMobileList() {
                var mobile = $("#qmobile").val();
                var blackpool = $("#qblackpool").val();
                $.ajax({
                    url: "GwBlackMobile.ashx",
                    type: "POST",
                    data: { action: "loadGwBlackMobile", mobile: mobile, blackpool: blackpool },
                    success: function (result) {
                        if (result.OK) {
                            $("#table-poolmobile tbody").html(result.Message.Table);
                        } else {
                            mytek.alert(result.Message, result.False);
                        }
                    }
                });
            }
 
            $(document).on("click", ".action-query", function () {
                pagination.setPageIndex(1);
                loadPageList();
            });
 
            $(document).on("click", ".action-query-poolmobile", function () {
                loadblackPoolMobileList();
            });
 
            $(document).on("click", "a[data-index]", function () {
                pagination.setPageIndex($(this).attr("data-index"));
                loadPageList();
            });
            loadPageList();
 
            $(document).on("click", ".action-modal-create", function () {
                $("#gwBlackPoolDialog .modal-title").text("创建黑名单池");
                $("#gwBlackPoolDialog input[name=action]").val("save");
                $("#gwBlackPoolDialog #poolName").val("");
 
                $("#gwBlackPoolDialog").modal("show");
            });
 
            $(document).on("click", ".action-modal-edit", function () {
                $("#gwBlackPoolDialog .modal-title").text("修改黑名单池");
                $("#gwBlackPoolDialog input[name=action]").val("update");
                var id = $(this).data("id");
                $.get("GwBlackMobile.ashx", { action: "getGwBlackPool", poolID: id }, function (r) {
                    if (r.OK) {
                        try {
                            $("#gwBlackPoolDialog #poolID").val(r.Message.PoolID);
                            $("#gwBlackPoolDialog #poolName").val(r.Message.PoolName);
                        }
                        catch (e) {
                        }
 
                        $("#gwBlackPoolDialog").modal("show");
                    }
                    else {
                        mytek.alert(r.Message, r.OK);
                    }
                }, "json");
            });
 
            $(document).on("click", ".action-delete", function () {
                var id = $(this).data("id");
                mytek.confirm("是否确认删除该黑名单池?", "删除后黑名单池中的号码将同时被删除,请谨慎操作!", function (b) {
                    if (b) {
                        $.post("GwBlackMobile.ashx", { action: "deletePool", poolID: id }, function (r) {
                            mytek.alert(r.Message, r.OK, function () {
                                loadPageList();
                            });
                        });
                    }
                });
            });
 
            $("#gwBlackPoolForm").ajaxForm({
                success: function (r) {
                    if (r.OK) {
                        mytek.alert(r.Message, r.OK, function () {
                            $("#gwBlackPoolDialog").modal("hide");
                            loadPageList();
                        });
                    } else {
                        mytek.alert(r.Message, r.False);
                    }
                }
            });
 
            $(document).on("click", ".action-import", function () {
                var type = $(this).data("id");
                window.location = "GwBlackMobile.aspx?type=" + type;
            });
 
            $('#qpoolName').keydown(function (e) {
                if (e.keyCode == 13) {
                    loadPageList();
                }
            });
 
            $(document).on("click", ".btn-mobile-segment", function () {
                var pid = $(this).data("id");
                $.get("GwBlackMobile.ashx?action=getMobileSegment", { pid: pid }, function (r) {
                    if (r.OK) {
                        $("#whiteDialog input[name='pid']").val(pid);
                        $("#whiteDialog textarea").val(r.Message.MobileSegMent);
                        $("#whiteDialog").modal("show");
                    }
                    else {
                        mytek.alert(r.Message, r.OK);
                    }
                }, "json");
            });
 
            $(document).on("click", ".action-modal-blackmobile-create", function () {
                $("#gwpoolblackmobile").modal("show");
            });
 
            //清除黑名单所有数据
            $(document).on("click", ".action-truntate", function() {
 
                mytek.confirm("确定清除所有黑名单吗?", "清除后将无法恢复,请谨慎操作!", function(b) {
                    if (b) {
                        $.post("GwBlackMobile.ashx", { "action": "truntateBlackMobile" }, function(result) {
                            mytek.alert(result.Message, result.OK, function() {
                                loadPageList();
                            });
                        },
                    "json");
                    }
                });
            });
 
            //添加黑名单
            $(document).on("click", ".action-Poolblackmobile", function () {
                var mobile = $("#qmobile").val();
                var selectAblackpool = $("#selectAblackpool").val();
            });
            //添加黑名单
            $(document).on("click", ".action-modal-createmobile", function () {
                var mobile = $("#qmobile").val();
                var blackpool = $("#qblackpool").val();
                $.ajax({
                    url: "GwBlackMobile.ashx",
                    type: "POST",
                    data: { action: "addGwBlackMobile", mobile: mobile, blackpool: blackpool },
                    success: function (r) {
                        mytek.alert(r.Message, r.OK, function () {
                            loadPageList();
                        });
                    }
                });
            });
            //删除黑名单
            $(document).on("click", ".action-mobile-delete", function () {
                var poolID = $(this).data("id");
                var mobile = $(this).data("moblie");
                mytek.confirm("是否需要删除该黑名单号码?", "黑名单号码删除后将无法恢复,请谨慎操作!", function (b) {
                    if (b) {
                        $.post("GwBlackMobile.ashx", { action: "deleteMobile", poolID: poolID, mobile: mobile }, function (r) {
                            mytek.alert(r.Message, r.OK, function () {
                                loadblackPoolMobileList();
                            });
                        });
                    }
                });
            });
            //导入黑名单
            $(document).on("click", ".action-txtimportBlack", function () {
                var id = $(this).data("id");
                var name = "导入" + $(this).data("name");
                $("#ablackpool").val(id);
                $("#txtimportfile_form .modal-title").text(name);
                $("#stopwatchTime").text('');
                $("#txtimportfile_blackMobile").modal("show");
            });
            $(document).on("click", ".btn-poolmobile", function () {
                $("#FormPoolblackMobileList").modal("show");
            });
 
            $("#txtimportfile_form").ajaxForm({
                beforeSend: function () {
                    $('#txtimportfile_form .action-save').attr('disabled', "true");
                    $('#txtimportfile_form .action-save').text('正在导入...');
                },
                success: function (result) {
                    if (result.OK) {
                        mytek.alert(result.Message.Message);
                        $("#stopwatchTime").text(result.Message.Msg);
                        $('#txtimportfile_form .action-save').removeAttr("disabled");
                        $("#certPath").val('');
                        $('#txtimportfile_form .action-save').text('导入');
                    } else {
                        mytek.alert(result.Message, result.False);
                        $('#txtimportfile_form .action-save').removeAttr("disabled");
                        $('#txtimportfile_form .action-save').text('导入');
                    }
                }
            });
 
            $("#poolblackmobile").ajaxForm({
                success: function (r) {
                    if (r.OK) {
                        mytek.alert(r.Message, r.OK, function () {
                            $("#gwpoolblackmobile").modal("hide");
                            loadPageList();
                        })
                    } else { mytek.alert(r.Message); }
                }
            })
 
            $("#whiteForm").ajaxForm({
                success: function (r) {
                    mytek.alert(r.Message, r.OK, function () {
                        $("#whiteDialog").modal("hide");
                    });
                }
            });
 
        });
    </script>
    <style>
        .mask { position: absolute; top: 0px; filter: alpha(opacity=60); background-color: #777; z-index: 1002; left: 0px; opacity: 0.5; -moz-opacity: 0.5; text-align: center; display: none; }
        .mask span { height: 100%; display: inline-block; vertical-align: middle; }
        .mask span img { vertical-align: middle; }
    </style>
 </asp:Content> 
<asp:Content runat="server" ID="Content2" ContentPlaceHolderID="title">黑名单</asp:Content> 
<asp:Content ID="Content3" ContentPlaceHolderID="content" runat="Server">
       
    <div class="modal inmodal fade" id="gwpoolblackmobile" tabindex="-1" role="dialog"
        aria-hidden="true">
        <form name="poolblackmobile" method="post" action="GwBlackMobile.ashx?action=addGwBlackMobile"
        id="poolblackmobile" class="form-horizontal">
        <div class="modal-dialog form-horizontal">
            <div class="modal-content ">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">
                        <span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                    <h4 class="modal-title">
                        添加黑名单
                    </h4>
                </div>
                <div class="modal-body">
                    <div class="form-group " style="padding-left: 20px">
                        <label class="control-label col-sm-3">
                            黑名单池</label>
                        <div class="input-group">
                            <select name="blackpool" id="blackpool" class="form-control">
                                <%__w.Write(this.GenerateOPIDOptions());%>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3">
                            号码</label>
                        <div class="col-sm-8">
                            <input type="text" name="mobile" id="mobile" value="" class="form-control" maxlength="20" />
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button class="btn btn-default " data-dismiss="modal" aria-hidden="true">
                        取消</button>&nbsp;&nbsp;
                    <button class="btn btn-primary action-Poolblackmobile">
                        保存</button>
                </div>
            </div>
        </div>
        </form>
    </div>
    <div class="modal inmodal fade" id="txtimportfile_blackMobile" tabindex="-1" role="dialog"
        aria-hidden="true">
        <form name="txtimportfile_form" method="post" action="GwBlackMobile.ashx?action=txtimportBlackMobile"
        id="txtimportfile_form" class="form-horizontal">
        <div class="modal-dialog form-horizontal">
            <div class="modal-content ">
                <input type="hidden" id="ablackpool" value="" name="ablackpool" />
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">
                        <span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                    <h4 class="modal-title">
                        黑名单导入
                    </h4>
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <label class="control-label col-sm-3">
                            请选择要导入的文件</label>
                        <input type="file" id="certPath" name="certPath" />
                        
                        &nbsp;&nbsp;<span id="stopwatchTime" style="word-wrap: break-word; word-break: break-all;"></span>
                    </div>
                    <div>
                        <h3>
                            说明</h3>
                        <ul>
                            <li class="text-info">黑名单号码导入文件格式为txt压缩成zip文件(文件大小不能超过100M),每个号码必须11位;</li>
                            <li>黑名单中一行一个号码或者号码之间使用","(逗号)、";"(分号)、"|"(竖线)、" "(空格)分隔;</li>
                            <li>黑名单池针对通道有效,不同的通道可以配置不同的黑名单池;</li>
                            <li>不同的黑名单池中可以导入不同的号码,同一个黑名单池中不能有重复号码;</li>
                            <li>当某通道没有配置黑名单池时,此通道只能使用全局黑名单;</li>
                            <li>全局黑名单针对系统所有账号有效(账户必须启用全局黑名单);</li>
                            <li>黑名单中可以支持上千万个号码,黑名单中的手机号将无法下发短信;</li>
                  
                        </ul>
                    </div>
                </div>
                <div class="modal-footer">
                    <button class="btn btn-default " data-dismiss="modal" aria-hidden="true">
                        取消</button>&nbsp;&nbsp;
                    <button class="btn btn-primary action-save">
                        导入</button>
                </div>
            </div>
        </div>
        </form>
        <div id="mask" class="mask">
            <span></span>
            <img src="img/spinning-circles.svg" alt="载入中..." /></div>
    </div>
    <div class="modal inmodal fade" id="whiteDialog" tabindex="-1" role="dialog" aria-hidden="true">
        <form name="whiteForm" method="post" action="GwBlackMobile.ashx?action=saveMobileSegMent"
        id="whiteForm" class="form-horizontal">
        <div class="modal-dialog modal-sm">
            <div class="modal-content ">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">
                        <span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                    <h4 class="modal-title">
                        黑名单号段
                    </h4>
                    <input type="hidden" value="" name="pid" />
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <span class="help-block m-b-none">每行一个号码,黑名单号段会把当前的所有相关号段号码进行拦截; </span><span class="help-block m-b-none"
                            style="color: Red;">黑名单号段支持5-8位 </span>
                    </div>
                    <div class="form-group">
                        <textarea class="form-control" name="mobileData" rows="6"></textarea>
                    </div>
                </div>
                <div class="modal-footer">
                    <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">
                        取消</button>&nbsp;&nbsp;
                    <button class="btn btn-primary action-save">
                        保存</button>
                </div>
            </div>
        </div>
        </form>
    </div>
    <div class="modal inmodal fade" id="gwBlackPoolDialog" tabindex="-1" role="dialog"
        aria-hidden="true">
        <form name="gwBlackPoolForm" method="post" action="GwBlackMobile.ashx" id="gwBlackPoolForm"
        class="form-horizontal">
        <div class="modal-dialog form-horizontal">
            <div class="modal-content ">
                <input type="hidden" id="poolID" value="" name="poolID" />
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">
                        <span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                    <h4 class="modal-title">
                        创建/修改黑名单池
                    </h4>
                    <input value="add" name="action" type="hidden" />
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <label class="control-label col-sm-3">
                            黑名单池名称</label>
                        <div class="col-sm-8">
                            <input type="text" name="poolName" id="poolName" value="" class="form-control" maxlength="20" />
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button class="btn btn-default " data-dismiss="modal" aria-hidden="true">
                        取消</button>&nbsp;&nbsp;
                    <button class="btn btn-primary action-save">
                        保存</button>
                </div>
            </div>
        </div>
        </form>
    </div>
    <div class="modal inmodal fade" id="FormPoolblackMobileList" tabindex="-1" role="dialog"
        aria-hidden="true">
        <div class="modal-dialog modal-lg">
            <div class="modal-content ">
                <div class="modal-header">
                    <form name="queryFormlist" method="post" id="queryFormlist" class="form-inline" style="float: left;">
                    <input type="text" style="display: none" />
                    <div class="form-group ">
                        <div class="input-group m-b">
                            <span class="input-group-addon">黑名单池</span>
                            <select name="qblackpool" id="qblackpool" class="form-control">
                               <%__w.Write(this.GenerateOPIDOptions());%>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group m-b">
                            <span class="input-group-addon">手机号码</span>
                            <input id="qmobile" class="form-control" name="qmobile" value="" maxlength="11" type="text" />
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group m-b">
                            <input type="button" value="查询" class="btn btn-primary action-query-poolmobile" />
                            <input class="btn btn-warning action-modal-createmobile" value="添加" type="button" />
                        </div>
                    </div>
                    </form>
                    <table class="table table-striped table-bordered table-hover" id="table-poolmobile">
                        <thead>
                            <tr class="header">
                                <th>
                                    手机号码
                                </th>
                                <th>
                                    黑名单池
                                </th>
                                <th>
                                    时间
                                </th>
                                <th class="col-md-3">
                                    操作
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                        </tbody>
                    </table>
                    <div id="pager">
                    </div>
                    <input type="hidden" id="page-spid" />
                </div>
                <div class="modal-footer">
                    <button class="btn-default btn" data-dismiss="modal" aria-hidden="true">
                        关闭</button>&nbsp;&nbsp;
                </div>
            </div>
        </div>
    </div>
    <form name="queryForm" method="post" id="queryForm" class="form-inline">
    <input type="text" style="display: none" />
    <div class="form-group">
        <div class="input-group m-b">
            <span class="input-group-addon">黑名单池名称</span>
            <input id="qpoolName" class="form-control" name="qpoolName" value="" type="text" />
        </div>
    </div>
    <div class="form-group">
        <div class="input-group m-b">
            <input type="button" value="查询" class="btn btn-primary action-query" />&nbsp; &nbsp; 
            <input class="btn btn-warning action-modal-create" value="创建黑名单池" type="button" />&nbsp; &nbsp; 
            
            <input type="button" class="btn btn-danger action-truntate" value="清除全部黑名单号码" />
        </div>
    </div>
    </form>
    <div class="table-responsive">
        <table class="table table-striped table-bordered table-hover" id="gwclientTable">
            <thead>
                <tr class="header">
                    <th>
                        黑名单池名称
                    </th>
                    <th>
                        黑名单池号码数量(个)
                    </th>
                    <th class="col-md-3">
                        操作
                    </th>
                </tr>
            </thead>
            <tbody>
            </tbody>
        </table>
    </div>
    <div id="pagination">
    </div>
    <div class="form-group">
      
        
    </div>
    <div id="mask" class="mask">
        <span></span>
        <img src="img/spinning-circles.svg" alt="载入中..." /></div>
</asp:Content>