zhaoxiaoqiang1
2026-01-04 f1d30d03186c79ca2cbcfe60d6d2ce7d73fba97b
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
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
/**
 * getDictionaryList-请求对应字典值公共方法:
 * @param {String} codeNo 字典编号
 * @param {String} windowName window.变量名
 * @param {Boolean} async 是否异步
 *
 * 用法:common_getDictionaryList(字典编号, window.变量名, 是否异步);
 */
// function common_getDictionaryList(codeNo, windowName, async) {
//     $.ajax({
//       type: 'POST',
//       async: async ? async : false,
//       url: base_url+"/rlc-cts/server/getDictionaryList",
//       data: JSON.stringify({
//           codeNo: codeNo
//       }),
//       dataType: 'json',
//       contentType: "application/json",
//       success: function (res) {
//           if(res.code == '00'){
//               // console.log('common_getDictionaryList请求字典值为:'+codeNo+'时成功,并赋值给window.'+windowName);
//               window[windowName] = res;
//           }else{
//               layer.msg(res.msg);
//           }
//       }
//     });
//     // console.log('获取', windowName, ': ', window[windowName]);
// }
 
// 查询用户信息
$.ajax({
  url: base_url + "/sso-portal/user/getUserInfo",
  dataType: 'json',
  contentType: "application/json",
  type: 'POST',
  success: function (res) {
      if (res.resultCode == 1) {
          $("#user_name").text(res.data.userName);
          usre_info = res.data
          localStorage.setItem("userInfo",JSON.stringify(usre_info))
      } else {
          layer.msg(res.errorDesc);
      }
  }
});
 
// 查询菜单
$.ajax({
    url: base_url + "/sso-portal/menu/getUserMenu",
    dataType: 'json',
    contentType: "application/json",
    type: 'POST',
    success: function (res) {
        if (res.resultCode == 1) {
            $('#left-navwrap').html(template('left-navtpl', res.data));
            $('#fold_side_bar_wrap').html(template('fold_side_bar_tpl', res.data));
            //JavaScript代码区域
            layui.use('element', function () {
                var element = layui.element;
                element.init();
                /* 新增一个Tab项 */
                element.tabAdd('content_tab_filter', {
                    title: '首页'
                    , content: ""
                    , id: '0'
                });
                element.tabChange('content_tab_filter', '0');
                $("#tab_content_wrap").find(".layui-tab-item").append($("<iframe class='other_system_iframe'></iframe>"));
                // if(usre_info.orgCode == '1114' || usre_info.orgCode == '1115' || usre_info.orgCode == '1117' || usre_info.orgCode == '002') {
                //   // 避免访问首页的信息
                //   $("#tab_content_wrap").find(".layui-tab-item").find("iframe").attr("src", base_url+'/iPortal/notfund.html');
                // } else {
                  $("#tab_content_wrap").find(".layui-tab-item").find("iframe").attr("src", base_url+'/cts-web/#/home');
                // }
            });
        } else {
            layer.msg(res.errorDesc);
        }
    }
});
 
 
 
// 注销
$("#log_out_btn").click(function () {
    $.ajax({
        url: base_url + "/sso-portal/logout",
        dataType: 'json',
        contentType: "application/json",
        type: 'POST',
        success: function (res) {
            if (res.resultCode == 1) {
                location.href = "login.html";
            } else {
                layer.msg(res.errorDesc);
            }
        }
    });
});
// 修改密码
$("#change_pwd_btn").click(function () {
  $.get('views/jurisdiction/user_change_pwd_modal.html', function(str){
    window.user_reset_pwd_modal_index = layer.open({
        type: 1
        ,title :'修改密码'
        ,content: str //注意,如果str是object,那么需要字符拼接。
        ,maxmin: true
        ,area: ['360px','300px']
    });
  });
});
 
