12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484 |
- 'use strict';
- app.controller('charts3Ctrl', ["$scope", "$rootScope", "$state", "$timeout", "$interval", "$http", "$cookieStore", "Restangular", "api_hkreport", "api_wechat_operate", "api_newreport", function ($scope, $rootScope, $state, $timeout, $interval, $http, $cookieStore, Restangular, api_hkreport, api_wechat_operate, api_newreport) {
- $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;
- }
- }
- function move2() {
- 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 == 3){
- map_time_area({
- "startTime": moment(new Date().getTime()).format("YYYY-MM-DD") + ' 00:00:00',
- "endTime": moment(new Date().getTime()).format("YYYY-MM-DD HH:mm:ss")
- }, $scope.slideBoxLeft3)
- }
- // 30天信息
- if($scope.slideBoxLeft3 == 1 || $scope.slideBoxLeft3 == 4){
- map_time_area({
- "startTime": lastMonth + " 00:00:00",
- "endTime": yesterDay + " 23:59:59"
- }, $scope.slideBoxLeft3)
- }
- // 一年信息
- if($scope.slideBoxLeft3 == 2 || $scope.slideBoxLeft3 == 5){
- map_time_area({
- "startTime": lastYear + " 00:00:00",
- "endTime": yesterDay + " 23:59:59"
- }, $scope.slideBoxLeft3)
- }
- }
- }
- // 列表滚动
- // 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秒
- $scope.timer = setTimeout(() => {
- move2()
- }, 15000); //15秒
- // 地图聚合点信息----------------------------------------start
- // // 获取近一个月建单总数数据
- // // 开始
- // $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"
- // })
- // 结束
- // // 开始
- function map_time_area(time, slideBoxLeft3) {
- api_newreport.fetchDataList('oneMapData', time).then(function (res) {
- console.log(res)
- if(res.status == 200){
- for (let name in res.data) {
- let GLIDList = [];
- let dataList = [];
- res.data[name].forEach(function(v){
- GLIDList.push(v[2]);
- dataList.push(v[3]);
- })
- $scope.addClusterLayer(GLIDList, dataList, name);
- }
- // 地址切换
- if(slideBoxLeft3 === 0 || slideBoxLeft3 === 1 || slideBoxLeft3 === 2){
- $scope.cloudMap.goTo(114.41276, 30.51515, 1, 16);//主校区
- clearTimeout($scope.timer);
- setTimeout(() => {
- for (let name in res.data) {
- $scope.delClusterLayer(name);
- }
- move2()
- }, 15000); //15秒
- }
- if(slideBoxLeft3 === 3 || slideBoxLeft3 === 4 || slideBoxLeft3 === 5){
- $scope.cloudMap.goTo(114.254, 30.5855, 3, 16);//同济校区
- clearTimeout($scope.timer);
- setTimeout(() => {
- for (let name in res.data) {
- $scope.delClusterLayer(name);
- }
- move2()
- }, 15000); //15秒
- }
- }
- })
- }
- // map_time_area({
- // "startTime": lastMonth + " 00:00:00",
- // "endTime": yesterDay + " 23:59:59"
- // })
- // map_time_area({
- // "startTime": lastYear + " 00:00:00",
- // "endTime": yesterDay + " 23:59:59"
- // })
-
- // 结束
- // 地图聚合点信息----------------------------------------end
- // 获取地图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.delClusterLayer = function(name) {
- $scope.cloudMap.removeClusterLayer(name);
- }
- //聚合图层
- $scope.addClusterLayer = function(GLIDList, dataList, name) {
- console.log(GLIDList, dataList, name);
- // name = '风险点';
- //建筑物GLID
- // GLIDList =["10192","10195","10157","10114","10314","10101","10288","10394","10427"];
- //建筑物对应的数值,dCount必须为正整数
- // dataList =[ 23, 15, 5, 6,8,12, 35, 66,1];
- $scope.cloudMap.addClusterLayer(GLIDList, dataList, name);
- }
- $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() {
- map_time_area({
- "startTime": moment(new Date().getTime()).format("YYYY-MM-DD") + ' 00:00:00',
- "endTime": moment(new Date().getTime()).format("YYYY-MM-DD HH:mm:ss")
- })
- //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
- //
- })
- }]);
|