charts3.js 51 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485
  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. $scope.cloudMap.changeLayerVisible('2.5D底图', false);
  1366. map_time_area({
  1367. "startTime": moment(new Date().getTime()).format("YYYY-MM-DD") + ' 00:00:00',
  1368. "endTime": moment(new Date().getTime()).format("YYYY-MM-DD HH:mm:ss")
  1369. })
  1370. //cloudMap.changeLayerVisible('建筑物中心点', false);
  1371. //地图加载成功
  1372. // cloudMap.initLayerList("top-right"); //显示图层管理模块,位置top-right,top-left,bottom-right,bottom-right
  1373. // cloudMap.initLegend("top-left"); //显示图例
  1374. // cloudMap.click(doSomeThing); //绑定点击查询事件,点击空白处返回 “0”,点击具体的点则会返回相应数doSomeThing是回调函数,根据返回的结果
  1375. //获取全部图层名称
  1376. // var allLayerTitle = cloudMap.getAllLayerTitle();
  1377. // console.log(allLayerTitle);
  1378. //动态添加图层(下拉列表)
  1379. // allLayerTitle.forEach((element) => {
  1380. // //console.log(element);
  1381. // document
  1382. // .getElementById("txt_layer")
  1383. // .options.add(new Option(element, element));
  1384. // document
  1385. // .getElementById("txt_layer2")
  1386. // .options.add(new Option(element, element));
  1387. // });
  1388. }
  1389. //#endregion 渲染地图--------------------end
  1390. //
  1391. })
  1392. }]);