| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514 |
-
- var telCountData
- var barWidth = 20
- $('.btn_time').click(function(e) {
- if(e.target.tagName == 'SPAN') {
- if($(e.target).attr('data-state') == '1') {
- $(".hwsjtj").hide()
- $('.daySeat').css('display', 'none')
- $('.timeTraffic').css('display', 'inline-block')
- $('#traffic').css('display', 'none')
- $('#timeTraffic').css('display', 'block')
- $(this).siblings(".act").children("label").attr("indexTitle", "日话务数据统计1")
- $('.call_situation h2').text('话务数据统计')
- getworkOrder()
- trafficState = 0
- }
- }
- e.stopPropagation();
- })
-
- var insertType = '';
- var insertText = '';
-
- function getworkOrder() {
- insertType = '';
- insertText = '';
-
- let workOrderData = [];
- let workOrderName = []
- new doAjax({
- url: huayi.config.callcenter_url + "/InfoNew/GetTelCountByNow",
- data: {
- token: $.cookie("token"),
- second:$('#secondCut').val(),
- timetype: telCountByNowType
- },
- callBack: function(res) {
- var data = res.data.hw[0]
- // var data = {"invalid":40,"hwcount":426,"jtcount":384,"zzcount":0,"hbcount":11,"hccount":68,"hcjtcount":37,"jtbili":"99.48","zzbili":"0.00","hbbili":"2.85","hcbili":"54.41","effective":386.0};
- telCountData = data
-
- if ($('#secondCut').val() == '15') {
- // if (data.hbcount > 0) {
- // insertType = '回拨';
- // insertText = '人工: ' + data.artificial + '(' + telCountData.hbbili + '%)'
- // } else if (data.zzcount > 0) {
- // insertType = '自助';
- // insertText = '人工: ' + data.artificial + '(' + telCountData.hbbili + '%)'
- // } else if (data.jtcount > 0) {
- // insertType = '接通';
- // insertText = '人工: ' + data.artificial + '(' + telCountData.hbbili + '%)'
- // }
- insertText = '人工: ' + data.artificial + '(' + telCountData.artificialbili + '%)'
-
- }
- trafficDataChart(data)
-
- }
- });
- }
-
- function getLabelOption(positionObj, numberType) {
- var labelOption = {
- show: true,
- rotate: 0,
- align: 'left',
- color: '#fff',
- verticalAlign: 'middle',
- position: positionObj,
- formatter: function(params) {
- // console.log(params.seriesName, 'params.seriesName')
- if(params.value > 0) {
- dataValue = params.seriesName + ': ' + params.value
- if ($('#secondCut').val() == '15') {
-
- if (params.seriesName == '接通') {
- return insertText;
- } else if(params.seriesName === "呼出接通") {
- dataValue = dataValue + '(' + telCountData.hcbili + '%)'
- } else if (['回拨', '自助'].includes(params.seriesName)) {
- return '';
- }
-
- } else {
-
- if(params.seriesName === "回拨") {
- dataValue = dataValue + '(' + telCountData.hbbili + '%)'
- } else if(params.seriesName === "自助") {
- dataValue = dataValue + '(' + telCountData.zzbili + '%)'
- } else if(params.seriesName === "人工") {
- dataValue = dataValue + '(' + telCountData.jtbili + '%)'
- } else if(params.seriesName === "接通") {
- dataValue = dataValue + '(' + telCountData.jtbili + '%)'
- } else if(params.seriesName === "呼出接通") {
- dataValue = dataValue + '(' + telCountData.hcbili + '%)'
- }
- }
-
-
- // if ($('#secondCut').val() == '15') {
- // dataValue += ' \n\n'
- // }
-
- // if (insertType && params.seriesName == insertType) {
- // dataValue = insertText + '\n\n' + dataValue
- // }
- //
- return dataValue;
- } else {
- return ' ';
- }
- },
- fontSize: 12,
- };
- return labelOption
- }
- function getItemStyleColor(colorSting){
- var ColorData
- if (colorSting === 'red') {
- ColorData = ['#DC0707','#DC0707','#AF0808','#AF0808']
- } else if(colorSting === 'yellow'){
- ColorData = ['#EE7923','#F67C20','#D16A1E','#CC681E']
- } else if (colorSting === 'green'){
- ColorData = ['#2ADFE1','#32FFEE','#04D1C1','#00E8D5']
- }
-
- var color = {
- type: 'linear',
- x: 0,
- x2: 1,
- y: 0,
- y2: 0,
- colorStops: [{
- offset: 0,
- color: ColorData[0]
- },
- {
- offset: 0.5,
- color: ColorData[1]
- },
- {
- offset: 0.5,
- color: ColorData[2]
- },
- {
- offset: 1,
- color: ColorData[3]
- }
- ]
- }
- return color
- }
-
- function trafficDataChart(getdata) {
- let hotThingsLeft = echarts.init(document.getElementById("timeTrafficLeft"));
- let hotThingsRight = echarts.init(document.getElementById("timeTrafficRight"));
- window.onresize = function() {
- hotThingsLeft.resize()
- hotThingsRight.resize()
- }
-
- // console.log($('#secondCut').val(), '123')
- if ($('#secondCut').val() == '15') {
- hotThingsLeft.setOption(getOption15(getSeriesLeftData15(),['呼入量接通量']));
- } else {
- hotThingsLeft.setOption(getOption(getSeriesLeftData(),['呼入量接通量']));
- }
-
- //hotThingsLeft.setOption(getOption(getSeriesLeftData(),['呼入量接通量']));
-
- hotThingsRight.setOption(getOption(getSeriesRightData(),['呼出量呼出接通量']));
- }
-
- function getSeriesLeftData15 (){
- return [{
- name: '有效来电',
- type: 'bar',
- stack: 'A',
- label: getLabelOption(['-350%', 40], 0),
- barWidth,
- emphasis: {
- focus: 'series'
- },
- data: [telCountData.effective],
- itemStyle: {
- color: getItemStyleColor('red')
- }
- },
- {
- name: '无效来电',
- type: 'bar',
- stack: 'A',
- label: getLabelOption(['-350%', 0], 0),
- barWidth,
- emphasis: {
- focus: 'series'
- },
- data: [telCountData.invalid],
- itemStyle: {
- color: getItemStyleColor('yellow')
- }
- },
- {
- name: '接通',
- type: 'bar',
- stack: 'Ad',
- barWidth, //hbbili
- label: getLabelOption(['100%', 20], 0),
- emphasis: {
- focus: 'series'
- },
- data: [telCountData.jtcount],
- itemStyle: {
- color: getItemStyleColor('green')
- }
- },
- {
- name: '自助',
- type: 'bar',
- stack: 'Ad',
- barWidth,
- label: getLabelOption(['100%', 0], 0),
- emphasis: {
- focus: 'series'
- },
- data: [telCountData.zzcount],
- itemStyle: {
- color: getItemStyleColor('yellow')
- }
- },
- {
- name: '回拨',
- type: 'bar',
- stack: 'Ad',
- barWidth,
- label: getLabelOption(['100%', -20], 0),
- emphasis: {
- focus: 'series'
- },
- data: [telCountData.hbcount],
- itemStyle: {
- color: getItemStyleColor('red')
- }
- },
- ]
-
- }
-
- function getSeriesLeftData (){
- return [{
- name: '有效来电',
- type: 'bar',
- stack: 'A',
- label: getLabelOption(['-350%', 40], 0),
- barWidth,
- emphasis: {
- focus: 'series'
- },
- data: [telCountData.effective],
- itemStyle: {
- color: getItemStyleColor('red')
- }
- },
- {
- name: '无效来电',
- type: 'bar',
- stack: 'A',
- label: getLabelOption(['-350%', 0], 0),
- barWidth,
- emphasis: {
- focus: 'series'
- },
- data: [telCountData.invalid],
- itemStyle: {
- color: getItemStyleColor('yellow')
- }
- },
- {
- name: '人工',
- type: 'bar',
- stack: 'Ad',
- barWidth, //hbbili
- label: getLabelOption(['100%', 20], 0),
- emphasis: {
- focus: 'series'
- },
- data: [telCountData.jtcount],
- itemStyle: {
- color: getItemStyleColor('green')
- }
- },
- {
- name: '自助',
- type: 'bar',
- stack: 'Ad',
- barWidth,
- label: getLabelOption(['100%', 0], 0),
- emphasis: {
- focus: 'series'
- },
- data: [telCountData.zzcount],
- itemStyle: {
- color: getItemStyleColor('yellow')
- }
- },
- {
- name: '回拨',
- type: 'bar',
- stack: 'Ad',
- barWidth,
- label: getLabelOption(['100%', -20], 0),
- emphasis: {
- focus: 'series'
- },
- data: [telCountData.hbcount],
- itemStyle: {
- color: getItemStyleColor('red')
- }
- },
- ]
-
- }
-
- function getSeriesRightData (){
- return [{
- name: '呼出',
- type: 'bar',
- barWidth,
- label: getLabelOption(['-200%', -5], 0),
- labelLine:{
- show:true,
- normal:{
- length:15,
- length2: 0,
- }
- },
- emphasis: {
- focus: 'series'
- },
- data: [telCountData.hccount],
- itemStyle: {
- color: getItemStyleColor('red')
- }
- },
- {
- name: '呼出接通',
- type: 'bar',
- barWidth,
- label: getLabelOption(['-100%', -5], 0),
- emphasis: {
- focus: 'series'
- },
- data: [telCountData.hcjtcount],
- itemStyle: {
- color: getItemStyleColor('green')
- }
- }
- ]
-
- }
-
- function getOption15(getSeriesData,xAxisData) {
-
- return option = {
- tooltip: {
- trigger: 'item',
- show: true,
- // 进行数据处理
- formatter: function(params) {
- // console.log(params, 'params')
- var html = '';
- if(params.value > 0) {
- html += params.marker;
- if(params.name.indexOf('率') >= 0) {
- html += params.seriesName + ': ' + params.value + '%<br/>';
- } else {
- html += params.seriesName + ': ' + params.value + '<br/>';
- }
- }
- return html;
- }
- },
- grid: {
- left: '3%',
- right: '4%',
- bottom: '15%',
- containLabel: true
- },
- xAxis: [{
- type: 'category',
- axisLine: {
- lineStyle: {
- color: '#ffffff'
- }
- },
- axisLabel: {
- show: true,
- rotate: 0, // 角度值:Number
- interval: '0',
- verticalAlign: 'left',
- fontSize: 12, // 顺便调小一点字体大小
- padding: [0, 0, 0, -10],
- textStyle: {
- color: '#ffffff'
- },
- formatter: function(value) {
- //x轴的文字改为竖版显示
- var str;
- // console.log(value)
- if(value === "呼入量接通量") {
- str = "呼入量 接通量"
- } else if(value === "呼出量呼出接通量") {
- str = " 呼出量 呼出接通量"
- }
- return str
- }
- },
- data: xAxisData
- }],
- yAxis: [{
- type: 'value',
- splitLine: {
- show: false
- },
- axisLine: {
- lineStyle: {
- color: '#ffffff'
- }
- }
- }],
- color: ['#cd5c5c', '#87cefa', '#da70d6', '#32cd32', '#6495ed',
- '#ff69b4', '#ba55d3', '#cd5c5c', '#ffa500', '#40e0d0'
- ],
- series: getSeriesData
- };
-
- }
-
- function getOption(getSeriesData,xAxisData) {
-
- return option = {
- tooltip: {
- trigger: 'item',
- show: true,
- // 进行数据处理
- formatter: function(params) {
- // console.log(params, 'params')
- var html = '';
- if(params.value > 0) {
- html += params.marker;
- if(params.name.indexOf('率') >= 0) {
- html += params.seriesName + ': ' + params.value + '%<br/>';
- } else {
- html += params.seriesName + ': ' + params.value + '<br/>';
- }
- }
- return html;
- }
- },
- grid: {
- left: '3%',
- right: '4%',
- bottom: '15%',
- containLabel: true
- },
- xAxis: [{
- type: 'category',
- axisLine: {
- lineStyle: {
- color: '#ffffff'
- }
- },
- axisLabel: {
- show: true,
- rotate: 0, // 角度值:Number
- interval: '0',
- verticalAlign: 'left',
- fontSize: 12, // 顺便调小一点字体大小
- padding: [0, 0, 0, -10],
- textStyle: {
- color: '#ffffff'
- },
- formatter: function(value) {
- //x轴的文字改为竖版显示
- var str;
- // console.log(value)
- if(value === "呼入量接通量") {
- str = "呼入量 接通量"
- } else if(value === "呼出量呼出接通量") {
- str = " 呼出量 呼出接通量"
- }
- return str
- }
- },
- data: xAxisData
- }],
- yAxis: [{
- type: 'value',
- splitLine: {
- show: false
- },
- axisLine: {
- lineStyle: {
- color: '#ffffff'
- }
- }
- }],
- color: ['#cd5c5c', '#87cefa', '#da70d6', '#32cd32', '#6495ed',
- '#ff69b4', '#ba55d3', '#cd5c5c', '#ffa500', '#40e0d0'
- ],
- series: getSeriesData
- };
-
- }
|