charts3.js 40 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205
  1. 'use strict';
  2. app.controller('charts3Ctrl', ["$scope", "$rootScope", "$state", "$timeout", "$interval", "$http", "$cookieStore", "Restangular", "api_hkreport", function ($scope, $rootScope, $state, $timeout, $interval, $http, $cookieStore, Restangular, api_hkreport) {
  3. $scope.ceshi = ["110", "105", "84", "125", "110", "92", "98"];
  4. // 来电趋势图
  5. var dom_laidianqushitu = document.getElementById("laidianqushitu");
  6. var myChart_laidianqushitu = echarts.init(dom_laidianqushitu);
  7. var app = {};
  8. // 旧趋势图
  9. {
  10. // option_laidianqushitu = {
  11. // backgroundColor: "transparent",
  12. // tooltip: {},
  13. // grid: {
  14. // top: '8%',
  15. // left: '1%',
  16. // right: '1%',
  17. // bottom: '8%',
  18. // containLabel: true,
  19. // },
  20. // xAxis: [{
  21. // type: 'category',
  22. // boundaryGap: false,
  23. // axisLine: { //坐标轴轴线相关设置。数学上的x轴
  24. // show: true,
  25. // lineStyle: {
  26. // color: '#233e64'
  27. // },
  28. // },
  29. // axisLabel: { //坐标轴刻度标签的相关设置
  30. // textStyle: {
  31. // color: 'white',
  32. // margin: 15,
  33. // align: 'right'
  34. // },
  35. // },
  36. // axisTick: {
  37. // show: false,
  38. // },
  39. // data: ['8:00', '9:00', '10:00', '11:00', '12:00', '13:00', '14:00'],
  40. // }],
  41. // yAxis: [{
  42. // type: 'value',
  43. // min: 0,
  44. // // max: 16,
  45. // minInterval: 1,
  46. // // splitNumber: 7,
  47. // splitLine: {
  48. // show: true,
  49. // lineStyle: {
  50. // color: '#233e64'
  51. // }
  52. // },
  53. // axisLine: {
  54. // show: false,
  55. // },
  56. // axisLabel: {
  57. // margin: 20,
  58. // textStyle: {
  59. // color: 'white',
  60. // },
  61. // },
  62. // axisTick: {
  63. // show: false,
  64. // },
  65. // }],
  66. // series: [{
  67. // name: '异常流量',
  68. // type: 'line',
  69. // smooth: true, //是否平滑曲线显示
  70. // // symbol:'circle', // 默认是空心圆(中间是白色的),改成实心圆
  71. // symbolSize: 0,
  72. // lineStyle: {
  73. // normal: {
  74. // color: "rgb(34,142,215)" // 线条颜色
  75. // }
  76. // },
  77. // areaStyle: { //区域填充样式
  78. // normal: {
  79. // //线性渐变,前4个参数分别是x0,y0,x2,y2(范围0~1);相当于图形包围盒中的百分比。如果最后一个参数是‘true’,则该四个值是绝对像素位置。
  80. // color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  81. // offset: 0,
  82. // color: 'rgba(34,142,215, 0.6)'
  83. // },
  84. // {
  85. // offset: 1,
  86. // color: 'rgba(34,142,215, 0.1)'
  87. // }
  88. // ], false),
  89. // shadowColor: 'rgba(34,142,215, 0.9)', //阴影颜色
  90. // shadowBlur: 20 //shadowBlur设图形阴影的模糊大小。配合shadowColor,shadowOffsetX/Y, 设置图形的阴影效果。
  91. // }
  92. // },
  93. // // data: [90, 105, 84, 125, 110, 92, 98]
  94. // data: $scope.ceshi
  95. // }]
  96. // };
  97. }
  98. var option_laidianqushitu = null;
  99. option_laidianqushitu = {
  100. backgroundColor: "transparent",
  101. tooltip: {},
  102. grid: {
  103. top: '8%',
  104. left: '1%',
  105. right: '1%',
  106. bottom: '8%',
  107. containLabel: true,
  108. },
  109. xAxis: [{
  110. type: 'category',
  111. // boundaryGap: false,
  112. axisLine: { //坐标轴轴线相关设置。数学上的x轴
  113. show: true,
  114. lineStyle: {
  115. color: '#233e64'
  116. },
  117. },
  118. axisLabel: { //坐标轴刻度标签的相关设置
  119. textStyle: {
  120. color: 'white',
  121. // margin: 15,
  122. align: 'center'
  123. },
  124. // margin:10,
  125. // rotate:40
  126. },
  127. axisTick: {
  128. show: false,
  129. },
  130. data: ['8:00', '9:00', '10:00', '11:00', '12:00', '13:00', '14:00'],
  131. }],
  132. yAxis: [{
  133. type: 'value',
  134. min: 0,
  135. // max: 16,
  136. minInterval: 1,
  137. // splitNumber: 7,
  138. splitLine: {
  139. show: true,
  140. lineStyle: {
  141. color: '#233e64'
  142. }
  143. },
  144. axisLine: {
  145. show: false,
  146. },
  147. axisLabel: {
  148. margin: 20,
  149. textStyle: {
  150. color: 'white',
  151. },
  152. },
  153. axisTick: {
  154. show: false,
  155. },
  156. }],
  157. series: [{
  158. name: '异常流量',
  159. type: 'line',
  160. // smooth: true, //是否平滑曲线显示
  161. symbolSize: 5,
  162. symbol: 'emptyCircle',
  163. tooltip: {
  164. show: false
  165. },
  166. "itemStyle": {
  167. "normal": {
  168. "color": "rgb(34,142,215)",
  169. "barBorderRadius": 0,
  170. },
  171. borderColor: '#f0f'
  172. },
  173. // data: [90, 105, 84, 125, 110, 92, 98]
  174. data: $scope.ceshi
  175. },
  176. {
  177. name: '异常流量',
  178. type: 'bar',
  179. barWidth: 15,
  180. tooltip: {
  181. show: false
  182. },
  183. itemStyle: {
  184. normal: {
  185. color: "rgb(34,142,215)" // 线条颜色
  186. }
  187. },
  188. // data: [90, 105, 84, 125, 110, 92, 98]
  189. data: $scope.ceshi
  190. }
  191. ]
  192. };
  193. // 报修趋势图
  194. var dom_baoxiuqushitu = document.getElementById("baoxiuqushitu");
  195. var myChart_baoxiuqushitu = echarts.init(dom_baoxiuqushitu);
  196. var app = {};
  197. var option_baoxiuqushitu = null;
  198. option_baoxiuqushitu = {
  199. backgroundColor: "transparent",
  200. tooltip: {},
  201. grid: {
  202. top: '8%',
  203. left: '1%',
  204. right: '1%',
  205. bottom: '8%',
  206. containLabel: true,
  207. },
  208. xAxis: [{
  209. type: 'category',
  210. // boundaryGap: false,
  211. axisLine: { //坐标轴轴线相关设置。数学上的x轴
  212. show: true,
  213. lineStyle: {
  214. color: '#233e64'
  215. },
  216. },
  217. axisLabel: { //坐标轴刻度标签的相关设置
  218. textStyle: {
  219. color: 'white',
  220. margin: 15,
  221. align: 'center'
  222. },
  223. },
  224. axisTick: {
  225. show: false,
  226. },
  227. data: ['8:00', '9:00', '10:00', '11:00', '12:00', '13:00', '14:00'],
  228. }],
  229. yAxis: [{
  230. type: 'value',
  231. min: 0,
  232. // max: 16,
  233. minInterval: 1,
  234. // splitNumber: 7,
  235. splitLine: {
  236. show: true,
  237. lineStyle: {
  238. color: '#233e64'
  239. }
  240. },
  241. axisLine: {
  242. show: false,
  243. },
  244. axisLabel: {
  245. margin: 20,
  246. textStyle: {
  247. color: 'white',
  248. },
  249. },
  250. axisTick: {
  251. show: false,
  252. },
  253. }],
  254. series: [{
  255. name: '异常流量',
  256. type: 'line',
  257. // smooth: true, //是否平滑曲线显示
  258. symbol: 'emptyCircle', // 默认是空心圆(中间是白色的),改成实心圆
  259. symbolSize: 5,
  260. itemStyle: {
  261. normal: {
  262. color: "#eb9341" // 线条颜色
  263. },
  264. borderColor: '#f0f'
  265. },
  266. tooltip: {
  267. show: false
  268. },
  269. data: [90, 105, 84, 125, 110, 92, 98]
  270. },
  271. {
  272. name: '异常流量',
  273. type: 'bar',
  274. barWidth: 15,
  275. itemStyle: {
  276. normal: {
  277. color: "#eb9341" // 线条颜色
  278. }
  279. },
  280. data: [90, 105, 84, 125, 110, 92, 98]
  281. }
  282. ]
  283. };
  284. // 旧趋势图
  285. {
  286. // option_baoxiuqushitu = {
  287. // backgroundColor: "transparent",
  288. // tooltip: {},
  289. // grid: {
  290. // top: '8%',
  291. // left: '1%',
  292. // right: '1%',
  293. // bottom: '8%',
  294. // containLabel: true,
  295. // },
  296. // xAxis: [{
  297. // type: 'category',
  298. // boundaryGap: false,
  299. // axisLine: { //坐标轴轴线相关设置。数学上的x轴
  300. // show: true,
  301. // lineStyle: {
  302. // color: '#233e64'
  303. // },
  304. // },
  305. // axisLabel: { //坐标轴刻度标签的相关设置
  306. // textStyle: {
  307. // color: 'white',
  308. // margin: 15,
  309. // align: 'right'
  310. // },
  311. // },
  312. // axisTick: {
  313. // show: false,
  314. // },
  315. // data: ['8:00', '9:00', '10:00', '11:00', '12:00', '13:00', '14:00'],
  316. // }],
  317. // yAxis: [{
  318. // type: 'value',
  319. // min: 0,
  320. // // max: 16,
  321. // minInterval: 1,
  322. // // splitNumber: 7,
  323. // splitLine: {
  324. // show: true,
  325. // lineStyle: {
  326. // color: '#233e64'
  327. // }
  328. // },
  329. // axisLine: {
  330. // show: false,
  331. // },
  332. // axisLabel: {
  333. // margin: 20,
  334. // textStyle: {
  335. // color: 'white',
  336. // },
  337. // },
  338. // axisTick: {
  339. // show: false,
  340. // },
  341. // }],
  342. // series: [{
  343. // name: '异常流量',
  344. // type: 'line',
  345. // smooth: true, //是否平滑曲线显示
  346. // // symbol:'circle', // 默认是空心圆(中间是白色的),改成实心圆
  347. // symbolSize: 0,
  348. // lineStyle: {
  349. // normal: {
  350. // color: "rgb(208,64,47)" // 线条颜色
  351. // }
  352. // },
  353. // areaStyle: { //区域填充样式
  354. // normal: {
  355. // //线性渐变,前4个参数分别是x0,y0,x2,y2(范围0~1);相当于图形包围盒中的百分比。如果最后一个参数是‘true’,则该四个值是绝对像素位置。
  356. // color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  357. // offset: 0,
  358. // color: 'rgba(208,64,47, 0.6)'
  359. // },
  360. // {
  361. // offset: 1,
  362. // color: 'rgba(208,64,47, 0.1)'
  363. // }
  364. // ], false),
  365. // shadowColor: 'rgba(208,64,47, 0.9)', //阴影颜色
  366. // shadowBlur: 20 //shadowBlur设图形阴影的模糊大小。配合shadowColor,shadowOffsetX/Y, 设置图形的阴影效果。
  367. // }
  368. // },
  369. // data: [90, 105, 84, 125, 110, 92, 98]
  370. // }]
  371. // };
  372. }
  373. // myChart_baoxiuqushitu.setOption(option_baoxiuqushitu);
  374. // 事件工单列表轮播图
  375. // var shijian_index=1;
  376. // setInterval(function(){
  377. // var l='-'+414*shijian_index+'px';
  378. // $('.shijian_tables_box:eq(0)').animate({left:l},1000,function(){
  379. // if(shijian_index == $('.shijian_tables').length-1){
  380. // $(this).css('left',0);
  381. // shijian_index=1;
  382. // }else{
  383. // shijian_index++;
  384. // }
  385. // });
  386. // },5000)
  387. // 报修列表轮播图
  388. // var baoxiu_index=1;
  389. // setInterval(function(){
  390. // var l='-'+414*baoxiu_index+'px';
  391. // $('.baoxiu_tables_box:eq(0)').animate({left:l},1000,function(){
  392. // if(baoxiu_index == $('.baoxiu_tables').length-1){
  393. // $(this).css('left',0);
  394. // baoxiu_index=1;
  395. // }else{
  396. // baoxiu_index++;
  397. // }
  398. // });
  399. // },5000)
  400. // 调用数据
  401. var nowDay = moment(new Date().getTime() + 86400000).format("YYYY-MM-DD");
  402. var yesterDay = moment(new Date().getTime()).format("YYYY-MM-DD");
  403. var nowHour = moment(new Date().getTime()).format("YYYY-MM-DD HH:mm:ss");
  404. // 一个月前
  405. var lastMonth = moment(new Date()).subtract(1, 'months').format('YYYY-MM-DD');
  406. var sixHourAgo = moment(new Date().getTime() - 3600000 * 6).format("YYYY-MM-DD HH:mm:ss");
  407. // 近1年
  408. var lastYear = moment().subtract(1, "years").format("YYYY-MM-DD");
  409. // 获取工单实时总数数据
  410. // 开始
  411. $scope.incident_allData = "";
  412. function getIncident_allData(time) {
  413. api_hkreport.incidentreport(time, 'large_screen_incident_total').then(function (res) {
  414. console.log(res);
  415. $scope.incident_allData = res.data[0].sum
  416. })
  417. }
  418. getIncident_allData({
  419. })
  420. // 结束
  421. // 获取及时响应数据
  422. // 开始
  423. $scope.incident_responseData = "";
  424. function getIncident_responseData(time) {
  425. api_hkreport.incidentreport(time, 'large_screen_incident_pending_total').then(function (res) {
  426. console.log(res);
  427. $scope.incident_responseData = res.data[0].sum
  428. })
  429. }
  430. getIncident_responseData({})
  431. // 结束
  432. // 获取解决中数据
  433. // 开始
  434. $scope.incident_solveNowData = "";
  435. function getIncident_solveNowData(time) {
  436. api_hkreport.incidentreport(time, 'large_screen_incident_handler_total').then(function (res) {
  437. console.log(res);
  438. $scope.incident_solveNowData = res.data[0].sum
  439. })
  440. }
  441. getIncident_solveNowData({
  442. })
  443. // // 结束
  444. // // 获取已解决数据
  445. // // 开始
  446. $scope.incident_solvedData = "";
  447. function getIncident_solvedData(time) {
  448. api_hkreport.incidentreport(time, 'large_screen_incident_resolved_total').then(function (res) {
  449. $scope.incident_solvedData = res.data[0].sum
  450. })
  451. }
  452. getIncident_solvedData({})
  453. // 结束
  454. // // 获取近一年建单总数数据
  455. // // 开始
  456. $scope.incident_total_year = "";
  457. function getYear_incident_total(time) {
  458. api_hkreport.incidentreport(time, 'large_screen_year_incident_total').then(function (res) {
  459. $scope.incident_total_year = res.data[0].sum
  460. })
  461. }
  462. getYear_incident_total({
  463. "start": lastYear + " 00:00:00",
  464. "end": yesterDay + " 23:59:59"
  465. })
  466. // 结束
  467. // // 获取近一个月建单总数数据
  468. // // 开始
  469. $scope.incident_total_month = "";
  470. function getYear_incident_total_month(time) {
  471. api_hkreport.incidentreport(time, 'large_screen_year_incident_total').then(function (res) {
  472. $scope.incident_total_month = res.data[0].sum
  473. })
  474. }
  475. getYear_incident_total_month({
  476. "start": lastMonth + " 00:00:00",
  477. "end": yesterDay + " 23:59:59"
  478. })
  479. // 结束
  480. // // 获取近一年事件解决总时长数据
  481. // // 开始
  482. $scope.incident_solve_time_year = "";
  483. function getIncident_solve_time(time) {
  484. api_hkreport.incidentreport(time, 'large_screen_year_incident_solve_time').then(function (res) {
  485. $scope.incident_solve_time_year = res.data[0].hour || 0
  486. })
  487. }
  488. getIncident_solve_time({
  489. "start": lastYear + " 00:00:00",
  490. "end": yesterDay + " 23:59:59"
  491. })
  492. // 结束
  493. // // 获取近一个月事件解决总时长数据
  494. // // 开始
  495. $scope.incident_solve_time_month = "";
  496. function getIncident_solve_time_month(time) {
  497. api_hkreport.incidentreport(time, 'large_screen_year_incident_solve_time').then(function (res) {
  498. $scope.incident_solve_time_month = res.data[0].hour || 0
  499. })
  500. }
  501. getIncident_solve_time_month({
  502. "start": lastMonth + " 00:00:00",
  503. "end": yesterDay + " 23:59:59"
  504. })
  505. // 结束
  506. // // 获取近一年已解决工单数据
  507. // // 开始
  508. $scope.incident_solve_total_year = "";
  509. function getIncident_solve_total(time) {
  510. api_hkreport.incidentreport(time, 'large_screen_year_incident_solve_total').then(function (res) {
  511. $scope.incident_solve_total_year = res.data[0].sum
  512. })
  513. }
  514. getIncident_solve_total({
  515. "start": lastYear + " 00:00:00",
  516. "end": yesterDay + " 23:59:59"
  517. })
  518. // 结束
  519. // // 获取近一个月已解决工单数据
  520. // // 开始
  521. $scope.incident_solve_total_month = "";
  522. function getIncident_solve_total_month(time) {
  523. api_hkreport.incidentreport(time, 'large_screen_year_incident_solve_total').then(function (res) {
  524. $scope.incident_solve_total_month = res.data[0].sum
  525. })
  526. }
  527. getIncident_solve_total_month({
  528. "start": lastMonth + " 00:00:00",
  529. "end": yesterDay + " 23:59:59"
  530. })
  531. // 结束
  532. // // 获取近一年满意度数据
  533. // // 开始
  534. $scope.incident_degree_year = "";
  535. function getIncident_degree(time) {
  536. api_hkreport.incidentreport(time, 'large_screen_year_incident_degree').then(function (res) {
  537. $scope.incident_degree_year = res.data[0].degree || 0
  538. })
  539. }
  540. getIncident_degree({
  541. "start": lastYear + " 00:00:00",
  542. "end": yesterDay + " 23:59:59"
  543. })
  544. // 结束
  545. // // 获取近一个月满意度数据
  546. // // 开始
  547. $scope.incident_degree_month = "";
  548. function getIncident_degree_month(time) {
  549. api_hkreport.incidentreport(time, 'large_screen_year_incident_degree').then(function (res) {
  550. $scope.incident_degree_month = res.data[0].degree || 0
  551. })
  552. }
  553. getIncident_degree_month({
  554. "start": lastMonth + " 00:00:00",
  555. "end": yesterDay + " 23:59:59"
  556. })
  557. // 结束
  558. // 获取呼叫中心来电趋势图数据
  559. // 开始
  560. function getCallPitData(time) {
  561. api_hkreport.incidentreport(time, 'large_screen_call_trend').then(function (res) {
  562. var timeArr = [];
  563. var time = [];
  564. var value = [];
  565. var time = res.date;
  566. $scope.allIncidentreport = 0;
  567. for (var i = 0; i < res.value.length; i++) {
  568. $scope.allIncidentreport = $scope.allIncidentreport + Number(res.value[i])
  569. }
  570. for (var i = 0; i < time.length; i++) {
  571. timeArr.push(time[i].substring(time[i].length - 2, time[i].length) + ":00");
  572. }
  573. value = res.value;
  574. option_laidianqushitu.xAxis[0].data = timeArr;
  575. option_laidianqushitu.series[0].data = value;
  576. option_laidianqushitu.series[1].data = value;
  577. myChart_laidianqushitu.setOption(option_laidianqushitu);
  578. // $scope.incident_solveData=res.data[0].sum
  579. })
  580. }
  581. getCallPitData({
  582. "start": yesterDay + " 08",
  583. // "start": "2018-05-28 00",
  584. "end": yesterDay + " 18"
  585. });
  586. // 结束
  587. // 呼叫中心来电总数
  588. // 开始
  589. // $scope.callAll=0;
  590. // function getCallPitAllData(time){
  591. // api_hkreport.incidentreport(time, 'service_counter').then(function(res) {
  592. // console.log(res);
  593. // $scope.callAll=res.workCallProportion.sum
  594. // })
  595. // }
  596. // getCallPitAllData({
  597. // "start":yesterDay,
  598. // "end":moment(new Date().getTime()+86400000).format("YYYY-MM-DD")
  599. // })
  600. // $interval(function(){
  601. // getCallPitAllData({
  602. // "start":yesterDay,
  603. // "end":moment(new Date().getTime()+86400000).format("YYYY-MM-DD")
  604. // })
  605. // },30000)
  606. // 结束
  607. // 微信报修总数
  608. // 开始
  609. $scope.wxAll = 0;
  610. function getWxPitAllData(time) {
  611. api_hkreport.incidentreport(time, 'large_screen_wx_incident_sum').then(function (res) {
  612. console.log(res);
  613. $scope.wxAll = res.data[0].sum
  614. // $scope.callAll=res.workCallProportion.sum
  615. })
  616. }
  617. getWxPitAllData({
  618. "start": yesterDay + " 00:00:00",
  619. // "start": "2018-05-28 00:00:00",
  620. "end": yesterDay + " 23:59:59"
  621. })
  622. // 结束
  623. // 获取微信报修趋势图数据
  624. // 开始
  625. function getWechatPitData(time) {
  626. api_hkreport.incidentreport(time, 'large_screen_wx_incident_trend').then(function (res) {
  627. var timeArr = [];
  628. var time = [];
  629. var value = [];
  630. var time = res.date;
  631. for (var i = 0; i < time.length; i++) {
  632. timeArr.push(time[i].substring(time[i].length - 2, time[i].length) + ":00");
  633. }
  634. value = res.value;
  635. option_baoxiuqushitu.xAxis[0].data = timeArr;
  636. option_baoxiuqushitu.series[0].data = value;
  637. option_baoxiuqushitu.series[1].data = value;
  638. myChart_baoxiuqushitu.setOption(option_baoxiuqushitu);
  639. })
  640. }
  641. getWechatPitData({
  642. "start": yesterDay + " 08:00:00",
  643. // "start": "2018-05-28 00:00:00",
  644. "end": yesterDay + " 18:00:00"
  645. });
  646. // 结束
  647. // 获取事件工单处理实时情况数据
  648. // 开始
  649. $scope.incidentHandleList1 = [];
  650. // $scope.incidentHandleList2 = [];
  651. function getIncidentHandleData(time, inter) {
  652. api_hkreport.incidentreport(time, 'large_screen_incident_rt_status').then(function (res) {
  653. $scope.incidentHandleList1 = res.data;
  654. setTimeout(() => {
  655. $scope.slides('body', 'box', 'box1', 'list1', 5, inter);
  656. }, 1000);
  657. // if (res.data.length > 14) {
  658. // $scope.incidentHandleList2 = res.data.slice(8, 15);
  659. // } else {
  660. // $scope.incidentHandleList1 = res.data;
  661. // $scope.incidentHandleList2 = res.data;
  662. // }
  663. })
  664. }
  665. getIncidentHandleData({}, 1)
  666. // 结束
  667. // 获取微信报修详情列表数据
  668. // 开始
  669. $scope.weChatList1 = [];
  670. // $scope.weChatList2 = [];
  671. function getWeChatData(time, inter) {
  672. api_hkreport.incidentreport(time, 'large_screen_wx_incident_details').then(function (res) {
  673. var str = []
  674. for (var i = 0; i < res.data.length; i++) {
  675. if (res.data[i].name != '咨询' && res.data[i].name != '管理员' && res.data[i].name != '' && res.data[i].name != null) {
  676. str.push(res.data[i]);
  677. }
  678. }
  679. $scope.weChatList1 = str;
  680. // console.log($scope.weChatList1)
  681. setTimeout(() => {
  682. $scope.slides('body', 'box2', 'box3', 'list2', 5, inter);
  683. }, 1000);
  684. // console.log(res);
  685. // for (var i = 0; i < res.data.length; i++) {
  686. // if (res.data[i].name == "咨询") {
  687. // // delete res.data[i]
  688. // res.data.splice(i, 1)
  689. // }
  690. // }
  691. // if (res.data.length > 14) {
  692. // $scope.weChatList1 = res.data.slice(0, 7);
  693. // $scope.weChatList2 = res.data.slice(8, 15);
  694. // } else {
  695. // $scope.weChatList2 = res.data;
  696. // }
  697. })
  698. }
  699. getWeChatData({}, 1)
  700. // 结束
  701. // 获取处理地点列表数据
  702. // 开始
  703. $scope.placeList = [];
  704. function getPlaceListData(time, inter) {
  705. api_hkreport.incidentreport(time, 'large_screen_incident_area').then(function (res) {
  706. console.log(res);
  707. // res.data=[
  708. // {"area":"主校区","statusid":4,"priority":"重大"},
  709. // {"area":"主校区","statusid":4,"priority":"普通"},
  710. // {"area":"主校区","statusid":4,"priority":"普通"},
  711. // {"area":"同济校区","statusid":4,"priority":"重大"},
  712. // {"area":"同济校区","statusid":4,"priority":"普通"},
  713. // ]
  714. // $("#box5").html('');
  715. $scope.placeList = res.data;
  716. var shijian_index = 0;
  717. $(".map_list_body_poi:eq(0)").scrollTop(0);
  718. $scope.tongjixiaoquSum = 0;
  719. $scope.tongjixiaoqu_zhongdaSum = 0;
  720. $scope.tongjixiaoqu_gaoSum = 0;
  721. $scope.tongjixiaoqu_jiaogaoSum = 0;
  722. $scope.tongjixiaoqu_putongSum = 0;
  723. $scope.zhuxiaoquSum = 0;
  724. $scope.zhuxiaoqu_zhongdaSum = 0;
  725. $scope.zhuxiaoqu_gaoSum = 0;
  726. $scope.zhuxiaoqu_jiaogaoSum = 0;
  727. $scope.zhuxiaoqu_putongSum = 0;
  728. $scope.dongxiaoquSum = 0;
  729. $scope.dongxiaoqu_zhongdaSum = 0;
  730. $scope.dongxiaoqu_gaoSum = 0;
  731. $scope.dongxiaoqu_jiaogaoSum = 0;
  732. $scope.dongxiaoqu_putongSum = 0;
  733. $scope.tongjixiaoqu_chuliguo = 0;
  734. $scope.zhuxiaoqu_chuliguo = 0;
  735. $scope.dongxiaoqu_chuliguo = 0;
  736. for (var i = 0; i < res.data.length; i++) {
  737. if (res.data[i].area == "主校区" && res.data[i].statusid == 4 || res.data[i].statusid == 2) {
  738. $scope.zhuxiaoquSum++
  739. if (res.data[i].priority == "重大") {
  740. $scope.zhuxiaoqu_zhongdaSum++
  741. } else if (res.data[i].priority == "高") {
  742. $scope.zhuxiaoqu_gaoSum++
  743. } else if (res.data[i].priority == "较高") {
  744. $scope.zhuxiaoqu_jiaogaoSum++
  745. } else {
  746. $scope.zhuxiaoqu_putongSum++
  747. }
  748. } else if (res.data[i].area == "同济校区" && res.data[i].statusid == 4 || res.data[i].statusid == 2) {
  749. $scope.tongjixiaoquSum++
  750. if (res.data[i].priority == "重大") {
  751. $scope.tongjixiaoqu_zhongdaSum++
  752. } else if (res.data[i].priority == "高") {
  753. $scope.tongjixiaoqu_gaoSum++
  754. } else if (res.data[i].priority == "较高") {
  755. $scope.tongjixiaoqu_jiaogaoSum++
  756. } else {
  757. $scope.tongjixiaoqu_putongSum++
  758. }
  759. } else if (res.data[i].area == "东校区" && res.data[i].statusid == 4 || res.data[i].statusid == 2) {
  760. $scope.dongxiaoquSum++
  761. if (res.data[i].priority == "重大") {
  762. $scope.dongxiaoqu_zhongdaSum++
  763. } else if (res.data[i].priority == "高") {
  764. $scope.dongxiaoqu_gaoSum++
  765. } else if (res.data[i].priority == "较高") {
  766. $scope.dongxiaoqu_jiaogaoSum++
  767. } else {
  768. $scope.dongxiaoqu_putongSum++
  769. }
  770. }
  771. }
  772. for (var i = 0; i < res.data.length; i++) {
  773. if (res.data[i].statusid != 4 && res.data[i].statusid != 2) {
  774. if (res.data[i].area == "主校区") {
  775. $scope.zhuxiaoqu_chuliguo++;
  776. $scope.zhuxiaoquSum++;
  777. $scope.zhuxiaoqu_zhongdaSum++
  778. } else if (res.data[i].area == "同济校区") {
  779. $scope.tongjixiaoqu_chuliguo++;
  780. $scope.tongjixiaoquSum++;
  781. $scope.tongjixiaoqu_zhongdaSum++
  782. } else if (res.data[i].area == "东校区") {
  783. $scope.dongxiaoqu_chuliguo++;
  784. $scope.dongxiaoquSum++;
  785. $scope.dongxiaoqu_zhongdaSum++
  786. }
  787. }
  788. }
  789. setTimeout(() => {
  790. $scope.slides('body1', 'box4', 'box5', 'list3', 3, inter);
  791. }, 1000);
  792. // console.log("zhongda " + $scope.zhuxiaoqu_zhongdaSum + "; putong" + $scope.zhuxiaoquSum);
  793. // if (res.data.length > 5) {
  794. // $scope.listTimerFn = function () {
  795. // $scope.listTimer = $interval(function timer() {
  796. // $(".map_list_body_poi:eq(0)").scrollTop(shijian_index);
  797. // if (shijian_index - 2 > $(".map_list_body_poi:eq(0)").scrollTop()) {
  798. // $interval.cancel($scope.listTimer);
  799. // $timeout(function () {
  800. // $scope.listTimerFn();
  801. // $(".map_list_body_poi:eq(0)").scrollTop(0);
  802. // shijian_index = 0;
  803. // }, 5000)
  804. // };
  805. // shijian_index++;
  806. // }, 240)
  807. // }
  808. // $scope.listTimerFn()
  809. // }
  810. })
  811. }
  812. getPlaceListData({
  813. "start": yesterDay + " 00:00:00",
  814. // "start": "2018-05-28 00:00:00",
  815. "end": yesterDay + " 23:59:59"
  816. // "start":"2019-04-17 23:59:59",
  817. }, 1)
  818. // 结束
  819. // 获取近一年区域地点事件发生详情列表数据
  820. // 开始
  821. // 热力图
  822. {
  823. // 热力图
  824. // $scope.heatMaps = function (boxId, list) {
  825. // var heatmapInstance = h337.create({
  826. // container: document.getElementById(boxId),
  827. // radius: 40,
  828. // maxOpacity: .7,
  829. // gradient: {
  830. // '.3': 'rgba(115,255,155,.5)',//白
  831. // '.7': 'rgba(238,239,11,.4)',//黄
  832. // '.9': 'rgba(208,64,47,.1)',//红
  833. // }
  834. // });
  835. // var dataPoints = [{
  836. // x: 0,
  837. // y: 0,
  838. // // radius: 40,
  839. // value: 160
  840. // }, {
  841. // x: 0,
  842. // y: 0,
  843. // // radius: 40,
  844. // value: 180
  845. // }];
  846. // for (var i = 0; i < list.length; i++) {
  847. // if (list[i].coordinates) {
  848. // var point = list[i].coordinates.split(',');
  849. // heatmapInstance.addData([{
  850. // x: point[0] / 2 + 10,
  851. // y: point[1] / 2 + 10,
  852. // // radius: 40,
  853. // value: list[i].proportion
  854. // }, {
  855. // x: point[0] / 2 + 10,
  856. // y: point[1] / 2 + 10,
  857. // // radius: 40,
  858. // value: list[i].proportion
  859. // }]);
  860. // }
  861. // }
  862. // }
  863. }
  864. // 一年热力图&表格数据
  865. $scope.areaList = [];
  866. function getAreaListData(time, inter) {
  867. api_hkreport.incidentreport(time, 'large_screen_areaplace_incident_details').then(function (res) {
  868. console.log(res);
  869. $scope.areaList = res.data;
  870. setTimeout(() => {
  871. $scope.slides('body1', 'box6', 'box7', 'list4', 3, inter);
  872. // $scope.heatMaps('container', $scope.areaList)
  873. }, 1000);
  874. })
  875. }
  876. getAreaListData({
  877. sum: 100,
  878. "start": lastYear + " 00:00:00",
  879. "end": yesterDay + " 23:59:59"
  880. // "start":"2019-04-17 23:59:59",
  881. }, 1)
  882. // 一个月热力图
  883. $scope.areaMonthList = [];
  884. function getAreaMonthListData(time, inter) {
  885. api_hkreport.incidentreport(time, 'large_screen_areaplace_incident_details').then(function (res) {
  886. console.log(res);
  887. $scope.areaMonthList = res.data;
  888. setTimeout(() => {
  889. $scope.slides('body1', 'box8', 'box9', 'list5', 3, inter);
  890. // $scope.heatMaps('containerMonth', $scope.areaMonthList)
  891. }, 1000);
  892. })
  893. }
  894. getAreaMonthListData({
  895. sum: 100,
  896. "start": lastMonth + " 00:00:00",
  897. "end": yesterDay + " 23:59:59"
  898. // "start":"2019-04-17 23:59:59",
  899. }, 1)
  900. // 结束
  901. // 地图事件位置&数量
  902. // $scope.dayMapDataList = []; //当天
  903. $scope.monthMapDataList = []; //当月
  904. $scope.yearMapDataList = []; //当年
  905. // function getMapData(time) {
  906. // api_hkreport.incidentreport(time, 'large_screen_map_data').then(function (res) {
  907. // $scope.dayMapDataList = res.data;
  908. // })
  909. // }
  910. function getMonthMapData(time) {
  911. api_hkreport.incidentreport(time, 'large_screen_map_data').then(function (res) {
  912. $scope.monthMapDataList = res.data;
  913. })
  914. }
  915. function getYearMapData(time) {
  916. api_hkreport.incidentreport(time, 'large_screen_map_data').then(function (res) {
  917. $scope.yearMapDataList = res.data;
  918. })
  919. }
  920. // getMapData({
  921. // sum: 100,
  922. // "start": yesterDay + " 00:00:00",
  923. // "end": yesterDay + " 23:59:59"
  924. // })
  925. getMonthMapData({
  926. sum: 10,
  927. "start": lastMonth + " 00:00:00",
  928. "end": yesterDay + " 23:59:59"
  929. })
  930. getYearMapData({
  931. sum: 20,
  932. "start": lastYear + " 00:00:00",
  933. "end": yesterDay + " 23:59:59"
  934. })
  935. // 事件工单列表状态颜色
  936. $scope.statusColor = function (res) {
  937. if (res == "接单") {
  938. return "jiedai"
  939. } else if (res == "事件处理") {
  940. return "chulizhong"
  941. } else if (res == "事件关闭") {
  942. return "guanbi"
  943. } else {
  944. return "qita"
  945. }
  946. }
  947. // 事件工单处理实时情况状态转换
  948. $scope.incident_status = function (res) {
  949. if (res == "事件处理") {
  950. return "处理中"
  951. } else if (res == "事件关闭") {
  952. return "已办结"
  953. } else {
  954. return res
  955. }
  956. }
  957. // 列表前点颜色
  958. $scope.liebiao_zhuangtai = function (status, priority) {
  959. if (status == 4 || status == 2) {
  960. if (priority == "重大") {
  961. return "zhongda"
  962. } else {
  963. return ""
  964. }
  965. } else {
  966. return "chuliguo"
  967. }
  968. }
  969. // 来电趋势/微信报修趋势...(页面数据轮播)
  970. $scope.slideBoxLeft = 0;
  971. $scope.slideBoxLeft1 = 0;
  972. function move1() {
  973. if ($scope.slideBoxLeft == 0) {
  974. $scope.slideBoxLeft = '-100%';
  975. } else {
  976. $scope.slideBoxLeft = 0;
  977. }
  978. if ($scope.slideBoxLeft1 == 0) {
  979. $scope.slideBoxLeft1 = '-100%';
  980. } else if ($scope.slideBoxLeft1 == '-100%') {
  981. $scope.slideBoxLeft1 = '-200%';
  982. } else {
  983. $scope.slideBoxLeft1 = 0;
  984. }
  985. }
  986. // 列表滚动
  987. // a:table body 的class名;b:滚动父盒子的id名;c:滚动盒子的id名;d:滚动项的class名;e:每页展示的条数;f:interval定时器开启1/关闭0
  988. $scope.slides = function (a, b, c, d, e, f) {
  989. var speed = 45; //设置向上轮动的速度
  990. var list = $('.' + d).clone();
  991. if (list.length >= e) {
  992. var body1 = $('.' + a)[0];
  993. var box = $("#" + b);
  994. if (f) {
  995. $("#" + c).append(list.splice(0, e))
  996. }
  997. var top = 0;
  998. function moveTop() {
  999. if (top <= body1.offsetHeight - box[0].offsetHeight) {
  1000. top = 0;
  1001. } else {
  1002. top--;
  1003. }
  1004. box.css({
  1005. 'top': top + 'px'
  1006. })
  1007. }
  1008. var interval = setInterval(() => {
  1009. moveTop()
  1010. }, 50);
  1011. if (!f) {
  1012. clearInterval(interval)
  1013. }
  1014. }
  1015. }
  1016. // 区域地点实时动态图标点
  1017. $scope.pointPosition = function (point, statusid) {
  1018. var style = {};
  1019. if (point) {
  1020. var arr = point.split(',');
  1021. style.left = arr[0] / 2 + 10 + 'px';
  1022. style.top = arr[1] / 2 - 10 + 'px';
  1023. } else {
  1024. // 南1楼 - 南8楼
  1025. style.left = 800 / 2 + 10 + 'px';
  1026. style.top = 800 / 2 - 10 + 'px';
  1027. }
  1028. return style;
  1029. }
  1030. // 地图上的提示框闪烁
  1031. var a = 0;
  1032. function flicker(className) {
  1033. setInterval(() => {
  1034. a++
  1035. $(className).hide()
  1036. $($(className)[a]).show();
  1037. if (a >= $(className).length - 1) {
  1038. a = 0;
  1039. }
  1040. }, 1500);
  1041. }
  1042. // flicker('.dataHaoRooms')
  1043. // flicker('.dataHaoRooms1')
  1044. // flicker('.dataHaoRooms2')
  1045. // 定时刷新
  1046. function getDataInter(time) {
  1047. $interval(function () {
  1048. $interval.cancel($scope.listTimer);
  1049. getIncidentHandleData({}, 0);
  1050. getWeChatData({}, 0);
  1051. getPlaceListData({
  1052. "start": yesterDay + " 00:00:00",
  1053. // "start": "2018-05-28 00:00:00",
  1054. "end": yesterDay + " 23:59:59"
  1055. }, 0)
  1056. getIncident_allData({});
  1057. getIncident_responseData({});
  1058. getIncident_solveNowData({})
  1059. getIncident_solvedData({})
  1060. getYear_incident_total({
  1061. "start": lastYear + " 00:00:00",
  1062. "end": yesterDay + " 23:59:59"
  1063. })
  1064. getYear_incident_total_month({
  1065. "start": lastMonth + " 00:00:00",
  1066. "end": yesterDay + " 23:59:59"
  1067. })
  1068. getIncident_solve_time({
  1069. "start": lastYear + " 00:00:00",
  1070. "end": yesterDay + " 23:59:59"
  1071. })
  1072. getIncident_solve_time_month({
  1073. "start": lastMonth + " 00:00:00",
  1074. "end": yesterDay + " 23:59:59"
  1075. })
  1076. getIncident_solve_total({
  1077. "start": lastYear + " 00:00:00",
  1078. "end": yesterDay + " 23:59:59"
  1079. })
  1080. getIncident_solve_total_month({
  1081. "start": lastMonth + " 00:00:00",
  1082. "end": yesterDay + " 23:59:59"
  1083. })
  1084. getIncident_degree({
  1085. "start": lastYear + " 00:00:00",
  1086. "end": yesterDay + " 23:59:59"
  1087. })
  1088. getIncident_degree_month({
  1089. "start": lastMonth + " 00:00:00",
  1090. "end": yesterDay + " 23:59:59"
  1091. })
  1092. getCallPitData({
  1093. "start": yesterDay + " 08",
  1094. // "start": "2018-05-28 00",
  1095. "end": yesterDay + " 18"
  1096. });
  1097. getWxPitAllData({
  1098. "start": yesterDay + " 00:00:00",
  1099. // "start": "2018-05-28 00:00:00",
  1100. "end": yesterDay + " 23:59:59"
  1101. })
  1102. getWechatPitData({
  1103. "start": yesterDay + " 08:00:00",
  1104. // "start": "2018-05-28 00:00:00",
  1105. "end": yesterDay + " 18:00:00"
  1106. });
  1107. getMonthMapData({
  1108. sum: 10,
  1109. "start": lastMonth + " 00:00:00",
  1110. "end": yesterDay + " 23:59:59"
  1111. })
  1112. getYearMapData({
  1113. sum: 20,
  1114. "start": lastYear + " 00:00:00",
  1115. "end": yesterDay + " 23:59:59"
  1116. })
  1117. }, time)
  1118. }
  1119. getDataInter(300000) //5分钟
  1120. // 切屏
  1121. setInterval(() => {
  1122. move1()
  1123. }, 5000); //5秒
  1124. }]);