/** * 接通呼损统计 * */ var token = $.cookie("token"), tabtu, xzhou, jtCount, //接通次数 hsCount, //呼损次数 jtPercent, //接通率 hsPercent; //呼损率 $(document).ready(function() { $('.tool_bars').authorizeButton(); laydate.render({ elem: '#chooseTime', theme: '#249fea', range: '~', }); //图形 tabtu = echarts.init(document.getElementById('tabtu')); option = { tooltip: { trigger: 'axis', }, legend: { data: ['接通次数', '呼损次数', '接通率', '呼损率'], bottom: 0 }, xAxis: [{ type: 'category', data: xzhou, axisPointer: { type: '' }, axisLabel: { rotate: 30, interval: 0 } }], yAxis: [{ type: 'value', name: '通话次数(通)', nameLocation: 'middle', nameGap: 40, // min: 0, // max:300, interval: 50, axisLabel: { formatter: '{value}' } }, { type: 'value', name: '百分比(%)', nameLocation: 'middle', nameGap: 35, min: 0, max: 100, interval: 10, axisLabel: { formatter: '{value}%' } } ], series: [{ type: 'bar', name: '接通次数', data: jtCount }, { type: 'bar', name: '呼损次数', data: hsCount }, { type: 'line', name: '接通率', data: jtPercent, yAxisIndex: 1, }, { type: 'line', name: '呼损率', data: hsPercent, yAxisIndex: 1, } ], color: ['#1ab394', '#fbbe5b', '#88ebc4', '#fa957f'] }; getDatalist(); tabtu.setOption(option); getColumnList(); //tab切换 $('.th-tab li').click(function() { $(this).addClass('active') .siblings().removeClass('active'); var index = $(this).index(); $('.th-content >div').eq(index).show() .siblings().hide(); }) //搜索事件 $("#sc_btns").click(function() { $('.thTable tbody').html(''); getDatalist(); tabtu.setOption(option); }); }) //表头数据 function getColumnList() { $.ajax({ type: "get", url: huayi.config.callcenter_url + "SwitchedlossCall/GetColumnList", async: true, dataType: 'json', data: { token: token }, success: function(res) { var con = res.data; for(var i = 0; i < con.length; i++) { $('