| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217 |
- 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 += '<li><span>' + v.F_Title + ':</span><span>' + v.F_Content + '</span><span>' + v
- // .F_CreateOn + '</span></li>'
- str += '<li><span>' + v.F_Content + '</span><span>' + v
- .F_CreateOn + '</span></li>'
- })
- $('.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+='<li><div><span>'+v.name+'</span></div><div><p><label class="db">'+v.value+'</label><label>数量</label>'+
- '</p><p><label class="bdrate">'+v.bili+'</label><label>百分比</label></p></div></li>'
- })
- $('.questype').html(str)
- })
- }
|