$("#side_bar_wrap_toggle_btn").click(function () {
    if ($(this).attr("src") == "image/toggle_left.png") {
        $(this).attr("src", "image/toggle_right.png");
        $(this).attr("title", "展开菜单");
        $("#side_bar_wrap").css("width", 68);
        $("#company_logo_area").css("width", 68);
        $("#view_container").css("left", 68);
        $("#lateral_nav_wrap").css("left", 68);
        $("#side_bar_inner_wrap").hide();
        $("#company_name").hide();
        $("#fold_side_bar_wrap").show();
    } else if ($(this).attr("src") == "image/toggle_right.png") {
        layer.closeAll('tips'); //关闭所有的tips层
        $(this).attr("src", "image/toggle_left.png");
        $(this).attr("title", "收起菜单");
        $("#side_bar_wrap").css("width", 200);
        $("#company_logo_area").css("width", 200);
        $("#view_container").css("left", 200);
        $("#lateral_nav_wrap").css("left", 200);
        $("#side_bar_inner_wrap").show();
        $("#company_name").show();
        $("#fold_side_bar_wrap").hide();
    }
});
 
$("body").on('click', '.operation_left_tree_img', function () {
    if ($(this).attr("src") == "image/hide_left_tree.png") {
        $(this).attr("src", "image/show_left_tree.png");
        $(this).parent(".folding_partition_line").css("border-right", "none").siblings(".left_tree_wrap").hide();
        $(this).parent(".folding_partition_line").siblings(".form_and_table_wrap").addClass("tree_hide_table_width");
    } else {
        $(this).attr("src", "image/hide_left_tree.png");
        $(this).parent(".folding_partition_line").css("border-right", "1px solid #e6e6e6").siblings(".left_tree_wrap").show();
        $(this).parent(".folding_partition_line").siblings(".form_and_table_wrap").removeClass("tree_hide_table_width");
    }
});
 
$("body").on('click', '.fold_side_bar_unit', function () {
    $("#side_bar_wrap_toggle_btn").click();
});
 
// 搜索条件展开折叠逻辑
$("body").on('click', '.search_field_spread_toggle_btn', function () {
    if ($(this).find(".spread__toggle_inner_text").text() == "展开") {
        $(this).find(".spread__toggle_inner_text").text("收起");
        $(this).find(".search_field_spread_toggle_icon1").hide();
        $(this).find(".search_field_spread_toggle_icon2").show();
        $(this).parent(".layui-inline").siblings(".form_toggle_search_field_unit").removeClass("hide");
    } else {
        $(this).find(".spread__toggle_inner_text").text("展开");
        $(this).find(".search_field_spread_toggle_icon1").show();
        $(this).find(".search_field_spread_toggle_icon2").hide();
        $(this).parent(".layui-inline").siblings(".form_toggle_search_field_unit").addClass("hide");
    }
});
 
// 搜索条件展开折叠逻辑
$("body").on('click', '.search_field_spread_toggle_btn2', function () {
    if ($(this).find(".spread__toggle_inner_text").text() == "展开") {
        $(this).find(".spread__toggle_inner_text").text("收起");
        $(this).find(".search_field_spread_toggle_icon1").hide();
        $(this).find(".search_field_spread_toggle_icon2").show();
    } else {
        $(this).find(".spread__toggle_inner_text").text("展开");
        $(this).find(".search_field_spread_toggle_icon1").show();
        $(this).find(".search_field_spread_toggle_icon2").hide();
    }
    $(this).parent(".top_progress_bar_area").siblings(".right_fixed_progress_bar_area").toggle();
});
 
$("body").on('mouseenter', '.link_btn:has(.expand_three_level_icon)', function () {
    if($(window).height() - $(this).offset().top >  $(this).children(".three_level_nav_wrap").height()){
        $(this).children(".three_level_nav_wrap").css("top", $(this).offset().top).show();
 
    }else if($(this).offset().top >  $(this).children(".three_level_nav_wrap").height()){
        $(this).children(".three_level_nav_wrap").css("top", $(this).offset().top - $(this).children(".three_level_nav_wrap").height() + 44).show();
 
    }else{
        $(this).children(".three_level_nav_wrap").css({
            "top": $(this).offset().top,
            "height": "176px",
            "overflow": "hidden scroll",
        }).show();
    }
});
 
$("body").on('mouseleave', '.link_btn:has(.expand_three_level_icon),#three_level_nav_wrap', function () {
    $(".three_level_nav_wrap").css({
        "height": "auto",
        "overflow": "hidden"
    }).hide();
});
 
$("#three_level_nav_wrap").on('mouseenter', function () {
    $(this).show();
});
 
$("body").on('mouseenter', '.fold_side_bar_unit img', function () {
    var that = this;
    layer.tips($(that).attr("data-title"), that, {
        tips: 2
    });
});
 
