layui.use(['table', 'jquery'], function () {
    var table = layui.table;
    //监听表格复选框选择
    table.on('checkbox(demo)', function (obj) {
        console.log(obj)
    });

    var $ = layui.$, active = {
        //查询按钮
        reload: function () {
            var callnumber = $('#callnumber');
            var usercode = $('#usercode');
            //执行重载
            table.reload('recordtable', {
                page: {
                    curr: 1 //重新从第 1 页开始
                }
              , where: {
                     NowDateTime: new Date(),
                      callnumber: callnumber.val(),
                  usercode: usercode.val(),
                  userid: $('#userid').val(),
                      callType: $('#callTypes').val(),
                      callStatus: $('#callRercordStatus').val()
                  
              }
            });
        }

    };

    $('.searchfilter .layui-btn').on('click', function () {
        var type = $(this).data('type');
        active[type] ? active[type].call(this) : '';
    });
    formatcalldir = function (d) {
        var rescontent = "";
        if (d == 1) {
            rescontent = "<i class=\"iconfont icon-huchu\"></i>";
        }
        else {
            rescontent = "<i class=\"iconfont icon-huru\"></i>";
        }
        return rescontent;
    }

    playMp3= function (d) {
      //  return  " <audio controls=\"controls\"><source src=\"/content/test.mp3\" type=\"audio/mpeg\"> </audio>";
        return " <audio src=\"/content/test.mp3\" controls></audio>";
        
    }

     
                            
                           
                       

});