'use strict'; app.controller('charts3Ctrl', ["$scope", "$rootScope", "$state", "$timeout", "$interval", "$http", "$cookieStore", "Restangular", "api_hkreport", "api_wechat_operate", function ($scope, $rootScope, $state, $timeout, $interval, $http, $cookieStore, Restangular, api_hkreport, api_wechat_operate) { $scope.ceshi = ["110", "105", "84", "125", "110", "92", "98"]; // 来电趋势图 var dom_laidianqushitu = document.getElementById("laidianqushitu"); var myChart_laidianqushitu = echarts.init(dom_laidianqushitu); var app = {}; // 旧趋势图 { // 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, // minInterval: 1, // // 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 // }] // }; } 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: 'center' }, // margin:10, // rotate:40 }, 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, minInterval: 1, // 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, //是否平滑曲线显示 symbolSize: 5, symbol: 'emptyCircle', tooltip: { show: false }, "itemStyle": { "normal": { "color": "rgb(34,142,215)", "barBorderRadius": 0, }, borderColor: '#f0f' }, // data: [90, 105, 84, 125, 110, 92, 98] data: $scope.ceshi }, { name: '异常流量', type: 'bar', barWidth: 15, tooltip: { show: false }, itemStyle: { normal: { color: "rgb(34,142,215)" // 线条颜色 } }, // data: [90, 105, 84, 125, 110, 92, 98] data: $scope.ceshi } ] }; // 报修趋势图 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: 'center' }, }, 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, minInterval: 1, // 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: 'emptyCircle', // 默认是空心圆(中间是白色的),改成实心圆 symbolSize: 5, itemStyle: { normal: { color: "#eb9341" // 线条颜色 }, borderColor: '#f0f' }, tooltip: { show: false }, data: [90, 105, 84, 125, 110, 92, 98] }, { name: '异常流量', type: 'bar', barWidth: 15, itemStyle: { normal: { color: "#eb9341" // 线条颜色 } }, data: [90, 105, 84, 125, 110, 92, 98] } ] }; // 旧趋势图 { // 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, // minInterval: 1, // // 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 lastMonth = moment(new Date()).subtract(1, 'months').format('YYYY-MM-DD'); var sixHourAgo = moment(new Date().getTime() - 3600000 * 6).format("YYYY-MM-DD HH:mm:ss"); // 近1年 var lastYear = moment().subtract(1, "years").format("YYYY-MM-DD"); // 获取工单实时总数数据 // 开始 $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_solvedData = ""; function getIncident_solvedData(time) { api_hkreport.incidentreport(time, 'large_screen_incident_resolved_total').then(function (res) { $scope.incident_solvedData = res.data[0].sum }) } getIncident_solvedData({}) // 结束 // // 获取近一年建单总数数据 // // 开始 $scope.incident_total_year = ""; function getYear_incident_total(time) { api_hkreport.incidentreport(time, 'large_screen_year_incident_total').then(function (res) { $scope.incident_total_year = res.data[0].sum }) } getYear_incident_total({ "start": lastYear + " 00:00:00", "end": yesterDay + " 23:59:59" }) // 结束 // // 获取近一个月建单总数数据 // // 开始 $scope.incident_total_month = ""; function getYear_incident_total_month(time) { api_hkreport.incidentreport(time, 'large_screen_year_incident_total').then(function (res) { $scope.incident_total_month = res.data[0].sum }) } getYear_incident_total_month({ "start": lastMonth + " 00:00:00", "end": yesterDay + " 23:59:59" }) // 结束 // // 获取近一年事件解决总时长数据 // // 开始 $scope.incident_solve_time_year = ""; function getIncident_solve_time(time) { api_hkreport.incidentreport(time, 'large_screen_year_incident_solve_time').then(function (res) { $scope.incident_solve_time_year = res.data[0].hour || 0 }) } getIncident_solve_time({ "start": lastYear + " 00:00:00", "end": yesterDay + " 23:59:59" }) // 结束 // // 获取近一个月事件解决总时长数据 // // 开始 $scope.incident_solve_time_month = ""; function getIncident_solve_time_month(time) { api_hkreport.incidentreport(time, 'large_screen_year_incident_solve_time').then(function (res) { $scope.incident_solve_time_month = res.data[0].hour || 0 }) } getIncident_solve_time_month({ "start": lastMonth + " 00:00:00", "end": yesterDay + " 23:59:59" }) // 结束 // // 获取近一年已解决工单数据 // // 开始 $scope.incident_solve_total_year = ""; function getIncident_solve_total(time) { api_hkreport.incidentreport(time, 'large_screen_year_incident_solve_total').then(function (res) { $scope.incident_solve_total_year = res.data[0].sum }) } getIncident_solve_total({ "start": lastYear + " 00:00:00", "end": yesterDay + " 23:59:59" }) // 结束 // // 获取近一个月已解决工单数据 // // 开始 $scope.incident_solve_total_month = ""; function getIncident_solve_total_month(time) { api_hkreport.incidentreport(time, 'large_screen_year_incident_solve_total').then(function (res) { $scope.incident_solve_total_month = res.data[0].sum }) } getIncident_solve_total_month({ "start": lastMonth + " 00:00:00", "end": yesterDay + " 23:59:59" }) // 结束 // // 获取近一年满意度数据 // // 开始 $scope.incident_degree_year = ""; function getIncident_degree(time) { api_hkreport.incidentreport(time, 'large_screen_year_incident_degree').then(function (res) { $scope.incident_degree_year = res.data[0].degree || 0 }) } getIncident_degree({ "start": lastYear + " 00:00:00", "end": yesterDay + " 23:59:59" }) // 结束 // // 获取近一个月满意度数据 // // 开始 $scope.incident_degree_month = ""; function getIncident_degree_month(time) { api_hkreport.incidentreport(time, 'large_screen_year_incident_degree').then(function (res) { $scope.incident_degree_month = res.data[0].degree || 0 }) } getIncident_degree_month({ "start": lastMonth + " 00:00:00", "end": yesterDay + " 23:59:59" }) // 结束 // 获取呼叫中心来电趋势图数据 // 开始 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; for (var i = 0; i < res.value.length; i++) { $scope.allIncidentreport = $scope.allIncidentreport + Number(res.value[i]) } for (var i = 0; i < time.length; i++) { timeArr.push(time[i].substring(time[i].length - 2, time[i].length) + ":00"); } value = res.value; option_laidianqushitu.xAxis[0].data = timeArr; option_laidianqushitu.series[0].data = value; option_laidianqushitu.series[1].data = value; myChart_laidianqushitu.setOption(option_laidianqushitu); // $scope.incident_solveData=res.data[0].sum }) } getCallPitData({ "start": yesterDay + " 08", // "start": "2018-05-28 00", "end": yesterDay + " 18" }); // 结束 // 呼叫中心来电总数 // 开始 // $scope.callAll=0; // function getCallPitAllData(time){ // api_hkreport.incidentreport(time, 'service_counter').then(function(res) { // console.log(res); // $scope.callAll=res.workCallProportion.sum // }) // } // getCallPitAllData({ // "start":yesterDay, // "end":moment(new Date().getTime()+86400000).format("YYYY-MM-DD") // }) // $interval(function(){ // getCallPitAllData({ // "start":yesterDay, // "end":moment(new Date().getTime()+86400000).format("YYYY-MM-DD") // }) // },30000) // 结束 // 微信报修总数 // 开始 $scope.wxAll = 0; function getWxPitAllData(time) { api_hkreport.incidentreport(time, 'large_screen_wx_incident_sum').then(function (res) { console.log(res); $scope.wxAll = res.data[0].sum // $scope.callAll=res.workCallProportion.sum }) } getWxPitAllData({ "start": yesterDay + " 00:00:00", // "start": "2018-05-28 00:00:00", "end": yesterDay + " 23:59:59" }) // 结束 // 获取微信报修趋势图数据 // 开始 function getWechatPitData(time) { api_hkreport.incidentreport(time, 'large_screen_wx_incident_trend').then(function (res) { var timeArr = []; var time = []; var value = []; var time = res.date; for (var i = 0; i < time.length; i++) { timeArr.push(time[i].substring(time[i].length - 2, time[i].length) + ":00"); } value = res.value; option_baoxiuqushitu.xAxis[0].data = timeArr; option_baoxiuqushitu.series[0].data = value; option_baoxiuqushitu.series[1].data = value; myChart_baoxiuqushitu.setOption(option_baoxiuqushitu); }) } getWechatPitData({ "start": yesterDay + " 08:00:00", // "start": "2018-05-28 00:00:00", "end": yesterDay + " 18:00:00" }); // 结束 // 获取事件工单处理实时情况数据 // 开始 $scope.incidentHandleList1 = []; // $scope.incidentHandleList2 = []; function getIncidentHandleData(time, inter) { api_hkreport.incidentreport(time, 'large_screen_incident_rt_status').then(function (res) { $scope.incidentHandleList1 = res.data; setTimeout(() => { $scope.slides('body', 'box', 'box1', 'list1', 5, inter); }, 1000); // if (res.data.length > 14) { // $scope.incidentHandleList2 = res.data.slice(8, 15); // } else { // $scope.incidentHandleList1 = res.data; // $scope.incidentHandleList2 = res.data; // } }) } getIncidentHandleData({}, 1) // 结束 // 获取微信报修详情列表数据 // 开始 $scope.weChatList1 = []; // $scope.weChatList2 = []; function getWeChatData(time, inter) { api_hkreport.incidentreport(time, 'large_screen_wx_incident_details').then(function (res) { var str = [] for (var i = 0; i < res.data.length; i++) { if (res.data[i].name != '咨询' && res.data[i].name != '管理员' && res.data[i].name != '' && res.data[i].name != null) { str.push(res.data[i]); } } $scope.weChatList1 = str; // console.log($scope.weChatList1) setTimeout(() => { $scope.slides('body', 'box2', 'box3', 'list2', 5, inter); }, 1000); // console.log(res); // for (var i = 0; i < res.data.length; i++) { // if (res.data[i].name == "咨询") { // // delete res.data[i] // res.data.splice(i, 1) // } // } // if (res.data.length > 14) { // $scope.weChatList1 = res.data.slice(0, 7); // $scope.weChatList2 = res.data.slice(8, 15); // } else { // $scope.weChatList2 = res.data; // } }) } getWeChatData({}, 1) // 结束 // 获取处理地点列表数据 // 开始 $scope.placeList = []; function getPlaceListData(time, inter) { 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":"普通"}, // ] // $("#box5").html(''); $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; i < res.data.length; i++) { if (res.data[i].area == "主校区" && res.data[i].statusid == 4 || res.data[i].statusid == 2) { $scope.zhuxiaoquSum++ if (res.data[i].priority == "重大") { $scope.zhuxiaoqu_zhongdaSum++ } else if (res.data[i].priority == "高") { $scope.zhuxiaoqu_gaoSum++ } else if (res.data[i].priority == "较高") { $scope.zhuxiaoqu_jiaogaoSum++ } else { $scope.zhuxiaoqu_putongSum++ } } else if (res.data[i].area == "同济校区" && res.data[i].statusid == 4 || res.data[i].statusid == 2) { $scope.tongjixiaoquSum++ if (res.data[i].priority == "重大") { $scope.tongjixiaoqu_zhongdaSum++ } else if (res.data[i].priority == "高") { $scope.tongjixiaoqu_gaoSum++ } else if (res.data[i].priority == "较高") { $scope.tongjixiaoqu_jiaogaoSum++ } else { $scope.tongjixiaoqu_putongSum++ } } else if (res.data[i].area == "东校区" && res.data[i].statusid == 4 || res.data[i].statusid == 2) { $scope.dongxiaoquSum++ if (res.data[i].priority == "重大") { $scope.dongxiaoqu_zhongdaSum++ } else if (res.data[i].priority == "高") { $scope.dongxiaoqu_gaoSum++ } else if (res.data[i].priority == "较高") { $scope.dongxiaoqu_jiaogaoSum++ } else { $scope.dongxiaoqu_putongSum++ } } } for (var i = 0; i < res.data.length; i++) { if (res.data[i].statusid != 4 && res.data[i].statusid != 2) { if (res.data[i].area == "主校区") { $scope.zhuxiaoqu_chuliguo++; $scope.zhuxiaoquSum++; $scope.zhuxiaoqu_zhongdaSum++ } else if (res.data[i].area == "同济校区") { $scope.tongjixiaoqu_chuliguo++; $scope.tongjixiaoquSum++; $scope.tongjixiaoqu_zhongdaSum++ } else if (res.data[i].area == "东校区") { $scope.dongxiaoqu_chuliguo++; $scope.dongxiaoquSum++; $scope.dongxiaoqu_zhongdaSum++ } } } setTimeout(() => { $scope.slides('body1', 'box4', 'box5', 'list3', 3, inter); }, 1000); // console.log("zhongda " + $scope.zhuxiaoqu_zhongdaSum + "; putong" + $scope.zhuxiaoquSum); // if (res.data.length > 5) { // $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": yesterDay + " 00:00:00", // "start": "2018-05-28 00:00:00", "end": yesterDay + " 23:59:59" // "start":"2019-04-17 23:59:59", }, 1) // 结束 // 获取近一年区域地点事件发生详情列表数据 // 开始 // 热力图 { // 热力图 // $scope.heatMaps = function (boxId, list) { // var heatmapInstance = h337.create({ // container: document.getElementById(boxId), // radius: 40, // maxOpacity: .7, // gradient: { // '.3': 'rgba(115,255,155,.5)',//白 // '.7': 'rgba(238,239,11,.4)',//黄 // '.9': 'rgba(208,64,47,.1)',//红 // } // }); // var dataPoints = [{ // x: 0, // y: 0, // // radius: 40, // value: 160 // }, { // x: 0, // y: 0, // // radius: 40, // value: 180 // }]; // for (var i = 0; i < list.length; i++) { // if (list[i].coordinates) { // var point = list[i].coordinates.split(','); // heatmapInstance.addData([{ // x: point[0] / 2 + 10, // y: point[1] / 2 + 10, // // radius: 40, // value: list[i].proportion // }, { // x: point[0] / 2 + 10, // y: point[1] / 2 + 10, // // radius: 40, // value: list[i].proportion // }]); // } // } // } } // 一年热力图&表格数据 $scope.areaList = []; function getAreaListData(time, inter) { api_hkreport.incidentreport(time, 'large_screen_areaplace_incident_details').then(function (res) { console.log(res); $scope.areaList = res.data; setTimeout(() => { $scope.slides('body1', 'box6', 'box7', 'list4', 3, inter); // $scope.heatMaps('container', $scope.areaList) }, 1000); }) } getAreaListData({ sum: 100, "start": lastYear + " 00:00:00", "end": yesterDay + " 23:59:59" // "start":"2019-04-17 23:59:59", }, 1) // 一个月热力图 $scope.areaMonthList = []; function getAreaMonthListData(time, inter) { api_hkreport.incidentreport(time, 'large_screen_areaplace_incident_details').then(function (res) { $scope.areaMonthList = res.data; setTimeout(() => { $scope.slides('body1', 'box8', 'box9', 'list5', 3, inter); // $scope.heatMaps('containerMonth', $scope.areaMonthList) }, 1000); }) } getAreaMonthListData({ sum: 100, "start": lastMonth + " 00:00:00", "end": yesterDay + " 23:59:59" // "start":"2019-04-17 23:59:59", }, 1) // 结束 // 地图事件位置&数量 // $scope.dayMapDataList = []; //当天 $scope.monthMapDataList = []; //当月 $scope.yearMapDataList = []; //当年 // function getMapData(time) { // api_hkreport.incidentreport(time, 'large_screen_map_data').then(function (res) { // $scope.dayMapDataList = res.data; // }) // } function getMonthMapData(time) { api_hkreport.incidentreport(time, 'large_screen_map_data').then(function (res) { $scope.monthMapDataList = res.data; }) } function getYearMapData(time) { api_hkreport.incidentreport(time, 'large_screen_map_data').then(function (res) { $scope.yearMapDataList = res.data; }) } // getMapData({ // sum: 100, // "start": yesterDay + " 00:00:00", // "end": yesterDay + " 23:59:59" // }) getMonthMapData({ sum: 10, "start": lastMonth + " 00:00:00", "end": yesterDay + " 23:59:59" }) getYearMapData({ sum: 20, "start": lastYear + " 00:00:00", "end": yesterDay + " 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" } } // 来电趋势/微信报修趋势...(页面数据轮播) $scope.slideBoxLeft = 0; $scope.slideBoxLeft1 = 0; $scope.slideBoxLeft2 = 0; $scope.slideBoxLeft3 = 0; //索引 function move1() { if ($scope.slideBoxLeft == 0) { $scope.slideBoxLeft = '-100%'; } else { $scope.slideBoxLeft = 0; } if ($scope.slideBoxLeft1 == 0) { $scope.slideBoxLeft1 = '-100%'; } else if ($scope.slideBoxLeft1 == '-100%') { $scope.slideBoxLeft1 = '-200%'; } else if ($scope.slideBoxLeft1 == '-200%') { $scope.slideBoxLeft1 = '-300%'; } else if ($scope.slideBoxLeft1 == '-300%') { $scope.slideBoxLeft1 = '-400%'; } else if ($scope.slideBoxLeft1 == '-400%') { $scope.slideBoxLeft1 = '-500%'; } else { $scope.slideBoxLeft1 = 0; } if ($scope.slideBoxLeft2 == 0) { $scope.slideBoxLeft2 = '-100%'; } else if ($scope.slideBoxLeft2 == '-100%') { $scope.slideBoxLeft2 = '-200%'; } else { $scope.slideBoxLeft2 = 0; } if ($scope.slideBoxLeft3 >= 0) { $scope.slideBoxLeft3++; if($scope.slideBoxLeft3 == 6){ $scope.slideBoxLeft3 = 0; } // console.log($scope.slideBoxLeft3, '$scope.slideBoxLeft3') if($scope.slideBoxLeft3 == 0 || $scope.slideBoxLeft3 == 1 || $scope.slideBoxLeft3 == 2){ $scope.cloudMap.goTo(114.41276, 30.51515, 1, 16);//主校区 } if($scope.slideBoxLeft3 == 3 || $scope.slideBoxLeft3 == 4 || $scope.slideBoxLeft3 == 5){ $scope.cloudMap.goTo(114.254, 30.5855, 3, 16);//同济校区 } } } // 列表滚动 // a:table body 的class名;b:滚动父盒子的id名;c:滚动盒子的id名;d:滚动项的class名;e:每页展示的条数;f:interval定时器开启1/关闭0 $scope.slides = function (a, b, c, d, e, f) { var speed = 45; //设置向上轮动的速度 var list = $('.' + d).clone(); if (list.length >= e) { var body1 = $('.' + a)[0]; var box = $("#" + b); if (f) { $("#" + c).append(list.splice(0, e)) } var top = 0; function moveTop() { if (top <= body1.offsetHeight - box[0].offsetHeight) { top = 0; } else { top--; } box.css({ 'top': top + 'px' }) } var interval = setInterval(() => { moveTop() }, 50); if (!f) { clearInterval(interval) } } } // 区域地点实时动态图标点 $scope.pointPosition = function (point, statusid) { var style = {}; if (point) { var arr = point.split(','); style.left = arr[0] / 2 + 10 + 'px'; style.top = arr[1] / 2 - 10 + 'px'; } else { // 南1楼 - 南8楼 style.left = 800 / 2 + 10 + 'px'; style.top = 800 / 2 - 10 + 'px'; } return style; } // 地图上的提示框闪烁 var a = 0; function flicker(className) { setInterval(() => { a++ $(className).hide() $($(className)[a]).show(); if (a >= $(className).length - 1) { a = 0; } }, 1500); } // flicker('.dataHaoRooms') // flicker('.dataHaoRooms1') // flicker('.dataHaoRooms2') // 定时刷新 function getDataInter(time) { $interval(function () { $interval.cancel($scope.listTimer); getIncidentHandleData({}, 0); getWeChatData({}, 0); getPlaceListData({ "start": yesterDay + " 00:00:00", // "start": "2018-05-28 00:00:00", "end": yesterDay + " 23:59:59" }, 0) getIncident_allData({}); getIncident_responseData({}); getIncident_solveNowData({}) getIncident_solvedData({}) getYear_incident_total({ "start": lastYear + " 00:00:00", "end": yesterDay + " 23:59:59" }) getYear_incident_total_month({ "start": lastMonth + " 00:00:00", "end": yesterDay + " 23:59:59" }) getIncident_solve_time({ "start": lastYear + " 00:00:00", "end": yesterDay + " 23:59:59" }) getIncident_solve_time_month({ "start": lastMonth + " 00:00:00", "end": yesterDay + " 23:59:59" }) getIncident_solve_total({ "start": lastYear + " 00:00:00", "end": yesterDay + " 23:59:59" }) getIncident_solve_total_month({ "start": lastMonth + " 00:00:00", "end": yesterDay + " 23:59:59" }) getIncident_degree({ "start": lastYear + " 00:00:00", "end": yesterDay + " 23:59:59" }) getIncident_degree_month({ "start": lastMonth + " 00:00:00", "end": yesterDay + " 23:59:59" }) getCallPitData({ "start": yesterDay + " 08", // "start": "2018-05-28 00", "end": yesterDay + " 18" }); getWxPitAllData({ "start": yesterDay + " 00:00:00", // "start": "2018-05-28 00:00:00", "end": yesterDay + " 23:59:59" }) getWechatPitData({ "start": yesterDay + " 08:00:00", // "start": "2018-05-28 00:00:00", "end": yesterDay + " 18:00:00" }); getMonthMapData({ sum: 10, "start": lastMonth + " 00:00:00", "end": yesterDay + " 23:59:59" }) getYearMapData({ sum: 20, "start": lastYear + " 00:00:00", "end": yesterDay + " 23:59:59" }) }, time) } getDataInter(300000) //5分钟 // 切屏 setInterval(() => { move1() }, 15000); //15秒 // 获取地图token api_wechat_operate.mapToken({active: 1}, 'mapToken').then(function (res) { //#region 渲染地图--------------------start //arcgis字体文件资质 //var arcgisFontUrl = ""; var is3d = false; var username = "yunweixt20221207"; var addressToken = res.token; //通过api获取 //点位聚合 // var reductionCustom = { // 室内消火栓: { // clusterRadius: 100, // clusterMinSize: 28, // clusterMaxSize: 36, // }, // 图层名称2: { // clusterRadius: 100, // clusterMinSize: 28, // clusterMaxSize: 36, // }, // }; var reductionCustom = null; // var layerColor = null; var layerColor = { baseMap: "dark", floorMap: "dark", }; $scope.$watch('$viewContentLoaded', function() { console.log('viewContentLoaded'); $scope.cloudMap = Object.create(CloudMap); //页面加载完成后,创建map对象 // $scope.cloudMap2 = Object.create(CloudMap); //页面加载完成后,创建map对象 // $scope.cloudMap3 = Object.create(CloudMap); //页面加载完成后,创建map对象 // $scope.cloudMap4 = Object.create(CloudMap); //页面加载完成后,创建map对象 // $scope.cloudMap5 = Object.create(CloudMap); //页面加载完成后,创建map对象 // $scope.cloudMap6 = Object.create(CloudMap); //页面加载完成后,创建map对象 // 主校区 $scope.cloudMap.initMap( "viewDiv", 114.41276, 30.51515, 1, username, is3d, addressToken, null, reductionCustom, layerColor, mapReady ); // $scope.cloudMap2.initMap( // "viewDiv2", // 114.41276, // 30.51515, // 1, // username, // is3d, // addressToken, // null, // reductionCustom, // layerColor, // mapReady // ); // $scope.cloudMap3.initMap( // "viewDiv3", // 114.41276, // 30.51515, // 1, // username, // is3d, // addressToken, // null, // reductionCustom, // layerColor, // mapReady // ); // // 同济校区 // $scope.cloudMap4.initMap( // "viewDiv4", // 114.254, // 30.5855, // 3, // username, // is3d, // addressToken, // null, // reductionCustom, // layerColor, // mapReady // ); // $scope.cloudMap5.initMap( // "viewDiv5", // 114.254, // 30.5855, // 3, // username, // is3d, // addressToken, // null, // reductionCustom, // layerColor, // mapReady // ); // $scope.cloudMap6.initMap( // "viewDiv6", // 114.254, // 30.5855, // 3, // username, // is3d, // addressToken, // null, // reductionCustom, // layerColor, // mapReady // ); }); function mapReady() { //cloudMap.changeLayerVisible('建筑物中心点', false); //地图加载成功 // cloudMap.initLayerList("top-right"); //显示图层管理模块,位置top-right,top-left,bottom-right,bottom-right // cloudMap.initLegend("top-left"); //显示图例 // cloudMap.click(doSomeThing); //绑定点击查询事件,点击空白处返回 “0”,点击具体的点则会返回相应数doSomeThing是回调函数,根据返回的结果 //获取全部图层名称 // var allLayerTitle = cloudMap.getAllLayerTitle(); // console.log(allLayerTitle); //动态添加图层(下拉列表) // allLayerTitle.forEach((element) => { // //console.log(element); // document // .getElementById("txt_layer") // .options.add(new Option(element, element)); // document // .getElementById("txt_layer2") // .options.add(new Option(element, element)); // }); } //#endregion 渲染地图--------------------end // }) }]);