layui.use('element', function () {
    var element = layui.element;
    $("body").on('click', '.link_btn:not(:has(.expand_three_level_icon)),.three_level_nav', function () {
        var _length = $("#content_tab_header").find("li").length;
        var _that = this;
        window.g_menu_id = $(_that).attr("data-menuid");
        // 设置全局ajax
        $.ajaxSetup({
            xhrFields: {
                withCredentials: true
            },
            beforeSend: function(jqXHR, settings) {
                //在请求前给修改url(增加一个时间戳参数)
                settings.url += settings.url.match(/\?/) ? "&" : "?";
                settings.url += "menuId=" + window.g_menu_id;
            },
            cache: false, //关闭AJAX相应的缓存
            dataFilter : function(res, type){
                if(type == "json"){
                    var res2 = JSON.parse(res);
                    if(res2.errorCode == "003"){
                        location.href = res2.data.loginUrl;
                    }
                }
                return res;
            }
        });
 
        if (_length == 0) {
            $.when(
                // 获取页面元素权限
                getFunctionByMenuCode(_that)
            ).done(function () {
                /* 新增一个Tab项 */
                element.tabAdd('content_tab_filter', {
                    title: $(_that).attr("data-name")
                    , content: ""
                    , id: $(_that).attr("data-menuid")
                });
                if ($(_that).attr("data-pagetype") == 0) {
                    $("#tab_content_wrap").find(".layui-tab-item").load($(_that).attr("data-url") + ".html");
                } else if ($(_that).attr("data-pagetype") == 1) {
                    var url = $(_that).attr('data-url').replace(/&+$/, '');
                    var menuId = $(_that).attr("data-menuid")
                    url = url.indexOf('?') > -1 ? url + '&menuId=' + menuId : url + '?menuId=' + menuId;
                    $("#tab_content_wrap").find(".layui-tab-item").append($("<iframe class='other_system_iframe'></iframe>"));
                    $("#tab_content_wrap").find(".layui-tab-item").find("iframe").attr("src", url);
                }
                $("#content_tab_header").find("li").trigger("click");
            });
        } else if (_length >= 1 && _length < 15) {
            var _is_in_tab_list = false;
            $("#content_tab_header").find("li").each(function () {
                if ($(this).attr("lay-id") == $(_that).attr("data-menuid")) {
                    $(this).trigger("click");
                    _is_in_tab_list = true;
                } else {
 
                }
            });
            if (_is_in_tab_list) {
 
            } else {
                $.when(
                    // 获取页面元素权限
                    getFunctionByMenuCode(_that)
                ).done(function () {
                    /* 新增一个Tab项 */
                    element.tabAdd('content_tab_filter', {
                        title: $(_that).attr("data-name")
                        , content: ""
                        , id: $(_that).attr("data-menuid")
                    });
                    if ($(_that).attr("data-pagetype") == 0) {
                        $("#tab_content_wrap").find(".layui-tab-item:last").load($(_that).attr("data-url") + ".html");
                    } else if ($(_that).attr("data-pagetype") == 1) {
                        $("#tab_content_wrap").find(".layui-tab-item:last").append($("<iframe class='other_system_iframe'></iframe>"));
                        $("#tab_content_wrap").find(".layui-tab-item:last").find("iframe").attr("src", $(_that).attr("data-url"));
                    }
                    /* 切换到指定Tab项 */
                    element.tabChange('content_tab_filter', $(_that).attr("data-menuid"));
                });
            }
        } else if (_length >= 15) {
            var _is_in_tab_list = false;
            $("#content_tab_header").find("li").each(function () {
                if ($(this).attr("lay-id") == $(_that).attr("data-menuid")) {
                    $(this).trigger("click");
                    _is_in_tab_list = true;
                } else {
 
                }
            });
            if (_is_in_tab_list) {
 
            } else {
                layer.msg("最多只能打开15个页签,如要打开更多,请先关闭部分不使用的页签");
            }
        }
    });
 
    function getFunctionByMenuCode(_that){
        // 获取页面元素权限
        $.ajax({
            url: base_url + "/sso-portal/menu/getFunctionByMenuCode",
            dataType: 'json',
            contentType: "application/json",
            type: 'POST',
            data: JSON.stringify({
                params: {
                    "resourceCode": $(_that).attr("data-id")
                }
            }),
            success: function (res) {
                if (res.resultCode == 1) {
                    if (!res.data) {
 
                    } else {
                        delete window['_server_queryApplyTabTree']
                        $.each(res.data, function (i, n) {
                            if (n == true) {
                                //调用接口成功后删除部分重复的字段
                                window[i] = true;
                            }
                        });
                    }
                } else {
                    layer.msg(res.errorDesc);
                }
            }
        })
    }
 
    //监听Tab切换,以改变地址hash值
    element.on('tab(content_tab_filter)', function(){
        window.g_menu_id = this.getAttribute('lay-id');
        $('#left-navwrap li').each(function () {
            $(this).find('dd').each(function () {
                $(this).removeClass('layui-this');
                if($(this).children('a').attr('data-menuid') == window.g_menu_id){
                    $(this).parents('.layui-nav-item').addClass('layui-nav-itemed').siblings().removeClass('layui-nav-itemed')
                    $(this).addClass('layui-this')
                    getFunctionByMenuCode($(this).children('a'))
                }else{
                    $(this).find('.three_level_nav').each(function() {
                        if($(this).attr('data-menuid') == window.g_menu_id){
                            $(this).parents('.layui-nav-item').addClass('layui-nav-itemed').siblings().removeClass('layui-nav-itemed')
                            $(this).parents('dd').addClass('layui-this')
                            getFunctionByMenuCode($(this))
                        }
                    })
                }
            })
        })
        if($('.other_system_iframe')[0]&&$(this).text().indexOf('首页')!=-1){
            // $('.other_system_iframe')[0].contentWindow.refreshChart()
        }
        // 设置全局ajax
        $.ajaxSetup({
            xhrFields: {
                withCredentials: true
            },
            beforeSend: function(jqXHR, settings) {
                //在请求前给修改url(增加一个时间戳参数)
                settings.url += settings.url.match(/\?/) ? "&" : "?";
                settings.url += "menuId=" + window.g_menu_id;
            },
            cache: false, //关闭AJAX相应的缓存
            dataFilter : function(res, type){
                if(type == "json"){
                    var res2 = JSON.parse(res);
                    if(res2.errorCode == "003"){
                        location.href = res2.data.loginUrl;
                    }
                }
                return res;
            }
        });
    });
 
    if($(window).width() <= '1280'){
        $("#side_bar_wrap_toggle_btn").attr("src", "image/toggle_right.png");
        $('#side_bar_wrap_toggle_btn').attr("title", "展开菜单");
        $("#side_bar_wrap").css("width", 68);
        $("#company_logo_area").css("width", 68);
        $("#view_container").css("left", 68);
        $("#lateral_nav_wrap").css("left", 68);
        $("#side_bar_inner_wrap").hide();
        $("#company_name").hide();
        $("#fold_side_bar_wrap").show();
    }else{
        $("#side_bar_wrap_toggle_btn").attr("src", "image/toggle_left.png");
        $('#side_bar_wrap_toggle_btn').attr("title", "收起菜单");
        layer.closeAll('tips'); //关闭所有的tips层
        $("#side_bar_wrap").css("width", 200);
        $("#company_logo_area").css("width", 200);
        $("#view_container").css("left", 200);
        $("#lateral_nav_wrap").css("left", 200);
        $("#side_bar_inner_wrap").show();
        $("#company_name").show();
        $("#fold_side_bar_wrap").hide();
    }
});
 
