var inval; $(document).ready(function() { teltotal(); getQuesType() getHotWorkOrder() // telhour(); telday(); // worktotal(); if (inval) { clearInterval(inval); } inval = setInterval(function() { teltotal(); getQuesType() getHotWorkOrder() // telhour(); telday(); // worktotal(); }, huayi.config.indextime); }) function teltotal() { $.getJSON(huayi.config.callcenter_url + 'Index/GetTelRecordsTotal', { "token": $.cookie("token") }, function(result) { if (result.state.toLowerCase() == "success") { $(".style1").eq(0).find("h2").eq(1).text(result.data.dayin.count); $(".style1").eq(0).find("h3").text("总时长:" + result.data.dayin.totaltime); $(".style1").eq(1).find("h2").eq(1).text(result.data.dayout.count); $(".style1").eq(1).find("h3").text("总时长:" + result.data.dayout.totaltime); $(".style1").eq(2).find("h2").eq(1).text(result.data.monin.count); $(".style1").eq(2).find("h3").text("总时长:" + result.data.monin.totaltime); $(".style1").eq(3).find("h2").eq(1).text(result.data.monout.count); $(".style1").eq(3).find("h3").text("总时长:" + result.data.monout.totaltime); $(".style1").eq(4).find("h2").eq(1).text(result.data.daynocon); } }) } //图一 function getHotWorkOrder() { $.getJSON(huayi.config.callcenter_url + 'Notice/GetListTop', { "token": $.cookie("token"), top: 10 }, function(res) { if (res.rows.length > 7) { res.rows.splice(7) } let str = '' res.rows.forEach(function(v, n) { // str += '
  • ' + v.F_Title + ':' + v.F_Content + '' + v // .F_CreateOn + '
  • ' str += '
  • ' + v.F_Content + '' + v .F_CreateOn + '
  • ' }) $('.TG').html(str); }) } //myChart.setOption(option); //图3 var myChart3 = echarts.init(document.getElementById('flot-line-chart')); var option3 = { grid: { top: '15%', right: '3%', left: '5%', bottom: '12%' }, xAxis: [{ type: 'category', data: ['呼入量', '呼出量'], axisLine: { lineStyle: { color: 'rgb(204,204,204)' } }, axisLabel: { margin: 10, color: 'rgb(25,160,244)', textStyle: { fontSize: 14 }, }, }], yAxis: [{ name: '单位', nameTextStyle: { color: 'rgb(25,160,244)' }, axisLabel: { formatter: '{value}', color: 'rgb(25,160,244)', }, axisLine: { show: true, lineStyle: { color: 'rgb(204,204,204)' } }, splitLine: { show: false, lineStyle: { color: 'rgb(204,204,204)' } } }], series: [{ type: 'bar', data: [], barWidth: '30px', itemStyle: { normal: { color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ offset: 0, color: 'rgba(0,244,255,1)' // 0% 处的颜色 }, { offset: 1, color: 'rgba(0,77,167,1)' // 100% 处的颜色 }], false), barBorderRadius: [30, 30, 30, 30], shadowColor: 'rgba(0,160,221,1)', shadowBlur: 4, } }, label: { normal: { show: true, lineHeight: 30, width: 80, height: 30, backgroundColor: 'rgba(0,160,221,0.1)', borderRadius: 200, position: ['-4', '-60'], distance: 1, formatter: [ ' {d|●}', ' {a|{c}} \n', ' {b|}' ].join(','), rich: { d: { color: '#3CDDCF', }, a: { color: '#222', align: 'center', }, b: { width: 1, height: 30, borderWidth: 1, borderColor: '#234e6c', align: 'left' }, } } } }] }; function telday() { $.getJSON(huayi.config.callcenter_url + 'Index/GetCallTypecCount', { "token": $.cookie("token") }, function(result) { if (result.state.toLowerCase() == "success") { let xData2 = ['呼出量', '呼入量']; let data1 = []; result.data.forEach(function(v, n) { data1.push(v.num) }) option3.series[0].data = data1 myChart3.setOption(option3) } }) } //图2 function getQuesType(){ $.getJSON(huayi.config.callcenter_url + 'Index/getWTFL', { "token": $.cookie("token") }, function(res) { let str=''; let tName = ['移网质量', '渠道服务', '光网质量', '装维服务', '套餐资费']; let data = []; let oName = [] let otherName = []; res.data.forEach(function(v, n) { if(v&&v.dicname){ data.push({ name:v.dicname, value:v.num, bili:v.per }) oName.push(v.dicname) } }) const _arr = tName.filter(item1 => !oName.includes(item1)); const _arr3 = oName.filter(item2 => !tName.includes(item2)); otherName = _arr.concat(_arr3); otherName.forEach(function(v, n) { if (v) { data.push({ name:v, value:0, bili:'0' }) } }) data.forEach(function(v,n){ str+='
  • '+v.name+'

    '+ '

  • ' }) $('.questype').html(str) }) }