'use strict'; app.controller('charts2Ctrl', ["$scope", "$rootScope", "$state", "$timeout", "$interval", "$http", "$cookieStore", "Restangular", "api_hkreport", function($scope, $rootScope, $state, $timeout, $interval, $http, $cookieStore, Restangular, api_hkreport) { $scope.ceshi=["110", "105", "84", "125", "110", "92", "98"]; // 来电趋势图 var dom_laidianqushitu = document.getElementById("laidianqushitu"); var myChart_laidianqushitu = echarts.init(dom_laidianqushitu); var app = {}; var option_laidianqushitu = null; option_laidianqushitu = { backgroundColor: "transparent", tooltip: { }, grid: { top: '8%', left: '1%', right: '1%', bottom: '8%', containLabel: true, }, xAxis: [{ type: 'category', boundaryGap: false, axisLine: { //坐标轴轴线相关设置。数学上的x轴 show: true, lineStyle: { color: '#233e64' }, }, axisLabel: { //坐标轴刻度标签的相关设置 textStyle: { color: 'white', margin:15, align:'right' }, }, axisTick: { show: false,}, data: ['8:00', '9:00', '10:00', '11:00', '12:00', '13:00', '14:00'], }], yAxis: [{ type: 'value', min: 0, max:16, splitNumber: 7, splitLine: { show: true, lineStyle: { color: '#233e64' } }, axisLine: {show: false,}, axisLabel: { margin:20, textStyle: { color: 'white', }, }, axisTick: { show: false,}, }], series: [{ name: '异常流量', type: 'line', smooth: true, //是否平滑曲线显示 // symbol:'circle', // 默认是空心圆(中间是白色的),改成实心圆 symbolSize:0, lineStyle: { normal: { color: "rgb(34,142,215)" // 线条颜色 } }, areaStyle: { //区域填充样式 normal: { //线性渐变,前4个参数分别是x0,y0,x2,y2(范围0~1);相当于图形包围盒中的百分比。如果最后一个参数是‘true’,则该四个值是绝对像素位置。 color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ { offset: 0, color: 'rgba(34,142,215, 0.6)'}, { offset: 1, color: 'rgba(34,142,215, 0.1)'} ], false), shadowColor: 'rgba(34,142,215, 0.9)', //阴影颜色 shadowBlur: 20 //shadowBlur设图形阴影的模糊大小。配合shadowColor,shadowOffsetX/Y, 设置图形的阴影效果。 } }, // data: [90, 105, 84, 125, 110, 92, 98] data:$scope.ceshi }] };; // myChart_laidianqushitu.setOption(option_laidianqushitu); // 报修趋势图 var dom_baoxiuqushitu = document.getElementById("baoxiuqushitu"); var myChart_baoxiuqushitu = echarts.init(dom_baoxiuqushitu); var app = {}; var option_baoxiuqushitu = null; option_baoxiuqushitu = { backgroundColor: "transparent", tooltip: { }, grid: { top: '8%', left: '1%', right: '1%', bottom: '8%', containLabel: true, }, xAxis: [{ type: 'category', boundaryGap: false, axisLine: { //坐标轴轴线相关设置。数学上的x轴 show: true, lineStyle: { color: '#233e64' }, }, axisLabel: { //坐标轴刻度标签的相关设置 textStyle: { color: 'white', margin:15, align:'right' }, }, axisTick: { show: false,}, data: ['8:00', '9:00', '10:00', '11:00', '12:00', '13:00', '14:00'], }], yAxis: [{ type: 'value', min: 0, max:16, splitNumber: 7, splitLine: { show: true, lineStyle: { color: '#233e64' } }, axisLine: {show: false,}, axisLabel: { margin:20, textStyle: { color: 'white', }, }, axisTick: { show: false,}, }], series: [{ name: '异常流量', type: 'line', smooth: true, //是否平滑曲线显示 // symbol:'circle', // 默认是空心圆(中间是白色的),改成实心圆 symbolSize:0, lineStyle: { normal: { color: "rgb(208,64,47)" // 线条颜色 } }, areaStyle: { //区域填充样式 normal: { //线性渐变,前4个参数分别是x0,y0,x2,y2(范围0~1);相当于图形包围盒中的百分比。如果最后一个参数是‘true’,则该四个值是绝对像素位置。 color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ { offset: 0, color: 'rgba(208,64,47, 0.6)'}, { offset: 1, color: 'rgba(208,64,47, 0.1)'} ], false), shadowColor: 'rgba(208,64,47, 0.9)', //阴影颜色 shadowBlur: 20 //shadowBlur设图形阴影的模糊大小。配合shadowColor,shadowOffsetX/Y, 设置图形的阴影效果。 } }, data: [90, 105, 84, 125, 110, 92, 98] }] };; // myChart_baoxiuqushitu.setOption(option_baoxiuqushitu); // 事件工单列表轮播图 // var shijian_index=1; // setInterval(function(){ // var l='-'+414*shijian_index+'px'; // $('.shijian_tables_box:eq(0)').animate({left:l},1000,function(){ // if(shijian_index == $('.shijian_tables').length-1){ // $(this).css('left',0); // shijian_index=1; // }else{ // shijian_index++; // } // }); // },5000) // 报修列表轮播图 // var baoxiu_index=1; // setInterval(function(){ // var l='-'+414*baoxiu_index+'px'; // $('.baoxiu_tables_box:eq(0)').animate({left:l},1000,function(){ // if(baoxiu_index == $('.baoxiu_tables').length-1){ // $(this).css('left',0); // baoxiu_index=1; // }else{ // baoxiu_index++; // } // }); // },5000) // 调用数据 var nowDay=moment(new Date().getTime()+86400000).format("YYYY-MM-DD"); var yesterDay=moment(new Date().getTime()).format("YYYY-MM-DD"); var nowHour=moment(new Date().getTime()).format("YYYY-MM-DD HH:mm:ss"); var sixHourAgo=moment(new Date().getTime()-3600000*6).format("YYYY-MM-DD HH:mm:ss"); console.log(nowHour); // 获取工单实时总数数据 // 开始 $scope.incident_allData=""; function getIncident_allData(time){ api_hkreport.incidentreport(time, 'large_screen_incident_total').then(function(res) { console.log(res); $scope.incident_allData=res.data[0].sum }) } getIncident_allData({ }) // 结束 // 获取及时响应数据 // 开始 $scope.incident_responseData=""; function getIncident_responseData(time){ api_hkreport.incidentreport(time, 'large_screen_incident_pending_total').then(function(res) { console.log(res); $scope.incident_responseData=res.data[0].sum }) } getIncident_responseData({}) // 结束 // 获取解决中数据 // 开始 // $scope.incident_solveNowData=""; // function getIncident_solveNowData(time){ // api_hkreport.incidentreport(time, 'large_screen_incident_handler_total').then(function(res) { // console.log(res); // $scope.incident_solveNowData=res.data[0].sum // }) // } // getIncident_solveNowData({ // }) // // 结束 // // 获取已解决数据 // // 开始 // $scope.incident_solveData=""; // function getIncident_solveData(time){ // api_hkreport.incidentreport(time, 'large_screen_incident_resolved_total').then(function(res) { // console.log(res); // $scope.incident_solveData=res.data[0].sum // }) // } // getIncident_solveData({ // }) // 结束 // 获取呼叫中心来电趋势图数据 // 开始 function getCallPitData(time){ api_hkreport.incidentreport(time, 'large_screen_call_trend').then(function(res) { var timeArr=[]; var time=[]; var value=[]; var time=res.date; $scope.allIncidentreport=0; console.log(time); for(var i=0;i14){ $scope.incidentHandleList1=res.data.slice(0,7); $scope.incidentHandleList2=res.data.slice(8,15); }else{ $scope.incidentHandleList1=res.data; $scope.incidentHandleList2=res.data; } }) } getIncidentHandleData({}) // 结束 // 获取微信报修详情列表数据 // 开始 $scope.weChatList1=[]; $scope.weChatList2=[]; function getWeChatData(time){ api_hkreport.incidentreport(time, 'large_screen_wx_incident_details').then(function(res) { console.log(res); for(var i=0;i14){ $scope.weChatList1=res.data.slice(0,7); $scope.weChatList2=res.data.slice(8,15); }else{ $scope.weChatList1=res.data; $scope.weChatList2=res.data; } }) } getWeChatData({}) // 结束 // 获取处理地点列表数据 // 开始 $scope.placeList=[]; function getPlaceListData(time){ api_hkreport.incidentreport(time, 'large_screen_incident_area').then(function(res) { console.log(res); // res.data=[ // {"area":"主校区","statusid":4,"priority":"重大"}, // {"area":"主校区","statusid":4,"priority":"普通"}, // {"area":"主校区","statusid":4,"priority":"普通"}, // {"area":"同济校区","statusid":4,"priority":"重大"}, // {"area":"同济校区","statusid":4,"priority":"普通"}, // ] $scope.placeList=res.data; var shijian_index=0; $(".map_list_body_poi:eq(0)").scrollTop(0); $scope.tongjixiaoquSum=0; $scope.tongjixiaoqu_zhongdaSum=0; $scope.tongjixiaoqu_gaoSum=0; $scope.tongjixiaoqu_jiaogaoSum=0; $scope.tongjixiaoqu_putongSum=0; $scope.zhuxiaoquSum=0; $scope.zhuxiaoqu_zhongdaSum=0; $scope.zhuxiaoqu_gaoSum=0; $scope.zhuxiaoqu_jiaogaoSum=0; $scope.zhuxiaoqu_putongSum=0; $scope.dongxiaoquSum=0; $scope.dongxiaoqu_zhongdaSum=0; $scope.dongxiaoqu_gaoSum=0; $scope.dongxiaoqu_jiaogaoSum=0; $scope.dongxiaoqu_putongSum=0; $scope.tongjixiaoqu_chuliguo=0; $scope.zhuxiaoqu_chuliguo=0; $scope.dongxiaoqu_chuliguo=0; for(var i=0;i5){ $scope.listTimerFn=function(){ $scope.listTimer=$interval(function timer(){ $(".map_list_body_poi:eq(0)").scrollTop(shijian_index); if(shijian_index-2>$(".map_list_body_poi:eq(0)").scrollTop()){ $interval.cancel($scope.listTimer); $timeout(function(){ $scope.listTimerFn(); $(".map_list_body_poi:eq(0)").scrollTop(0); shijian_index=0; },5000) }; shijian_index++; },240) } $scope.listTimerFn() } }) } getPlaceListData({ "start":moment(new Date().getTime()).format("YYYY-MM-DD")+" 00:00:00", // "start":"2019-04-18 00:00:00", "end":moment(new Date().getTime()).format("YYYY-MM-DD")+" 23:59:59" // "start":"2019-04-17 23:59:59", }) // 结束 // 事件工单列表状态颜色 $scope.statusColor=function(res){ if(res=="接单"){ return "jiedai" }else if(res=="事件处理"){ return "chulizhong" }else if(res=="事件关闭"){ return "guanbi" }else{ return "qita" } } // 事件工单处理实时情况状态转换 $scope.incident_status=function(res){ if(res=="事件处理"){ return "处理中" }else if(res=="事件关闭"){ return "已办结" }else{ return res } } // 列表前点颜色 $scope.liebiao_zhuangtai=function(status,priority){ if(status==4||status==2){ if(priority=="重大"){ return "zhongda" }else{ return "" } }else{ return "chuliguo" } } // 定时刷新 function getDataInter(time){ $interval(function(){ $interval.cancel($scope.listTimer); getIncidentHandleData({}); getWeChatData({}); getPlaceListData({ "start":moment(new Date().getTime()).format("YYYY-MM-DD")+" 00:00:00", "end":moment(new Date().getTime()).format("YYYY-MM-DD")+" 23:59:59" }) getIncident_allData({}); getIncident_responseData({}) },time) } getDataInter(300000) // getDataInter(5000) }]);