zhaojs
2023-08-02 acba9f7ea0506e3df39055f3ae25283b943792fe
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
define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefined, Backend, Form, Table) {
 
    var Controller = {
        index: function () {
            Controller.api.bindevent();
            var agent_mode = $('#c-agent_mode').val();
            if(agent_mode == 1)$('.item2').css('display', 'none');
            if(agent_mode == 2)$('.item2').css('display', 'block');
            $(document).on("change", "#c-agent_mode", function () {
                var value = $(this).val();
                if(value == 1){
                    $('.item2').css('display', 'none');
                }else{
                    $('.item2').css('display', 'block');
                }
            });
           
            $(".nav-item").each(function () {
                $(this).click(function () {
                    $(this).addClass('active').siblings().removeClass("active");
                    $(".tab").css('display', 'none');
                    var className = $(this).attr('data-class');
                    $('.'+className).css('display','block');
                });
            });
        },
        api: {
            bindevent: function () {
                Form.api.bindevent($("form[role=form]"));
            }
        }
 
    };
    return Controller;
});