| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176 |
- getworkOrder()
- var telCountData
- $('.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();
- })
- function getworkOrder() {
- let workOrderData = [];
- let workOrderName = []
- new doAjax({
- url: huayi.config.callcenter_url + "/InfoNew/GetTelCountByNow",
- data: {
- timetype: telCountByNowType
- },
- callBack: function(res) {
- var data = res.data.hw[0]
- telCountData = data
- trafficDataChart(data)
- }
- });
- }
- function getLabelOption(positionObj, numberType) {
- var labelOption = {
- show: true,
- rotate: 0,
- align: 'left',
- color: '#fff',
- verticalAlign: 'middle',
- position: positionObj,
- formatter: function(params) {
- if(params.value > 0) {
- dataValue = params.seriesName + ': ' + params.value
- if(params.seriesName === "回拨") {
- dataValue = dataValue + '(' + telCountData.hbbili + '%)'
- } else if(params.seriesName === "自助") {
- dataValue = dataValue + '(' + telCountData.zzbili + '%)'
- } else if(params.seriesName === "人工") {
- dataValue = dataValue + '(' + telCountData.jtbili + '%)'
- }
- return dataValue;
- } else {
- return ' ';
- }
- },
- fontSize: 12,
- };
- return labelOption
- }
- function trafficDataChart(getdata) {
- let hotThingsLeft = echarts.init(document.getElementById("timeTrafficLeft"));
- let hotThingsRight = echarts.init(document.getElementById("timeTrafficRight"));
- window.onresize = function() {
- hotThingsLeft.resize()
- hotThingsRight.resize()
- }
- hotThingsLeft.setOption(getOption(getdata));
- // hotThingsRight.setOption(getOption(getdata));
- }
- function getOption(getdata) {
- return option = {
- tooltip: {
- trigger: 'item',
- formatter: '{a} <br/>{b}: {c} ({d}%)'
- },
- grid: {
- bottom: '20%',
- left: '50%',
- right: '20%',
- bottom: '20%',
- containLabel: true
- },
- // color:['#cd5c5c','#87cefa','#da70d6','#32cd32', '#6495ed'], //cd5c5c 32cd32 87cefa
- series: [{
- name: 'Access From',
-
- type: 'pie',
- selectedMode: 'single',
- radius: [0, '30%'],
- label: {
- position: 'inner',
- fontSize: 14
- },
- labelLine: {
- show: false
- },
- data: [{
- value: 101,
- name: '无效来电'
- },
- {
- value: 477,
- name: '有效来电',
- selected: true
- },
- ]
- },
- {
- name: 'Access From',
- type: 'pie',
- position:'outer',
- alignTo:'edge',
- margin:10,
- radius: ['45%', '60%'],
- label: {
- formatter: '{b}:{c} {per|{d}%}',
- //backgroundColor: '#F6F8FC',
- //borderColor: '#8C8D8E',
- //borderWidth: 1,
- borderRadius: 4,
- rich: {
- a: {
- color: '#6E7079',
- lineHeight: 22,
- align: 'center'
- },
- hr: {
- borderColor: '#8C8D8E',
- width: '100%',
- borderWidth: 1,
- height: 0
- },
- b: {
- color: '#4C5058',
- fontSize: 14,
- fontWeight: 'bold',
- lineHeight: 33
- },
- per: {
- color: '#fff',
- // backgroundColor: '#4C5058',
- padding: [3, 4],
- borderRadius: 4
- }
- }
- },
- labelLine:{
- show:true,
- normal:{
- length:15,
- length2: 0,
- }
- },
- data: [{
- value: 5,
- name: '回拨'
- },
- {
- value: 6,
- name: '自助'
- },
- {
- value: 435,
- name: '人工'
- },
- ]
- }
- ]
- }
- }
|