//提供给vue页面删除已打开窗口的方法
function tabDelete(name) {
    /* 删除指定Tab项 */
    layui.use('element', function () {
        var element = layui.element;
        $('#content_tab_header li').each(function () {
            if($(this).text().indexOf(name) != -1){
                element.tabDelete('content_tab_filter', $(this).attr('lay-id'));
            }
        })
    });
};
 
//提供给vue页面打开新窗口的方法
function getMenuByParent(firstMenu,secondMenu,thirdMenu){
    var isHaveMenu = false
    $('#left-navwrap li').each(function () {
        if($(this).children('a').text() == firstMenu){
            $(this).find('dd').each(function () {
                if($(this).children('a').attr('data-name') == secondMenu){
                    isHaveMenu = true
                    if(thirdMenu){
                        $(this).find('.three_level_nav').each(function() {
                            if($(this).attr('data-name') == thirdMenu){
                                $(this).trigger("click");
                            }
                        })
                    }else{
                        $(this).children('a').trigger("click");
                    }
                }
            })
        }else{
        }
    })
    if(!isHaveMenu){
        layer.msg('当前用户无权限查看,请联系管理员');
    }
}
 
//根据菜单id来打开新窗口
function getMenuIdByParent(secMenuId,menuId){
    $('#left-navwrap li').each(function () {
        $(this).find('dd').each(function () {
            if(secMenuId && $(this).children('a').attr('data-menuid') == secMenuId){
                if(secMenuId == menuId){
                    $(this).children('a').trigger("click");
                }else{
                    $(this).find('.three_level_nav').each(function() {
                        if($(this).attr('data-menuid') == menuId){
                            $(this).trigger("click");
                        }
                    })
                }
            }
            if(!secMenuId && $(this).children('a').attr('data-menuid') == menuId){
                $(this).children('a').trigger("click");
            }
        })
    })
}
/**
 * 下拉框子元素替换
 *
 * @param tpl 字符串模板
 * 1.清空下拉框素有子元素
 * 2.向头部追加 默认模板
 * 3.追加新增模板
 */
