charts3.js 53 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541
  1. 'use strict';
  2. 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) {
  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. $scope.incident_responseData = "";
  423. function getIncident_responseData(time) {
  424. api_hkreport.incidentreport(time, 'large_screen_incident_pending_total').then(function (res) {
  425. console.log(res);
  426. $scope.incident_responseData = res.data[0].sum
  427. })
  428. }
  429. getIncident_responseData({})
  430. // 结束
  431. // 获取解决中数据
  432. // 开始
  433. $scope.incident_solveNowData = "";
  434. function getIncident_solveNowData(time) {
  435. api_hkreport.incidentreport(time, 'large_screen_incident_handler_total').then(function (res) {
  436. console.log(res);
  437. $scope.incident_solveNowData = res.data[0].sum
  438. })
  439. }
  440. getIncident_solveNowData({})
  441. // // 结束
  442. // // 获取已解决数据
  443. // // 开始
  444. $scope.incident_solvedData = "";
  445. function getIncident_solvedData(time) {
  446. api_hkreport.incidentreport(time, 'large_screen_incident_resolved_total').then(function (res) {
  447. $scope.incident_solvedData = res.data[0].sum
  448. })
  449. }
  450. getIncident_solvedData({})
  451. // 结束
  452. // // 获取近一年建单总数数据
  453. // // 开始
  454. $scope.incident_total_year = "";
  455. function getYear_incident_total(time) {
  456. api_hkreport.incidentreport(time, 'large_screen_year_incident_total').then(function (res) {
  457. $scope.incident_total_year = res.data[0].sum
  458. })
  459. }
  460. getYear_incident_total({
  461. "start": lastYear + " 00:00:00",
  462. "end": yesterDay + " 23:59:59"
  463. })
  464. // 结束
  465. // // 获取近一个月建单总数数据
  466. // // 开始
  467. $scope.incident_total = "";
  468. function getYear_incident_total_month(time) {
  469. api_hkreport.incidentreport(time, 'large_screen_year_incident_total').then(function (res) {
  470. $scope.incident_total = res.data[0].sum
  471. })
  472. }
  473. getYear_incident_total_month({
  474. "start": lastMonth + " 00:00:00",
  475. "end": yesterDay + " 23:59:59"
  476. })
  477. // 结束
  478. // // 获取近一年事件解决总时长数据
  479. // // 开始
  480. $scope.incident_solve_time = "";
  481. function getIncident_solve_time(time) {
  482. api_hkreport.incidentreport(time, 'large_screen_year_incident_solve_time').then(function (res) {
  483. $scope.incident_solve_time = res.data[0].hour || 0
  484. })
  485. }
  486. getIncident_solve_time({
  487. "start": lastYear + " 00:00:00",
  488. "end": yesterDay + " 23:59:59"
  489. })
  490. // 结束
  491. // // 获取近一个月事件解决总时长数据
  492. // // 开始
  493. $scope.incident_solve_time = "";
  494. function getIncident_solve_time_month(time) {
  495. api_hkreport.incidentreport(time, 'large_screen_year_incident_solve_time').then(function (res) {
  496. $scope.incident_solve_time = res.data[0].hour || 0
  497. })
  498. }
  499. getIncident_solve_time_month({
  500. "start": lastMonth + " 00:00:00",
  501. "end": yesterDay + " 23:59:59"
  502. })
  503. // 结束
  504. // // 获取近一年已解决工单数据
  505. // // 开始
  506. $scope.incident_solve_total = "";
  507. function getIncident_solve_total(time) {
  508. api_hkreport.incidentreport(time, 'large_screen_year_incident_solve_total').then(function (res) {
  509. $scope.incident_solve_total = res.data[0].sum
  510. })
  511. }
  512. getIncident_solve_total({
  513. "start": lastYear + " 00:00:00",
  514. "end": yesterDay + " 23:59:59"
  515. })
  516. // 结束
  517. // // 获取近一个月已解决工单数据
  518. // // 开始
  519. $scope.incident_solve_total = "";
  520. function getIncident_solve_total_month(time) {
  521. api_hkreport.incidentreport(time, 'large_screen_year_incident_solve_total').then(function (res) {
  522. $scope.incident_solve_total = res.data[0].sum
  523. })
  524. }
  525. getIncident_solve_total_month({
  526. "start": lastMonth + " 00:00:00",
  527. "end": yesterDay + " 23:59:59"
  528. })
  529. // 结束
  530. // // 获取近一年满意度数据
  531. // // 开始
  532. $scope.incident_degree = "";
  533. function getIncident_degree(time) {
  534. api_hkreport.incidentreport(time, 'large_screen_year_incident_degree').then(function (res) {
  535. $scope.incident_degree = res.data[0].degree || 0
  536. })
  537. }
  538. getIncident_degree({
  539. "start": lastYear + " 00:00:00",
  540. "end": yesterDay + " 23:59:59"
  541. })
  542. // 结束
  543. // // 获取近一个月满意度数据
  544. // // 开始
  545. $scope.incident_degree = "";
  546. function getIncident_degree_month(time) {
  547. api_hkreport.incidentreport(time, 'large_screen_year_incident_degree').then(function (res) {
  548. $scope.incident_degree = res.data[0].degree || 0
  549. })
  550. }
  551. getIncident_degree_month({
  552. "start": lastMonth + " 00:00:00",
  553. "end": yesterDay + " 23:59:59"
  554. })
  555. // 结束
  556. // 获取呼叫中心来电趋势图数据
  557. // 开始
  558. function getCallPitData(time) {
  559. api_hkreport.incidentreport(time, 'large_screen_call_trend').then(function (res) {
  560. var timeArr = [];
  561. var time = [];
  562. var value = [];
  563. var time = res.date;
  564. $scope.allIncidentreport = 0;
  565. for (var i = 0; i < res.value.length; i++) {
  566. $scope.allIncidentreport = $scope.allIncidentreport + Number(res.value[i])
  567. }
  568. for (var i = 0; i < time.length; i++) {
  569. timeArr.push(time[i].substring(time[i].length - 2, time[i].length) + ":00");
  570. }
  571. value = res.value;
  572. option_laidianqushitu.xAxis[0].data = timeArr;
  573. option_laidianqushitu.series[0].data = value;
  574. option_laidianqushitu.series[1].data = value;
  575. myChart_laidianqushitu.setOption(option_laidianqushitu);
  576. // $scope.incident_solveData=res.data[0].sum
  577. })
  578. }
  579. getCallPitData({
  580. "start": yesterDay + " 08",
  581. // "start": "2018-05-28 00",
  582. "end": yesterDay + " 18"
  583. });
  584. // 结束
  585. // 呼叫中心来电总数
  586. // 开始
  587. // $scope.callAll=0;
  588. // function getCallPitAllData(time){
  589. // api_hkreport.incidentreport(time, 'service_counter').then(function(res) {
  590. // console.log(res);
  591. // $scope.callAll=res.workCallProportion.sum
  592. // })
  593. // }
  594. // getCallPitAllData({
  595. // "start":yesterDay,
  596. // "end":moment(new Date().getTime()+86400000).format("YYYY-MM-DD")
  597. // })
  598. // $interval(function(){
  599. // getCallPitAllData({
  600. // "start":yesterDay,
  601. // "end":moment(new Date().getTime()+86400000).format("YYYY-MM-DD")
  602. // })
  603. // },30000)
  604. // 结束
  605. // 微信报修总数
  606. // 开始
  607. $scope.wxAll = 0;
  608. function getWxPitAllData(time) {
  609. api_hkreport.incidentreport(time, 'large_screen_wx_incident_sum').then(function (res) {
  610. console.log(res);
  611. $scope.wxAll = res.data[0].sum
  612. // $scope.callAll=res.workCallProportion.sum
  613. })
  614. }
  615. getWxPitAllData({
  616. "start": yesterDay + " 00:00:00",
  617. // "start": "2018-05-28 00:00:00",
  618. "end": yesterDay + " 23:59:59"
  619. })
  620. // 结束
  621. // 获取微信报修趋势图数据
  622. // 开始
  623. function getWechatPitData(time) {
  624. api_hkreport.incidentreport(time, 'large_screen_wx_incident_trend').then(function (res) {
  625. var timeArr = [];
  626. var time = [];
  627. var value = [];
  628. var time = res.date;
  629. for (var i = 0; i < time.length; i++) {
  630. timeArr.push(time[i].substring(time[i].length - 2, time[i].length) + ":00");
  631. }
  632. value = res.value;
  633. option_baoxiuqushitu.xAxis[0].data = timeArr;
  634. option_baoxiuqushitu.series[0].data = value;
  635. option_baoxiuqushitu.series[1].data = value;
  636. myChart_baoxiuqushitu.setOption(option_baoxiuqushitu);
  637. })
  638. }
  639. getWechatPitData({
  640. "start": yesterDay + " 08:00:00",
  641. // "start": "2018-05-28 00:00:00",
  642. "end": yesterDay + " 18:00:00"
  643. });
  644. // 结束
  645. // 获取事件工单处理实时情况数据
  646. // 开始
  647. $scope.incidentHandleList1 = [];
  648. // $scope.incidentHandleList2 = [];
  649. function getIncidentHandleData(time, inter) {
  650. api_hkreport.incidentreport(time, 'large_screen_incident_rt_status').then(function (res) {
  651. $scope.incidentHandleList1 = res.data;
  652. setTimeout(() => {
  653. $scope.slides('body', 'box', 'box1', 'list1', 5, inter);
  654. }, 1000);
  655. // if (res.data.length > 14) {
  656. // $scope.incidentHandleList2 = res.data.slice(8, 15);
  657. // } else {
  658. // $scope.incidentHandleList1 = res.data;
  659. // $scope.incidentHandleList2 = res.data;
  660. // }
  661. })
  662. }
  663. getIncidentHandleData({}, 1)
  664. // 结束
  665. // 获取微信报修详情列表数据
  666. // 开始
  667. $scope.weChatList1 = [];
  668. // $scope.weChatList2 = [];
  669. function getWeChatData(time, inter) {
  670. api_hkreport.incidentreport(time, 'large_screen_wx_incident_details').then(function (res) {
  671. var str = []
  672. for (var i = 0; i < res.data.length; i++) {
  673. if (res.data[i].name != '咨询' && res.data[i].name != '管理员' && res.data[i].name != '' && res.data[i].name != null) {
  674. str.push(res.data[i]);
  675. }
  676. }
  677. $scope.weChatList1 = str;
  678. // console.log($scope.weChatList1)
  679. setTimeout(() => {
  680. $scope.slides('body', 'box2', 'box3', 'list2', 5, inter);
  681. }, 1000);
  682. // console.log(res);
  683. // for (var i = 0; i < res.data.length; i++) {
  684. // if (res.data[i].name == "咨询") {
  685. // // delete res.data[i]
  686. // res.data.splice(i, 1)
  687. // }
  688. // }
  689. // if (res.data.length > 14) {
  690. // $scope.weChatList1 = res.data.slice(0, 7);
  691. // $scope.weChatList2 = res.data.slice(8, 15);
  692. // } else {
  693. // $scope.weChatList2 = res.data;
  694. // }
  695. })
  696. }
  697. getWeChatData({}, 1)
  698. // 结束
  699. // 获取处理地点列表数据
  700. // 开始
  701. $scope.placeList = [];
  702. function getPlaceListData(time, inter) {
  703. api_hkreport.incidentreport(time, 'large_screen_incident_area').then(function (res) {
  704. console.log(res);
  705. // res.data=[
  706. // {"area":"主校区","statusid":4,"priority":"重大"},
  707. // {"area":"主校区","statusid":4,"priority":"普通"},
  708. // {"area":"主校区","statusid":4,"priority":"普通"},
  709. // {"area":"同济校区","statusid":4,"priority":"重大"},
  710. // {"area":"同济校区","statusid":4,"priority":"普通"},
  711. // ]
  712. // $("#box5").html('');
  713. $scope.placeList = res.data;
  714. var shijian_index = 0;
  715. $(".map_list_body_poi:eq(0)").scrollTop(0);
  716. $scope.tongjixiaoquSum = 0;
  717. $scope.tongjixiaoqu_zhongdaSum = 0;
  718. $scope.tongjixiaoqu_gaoSum = 0;
  719. $scope.tongjixiaoqu_jiaogaoSum = 0;
  720. $scope.tongjixiaoqu_putongSum = 0;
  721. $scope.zhuxiaoquSum = 0;
  722. $scope.zhuxiaoqu_zhongdaSum = 0;
  723. $scope.zhuxiaoqu_gaoSum = 0;
  724. $scope.zhuxiaoqu_jiaogaoSum = 0;
  725. $scope.zhuxiaoqu_putongSum = 0;
  726. $scope.dongxiaoquSum = 0;
  727. $scope.dongxiaoqu_zhongdaSum = 0;
  728. $scope.dongxiaoqu_gaoSum = 0;
  729. $scope.dongxiaoqu_jiaogaoSum = 0;
  730. $scope.dongxiaoqu_putongSum = 0;
  731. $scope.tongjixiaoqu_chuliguo = 0;
  732. $scope.zhuxiaoqu_chuliguo = 0;
  733. $scope.dongxiaoqu_chuliguo = 0;
  734. for (var i = 0; i < res.data.length; i++) {
  735. if (res.data[i].area == "主校区" && res.data[i].statusid == 4 || res.data[i].statusid == 2) {
  736. $scope.zhuxiaoquSum++
  737. if (res.data[i].priority == "重大") {
  738. $scope.zhuxiaoqu_zhongdaSum++
  739. } else if (res.data[i].priority == "高") {
  740. $scope.zhuxiaoqu_gaoSum++
  741. } else if (res.data[i].priority == "较高") {
  742. $scope.zhuxiaoqu_jiaogaoSum++
  743. } else {
  744. $scope.zhuxiaoqu_putongSum++
  745. }
  746. } else if (res.data[i].area == "同济校区" && res.data[i].statusid == 4 || res.data[i].statusid == 2) {
  747. $scope.tongjixiaoquSum++
  748. if (res.data[i].priority == "重大") {
  749. $scope.tongjixiaoqu_zhongdaSum++
  750. } else if (res.data[i].priority == "高") {
  751. $scope.tongjixiaoqu_gaoSum++
  752. } else if (res.data[i].priority == "较高") {
  753. $scope.tongjixiaoqu_jiaogaoSum++
  754. } else {
  755. $scope.tongjixiaoqu_putongSum++
  756. }
  757. } else if (res.data[i].area == "东校区" && res.data[i].statusid == 4 || res.data[i].statusid == 2) {
  758. $scope.dongxiaoquSum++
  759. if (res.data[i].priority == "重大") {
  760. $scope.dongxiaoqu_zhongdaSum++
  761. } else if (res.data[i].priority == "高") {
  762. $scope.dongxiaoqu_gaoSum++
  763. } else if (res.data[i].priority == "较高") {
  764. $scope.dongxiaoqu_jiaogaoSum++
  765. } else {
  766. $scope.dongxiaoqu_putongSum++
  767. }
  768. }
  769. }
  770. for (var i = 0; i < res.data.length; i++) {
  771. if (res.data[i].statusid != 4 && res.data[i].statusid != 2) {
  772. if (res.data[i].area == "主校区") {
  773. $scope.zhuxiaoqu_chuliguo++;
  774. $scope.zhuxiaoquSum++;
  775. $scope.zhuxiaoqu_zhongdaSum++
  776. } else if (res.data[i].area == "同济校区") {
  777. $scope.tongjixiaoqu_chuliguo++;
  778. $scope.tongjixiaoquSum++;
  779. $scope.tongjixiaoqu_zhongdaSum++
  780. } else if (res.data[i].area == "东校区") {
  781. $scope.dongxiaoqu_chuliguo++;
  782. $scope.dongxiaoquSum++;
  783. $scope.dongxiaoqu_zhongdaSum++
  784. }
  785. }
  786. }
  787. setTimeout(() => {
  788. $scope.slides('body1', 'box4', 'box5', 'list3', 3, inter);
  789. }, 1000);
  790. // console.log("zhongda " + $scope.zhuxiaoqu_zhongdaSum + "; putong" + $scope.zhuxiaoquSum);
  791. // if (res.data.length > 5) {
  792. // $scope.listTimerFn = function () {
  793. // $scope.listTimer = $interval(function timer() {
  794. // $(".map_list_body_poi:eq(0)").scrollTop(shijian_index);
  795. // if (shijian_index - 2 > $(".map_list_body_poi:eq(0)").scrollTop()) {
  796. // $interval.cancel($scope.listTimer);
  797. // $timeout(function () {
  798. // $scope.listTimerFn();
  799. // $(".map_list_body_poi:eq(0)").scrollTop(0);
  800. // shijian_index = 0;
  801. // }, 5000)
  802. // };
  803. // shijian_index++;
  804. // }, 240)
  805. // }
  806. // $scope.listTimerFn()
  807. // }
  808. })
  809. }
  810. getPlaceListData({
  811. "start": yesterDay + " 00:00:00",
  812. // "start": "2018-05-28 00:00:00",
  813. "end": yesterDay + " 23:59:59"
  814. // "start":"2019-04-17 23:59:59",
  815. }, 1)
  816. // 结束
  817. // 获取近一年区域地点事件发生详情列表数据
  818. // 开始
  819. // 热力图
  820. {
  821. // 热力图
  822. // $scope.heatMaps = function (boxId, list) {
  823. // var heatmapInstance = h337.create({
  824. // container: document.getElementById(boxId),
  825. // radius: 40,
  826. // maxOpacity: .7,
  827. // gradient: {
  828. // '.3': 'rgba(115,255,155,.5)',//白
  829. // '.7': 'rgba(238,239,11,.4)',//黄
  830. // '.9': 'rgba(208,64,47,.1)',//红
  831. // }
  832. // });
  833. // var dataPoints = [{
  834. // x: 0,
  835. // y: 0,
  836. // // radius: 40,
  837. // value: 160
  838. // }, {
  839. // x: 0,
  840. // y: 0,
  841. // // radius: 40,
  842. // value: 180
  843. // }];
  844. // for (var i = 0; i < list.length; i++) {
  845. // if (list[i].coordinates) {
  846. // var point = list[i].coordinates.split(',');
  847. // heatmapInstance.addData([{
  848. // x: point[0] / 2 + 10,
  849. // y: point[1] / 2 + 10,
  850. // // radius: 40,
  851. // value: list[i].proportion
  852. // }, {
  853. // x: point[0] / 2 + 10,
  854. // y: point[1] / 2 + 10,
  855. // // radius: 40,
  856. // value: list[i].proportion
  857. // }]);
  858. // }
  859. // }
  860. // }
  861. }
  862. // 一年热力图&表格数据
  863. $scope.areaList = [];
  864. function getAreaListData(time, inter) {
  865. api_hkreport.incidentreport(time, 'large_screen_areaplace_incident_details').then(function (res) {
  866. console.log(res);
  867. $scope.areaList = res.data;
  868. setTimeout(() => {
  869. $scope.slides('body1', 'box6', 'box7', 'list4', 3, inter);
  870. // $scope.heatMaps('container', $scope.areaList)
  871. }, 1000);
  872. })
  873. }
  874. getAreaListData({
  875. sum: 100,
  876. "start": lastYear + " 00:00:00",
  877. "end": yesterDay + " 23:59:59"
  878. // "start":"2019-04-17 23:59:59",
  879. }, 1)
  880. // 一个月热力图
  881. $scope.areaMonthList = [];
  882. function getAreaMonthListData(time, inter) {
  883. api_hkreport.incidentreport(time, 'large_screen_areaplace_incident_details').then(function (res) {
  884. $scope.areaMonthList = res.data;
  885. setTimeout(() => {
  886. $scope.slides('body1', 'box8', 'box9', 'list5', 3, inter);
  887. // $scope.heatMaps('containerMonth', $scope.areaMonthList)
  888. }, 1000);
  889. })
  890. }
  891. getAreaMonthListData({
  892. sum: 100,
  893. "start": lastMonth + " 00:00:00",
  894. "end": yesterDay + " 23:59:59"
  895. // "start":"2019-04-17 23:59:59",
  896. }, 1)
  897. // 结束
  898. // 地图事件位置&数量
  899. // $scope.dayMapDataList = []; //当天
  900. $scope.monthMapDataList = []; //当月
  901. $scope.yearMapDataList = []; //当年
  902. // function getMapData(time) {
  903. // api_hkreport.incidentreport(time, 'large_screen_map_data').then(function (res) {
  904. // $scope.dayMapDataList = res.data;
  905. // })
  906. // }
  907. function getMonthMapData(time) {
  908. api_hkreport.incidentreport(time, 'large_screen_map_data').then(function (res) {
  909. $scope.monthMapDataList = res.data;
  910. })
  911. }
  912. function getYearMapData(time) {
  913. api_hkreport.incidentreport(time, 'large_screen_map_data').then(function (res) {
  914. $scope.yearMapDataList = res.data;
  915. })
  916. }
  917. // getMapData({
  918. // sum: 100,
  919. // "start": yesterDay + " 00:00:00",
  920. // "end": yesterDay + " 23:59:59"
  921. // })
  922. getMonthMapData({
  923. sum: 10,
  924. "start": lastMonth + " 00:00:00",
  925. "end": yesterDay + " 23:59:59"
  926. })
  927. getYearMapData({
  928. sum: 20,
  929. "start": lastYear + " 00:00:00",
  930. "end": yesterDay + " 23:59:59"
  931. })
  932. // 事件工单列表状态颜色
  933. $scope.statusColor = function (res) {
  934. if (res == "接单") {
  935. return "jiedai"
  936. } else if (res == "事件处理") {
  937. return "chulizhong"
  938. } else if (res == "事件关闭") {
  939. return "guanbi"
  940. } else {
  941. return "qita"
  942. }
  943. }
  944. // 事件工单处理实时情况状态转换
  945. $scope.incident_status = function (res) {
  946. if (res == "事件处理") {
  947. return "处理中"
  948. } else if (res == "事件关闭") {
  949. return "已办结"
  950. } else {
  951. return res
  952. }
  953. }
  954. // 列表前点颜色
  955. $scope.liebiao_zhuangtai = function (status, priority) {
  956. if (status == 4 || status == 2) {
  957. if (priority == "重大") {
  958. return "zhongda"
  959. } else {
  960. return ""
  961. }
  962. } else {
  963. return "chuliguo"
  964. }
  965. }
  966. // 来电趋势/微信报修趋势...(页面数据轮播)
  967. $scope.slideBoxLeft = 0;
  968. $scope.slideBoxLeft1 = 0;
  969. $scope.slideBoxLeft2 = 0;
  970. $scope.slideBoxLeft3 = 0; //索引
  971. function move1() {
  972. if ($scope.slideBoxLeft == 0) {
  973. $scope.slideBoxLeft = '-100%';
  974. } else {
  975. $scope.slideBoxLeft = 0;
  976. }
  977. if ($scope.slideBoxLeft1 == 0) {
  978. $scope.slideBoxLeft1 = '-100%';
  979. } else if ($scope.slideBoxLeft1 == '-100%') {
  980. $scope.slideBoxLeft1 = '-200%';
  981. } else if ($scope.slideBoxLeft1 == '-200%') {
  982. $scope.slideBoxLeft1 = '-300%';
  983. } else if ($scope.slideBoxLeft1 == '-300%') {
  984. $scope.slideBoxLeft1 = '-400%';
  985. } else if ($scope.slideBoxLeft1 == '-400%') {
  986. $scope.slideBoxLeft1 = '-500%';
  987. } else {
  988. $scope.slideBoxLeft1 = 0;
  989. }
  990. if ($scope.slideBoxLeft2 == 0) {
  991. $scope.slideBoxLeft2 = '-100%';
  992. } else if ($scope.slideBoxLeft2 == '-100%') {
  993. $scope.slideBoxLeft2 = '-200%';
  994. } else {
  995. $scope.slideBoxLeft2 = 0;
  996. }
  997. }
  998. function move2() {
  999. if ($scope.slideBoxLeft3 >= 0) {
  1000. $scope.slideBoxLeft3++;
  1001. if($scope.slideBoxLeft3 == 6){
  1002. $scope.slideBoxLeft3 = 0;
  1003. }
  1004. console.log($scope.slideBoxLeft3, '$scope.slideBoxLeft3')
  1005. // 聚合点信息获取
  1006. $scope.incident_allData = '';
  1007. $scope.incident_responseData = '';
  1008. $scope.incident_solveNowData = '';
  1009. $scope.incident_solvedData = '';
  1010. $scope.incident_total = '';
  1011. $scope.incident_solve_time = '';
  1012. $scope.incident_solve_total = '';
  1013. $scope.incident_degree = '';
  1014. // 实时信息
  1015. if($scope.slideBoxLeft3 == 0 || $scope.slideBoxLeft3 == 3){
  1016. map_time_area({
  1017. "startTime": moment(new Date().getTime()).format("YYYY-MM-DD") + ' 00:00:00',
  1018. "endTime": moment(new Date().getTime()).format("YYYY-MM-DD HH:mm:ss")
  1019. }, $scope.slideBoxLeft3)
  1020. }
  1021. // 30天信息
  1022. if($scope.slideBoxLeft3 == 1 || $scope.slideBoxLeft3 == 4){
  1023. map_time_area({
  1024. "startTime": lastMonth + " 00:00:00",
  1025. "endTime": yesterDay + " 23:59:59"
  1026. }, $scope.slideBoxLeft3)
  1027. }
  1028. // 一年信息
  1029. if($scope.slideBoxLeft3 == 2 || $scope.slideBoxLeft3 == 5){
  1030. map_time_area({
  1031. "startTime": lastYear + " 00:00:00",
  1032. "endTime": yesterDay + " 23:59:59"
  1033. }, $scope.slideBoxLeft3)
  1034. }
  1035. }
  1036. }
  1037. // 列表滚动
  1038. // a:table body 的class名;b:滚动父盒子的id名;c:滚动盒子的id名;d:滚动项的class名;e:每页展示的条数;f:interval定时器开启1/关闭0
  1039. $scope.slides = function (a, b, c, d, e, f) {
  1040. var speed = 45; //设置向上轮动的速度
  1041. var list = $('.' + d).clone();
  1042. if (list.length >= e) {
  1043. var body1 = $('.' + a)[0];
  1044. var box = $("#" + b);
  1045. if (f) {
  1046. $("#" + c).append(list.splice(0, e))
  1047. }
  1048. var top = 0;
  1049. function moveTop() {
  1050. if (top <= body1.offsetHeight - box[0].offsetHeight) {
  1051. top = 0;
  1052. } else {
  1053. top--;
  1054. }
  1055. box.css({
  1056. 'top': top + 'px'
  1057. })
  1058. }
  1059. var interval = setInterval(() => {
  1060. moveTop()
  1061. }, 50);
  1062. if (!f) {
  1063. clearInterval(interval)
  1064. }
  1065. }
  1066. }
  1067. // 区域地点实时动态图标点
  1068. $scope.pointPosition = function (point, statusid) {
  1069. var style = {};
  1070. if (point) {
  1071. var arr = point.split(',');
  1072. style.left = arr[0] / 2 + 10 + 'px';
  1073. style.top = arr[1] / 2 - 10 + 'px';
  1074. } else {
  1075. // 南1楼 - 南8楼
  1076. style.left = 800 / 2 + 10 + 'px';
  1077. style.top = 800 / 2 - 10 + 'px';
  1078. }
  1079. return style;
  1080. }
  1081. // 地图上的提示框闪烁
  1082. var a = 0;
  1083. function flicker(className) {
  1084. setInterval(() => {
  1085. a++
  1086. $(className).hide()
  1087. $($(className)[a]).show();
  1088. if (a >= $(className).length - 1) {
  1089. a = 0;
  1090. }
  1091. }, 1500);
  1092. }
  1093. // flicker('.dataHaoRooms')
  1094. // flicker('.dataHaoRooms1')
  1095. // flicker('.dataHaoRooms2')
  1096. // 定时刷新
  1097. function getDataInter(time) {
  1098. $interval(function () {
  1099. $interval.cancel($scope.listTimer);
  1100. getIncidentHandleData({}, 0);
  1101. getWeChatData({}, 0);
  1102. getPlaceListData({
  1103. "start": yesterDay + " 00:00:00",
  1104. // "start": "2018-05-28 00:00:00",
  1105. "end": yesterDay + " 23:59:59"
  1106. }, 0)
  1107. // getIncident_allData({});
  1108. // getIncident_responseData({});
  1109. // getIncident_solveNowData({})
  1110. // getIncident_solvedData({})
  1111. // getYear_incident_total({
  1112. // "start": lastYear + " 00:00:00",
  1113. // "end": yesterDay + " 23:59:59"
  1114. // })
  1115. // getYear_incident_total_month({
  1116. // "start": lastMonth + " 00:00:00",
  1117. // "end": yesterDay + " 23:59:59"
  1118. // })
  1119. // getIncident_solve_time({
  1120. // "start": lastYear + " 00:00:00",
  1121. // "end": yesterDay + " 23:59:59"
  1122. // })
  1123. // getIncident_solve_time_month({
  1124. // "start": lastMonth + " 00:00:00",
  1125. // "end": yesterDay + " 23:59:59"
  1126. // })
  1127. // getIncident_solve_total({
  1128. // "start": lastYear + " 00:00:00",
  1129. // "end": yesterDay + " 23:59:59"
  1130. // })
  1131. // getIncident_solve_total_month({
  1132. // "start": lastMonth + " 00:00:00",
  1133. // "end": yesterDay + " 23:59:59"
  1134. // })
  1135. // getIncident_degree({
  1136. // "start": lastYear + " 00:00:00",
  1137. // "end": yesterDay + " 23:59:59"
  1138. // })
  1139. // getIncident_degree_month({
  1140. // "start": lastMonth + " 00:00:00",
  1141. // "end": yesterDay + " 23:59:59"
  1142. // })
  1143. getCallPitData({
  1144. "start": yesterDay + " 08",
  1145. // "start": "2018-05-28 00",
  1146. "end": yesterDay + " 18"
  1147. });
  1148. getWxPitAllData({
  1149. "start": yesterDay + " 00:00:00",
  1150. // "start": "2018-05-28 00:00:00",
  1151. "end": yesterDay + " 23:59:59"
  1152. })
  1153. getWechatPitData({
  1154. "start": yesterDay + " 08:00:00",
  1155. // "start": "2018-05-28 00:00:00",
  1156. "end": yesterDay + " 18:00:00"
  1157. });
  1158. getMonthMapData({
  1159. sum: 10,
  1160. "start": lastMonth + " 00:00:00",
  1161. "end": yesterDay + " 23:59:59"
  1162. })
  1163. getYearMapData({
  1164. sum: 20,
  1165. "start": lastYear + " 00:00:00",
  1166. "end": yesterDay + " 23:59:59"
  1167. })
  1168. }, time)
  1169. }
  1170. getDataInter(300000) //5分钟
  1171. // 切屏
  1172. setInterval(() => {
  1173. move1()
  1174. }, 15000); //15秒
  1175. $scope.timer = setTimeout(() => {
  1176. move2()
  1177. }, 15000); //15秒
  1178. // 地图聚合点信息----------------------------------------start
  1179. // // 获取近一个月建单总数数据
  1180. // // 开始
  1181. // $scope.incident_total_month = "";
  1182. // function getYear_incident_total_month(time) {
  1183. // api_hkreport.incidentreport(time, 'large_screen_year_incident_total').then(function (res) {
  1184. // $scope.incident_total_month = res.data[0].sum
  1185. // })
  1186. // }
  1187. // getYear_incident_total_month({
  1188. // "start": lastMonth + " 00:00:00",
  1189. // "end": yesterDay + " 23:59:59"
  1190. // })
  1191. // 结束
  1192. // // 开始
  1193. function map_time_area(time, slideBoxLeft3) {
  1194. // 右侧数据
  1195. // 实时信息
  1196. if(slideBoxLeft3 == 0 || slideBoxLeft3 == 3){
  1197. getIncident_allData({});
  1198. getIncident_responseData({})
  1199. getIncident_solveNowData({})
  1200. getIncident_solvedData({})
  1201. }
  1202. // 30天信息
  1203. if(slideBoxLeft3 == 1 || slideBoxLeft3 == 4){
  1204. getYear_incident_total_month({
  1205. "start": lastMonth + " 00:00:00",
  1206. "end": yesterDay + " 23:59:59"
  1207. })
  1208. getIncident_solve_time_month({
  1209. "start": lastMonth + " 00:00:00",
  1210. "end": yesterDay + " 23:59:59"
  1211. })
  1212. getIncident_solve_total_month({
  1213. "start": lastMonth + " 00:00:00",
  1214. "end": yesterDay + " 23:59:59"
  1215. })
  1216. getIncident_degree_month({
  1217. "start": lastMonth + " 00:00:00",
  1218. "end": yesterDay + " 23:59:59"
  1219. })
  1220. }
  1221. // 一年信息
  1222. if(slideBoxLeft3 == 2 || slideBoxLeft3 == 5){
  1223. getYear_incident_total({
  1224. "start": lastYear + " 00:00:00",
  1225. "end": yesterDay + " 23:59:59"
  1226. })
  1227. getIncident_solve_time({
  1228. "start": lastYear + " 00:00:00",
  1229. "end": yesterDay + " 23:59:59"
  1230. })
  1231. getIncident_solve_total({
  1232. "start": lastYear + " 00:00:00",
  1233. "end": yesterDay + " 23:59:59"
  1234. })
  1235. getIncident_degree({
  1236. "start": lastYear + " 00:00:00",
  1237. "end": yesterDay + " 23:59:59"
  1238. })
  1239. }
  1240. api_newreport.fetchDataList('oneMapData', time).then(function (res) {
  1241. console.log(res)
  1242. if(res.status == 200){
  1243. for (let name in res.data) {
  1244. let GLIDList = [];
  1245. let dataList = [];
  1246. res.data[name].forEach(function(v){
  1247. GLIDList.push(v[2]);
  1248. dataList.push(v[3]);
  1249. })
  1250. $scope.addClusterLayer(GLIDList, dataList, name);
  1251. }
  1252. // 地址切换
  1253. if(slideBoxLeft3 === 0 || slideBoxLeft3 === 1 || slideBoxLeft3 === 2){
  1254. $scope.cloudMap.goTo(114.41276, 30.51515, 1, 16);//主校区
  1255. clearTimeout($scope.timer);
  1256. setTimeout(() => {
  1257. for (let name in res.data) {
  1258. $scope.delClusterLayer(name);
  1259. }
  1260. move2()
  1261. }, 15000); //15秒
  1262. }
  1263. if(slideBoxLeft3 === 3 || slideBoxLeft3 === 4 || slideBoxLeft3 === 5){
  1264. $scope.cloudMap.goTo(114.254, 30.5855, 3, 16);//同济校区
  1265. clearTimeout($scope.timer);
  1266. setTimeout(() => {
  1267. for (let name in res.data) {
  1268. $scope.delClusterLayer(name);
  1269. }
  1270. move2()
  1271. }, 15000); //15秒
  1272. }
  1273. }
  1274. })
  1275. }
  1276. // map_time_area({
  1277. // "startTime": lastMonth + " 00:00:00",
  1278. // "endTime": yesterDay + " 23:59:59"
  1279. // })
  1280. // map_time_area({
  1281. // "startTime": lastYear + " 00:00:00",
  1282. // "endTime": yesterDay + " 23:59:59"
  1283. // })
  1284. // 结束
  1285. // 地图聚合点信息----------------------------------------end
  1286. // 获取地图token
  1287. api_wechat_operate.mapToken({active: 1}, 'mapToken').then(function (res) {
  1288. //#region 渲染地图--------------------start
  1289. //arcgis字体文件资质
  1290. //var arcgisFontUrl = "";
  1291. var is3d = false;
  1292. var username = "yunweixt20221207";
  1293. var addressToken = res.token; //通过api获取
  1294. //点位聚合
  1295. // var reductionCustom = {
  1296. // 室内消火栓: {
  1297. // clusterRadius: 100,
  1298. // clusterMinSize: 28,
  1299. // clusterMaxSize: 36,
  1300. // },
  1301. // 图层名称2: {
  1302. // clusterRadius: 100,
  1303. // clusterMinSize: 28,
  1304. // clusterMaxSize: 36,
  1305. // },
  1306. // };
  1307. var reductionCustom = null;
  1308. // var layerColor = null;
  1309. var layerColor = {
  1310. baseMap: "dark",
  1311. floorMap: "dark",
  1312. };
  1313. // 清除聚合图层
  1314. $scope.delClusterLayer = function(name) {
  1315. $scope.cloudMap.removeClusterLayer(name);
  1316. }
  1317. //聚合图层
  1318. $scope.addClusterLayer = function(GLIDList, dataList, name) {
  1319. console.log(GLIDList, dataList, name);
  1320. // name = '风险点';
  1321. //建筑物GLID
  1322. // GLIDList =["10192","10195","10157","10114","10314","10101","10288","10394","10427"];
  1323. //建筑物对应的数值,dCount必须为正整数
  1324. // dataList =[ 23, 15, 5, 6,8,12, 35, 66,1];
  1325. $scope.cloudMap.addClusterLayer(GLIDList, dataList, name);
  1326. }
  1327. $scope.$watch('$viewContentLoaded', function() {
  1328. console.log('viewContentLoaded');
  1329. $scope.cloudMap = Object.create(CloudMap); //页面加载完成后,创建map对象
  1330. // $scope.cloudMap2 = Object.create(CloudMap); //页面加载完成后,创建map对象
  1331. // $scope.cloudMap3 = Object.create(CloudMap); //页面加载完成后,创建map对象
  1332. // $scope.cloudMap4 = Object.create(CloudMap); //页面加载完成后,创建map对象
  1333. // $scope.cloudMap5 = Object.create(CloudMap); //页面加载完成后,创建map对象
  1334. // $scope.cloudMap6 = Object.create(CloudMap); //页面加载完成后,创建map对象
  1335. // 主校区
  1336. $scope.cloudMap.initMap(
  1337. "viewDiv",
  1338. 114.41276,
  1339. 30.51515,
  1340. 1,
  1341. username,
  1342. is3d,
  1343. addressToken,
  1344. null,
  1345. reductionCustom,
  1346. layerColor,
  1347. mapReady
  1348. );
  1349. // $scope.cloudMap2.initMap(
  1350. // "viewDiv2",
  1351. // 114.41276,
  1352. // 30.51515,
  1353. // 1,
  1354. // username,
  1355. // is3d,
  1356. // addressToken,
  1357. // null,
  1358. // reductionCustom,
  1359. // layerColor,
  1360. // mapReady
  1361. // );
  1362. // $scope.cloudMap3.initMap(
  1363. // "viewDiv3",
  1364. // 114.41276,
  1365. // 30.51515,
  1366. // 1,
  1367. // username,
  1368. // is3d,
  1369. // addressToken,
  1370. // null,
  1371. // reductionCustom,
  1372. // layerColor,
  1373. // mapReady
  1374. // );
  1375. // // 同济校区
  1376. // $scope.cloudMap4.initMap(
  1377. // "viewDiv4",
  1378. // 114.254,
  1379. // 30.5855,
  1380. // 3,
  1381. // username,
  1382. // is3d,
  1383. // addressToken,
  1384. // null,
  1385. // reductionCustom,
  1386. // layerColor,
  1387. // mapReady
  1388. // );
  1389. // $scope.cloudMap5.initMap(
  1390. // "viewDiv5",
  1391. // 114.254,
  1392. // 30.5855,
  1393. // 3,
  1394. // username,
  1395. // is3d,
  1396. // addressToken,
  1397. // null,
  1398. // reductionCustom,
  1399. // layerColor,
  1400. // mapReady
  1401. // );
  1402. // $scope.cloudMap6.initMap(
  1403. // "viewDiv6",
  1404. // 114.254,
  1405. // 30.5855,
  1406. // 3,
  1407. // username,
  1408. // is3d,
  1409. // addressToken,
  1410. // null,
  1411. // reductionCustom,
  1412. // layerColor,
  1413. // mapReady
  1414. // );
  1415. });
  1416. function mapReady() {
  1417. $scope.cloudMap.changeLayerVisible('2.5D底图', false);
  1418. map_time_area({
  1419. "startTime": moment(new Date().getTime()).format("YYYY-MM-DD") + ' 00:00:00',
  1420. "endTime": moment(new Date().getTime()).format("YYYY-MM-DD HH:mm:ss")
  1421. })
  1422. getIncident_allData({});
  1423. getIncident_responseData({})
  1424. getIncident_solveNowData({})
  1425. getIncident_solvedData({})
  1426. //cloudMap.changeLayerVisible('建筑物中心点', false);
  1427. //地图加载成功
  1428. // cloudMap.initLayerList("top-right"); //显示图层管理模块,位置top-right,top-left,bottom-right,bottom-right
  1429. // cloudMap.initLegend("top-left"); //显示图例
  1430. // cloudMap.click(doSomeThing); //绑定点击查询事件,点击空白处返回 “0”,点击具体的点则会返回相应数doSomeThing是回调函数,根据返回的结果
  1431. //获取全部图层名称
  1432. // var allLayerTitle = cloudMap.getAllLayerTitle();
  1433. // console.log(allLayerTitle);
  1434. //动态添加图层(下拉列表)
  1435. // allLayerTitle.forEach((element) => {
  1436. // //console.log(element);
  1437. // document
  1438. // .getElementById("txt_layer")
  1439. // .options.add(new Option(element, element));
  1440. // document
  1441. // .getElementById("txt_layer2")
  1442. // .options.add(new Option(element, element));
  1443. // });
  1444. }
  1445. //#endregion 渲染地图--------------------end
  1446. //
  1447. })
  1448. }]);