| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576 |
- $(document).ready(function() {
- //part 1
- var main1 = echarts.init(document.getElementById('main1'));
- main1.setOption({
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'cross',
- label: {
- show: true,
- backgroundColor: '#333'
- }
- }
- },
- legend: {
- bottom:'bottom',
- // data: ["来电数量", "接通数量", "放弃数量", "黑名单拒接数量"],
- data: ["来话量", "通话量"],
- textStyle: {
- color: '#fff'
- }
- },
- xAxis: {
- name: '时',
- data: [],
- axisLine: {
- lineStyle: {
- color: '#ccc'
- }
- }
- },
- yAxis: {
- name: '数量',
- splitLine: {
- show: false
- },
- axisLine: {
- lineStyle: {
- color: '#ccc'
- }
- }
- },
- series: []
- });
-
- function partOne() {
- var index = layer.load(1, {
- shade: [0.5, '#030303'] //0.1透明度的白色背景
- });
- // $('.list_one').html('');
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "CallManage/GetCallCount",
- async: true,
- dataType: "json",
- data: {
- // date: $('#time1').val()
- },
- success: function(data) {
- if(data.state.toLowerCase() == "success") {
- layer.close(index);
- var con = data.data;
- main1.setOption({
- xAxis: {
- data: con.hour
- },
- series: [{
- name: "来话量",
- type: "line",
- smooth: true,
- showAllSymbol: true,
- symbol: "emptyCircle",
- symbolSize: 10,
- data: con.callin
- }, {
- name: "通话量",
- type: "line",
- smooth: true,
- showAllSymbol: true,
- symbol: "emptyCircle",
- symbolSize: 10,
- data: con.callconn
- // },
- // {
- // name: "放弃数量",
- // type: "line",
- // smooth: true,
- // showAllSymbol: true,
- // symbol: "emptyCircle",
- // symbolSize: 10,
- // data: con.gcounts
- // },
- // {
- // name: "黑名单拒接数量",
- // type: "line",
- // smooth: true,
- // showAllSymbol: true,
- // symbol: "emptyCircle",
- // symbolSize: 10,
- // data: con.scounts
- }]
- })
- }
- }
- });
- }
- //part 2
- var phone_num = echarts.init(document.getElementById('phone_num'));
- phone_num.setOption({
- // color: ['#6ce7ac', '#6a91e0', '#ceba5f', '#cb5f79', '#ae765a', '#569d4e'],
- color: [ '#6a91e0', '#ceba5f', '#cb5f79', '#ae765a', '#569d4e'],
- tooltip: {
- trigger: 'item',
- formatter: "{a} <br/>{b} : {c} ({d}%)",
- axisPointer: {
- crossStyle: {
- color: '#fff'
- }
- }
- },
- legend: {
- // orient: 'vertical',
- bottom: 'bottom',
- data: ['来电量','呼出量'],
- textStyle: {
- color: '#fff'
- }
- },
- series: [{
- name: '数据',
- type: 'pie',
- radius: '50%',
- // radius: ['30%', '60%'],
- center: ['50%', '50%'],
- data: [],
- itemStyle: {
- emphasis: {
- shadowBlur: 10,
- shadowOffsetX: 0,
- shadowColor: 'rgba(0, 0, 0, 0.5)'
- },
- normal: {
- label: {
- show: true,
- // formatter: '{b} : {c} ({d}%)'
- formatter: '{c} ({d}%)'
- // formatter: '{d}%'
- },
- labelLine: {
- show: true
- }
- }
- },
- label: {
- normal: {
- textStyle: {
- color: '#fff'
- }
- }
- }
- }]
- });
-
- var phone_num2 = echarts.init(document.getElementById('phone_num2'));
- phone_num2.setOption({
- color: [ '#ae765a', '#569d4e'],
- tooltip: {
- trigger: 'item',
- formatter: "{a} <br/>{b} : {c} ({d}%)",
- axisPointer: {
- crossStyle: {
- color: '#fff'
- }
- }
- },
- legend: {
- // orient: 'vertical',
- bottom: 'bottom',
- data: ['接通量','未接通量'],
- textStyle: {
- color: '#fff'
- }
- },
- series: [{
- name: '数据',
- type: 'pie',
- radius: '50%',
- center: ['50%', '50%'],
- data: [],
- itemStyle: {
- emphasis: {
- shadowBlur: 10,
- shadowOffsetX: 0,
- shadowColor: 'rgba(0, 0, 0, 0.5)'
- },
- normal: {
- label: {
- show: true,
- // formatter: '{b} : {c} ({d}%)'
- formatter: '{c} ({d}%)'
- },
- labelLine: {
- show: true
- }
- }
- },
- label: {
- normal: {
- textStyle: {
- color: '#fff'
- }
- }
- }
- }]
- });
-
- function partTwo() {
- var index = layer.load(1, {
- shade: [0.5, '#030303'] //0.1透明度的白色背景
- });
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "CallManage/GetCallTotal",
- async: true,
- dataType: "json",
- data: {
- // date: $('#time2').val()
- },
- success: function(data) {
- if(data.state.toLowerCase() == "success") {
- layer.close(index);
- var con = data.data;
- var part_2_ser = [{'value':con.daycallin ,'name':'来电量'},{'value':con.daycallout ,'name':'呼出量'}];
-
- phone_num.setOption({
- series: [{
- data: part_2_ser
- }]
- })
- var part_2_ser2 = [{'value':con.daycallconnect ,'name':'接通量'},{'value':con.daycallwconnect ,'name':'未接通量'}];
-
- phone_num2.setOption({
- series: [{
- data: part_2_ser2
- }]
- })
- }
- }
- });
- }
- //pasrt 5
- // var main = echarts.init(document.getElementById('main'));
- // main.setOption({
- //
- // tooltip: {
- // trigger: 'axis',
- // axisPointer: {
- // type: 'cross',
- // label: {
- // show: true,
- // backgroundColor: '#333'
- // }
- // },
- // formatter: function(datas) {
- // var res = datas[0].name + '<br/>',
- // val;
- // for(var i = 0, length = datas.length; i < length; i++) {
- // val = (datas[i].value) + '%';
- // res += datas[i].seriesName + ':' + val + '<br/>';
- // }
- // return res;
- // }
- // },
- // legend: {
- //// data: ["空闲", "通话", "置忙"],
- // data: [],
- // textStyle: {
- // color: '#fff'
- // },
- // bottom:'bottom'
- // },
- // xAxis: {
- // name: '时',
- // data: [],
- // axisLine: {
- // lineStyle: {
- // color: '#ccc'
- // }
- // }
- // },
- // yAxis: {
- // name: '比率',
- // splitLine: {
- // show: false
- // },
- // axisLine: {
- // lineStyle: {
- // color: '#ccc'
- // }
- // }
- // },
- // series: []
- // });
- //
- function partThree(){
- var index = layer.load(1, {
- shade: [0.5, '#030303'] //0.1透明度的白色背景
- });
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "CallManage/FreeBusyRate",
- async: true,
- dataType: "json",
- data: {
- // start: $('#time3').val(),
- // end: $('#time4').val()
- },
- success: function(data) {
- if(data.state.toLowerCase() == "success") {
- layer.close(index);
- var con = data.data;
- // var part3 = result.data.b;
- main.setOption({
- xAxis: {
- data: con.hour
- },
- legend: {
- data: con.callstate
- },
- series: [{
- name: "空闲",
- type: "bar",
- data: con.freecount
- }, {
- name: "通话中",
- type: "bar",
- data: con.callincount
- }, {
- name: "小休",
- type: "bar",
- data: con.restcount
- }]
- })
- }
- }
- });
- }
-
-
-
- //接通率报表part3
- var jtv = echarts.init(document.getElementById('jtv_num'));
- jtv.setOption({
- color: ['#4ab7c7', '#FF9800'],
- // title: {
- // text: '接通率统计',
- // x: 'center',
- // textStyle: {
- // color: '#fff',
- // fontSize: 18,
- // fontWeight: 'normal'
- // }
- // },
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'shadow',
- label: {
- show: true,
- backgroundColor: '#333'
- }
- },
- formatter: function(datas)
- {
- var res = datas[0].name + '<br/>', val;
- for(var i = 0, length = datas.length; i < length; i++) {
- val = (datas[i].value) + '%';
- res += datas[i].seriesName + ':' + val + '<br/>';
- }
- return res;
- }
- },
- legend: {
- // top: 30,
- bottom:'bottom',
- data: [],
- textStyle: {
- color: '#fff'
- }
- },
- xAxis: {
- name: '时',
- data: [],
- axisLine: {
- lineStyle: {
- color: '#ccc'
- }
- },
- },
- yAxis: {
- name: '比率',
- splitLine: {
- show: false
- },
- axisLine: {
- lineStyle: {
- color: '#ccc'
- }
- }
- },
- series: [{
- name: '接通量',
- type: 'bar',
- barWidth: 8,
- data: []
- },{
- name: '未接量',
- type: 'bar',
- barWidth: 8,
- data: []
- }]
- });
- function partFour(){
- var index = layer.load(1, { shade: [0.5,'#030303'] //0.1透明度的白色背景
- });
- $.ajax({
- type:"get",
- url:huayi.config.callcenter_url + "CallManage/GetCallState",
- async:true,
- dataType:'json',
- data:{
- // date:$('#time4').val()
- },
- success:function(data){
- if(data.state.toLowerCase()=='success'){
- layer.close(index);
- var con=data.data;
- // var part3=data.data.b;
- jtv.setOption({
- legend: {
- data: con.callstates,
- },
- xAxis: {
- data:con.hour
- },
- series: [{
- data:con.callconn
- },{
- data:con.callunconn
- }]
-
- })
-
- }
- }
- });
- }
-
- //通话时长part4
- var th_nums = echarts.init(document.getElementById('th_nums'));
- th_nums.setOption({
- // title: {
- // text: '通话时长统计',
- // x: 'center',
- // textStyle: {
- // color: '#fff',
- // fontSize: 18,
- // fontWeight: 'normal'
- // }
- // },
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'shadow',
- label: {
- show: true,
- backgroundColor: '#333'
- }
- }
-
- },
- legend: {
- bottom:'bottom',
- data: ['平均通话时长'],
- textStyle: {
- color: '#fff'
- }
- },
- xAxis: {
- name: '时',
- data: [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23],
- axisLine: {
- lineStyle: {
- color: '#ccc'
- }
- },
- },
- yAxis: {
- name: '秒',
- splitLine: {
- show: false
- },
- axisLine: {
- lineStyle: {
- color: '#ccc'
- }
- }
- },
- series: [{
- name: '平均通话时长',
- type: 'line',
- smooth:true,
- showAllSymbol:true,
- symbol :"emptyCircle",
- symbolSize: 10,
- data: []
- }]
- });
- function partFive(){
- var index = layer.load(1, { shade: [0.5,'#030303'] //0.1透明度的白色背景
- });
- $.ajax({
- type:"get",
- url:huayi.config.callcenter_url + "CallManage/GetCallTime",
- async:true,
- dataType:'json',
- data:{
- // date:$('#time5').val()
- },
- success:function(data){
- if(data.state.toLowerCase()=='success'){
- layer.close(index);
- var con=data.data;
- th_nums.setOption({
- // xAxis: {
- // data:con.hours
- // },
- series: [{
- data:con.avgtime
- }]
-
- })
-
-
-
- }
- }
- });
- }
- Ajax();
- function Ajax(){
- partOne();
- partTwo()
- // partThree();
- partFour();
- partFive();
- }
- setInterval(Ajax, huayi.config.indextime); //Ajax调用函数
- })
|