$.fn.extend({
    _take_place: function (tpl) {
        this.empty()
        this.prepend('<option value="">请选择</option>')
        this.append(tpl)
    }
})
 
/**
 * 拓展jq ajax方法
 * @param config jq的ajax配置
 * @returns _Promise 对象
 */
$.extend({
    _ajax: function (config) {
        return new _Promise(function (resolve, reject) {
            config.success = function (res) {
                resolve(res)
            }
            config.fail = function (err) {
                reject(err)
            }
            $.ajax(config)
        })
    }
})
 
/**
 *layui表格无数据且表头列宽过长时,导致表头显示不全的问题
 *
 * @param {*} table layui-table类
 * @param {*} config render方法需要的表格配置
 * @returns table实例
 */
function _table_render(table, config) {
    // 渲染图表
    var instance = table.render(config)
    var id = instance.config.id
    var container = $("div[lay-id='" + id + "']")
    var isNoData = container.find(".layui-none").length
    // 无数据且容器宽度小于表头宽度时,动态设置无数据容器宽度为表头宽度,使其能够出现滚动条
    if (isNoData) {
        var tableHeadWidth = $(container.find(".layui-table")[0]).outerWidth()
        var containerWidth = $(container.find(".layui-table-main")[0]).outerWidth()
        containerWidth < tableHeadWidth && $(container.find(".layui-none")[0]).outerWidth(tableHeadWidth)
    }
    return instance;
}
 
// 表格批量操作展开与搜索
$("body").on('click', '.table_batch_expand_btn', function () {
    if ($(this).find(".table_batch_expand_btn_text").text() == "展开") {
        $(this).find(".table_batch_expand_btn_text").text("收起");
        $(this).find(".table_batch_expand_btn_icon1").hide();
        $(this).find(".table_batch_expand_btn_icon2").show();
        $(this).parent(".table_batch_inline").parent(".table_batch_btn_main").siblings(".table_batch_btn_other").find(".table_batch_inline").removeClass("hide");
    } else {
        $(this).find(".table_batch_expand_btn_text").text("展开");
        $(this).find(".table_batch_expand_btn_icon1").show();
        $(this).find(".table_batch_expand_btn_icon2").hide();
        $(this).parent(".table_batch_inline").parent(".table_batch_btn_main").siblings(".table_batch_btn_other").find(".table_batch_inline").addClass("hide");
    }
});
 
/**
 *检测是否为数组或对象
 *
 * @param {*} obj 待检值
 * @returns 数据类型
 */
function _check_type(obj, isValue) {
    var _type = Object.prototype.toString.call(obj)
    if (!isValue) {
        switch (_type) {
            case "[object Object]":
            case "[object Array]":
                return true;
            default:
                return false;
        }
    } else {
        return _type;
    }
}
 
/**
 * 深拷贝
 *
 * @param {*} source 源对象
 * @returns 新的对象
 */
