charts3.js 51 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484
  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. // 开始
  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. $scope.areaMonthList = res.data;
  887. setTimeout(() => {
  888. $scope.slides('body1', 'box8', 'box9', 'list5', 3, inter);
  889. // $scope.heatMaps('containerMonth', $scope.areaMonthList)
  890. }, 1000);
  891. })
  892. }
  893. getAreaMonthListData({
  894. sum: 100,
  895. "start": lastMonth + " 00:00:00",
  896. "end": yesterDay + " 23:59:59"
  897. // "start":"2019-04-17 23:59:59",
  898. }, 1)
  899. // 结束
  900. // 地图事件位置&数量
  901. // $scope.dayMapDataList = []; //当天
  902. $scope.monthMapDataList = []; //当月
  903. $scope.yearMapDataList = []; //当年
  904. // function getMapData(time) {
  905. // api_hkreport.incidentreport(time, 'large_screen_map_data').then(function (res) {
  906. // $scope.dayMapDataList = res.data;
  907. // })
  908. // }
  909. function getMonthMapData(time) {
  910. api_hkreport.incidentreport(time, 'large_screen_map_data').then(function (res) {
  911. $scope.monthMapDataList = res.data;
  912. })
  913. }
  914. function getYearMapData(time) {
  915. api_hkreport.incidentreport(time, 'large_screen_map_data').then(function (res) {
  916. $scope.yearMapDataList = res.data;
  917. })
  918. }
  919. // getMapData({
  920. // sum: 100,
  921. // "start": yesterDay + " 00:00:00",
  922. // "end": yesterDay + " 23:59:59"
  923. // })
  924. getMonthMapData({
  925. sum: 10,
  926. "start": lastMonth + " 00:00:00",
  927. "end": yesterDay + " 23:59:59"
  928. })
  929. getYearMapData({
  930. sum: 20,
  931. "start": lastYear + " 00:00:00",
  932. "end": yesterDay + " 23:59:59"
  933. })
  934. // 事件工单列表状态颜色
  935. $scope.statusColor = function (res) {
  936. if (res == "接单") {
  937. return "jiedai"
  938. } else if (res == "事件处理") {
  939. return "chulizhong"
  940. } else if (res == "事件关闭") {
  941. return "guanbi"
  942. } else {
  943. return "qita"
  944. }
  945. }
  946. // 事件工单处理实时情况状态转换
  947. $scope.incident_status = function (res) {
  948. if (res == "事件处理") {
  949. return "处理中"
  950. } else if (res == "事件关闭") {
  951. return "已办结"
  952. } else {
  953. return res
  954. }
  955. }
  956. // 列表前点颜色
  957. $scope.liebiao_zhuangtai = function (status, priority) {
  958. if (status == 4 || status == 2) {
  959. if (priority == "重大") {
  960. return "zhongda"
  961. } else {
  962. return ""
  963. }
  964. } else {
  965. return "chuliguo"
  966. }
  967. }
  968. // 来电趋势/微信报修趋势...(页面数据轮播)
  969. $scope.slideBoxLeft = 0;
  970. $scope.slideBoxLeft1 = 0;
  971. $scope.slideBoxLeft2 = 0;
  972. $scope.slideBoxLeft3 = 0; //索引
  973. function move1() {
  974. if ($scope.slideBoxLeft == 0) {
  975. $scope.slideBoxLeft = '-100%';
  976. } else {
  977. $scope.slideBoxLeft = 0;
  978. }
  979. if ($scope.slideBoxLeft1 == 0) {
  980. $scope.slideBoxLeft1 = '-100%';
  981. } else if ($scope.slideBoxLeft1 == '-100%') {
  982. $scope.slideBoxLeft1 = '-200%';
  983. } else if ($scope.slideBoxLeft1 == '-200%') {
  984. $scope.slideBoxLeft1 = '-300%';
  985. } else if ($scope.slideBoxLeft1 == '-300%') {
  986. $scope.slideBoxLeft1 = '-400%';
  987. } else if ($scope.slideBoxLeft1 == '-400%') {
  988. $scope.slideBoxLeft1 = '-500%';
  989. } else {
  990. $scope.slideBoxLeft1 = 0;
  991. }
  992. if ($scope.slideBoxLeft2 == 0) {
  993. $scope.slideBoxLeft2 = '-100%';
  994. } else if ($scope.slideBoxLeft2 == '-100%') {
  995. $scope.slideBoxLeft2 = '-200%';
  996. } else {
  997. $scope.slideBoxLeft2 = 0;
  998. }
  999. }
  1000. function move2() {
  1001. if ($scope.slideBoxLeft3 >= 0) {
  1002. $scope.slideBoxLeft3++;
  1003. if($scope.slideBoxLeft3 == 6){
  1004. $scope.slideBoxLeft3 = 0;
  1005. }
  1006. console.log($scope.slideBoxLeft3, '$scope.slideBoxLeft3')
  1007. // 聚合点信息获取
  1008. // 实时信息
  1009. if($scope.slideBoxLeft3 == 0 || $scope.slideBoxLeft3 == 3){
  1010. map_time_area({
  1011. "startTime": moment(new Date().getTime()).format("YYYY-MM-DD") + ' 00:00:00',
  1012. "endTime": moment(new Date().getTime()).format("YYYY-MM-DD HH:mm:ss")
  1013. }, $scope.slideBoxLeft3)
  1014. }
  1015. // 30天信息
  1016. if($scope.slideBoxLeft3 == 1 || $scope.slideBoxLeft3 == 4){
  1017. map_time_area({
  1018. "startTime": lastMonth + " 00:00:00",
  1019. "endTime": yesterDay + " 23:59:59"
  1020. }, $scope.slideBoxLeft3)
  1021. }
  1022. // 一年信息
  1023. if($scope.slideBoxLeft3 == 2 || $scope.slideBoxLeft3 == 5){
  1024. map_time_area({
  1025. "startTime": lastYear + " 00:00:00",
  1026. "endTime": yesterDay + " 23:59:59"
  1027. }, $scope.slideBoxLeft3)
  1028. }
  1029. }
  1030. }
  1031. // 列表滚动
  1032. // a:table body 的class名;b:滚动父盒子的id名;c:滚动盒子的id名;d:滚动项的class名;e:每页展示的条数;f:interval定时器开启1/关闭0
  1033. $scope.slides = function (a, b, c, d, e, f) {
  1034. var speed = 45; //设置向上轮动的速度
  1035. var list = $('.' + d).clone();
  1036. if (list.length >= e) {
  1037. var body1 = $('.' + a)[0];
  1038. var box = $("#" + b);
  1039. if (f) {
  1040. $("#" + c).append(list.splice(0, e))
  1041. }
  1042. var top = 0;
  1043. function moveTop() {
  1044. if (top <= body1.offsetHeight - box[0].offsetHeight) {
  1045. top = 0;
  1046. } else {
  1047. top--;
  1048. }
  1049. box.css({
  1050. 'top': top + 'px'
  1051. })
  1052. }
  1053. var interval = setInterval(() => {
  1054. moveTop()
  1055. }, 50);
  1056. if (!f) {
  1057. clearInterval(interval)
  1058. }
  1059. }
  1060. }
  1061. // 区域地点实时动态图标点
  1062. $scope.pointPosition = function (point, statusid) {
  1063. var style = {};
  1064. if (point) {
  1065. var arr = point.split(',');
  1066. style.left = arr[0] / 2 + 10 + 'px';
  1067. style.top = arr[1] / 2 - 10 + 'px';
  1068. } else {
  1069. // 南1楼 - 南8楼
  1070. style.left = 800 / 2 + 10 + 'px';
  1071. style.top = 800 / 2 - 10 + 'px';
  1072. }
  1073. return style;
  1074. }
  1075. // 地图上的提示框闪烁
  1076. var a = 0;
  1077. function flicker(className) {
  1078. setInterval(() => {
  1079. a++
  1080. $(className).hide()
  1081. $($(className)[a]).show();
  1082. if (a >= $(className).length - 1) {
  1083. a = 0;
  1084. }
  1085. }, 1500);
  1086. }
  1087. // flicker('.dataHaoRooms')
  1088. // flicker('.dataHaoRooms1')
  1089. // flicker('.dataHaoRooms2')
  1090. // 定时刷新
  1091. function getDataInter(time) {
  1092. $interval(function () {
  1093. $interval.cancel($scope.listTimer);
  1094. getIncidentHandleData({}, 0);
  1095. getWeChatData({}, 0);
  1096. getPlaceListData({
  1097. "start": yesterDay + " 00:00:00",
  1098. // "start": "2018-05-28 00:00:00",
  1099. "end": yesterDay + " 23:59:59"
  1100. }, 0)
  1101. getIncident_allData({});
  1102. getIncident_responseData({});
  1103. getIncident_solveNowData({})
  1104. getIncident_solvedData({})
  1105. getYear_incident_total({
  1106. "start": lastYear + " 00:00:00",
  1107. "end": yesterDay + " 23:59:59"
  1108. })
  1109. getYear_incident_total_month({
  1110. "start": lastMonth + " 00:00:00",
  1111. "end": yesterDay + " 23:59:59"
  1112. })
  1113. getIncident_solve_time({
  1114. "start": lastYear + " 00:00:00",
  1115. "end": yesterDay + " 23:59:59"
  1116. })
  1117. getIncident_solve_time_month({
  1118. "start": lastMonth + " 00:00:00",
  1119. "end": yesterDay + " 23:59:59"
  1120. })
  1121. getIncident_solve_total({
  1122. "start": lastYear + " 00:00:00",
  1123. "end": yesterDay + " 23:59:59"
  1124. })
  1125. getIncident_solve_total_month({
  1126. "start": lastMonth + " 00:00:00",
  1127. "end": yesterDay + " 23:59:59"
  1128. })
  1129. getIncident_degree({
  1130. "start": lastYear + " 00:00:00",
  1131. "end": yesterDay + " 23:59:59"
  1132. })
  1133. getIncident_degree_month({
  1134. "start": lastMonth + " 00:00:00",
  1135. "end": yesterDay + " 23:59:59"
  1136. })
  1137. getCallPitData({
  1138. "start": yesterDay + " 08",
  1139. // "start": "2018-05-28 00",
  1140. "end": yesterDay + " 18"
  1141. });
  1142. getWxPitAllData({
  1143. "start": yesterDay + " 00:00:00",
  1144. // "start": "2018-05-28 00:00:00",
  1145. "end": yesterDay + " 23:59:59"
  1146. })
  1147. getWechatPitData({
  1148. "start": yesterDay + " 08:00:00",
  1149. // "start": "2018-05-28 00:00:00",
  1150. "end": yesterDay + " 18:00:00"
  1151. });
  1152. getMonthMapData({
  1153. sum: 10,
  1154. "start": lastMonth + " 00:00:00",
  1155. "end": yesterDay + " 23:59:59"
  1156. })
  1157. getYearMapData({
  1158. sum: 20,
  1159. "start": lastYear + " 00:00:00",
  1160. "end": yesterDay + " 23:59:59"
  1161. })
  1162. }, time)
  1163. }
  1164. getDataInter(300000) //5分钟
  1165. // 切屏
  1166. setInterval(() => {
  1167. move1()
  1168. }, 15000); //15秒
  1169. $scope.timer = setTimeout(() => {
  1170. move2()
  1171. }, 15000); //15秒
  1172. // 地图聚合点信息----------------------------------------start
  1173. // // 获取近一个月建单总数数据
  1174. // // 开始
  1175. // $scope.incident_total_month = "";
  1176. // function getYear_incident_total_month(time) {
  1177. // api_hkreport.incidentreport(time, 'large_screen_year_incident_total').then(function (res) {
  1178. // $scope.incident_total_month = res.data[0].sum
  1179. // })
  1180. // }
  1181. // getYear_incident_total_month({
  1182. // "start": lastMonth + " 00:00:00",
  1183. // "end": yesterDay + " 23:59:59"
  1184. // })
  1185. // 结束
  1186. // // 开始
  1187. function map_time_area(time, slideBoxLeft3) {
  1188. api_newreport.fetchDataList('oneMapData', time).then(function (res) {
  1189. console.log(res)
  1190. if(res.status == 200){
  1191. for (let name in res.data) {
  1192. let GLIDList = [];
  1193. let dataList = [];
  1194. res.data[name].forEach(function(v){
  1195. GLIDList.push(v[2]);
  1196. dataList.push(v[3]);
  1197. })
  1198. $scope.addClusterLayer(GLIDList, dataList, name);
  1199. }
  1200. // 地址切换
  1201. if(slideBoxLeft3 === 0 || slideBoxLeft3 === 1 || slideBoxLeft3 === 2){
  1202. $scope.cloudMap.goTo(114.41276, 30.51515, 1, 16);//主校区
  1203. clearTimeout($scope.timer);
  1204. setTimeout(() => {
  1205. for (let name in res.data) {
  1206. $scope.delClusterLayer(name);
  1207. }
  1208. move2()
  1209. }, 15000); //15秒
  1210. }
  1211. if(slideBoxLeft3 === 3 || slideBoxLeft3 === 4 || slideBoxLeft3 === 5){
  1212. $scope.cloudMap.goTo(114.254, 30.5855, 3, 16);//同济校区
  1213. clearTimeout($scope.timer);
  1214. setTimeout(() => {
  1215. for (let name in res.data) {
  1216. $scope.delClusterLayer(name);
  1217. }
  1218. move2()
  1219. }, 15000); //15秒
  1220. }
  1221. }
  1222. })
  1223. }
  1224. // map_time_area({
  1225. // "startTime": lastMonth + " 00:00:00",
  1226. // "endTime": yesterDay + " 23:59:59"
  1227. // })
  1228. // map_time_area({
  1229. // "startTime": lastYear + " 00:00:00",
  1230. // "endTime": yesterDay + " 23:59:59"
  1231. // })
  1232. // 结束
  1233. // 地图聚合点信息----------------------------------------end
  1234. // 获取地图token
  1235. api_wechat_operate.mapToken({active: 1}, 'mapToken').then(function (res) {
  1236. //#region 渲染地图--------------------start
  1237. //arcgis字体文件资质
  1238. //var arcgisFontUrl = "";
  1239. var is3d = false;
  1240. var username = "yunweixt20221207";
  1241. var addressToken = res.token; //通过api获取
  1242. //点位聚合
  1243. // var reductionCustom = {
  1244. // 室内消火栓: {
  1245. // clusterRadius: 100,
  1246. // clusterMinSize: 28,
  1247. // clusterMaxSize: 36,
  1248. // },
  1249. // 图层名称2: {
  1250. // clusterRadius: 100,
  1251. // clusterMinSize: 28,
  1252. // clusterMaxSize: 36,
  1253. // },
  1254. // };
  1255. var reductionCustom = null;
  1256. // var layerColor = null;
  1257. var layerColor = {
  1258. baseMap: "dark",
  1259. floorMap: "dark",
  1260. };
  1261. // 清除聚合图层
  1262. $scope.delClusterLayer = function(name) {
  1263. $scope.cloudMap.removeClusterLayer(name);
  1264. }
  1265. //聚合图层
  1266. $scope.addClusterLayer = function(GLIDList, dataList, name) {
  1267. console.log(GLIDList, dataList, name);
  1268. // name = '风险点';
  1269. //建筑物GLID
  1270. // GLIDList =["10192","10195","10157","10114","10314","10101","10288","10394","10427"];
  1271. //建筑物对应的数值,dCount必须为正整数
  1272. // dataList =[ 23, 15, 5, 6,8,12, 35, 66,1];
  1273. $scope.cloudMap.addClusterLayer(GLIDList, dataList, name);
  1274. }
  1275. $scope.$watch('$viewContentLoaded', function() {
  1276. console.log('viewContentLoaded');
  1277. $scope.cloudMap = Object.create(CloudMap); //页面加载完成后,创建map对象
  1278. // $scope.cloudMap2 = Object.create(CloudMap); //页面加载完成后,创建map对象
  1279. // $scope.cloudMap3 = Object.create(CloudMap); //页面加载完成后,创建map对象
  1280. // $scope.cloudMap4 = Object.create(CloudMap); //页面加载完成后,创建map对象
  1281. // $scope.cloudMap5 = Object.create(CloudMap); //页面加载完成后,创建map对象
  1282. // $scope.cloudMap6 = Object.create(CloudMap); //页面加载完成后,创建map对象
  1283. // 主校区
  1284. $scope.cloudMap.initMap(
  1285. "viewDiv",
  1286. 114.41276,
  1287. 30.51515,
  1288. 1,
  1289. username,
  1290. is3d,
  1291. addressToken,
  1292. null,
  1293. reductionCustom,
  1294. layerColor,
  1295. mapReady
  1296. );
  1297. // $scope.cloudMap2.initMap(
  1298. // "viewDiv2",
  1299. // 114.41276,
  1300. // 30.51515,
  1301. // 1,
  1302. // username,
  1303. // is3d,
  1304. // addressToken,
  1305. // null,
  1306. // reductionCustom,
  1307. // layerColor,
  1308. // mapReady
  1309. // );
  1310. // $scope.cloudMap3.initMap(
  1311. // "viewDiv3",
  1312. // 114.41276,
  1313. // 30.51515,
  1314. // 1,
  1315. // username,
  1316. // is3d,
  1317. // addressToken,
  1318. // null,
  1319. // reductionCustom,
  1320. // layerColor,
  1321. // mapReady
  1322. // );
  1323. // // 同济校区
  1324. // $scope.cloudMap4.initMap(
  1325. // "viewDiv4",
  1326. // 114.254,
  1327. // 30.5855,
  1328. // 3,
  1329. // username,
  1330. // is3d,
  1331. // addressToken,
  1332. // null,
  1333. // reductionCustom,
  1334. // layerColor,
  1335. // mapReady
  1336. // );
  1337. // $scope.cloudMap5.initMap(
  1338. // "viewDiv5",
  1339. // 114.254,
  1340. // 30.5855,
  1341. // 3,
  1342. // username,
  1343. // is3d,
  1344. // addressToken,
  1345. // null,
  1346. // reductionCustom,
  1347. // layerColor,
  1348. // mapReady
  1349. // );
  1350. // $scope.cloudMap6.initMap(
  1351. // "viewDiv6",
  1352. // 114.254,
  1353. // 30.5855,
  1354. // 3,
  1355. // username,
  1356. // is3d,
  1357. // addressToken,
  1358. // null,
  1359. // reductionCustom,
  1360. // layerColor,
  1361. // mapReady
  1362. // );
  1363. });
  1364. function mapReady() {
  1365. map_time_area({
  1366. "startTime": moment(new Date().getTime()).format("YYYY-MM-DD") + ' 00:00:00',
  1367. "endTime": moment(new Date().getTime()).format("YYYY-MM-DD HH:mm:ss")
  1368. })
  1369. //cloudMap.changeLayerVisible('建筑物中心点', false);
  1370. //地图加载成功
  1371. // cloudMap.initLayerList("top-right"); //显示图层管理模块,位置top-right,top-left,bottom-right,bottom-right
  1372. // cloudMap.initLegend("top-left"); //显示图例
  1373. // cloudMap.click(doSomeThing); //绑定点击查询事件,点击空白处返回 “0”,点击具体的点则会返回相应数doSomeThing是回调函数,根据返回的结果
  1374. //获取全部图层名称
  1375. // var allLayerTitle = cloudMap.getAllLayerTitle();
  1376. // console.log(allLayerTitle);
  1377. //动态添加图层(下拉列表)
  1378. // allLayerTitle.forEach((element) => {
  1379. // //console.log(element);
  1380. // document
  1381. // .getElementById("txt_layer")
  1382. // .options.add(new Option(element, element));
  1383. // document
  1384. // .getElementById("txt_layer2")
  1385. // .options.add(new Option(element, element));
  1386. // });
  1387. }
  1388. //#endregion 渲染地图--------------------end
  1389. //
  1390. })
  1391. }]);