1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378 |
- 'use strict';
- app.controller('charts3Ctrl', ["$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 = {};
- // 旧趋势图
- {
- // 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_hkreport.incidentreport({}, 'large_screen_incident_total').then(function (res) {
- //#region 渲染地图--------------------start
- //arcgis字体文件资质
- //var arcgisFontUrl = "";
- var is3d = false;
- var username = "yunweixt20221207";
- var addressToken =
- "TGYnE2lw7X0RuR4cpJmCulyoRZnVgVW2XVfcQ08yHA-7x3SLMM1ByO6s12LUf63mliF8E6BRZvXDjiMq4CwpA5O0yp7ngbRAnoeZ1i3b2jhmPEMUchaHmmf4DCztMB6AHO5hA3mRHRSjJw8l7WZrPQ.."; //通过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
- //
- })
- }]);
|