function _assign(source) {
    var cloneObj = Array.isArray(source) ? [] : {}
    try {
        if (typeof source === 'object') {
            for (var key in source) {
                if (source.hasOwnProperty(key)) {
                    if (_check_type(source[key])) {
                        cloneObj[key] = _assign(source[key])
                    } else {
                        cloneObj[key] = source[key]
                    }
                }
            }
        } else {
            cloneObj = source
        }
    } catch (error) {
        console.log(error)
    }
    return cloneObj
}
 
/**
 *合并
 *
 * @param {*} target 目标对象
 * @param {*} source 源对象
 * @returns 返回合成对象
 */
function _merge(target, source) {
    if (_check_type(target, true) !== '[object Object]' || _check_type(source, true) !== '[object Object]') throw Error("请确保传入两个对象参数");
    try {
        for (var key in source) {
            if (source.hasOwnProperty(key)) {
                if (_check_type(source[key]) && _check_type(target[key]) && _check_type(source[key], true) == _check_type(target[key], true)) {
                    if (_check_type(source[key], true) === '[object Array]') {
                        target[key] = target[key].concat(source[key])
                    } else {
                        target[key] = _merge(target[key], source[key])
                    }
                } else {
                    target[key] = source[key]
                }
            }
        }
    } catch (error) {
        console.log(error)
    }
    return target;
}
 
 
/**
 *深拷贝且合并两个对象
 *
 * @param {*} target 目标对象
 * @param {*} source 源对象
 * @returns 合并后的新目标对象
 */
function _assign_merge(target, source) {
    return _merge(_assign(target), source);
}
 
// 列表-申请管理:
// window.apply_manage_for_list = function() {
//     var str = '{{# if(d.detailFlag == "1"){ }} <a class="tool_event_textbtn" lay-event="detail_processing">详情</a> {{#  } }}' +
//     '{{# if (d.updateFlag == "1"){ }} <a class="tool_event_textbtn" lay-event="table_edit">修改</a> {{# } }}' +
//     '{{# if (d.cancelFlag == "1"){ }} <a class="tool_event_textbtn" lay-event="table_cancel">取消申请</a> {{# } }}' +
//     '{{# if (d.resetFlag == "1"){ }} <a class="tool_event_textbtn" lay-event="table_reset">重新申请</a> {{# } }}' +
//     '{{# if (d.supplyFlag == "1"){ }} <a class="tool_event_textbtn" lay-event="table_replenish">补充资料</a> {{# } }}' +
//     '{{# if(d.immediateFlag == "1"){ }} <a class="tool_event_textbtn" lay-event="immediate_processing">立即处理</a> {{#  } }}' +
//     '{{# if(d.continueFlag == "1"){ }} <a class="tool_event_textbtn" lay-event="continue_processing">继续处理</a> {{#  } }}'
//     return str;
// }
 
/***
 * 关闭弹窗:
 * @param event 事件对象
 */
function closeCurrentModal(event) {
    layer.close(event.data.id);
}
 
/**
 * 只作临时测试
 * 用作提交成功或提交失败的弹窗页面,
 * 正式使用时调整下弹窗位置即可。
 */
// // 引入提交失败2的弹窗:
// layui.use(['laypage'], function () {
//     console.log('引入成功...');
    // $.get('views/integrated_trading_system/loan_apply/submit_error.html', function(str){
    //     var submit_err_modal_id = layer.open({
    //         type: 10
    //         ,title : false
    //         ,content: str //注意,如果str是object,那么需要字符拼接。
    //         // ,area: ["850px","85%"]
    //         ,area: ["850px","auto"]
    //         ,closeBtn: 0
    //         ,offset: ['auto']
    //     });
    //     $('.submit_err .close_current_modal, .submit_err .confirm_btn').off().on('click', {id: submit_err_modal_id}, closeCurrentModal);
    // });
    // 引入提交成功的弹窗:~
    // $.get('views/integrated_trading_system/loan_apply/submit_success.html', function(str){
    //     var submit_success_modal_id = layer.open({
    //           title: false
    //         , content: str
    //         , type: 1
    //         ,area: ["300px","255px"]
    //         , closeBtn: 0
    //         , offset: ['auto']
    //     });
    //     $('.submit_success .close_current_modal, .submit_success .confirm_btn').off().on('click', {id: submit_success_modal_id}, closeCurrentModal);
    // });
// });