charts3.js 54 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554
  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 = "";
  455. function getYear_incident_total(time) {
  456. api_hkreport.incidentreport(time, 'large_screen_year_incident_total').then(function (res) {
  457. $scope.incident_total = 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', moment(new Date()).format('YYYY-MM-DD HH:mm:ss'))
  1005. // 实时信息
  1006. if($scope.slideBoxLeft3 == 0 || $scope.slideBoxLeft3 == 3){
  1007. map_time_area({
  1008. "startTime": moment(new Date().getTime()).format("YYYY-MM-DD") + ' 00:00:00',
  1009. "endTime": moment(new Date().getTime()).format("YYYY-MM-DD HH:mm:ss")
  1010. }, $scope.slideBoxLeft3)
  1011. }
  1012. // 30天信息
  1013. if($scope.slideBoxLeft3 == 1 || $scope.slideBoxLeft3 == 4){
  1014. map_time_area({
  1015. "startTime": lastMonth + " 00:00:00",
  1016. "endTime": yesterDay + " 23:59:59"
  1017. }, $scope.slideBoxLeft3)
  1018. }
  1019. // 一年信息
  1020. if($scope.slideBoxLeft3 == 2 || $scope.slideBoxLeft3 == 5){
  1021. map_time_area({
  1022. "startTime": lastYear + " 00:00:00",
  1023. "endTime": yesterDay + " 23:59:59"
  1024. }, $scope.slideBoxLeft3)
  1025. }
  1026. }
  1027. }
  1028. // 列表滚动
  1029. // a:table body 的class名;b:滚动父盒子的id名;c:滚动盒子的id名;d:滚动项的class名;e:每页展示的条数;f:interval定时器开启1/关闭0
  1030. $scope.slides = function (a, b, c, d, e, f) {
  1031. var speed = 45; //设置向上轮动的速度
  1032. var list = $('.' + d).clone();
  1033. if (list.length >= e) {
  1034. var body1 = $('.' + a)[0];
  1035. var box = $("#" + b);
  1036. if (f) {
  1037. $("#" + c).append(list.splice(0, e))
  1038. }
  1039. var top = 0;
  1040. function moveTop() {
  1041. if (top <= body1.offsetHeight - box[0].offsetHeight) {
  1042. top = 0;
  1043. } else {
  1044. top--;
  1045. }
  1046. box.css({
  1047. 'top': top + 'px'
  1048. })
  1049. }
  1050. var interval = setInterval(() => {
  1051. moveTop()
  1052. }, 50);
  1053. if (!f) {
  1054. clearInterval(interval)
  1055. }
  1056. }
  1057. }
  1058. // 区域地点实时动态图标点
  1059. $scope.pointPosition = function (point, statusid) {
  1060. var style = {};
  1061. if (point) {
  1062. var arr = point.split(',');
  1063. style.left = arr[0] / 2 + 10 + 'px';
  1064. style.top = arr[1] / 2 - 10 + 'px';
  1065. } else {
  1066. // 南1楼 - 南8楼
  1067. style.left = 800 / 2 + 10 + 'px';
  1068. style.top = 800 / 2 - 10 + 'px';
  1069. }
  1070. return style;
  1071. }
  1072. // 地图上的提示框闪烁
  1073. var a = 0;
  1074. function flicker(className) {
  1075. setInterval(() => {
  1076. a++
  1077. $(className).hide()
  1078. $($(className)[a]).show();
  1079. if (a >= $(className).length - 1) {
  1080. a = 0;
  1081. }
  1082. }, 1500);
  1083. }
  1084. // flicker('.dataHaoRooms')
  1085. // flicker('.dataHaoRooms1')
  1086. // flicker('.dataHaoRooms2')
  1087. // 定时刷新
  1088. function getDataInter(time) {
  1089. $interval(function () {
  1090. $interval.cancel($scope.listTimer);
  1091. getIncidentHandleData({}, 0);
  1092. getWeChatData({}, 0);
  1093. getPlaceListData({
  1094. "start": yesterDay + " 00:00:00",
  1095. // "start": "2018-05-28 00:00:00",
  1096. "end": yesterDay + " 23:59:59"
  1097. }, 0)
  1098. // getIncident_allData({});
  1099. // getIncident_responseData({});
  1100. // getIncident_solveNowData({})
  1101. // getIncident_solvedData({})
  1102. // getYear_incident_total({
  1103. // "start": lastYear + " 00:00:00",
  1104. // "end": yesterDay + " 23:59:59"
  1105. // })
  1106. // getYear_incident_total_month({
  1107. // "start": lastMonth + " 00:00:00",
  1108. // "end": yesterDay + " 23:59:59"
  1109. // })
  1110. // getIncident_solve_time({
  1111. // "start": lastYear + " 00:00:00",
  1112. // "end": yesterDay + " 23:59:59"
  1113. // })
  1114. // getIncident_solve_time_month({
  1115. // "start": lastMonth + " 00:00:00",
  1116. // "end": yesterDay + " 23:59:59"
  1117. // })
  1118. // getIncident_solve_total({
  1119. // "start": lastYear + " 00:00:00",
  1120. // "end": yesterDay + " 23:59:59"
  1121. // })
  1122. // getIncident_solve_total_month({
  1123. // "start": lastMonth + " 00:00:00",
  1124. // "end": yesterDay + " 23:59:59"
  1125. // })
  1126. // getIncident_degree({
  1127. // "start": lastYear + " 00:00:00",
  1128. // "end": yesterDay + " 23:59:59"
  1129. // })
  1130. // getIncident_degree_month({
  1131. // "start": lastMonth + " 00:00:00",
  1132. // "end": yesterDay + " 23:59:59"
  1133. // })
  1134. getCallPitData({
  1135. "start": yesterDay + " 08",
  1136. // "start": "2018-05-28 00",
  1137. "end": yesterDay + " 18"
  1138. });
  1139. getWxPitAllData({
  1140. "start": yesterDay + " 00:00:00",
  1141. // "start": "2018-05-28 00:00:00",
  1142. "end": yesterDay + " 23:59:59"
  1143. })
  1144. getWechatPitData({
  1145. "start": yesterDay + " 08:00:00",
  1146. // "start": "2018-05-28 00:00:00",
  1147. "end": yesterDay + " 18:00:00"
  1148. });
  1149. getMonthMapData({
  1150. sum: 10,
  1151. "start": lastMonth + " 00:00:00",
  1152. "end": yesterDay + " 23:59:59"
  1153. })
  1154. getYearMapData({
  1155. sum: 20,
  1156. "start": lastYear + " 00:00:00",
  1157. "end": yesterDay + " 23:59:59"
  1158. })
  1159. }, time)
  1160. }
  1161. getDataInter(300000) //5分钟
  1162. // 切屏
  1163. setInterval(() => {
  1164. move1()
  1165. }, 15000); //15秒
  1166. // $scope.timer = setTimeout(() => {
  1167. // move2()
  1168. // }, 15000); //15秒
  1169. // 地图聚合点信息----------------------------------------start
  1170. // // 获取近一个月建单总数数据
  1171. // // 开始
  1172. // $scope.incident_total_month = "";
  1173. // function getYear_incident_total_month(time) {
  1174. // api_hkreport.incidentreport(time, 'large_screen_year_incident_total').then(function (res) {
  1175. // $scope.incident_total_month = res.data[0].sum
  1176. // })
  1177. // }
  1178. // getYear_incident_total_month({
  1179. // "start": lastMonth + " 00:00:00",
  1180. // "end": yesterDay + " 23:59:59"
  1181. // })
  1182. // 结束
  1183. // // 开始
  1184. function map_time_area(time, slideBoxLeft3) {
  1185. var branch = undefined;
  1186. if(slideBoxLeft3 == 0 || slideBoxLeft3 == 1 || slideBoxLeft3 == 2){
  1187. branch = 1;
  1188. }else if(slideBoxLeft3 == 3 || slideBoxLeft3 == 4 || slideBoxLeft3 == 5){
  1189. branch = 2;
  1190. }
  1191. // 右侧数据
  1192. // 清空
  1193. $scope.incident_allData = '';
  1194. $scope.incident_responseData = '';
  1195. $scope.incident_solveNowData = '';
  1196. $scope.incident_solvedData = '';
  1197. $scope.incident_total = '';
  1198. $scope.incident_solve_time = '';
  1199. $scope.incident_solve_total = '';
  1200. $scope.incident_degree = '';
  1201. // 实时信息
  1202. if(slideBoxLeft3 == 0 || slideBoxLeft3 == 3){
  1203. getIncident_allData({branch: branch});
  1204. getIncident_responseData({branch: branch})
  1205. getIncident_solveNowData({branch: branch})
  1206. getIncident_solvedData({branch: branch})
  1207. }
  1208. // 30天信息
  1209. if(slideBoxLeft3 == 1 || slideBoxLeft3 == 4){
  1210. getYear_incident_total_month({
  1211. "start": lastMonth + " 00:00:00",
  1212. "end": yesterDay + " 23:59:59",
  1213. branch: branch
  1214. })
  1215. getIncident_solve_time_month({
  1216. "start": lastMonth + " 00:00:00",
  1217. "end": yesterDay + " 23:59:59",
  1218. branch: branch
  1219. })
  1220. getIncident_solve_total_month({
  1221. "start": lastMonth + " 00:00:00",
  1222. "end": yesterDay + " 23:59:59",
  1223. branch: branch
  1224. })
  1225. getIncident_degree_month({
  1226. "start": lastMonth + " 00:00:00",
  1227. "end": yesterDay + " 23:59:59",
  1228. branch: branch
  1229. })
  1230. }
  1231. // 一年信息
  1232. if(slideBoxLeft3 == 2 || slideBoxLeft3 == 5){
  1233. getYear_incident_total({
  1234. "start": lastYear + " 00:00:00",
  1235. "end": yesterDay + " 23:59:59",
  1236. branch: branch
  1237. })
  1238. getIncident_solve_time({
  1239. "start": lastYear + " 00:00:00",
  1240. "end": yesterDay + " 23:59:59",
  1241. branch: branch
  1242. })
  1243. getIncident_solve_total({
  1244. "start": lastYear + " 00:00:00",
  1245. "end": yesterDay + " 23:59:59",
  1246. branch: branch
  1247. })
  1248. getIncident_degree({
  1249. "start": lastYear + " 00:00:00",
  1250. "end": yesterDay + " 23:59:59",
  1251. branch: branch
  1252. })
  1253. }
  1254. time.branch = branch;
  1255. api_newreport.fetchDataList('oneMapData', time).then(function (res) {
  1256. console.log(res)
  1257. if(res.status == 200){
  1258. for (let name in res.data) {
  1259. let GLIDList = [];
  1260. let dataList = [];
  1261. res.data[name].forEach(function(v){
  1262. GLIDList.push(v[2]);
  1263. dataList.push(v[3]);
  1264. })
  1265. $scope.addClusterLayer(GLIDList, dataList, name);
  1266. }
  1267. // 地址切换
  1268. if(slideBoxLeft3 === 0 || slideBoxLeft3 === 1 || slideBoxLeft3 === 2){
  1269. $scope.cloudMap && $scope.cloudMap.goTo(114.41276, 30.51515, 1, 16);//主校区
  1270. clearTimeout($scope.timer);
  1271. setTimeout(() => {
  1272. for (let name in res.data) {
  1273. $scope.delClusterLayer(name);
  1274. }
  1275. move2()
  1276. }, 15000); //15秒
  1277. }
  1278. if(slideBoxLeft3 === 3 || slideBoxLeft3 === 4 || slideBoxLeft3 === 5){
  1279. $scope.cloudMap && $scope.cloudMap.goTo(114.254, 30.5855, 3, 16);//同济校区
  1280. clearTimeout($scope.timer);
  1281. setTimeout(() => {
  1282. for (let name in res.data) {
  1283. $scope.delClusterLayer(name);
  1284. }
  1285. move2()
  1286. }, 15000); //15秒
  1287. }
  1288. }
  1289. })
  1290. }
  1291. // map_time_area({
  1292. // "startTime": lastMonth + " 00:00:00",
  1293. // "endTime": yesterDay + " 23:59:59"
  1294. // })
  1295. // map_time_area({
  1296. // "startTime": lastYear + " 00:00:00",
  1297. // "endTime": yesterDay + " 23:59:59"
  1298. // })
  1299. // 结束
  1300. // 地图聚合点信息----------------------------------------end
  1301. // 获取地图token
  1302. api_wechat_operate.mapToken({active: 1}, 'mapToken').then(function (res) {
  1303. //#region 渲染地图--------------------start
  1304. //arcgis字体文件资质
  1305. //var arcgisFontUrl = "";
  1306. var is3d = false;
  1307. var username = "yunweixt20221207";
  1308. var addressToken = res.token; //通过api获取
  1309. //点位聚合
  1310. // var reductionCustom = {
  1311. // 室内消火栓: {
  1312. // clusterRadius: 100,
  1313. // clusterMinSize: 28,
  1314. // clusterMaxSize: 36,
  1315. // },
  1316. // 图层名称2: {
  1317. // clusterRadius: 100,
  1318. // clusterMinSize: 28,
  1319. // clusterMaxSize: 36,
  1320. // },
  1321. // };
  1322. var reductionCustom = null;
  1323. // var layerColor = null;
  1324. var layerColor = {
  1325. baseMap: "dark",
  1326. floorMap: "dark",
  1327. };
  1328. // 清除聚合图层
  1329. $scope.delClusterLayer = function(name) {
  1330. $scope.cloudMap.removeClusterLayer(name);
  1331. }
  1332. //聚合图层
  1333. $scope.addClusterLayer = function(GLIDList, dataList, name) {
  1334. console.log(GLIDList, dataList, name);
  1335. // name = '风险点';
  1336. //建筑物GLID
  1337. // GLIDList =["10192","10195","10157","10114","10314","10101","10288","10394","10427"];
  1338. //建筑物对应的数值,dCount必须为正整数
  1339. // dataList =[ 23, 15, 5, 6,8,12, 35, 66,1];
  1340. $scope.cloudMap.addClusterLayer(GLIDList, dataList, name);
  1341. }
  1342. $scope.$watch('$viewContentLoaded', function() {
  1343. console.log('viewContentLoaded');
  1344. $scope.cloudMap = Object.create(CloudMap); //页面加载完成后,创建map对象
  1345. // $scope.cloudMap2 = Object.create(CloudMap); //页面加载完成后,创建map对象
  1346. // $scope.cloudMap3 = Object.create(CloudMap); //页面加载完成后,创建map对象
  1347. // $scope.cloudMap4 = Object.create(CloudMap); //页面加载完成后,创建map对象
  1348. // $scope.cloudMap5 = Object.create(CloudMap); //页面加载完成后,创建map对象
  1349. // $scope.cloudMap6 = Object.create(CloudMap); //页面加载完成后,创建map对象
  1350. // 主校区
  1351. $scope.cloudMap.initMap(
  1352. "viewDiv",
  1353. 114.41276,
  1354. 30.51515,
  1355. 1,
  1356. username,
  1357. is3d,
  1358. addressToken,
  1359. null,
  1360. reductionCustom,
  1361. layerColor,
  1362. mapReady
  1363. );
  1364. // $scope.cloudMap2.initMap(
  1365. // "viewDiv2",
  1366. // 114.41276,
  1367. // 30.51515,
  1368. // 1,
  1369. // username,
  1370. // is3d,
  1371. // addressToken,
  1372. // null,
  1373. // reductionCustom,
  1374. // layerColor,
  1375. // mapReady
  1376. // );
  1377. // $scope.cloudMap3.initMap(
  1378. // "viewDiv3",
  1379. // 114.41276,
  1380. // 30.51515,
  1381. // 1,
  1382. // username,
  1383. // is3d,
  1384. // addressToken,
  1385. // null,
  1386. // reductionCustom,
  1387. // layerColor,
  1388. // mapReady
  1389. // );
  1390. // // 同济校区
  1391. // $scope.cloudMap4.initMap(
  1392. // "viewDiv4",
  1393. // 114.254,
  1394. // 30.5855,
  1395. // 3,
  1396. // username,
  1397. // is3d,
  1398. // addressToken,
  1399. // null,
  1400. // reductionCustom,
  1401. // layerColor,
  1402. // mapReady
  1403. // );
  1404. // $scope.cloudMap5.initMap(
  1405. // "viewDiv5",
  1406. // 114.254,
  1407. // 30.5855,
  1408. // 3,
  1409. // username,
  1410. // is3d,
  1411. // addressToken,
  1412. // null,
  1413. // reductionCustom,
  1414. // layerColor,
  1415. // mapReady
  1416. // );
  1417. // $scope.cloudMap6.initMap(
  1418. // "viewDiv6",
  1419. // 114.254,
  1420. // 30.5855,
  1421. // 3,
  1422. // username,
  1423. // is3d,
  1424. // addressToken,
  1425. // null,
  1426. // reductionCustom,
  1427. // layerColor,
  1428. // mapReady
  1429. // );
  1430. });
  1431. function mapReady() {
  1432. $scope.cloudMap.changeLayerVisible('2.5D底图', false);
  1433. map_time_area({
  1434. "startTime": moment(new Date().getTime()).format("YYYY-MM-DD") + ' 00:00:00',
  1435. "endTime": moment(new Date().getTime()).format("YYYY-MM-DD HH:mm:ss")
  1436. }, $scope.slideBoxLeft3)
  1437. // getIncident_allData({});
  1438. // getIncident_responseData({})
  1439. // getIncident_solveNowData({})
  1440. // getIncident_solvedData({})
  1441. //cloudMap.changeLayerVisible('建筑物中心点', false);
  1442. //地图加载成功
  1443. // cloudMap.initLayerList("top-right"); //显示图层管理模块,位置top-right,top-left,bottom-right,bottom-right
  1444. // cloudMap.initLegend("top-left"); //显示图例
  1445. // cloudMap.click(doSomeThing); //绑定点击查询事件,点击空白处返回 “0”,点击具体的点则会返回相应数doSomeThing是回调函数,根据返回的结果
  1446. //获取全部图层名称
  1447. // var allLayerTitle = cloudMap.getAllLayerTitle();
  1448. // console.log(allLayerTitle);
  1449. //动态添加图层(下拉列表)
  1450. // allLayerTitle.forEach((element) => {
  1451. // //console.log(element);
  1452. // document
  1453. // .getElementById("txt_layer")
  1454. // .options.add(new Option(element, element));
  1455. // document
  1456. // .getElementById("txt_layer2")
  1457. // .options.add(new Option(element, element));
  1458. // });
  1459. }
  1460. //#endregion 渲染地图--------------------end
  1461. //
  1462. })
  1463. }]);