total.js 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986
  1. // 各地区名称
  2. var region = [];
  3. province.forEach(function(item){
  4. region.push(item.NAME);
  5. });
  6. // 各地区用户人数
  7. var users = [];
  8. province.forEach(function(item){
  9. users.push(item.usercount);
  10. });
  11. // 巡更次数
  12. var patrolCount = province.map(item => ({
  13. day: item.patrolx,
  14. '巡查次数': item.patroly,
  15. })
  16. );
  17. // 各地区近一周订单量
  18. var ordersWeek = [];
  19. province.forEach(function(item){
  20. ordersWeek.push(item.ordertotalweek);
  21. });
  22. // 各地区近一月订单量
  23. var ordersMonth = [];
  24. province.forEach(function(item){
  25. ordersMonth.push(item.ordertotalmonth);
  26. });
  27. // 防患数据
  28. var prevent = [];
  29. province.forEach(function(item){
  30. prevent.push(item.yinhuaorder);
  31. });
  32. // 投诉数据
  33. var complain = [];
  34. province.forEach(function(item){
  35. complain.push(item.complaincount);
  36. });
  37. // 已转任务比率
  38. var preventionRatio = [];
  39. province.forEach(function(item){
  40. preventionRatio.push(parseInt(item.yinhuabl * 100));
  41. });
  42. // 总任务量
  43. var taskTotal = [];
  44. province.forEach(function(item){
  45. taskTotal.push(item.todototalcount);
  46. });
  47. // 已转任务比率
  48. var taskFinishRatio = [];
  49. province.forEach(function(item){
  50. taskFinishRatio.push(item.todobl * 100);
  51. });
  52. // 设备维护次数
  53. var deviceCount = [];
  54. province.forEach(function(item){
  55. deviceCount.push(item.devicerecordcount);
  56. });
  57. // 保洁
  58. var cleaningRatio = [];
  59. province.forEach(function(item){
  60. cleaningRatio.push(item.userbl3 * 100);
  61. });
  62. // 保安
  63. var securityRatio = [];
  64. province.forEach(function(item){
  65. securityRatio.push(item.userbl4 * 100);
  66. });
  67. // 维修
  68. var repairRatio = [];
  69. province.forEach(function(item){
  70. repairRatio.push(item.userbl2 * 100);
  71. });
  72. // 运送
  73. var transportRatio = [];
  74. province.forEach(function(item){
  75. transportRatio.push(item.userbl1 * 100);
  76. });
  77. // 安保数据统计(列表)
  78. var preventDayList = province.map(item => ({
  79. region: item.NAME,
  80. date: item.daytext,
  81. count: item.yinhuanday
  82. })
  83. );
  84. var preventWeekList = province.map(item => ({
  85. region: item.NAME,
  86. date: item.weektext,
  87. count: item.yinhuanweek
  88. })
  89. );
  90. var preventMonthList = province.map(item => ({
  91. region: item.NAME,
  92. date: item.monthtext,
  93. count: item.yinhuanmonth
  94. })
  95. );
  96. // 任务数据统计(列表)
  97. var taskFinishDayList = province.map(item => ({
  98. region: item.NAME,
  99. date: item.daytext,
  100. count: item.todofinishday
  101. })
  102. );
  103. var taskFinishWeekList = province.map(item => ({
  104. region: item.NAME,
  105. date: item.weektext,
  106. count: item.todofinishweek
  107. })
  108. );
  109. var taskFinishMonthList = province.map(item => ({
  110. region: item.NAME,
  111. date: item.monthtext,
  112. count: item.todofinishmonth
  113. })
  114. );
  115. var regionsList = [];
  116. var regionsListIndex = 0;
  117. //初始化
  118. for (var i=0;i<5;i++){
  119. if(regionsListIndex >= region.length){
  120. regionsListIndex = 0;
  121. }
  122. regionsList.push(region[regionsListIndex]);
  123. regionsListIndex++;
  124. }
  125. function personnel() {
  126. if (province.length > 0) {
  127. var personnelChart = echarts.init(document.getElementById("personnel"));
  128. personnelOption = null;
  129. personnelOption = {
  130. color: ['#50e2cb'],
  131. legend: {
  132. data:['用户人数'],
  133. textStyle: { color: "#FFFDFE" },
  134. // icon: "circle",
  135. },
  136. tooltip : {
  137. trigger: 'axis',
  138. axisPointer : { // 坐标轴指示器,坐标轴触发有效
  139. type : 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  140. }
  141. },
  142. grid: {
  143. left: '3%',
  144. right: '4%',
  145. bottom: '3%',
  146. containLabel: true
  147. },
  148. xAxis : [
  149. {
  150. type : 'category',
  151. data : region,
  152. axisTick: {
  153. alignWithLabel: true
  154. },
  155. axisLabel: {
  156. color:'#fff',
  157. },
  158. axisLine: {
  159. lineStyle: {
  160. type: 'solid',
  161. color: '#fff',
  162. }
  163. }
  164. }
  165. ],
  166. yAxis : [
  167. {
  168. type : 'value',
  169. axisLabel: {
  170. color:'#fff',
  171. },
  172. axisLine: {
  173. lineStyle: {
  174. type: 'solid',
  175. color: '#fff',
  176. }
  177. }
  178. }
  179. ],
  180. series : [
  181. {
  182. name:'用户人数',
  183. type:'bar',
  184. barMaxWidth: 30,
  185. label: {
  186. normal: {
  187. show: true,
  188. position: 'top',
  189. color: '#fff'
  190. }
  191. },
  192. data: users
  193. }
  194. ]
  195. };
  196. if (personnelOption && typeof personnelOption === "object") {
  197. personnelChart.setOption(personnelOption, true);
  198. }
  199. }
  200. }
  201. function orders(type) {
  202. if (province.length > 0) {
  203. var list = type === 1 ? ordersWeek : ordersMonth;
  204. var ordersChart = echarts.init(document.getElementById("orders"));
  205. ordersOption = null;
  206. ordersOption = {
  207. color:['#50e2cb','#137bc4'],
  208. tooltip: {
  209. trigger: 'axis',
  210. axisPointer: {
  211. type: 'shadow'
  212. }
  213. },
  214. grid: {
  215. left: '3%',
  216. right: '4%',
  217. bottom: '3%',
  218. containLabel: true
  219. },
  220. xAxis: {
  221. type: 'value',
  222. boundaryGap: [0, 0.01],
  223. axisLabel: {
  224. color:'#fff',
  225. }
  226. },
  227. yAxis: {
  228. type: 'category',
  229. data : region,
  230. axisLabel: {
  231. color:'#fff',
  232. }
  233. },
  234. series: [
  235. {
  236. name: '订单量',
  237. type: 'bar',
  238. barMaxWidth: 30,
  239. label: {
  240. normal: {
  241. show: true,
  242. position: 'right',
  243. color: '#fff'
  244. }
  245. },
  246. data: list
  247. }
  248. ]
  249. };
  250. if (ordersOption && typeof ordersOption === "object") {
  251. ordersChart.setOption(ordersOption, true);
  252. }
  253. }
  254. $('.orders-selects-total').removeClass('active');
  255. $('#orders'+type).addClass('active');
  256. }
  257. // 各地安保图表
  258. function prevention() {
  259. if (province.length > 0) {
  260. var preventionChart = echarts.init(document.getElementById("prevention"));
  261. preventionOption = null;
  262. preventionOption = {
  263. color:['#50e2cb','#137bc4','#eac304'],
  264. tooltip: {
  265. trigger: 'axis',
  266. axisPointer: {
  267. type: 'cross',
  268. crossStyle: {
  269. color: '#999'
  270. }
  271. }
  272. },
  273. legend: {
  274. data:['防患数据','投诉意见数据','已转任务比率'],
  275. textStyle: { color: "#FFFDFE" },
  276. top: 10
  277. },
  278. xAxis: [
  279. {
  280. type: 'category',
  281. data : region,
  282. axisPointer: {
  283. type: 'shadow'
  284. },
  285. axisLabel: {
  286. color:'#fff',
  287. }
  288. }
  289. ],
  290. yAxis: [
  291. {
  292. type: 'value',
  293. axisLabel: {
  294. formatter: '{value}',
  295. color:'#fff',
  296. }
  297. },
  298. {
  299. type: 'value',
  300. axisLabel: {
  301. formatter: '{value} %',
  302. color:'#fff',
  303. }
  304. }
  305. ],
  306. series: [
  307. {
  308. name:'防患数据',
  309. type:'bar',
  310. data: prevent
  311. },
  312. {
  313. name:'投诉意见数据',
  314. type:'bar',
  315. data: complain
  316. },
  317. {
  318. name:'已转任务比率',
  319. type:'line',
  320. yAxisIndex: 1,
  321. data: preventionRatio
  322. }
  323. ]
  324. };
  325. if (preventionOption && typeof preventionOption === "object") {
  326. preventionChart.setOption(preventionOption, true);
  327. }
  328. }
  329. }
  330. // 任务完成比率
  331. function taskRatio() {
  332. if (province.length > 0) {
  333. var assignmentsChart = echarts.init(document.getElementById("assignments"));
  334. assignmentsOption = null;
  335. assignmentsOption = {
  336. color:['#50e2cb','#137bc4'],
  337. tooltip: {
  338. trigger: 'axis',
  339. axisPointer: {
  340. type: 'cross',
  341. crossStyle: {
  342. color: '#999'
  343. }
  344. }
  345. },
  346. legend: {
  347. data:['总任务量','完成任务比率'],
  348. textStyle: { color: "#FFFDFE" },
  349. top: 10
  350. },
  351. xAxis: [
  352. {
  353. type: 'category',
  354. data : region,
  355. axisPointer: {
  356. type: 'shadow'
  357. },
  358. axisLabel: {
  359. color:'#fff',
  360. }
  361. }
  362. ],
  363. yAxis: [
  364. {
  365. type: 'value',
  366. axisLabel: {
  367. formatter: '{value}',
  368. color:'#fff',
  369. }
  370. },
  371. {
  372. type: 'value',
  373. axisLabel: {
  374. formatter: '{value} %',
  375. color:'#fff',
  376. }
  377. }
  378. ],
  379. series: [
  380. {
  381. name:'总任务量',
  382. type:'bar',
  383. barMaxWidth: 30,
  384. data: taskTotal
  385. },
  386. {
  387. name:'完成任务比率',
  388. type:'line',
  389. yAxisIndex: 1,
  390. data: taskFinishRatio
  391. }
  392. ]
  393. };
  394. if (assignmentsOption && typeof assignmentsOption === "object") {
  395. assignmentsChart.setOption(assignmentsOption, true);
  396. }
  397. }
  398. }
  399. // 员工学习
  400. function learning(i) {
  401. if (province.length > 0) {
  402. // var str = '';
  403. // for (var i in region){
  404. // str += '<span class="organization-title">'+region[i]+'</span>';
  405. // }
  406. // $('#leaning-title').html(str);
  407. $('.region').removeClass('active');
  408. $('#region'+i).addClass('active');
  409. var cleaning = echarts.init(document.getElementById('cleaning'));
  410. cleaningOption = {
  411. color: ['#2b5e8e', '#40edfe'],
  412. title: {
  413. text: '保洁',
  414. textStyle: {
  415. color: '#fff',
  416. fontSize: 14,
  417. },
  418. y: 'bottom',
  419. x: 'center',
  420. },
  421. series: [{
  422. name: '保洁',
  423. type: 'pie',
  424. radius: ['50%', '60%'],
  425. avoidLabelOverlap: false,
  426. label: {
  427. normal: {
  428. show: false,
  429. position: 'center',
  430. textStyle: {
  431. fontSize: 18,
  432. color: '#eac304',
  433. },
  434. formatter: '{c}%'
  435. }
  436. },
  437. labelLine: {
  438. normal: {
  439. show: false
  440. }
  441. },
  442. data: [
  443. {
  444. value: parseInt(100 - cleaningRatio[i]),
  445. color: '#40edfe',
  446. label: {
  447. normal: {
  448. show: false
  449. }
  450. }
  451. },
  452. {
  453. value: parseInt(cleaningRatio[i]),
  454. color: '#2b5e8e',
  455. label: {
  456. normal: {
  457. show: true,
  458. position: 'center',
  459. textStyle: {
  460. fontSize: 18,
  461. color: '#eac304',
  462. },
  463. formatter: '{c}%'
  464. }
  465. }
  466. }
  467. ]
  468. }]
  469. };
  470. cleaning.setOption(cleaningOption);
  471. // 保安
  472. var security = echarts.init(document.getElementById('security'));
  473. securityOption = {
  474. color: ['#2b5e8e', '#40edfe'],
  475. title: {
  476. text: '保安',
  477. textStyle: {
  478. color: '#fff',
  479. fontSize: 14,
  480. },
  481. y: 'bottom',
  482. x: 'center',
  483. },
  484. series: [{
  485. name: '保安',
  486. type: 'pie',
  487. radius: ['50%', '60%'],
  488. avoidLabelOverlap: false,
  489. label: {
  490. normal: {
  491. show: true,
  492. position: 'center',
  493. textStyle: {
  494. fontSize: 18,
  495. color: '#eac304',
  496. },
  497. formatter: '{c}%'
  498. }
  499. },
  500. labelLine: {
  501. normal: {
  502. show: false
  503. }
  504. },
  505. data: [{
  506. value: parseInt(100 - securityRatio[i]),
  507. color: '#40edfe',
  508. label: {
  509. normal: {
  510. show: false
  511. }
  512. }
  513. }, {
  514. value: parseInt(securityRatio[i]),
  515. color: '#2b5e8e',
  516. label: {
  517. normal: {
  518. show: true,
  519. position: 'center',
  520. textStyle: {
  521. fontSize: 18,
  522. color: '#eac304',
  523. },
  524. formatter: '{c}%'
  525. }
  526. }
  527. },
  528. ]
  529. }]
  530. };
  531. security.setOption(securityOption);
  532. // 维修
  533. var repair = echarts.init(document.getElementById('repair'));
  534. repairOption = {
  535. color: ['#2b5e8e', '#40edfe'],
  536. title: {
  537. text: '维修',
  538. textStyle: {
  539. color: '#fff',
  540. fontSize: 14,
  541. },
  542. y: 'bottom',
  543. x: 'center',
  544. },
  545. series: [{
  546. name: '维修',
  547. type: 'pie',
  548. radius: ['50%', '60%'],
  549. avoidLabelOverlap: false,
  550. label: {
  551. normal: {
  552. show: true,
  553. position: 'center',
  554. textStyle: {
  555. fontSize: 18,
  556. color: '#eac304',
  557. },
  558. formatter: '{c}%'
  559. }
  560. },
  561. labelLine: {
  562. normal: {
  563. show: false
  564. }
  565. },
  566. data: [{
  567. value: parseInt(100 - repairRatio[i]),
  568. color: '#40edfe',
  569. label: {
  570. normal: {
  571. show: false
  572. }
  573. }
  574. }, {
  575. value: parseInt(repairRatio[i]),
  576. color: '#2b5e8e',
  577. label: {
  578. normal: {
  579. show: true,
  580. position: 'center',
  581. textStyle: {
  582. fontSize: 18,
  583. color: '#eac304',
  584. },
  585. formatter: '{c}%'
  586. }
  587. }
  588. }]
  589. }]
  590. };
  591. repair.setOption(repairOption);
  592. // 运送
  593. var transport = echarts.init(document.getElementById('transport'));
  594. transportOption = {
  595. color: ['#2b5e8e', '#40edfe'],
  596. title: {
  597. text: '运送',
  598. textStyle: {
  599. color: '#fff',
  600. fontSize: 14,
  601. },
  602. y: 'bottom',
  603. x: 'center',
  604. },
  605. series: [{
  606. name: '运送',
  607. type: 'pie',
  608. radius: ['50%', '60%'],
  609. avoidLabelOverlap: false,
  610. label: {
  611. normal: {
  612. show: true,
  613. position: 'center',
  614. textStyle: {
  615. fontSize: 18,
  616. color: '#eac304',
  617. },
  618. formatter: '{c}%'
  619. }
  620. },
  621. labelLine: {
  622. normal: {
  623. show: false
  624. }
  625. },
  626. data: [{
  627. value: parseInt(100 - transportRatio[i]),
  628. color: '#40edfe',
  629. label: {
  630. normal: {
  631. show: false
  632. }
  633. }
  634. }, {
  635. value: parseInt(transportRatio[i]),
  636. color: '#2b5e8e',
  637. label: {
  638. normal: {
  639. show: true,
  640. position: 'center',
  641. textStyle: {
  642. fontSize: 18,
  643. color: '#eac304',
  644. },
  645. formatter: '{c}%'
  646. }
  647. }
  648. },
  649. ]
  650. }]
  651. };
  652. transport.setOption(transportOption);
  653. }
  654. }
  655. // 各地区设备维护
  656. function deviceRecord() {
  657. if (province.length > 0) {
  658. var deviceChart = echarts.init(document.getElementById("device"));
  659. deviceOption = null;
  660. deviceOption = {
  661. color: ['#50e2cb'],
  662. legend: {
  663. data:['维护次数'],
  664. textStyle: { color: "#FFFDFE" },
  665. // icon: "circle",
  666. },
  667. tooltip : {
  668. trigger: 'axis',
  669. axisPointer : { // 坐标轴指示器,坐标轴触发有效
  670. type : 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  671. }
  672. },
  673. grid: {
  674. left: '3%',
  675. right: '4%',
  676. bottom: '3%',
  677. containLabel: true
  678. },
  679. xAxis : [
  680. {
  681. type : 'category',
  682. data : region,
  683. axisTick: {
  684. alignWithLabel: true
  685. },
  686. axisLabel: {
  687. color:'#fff',
  688. },
  689. axisLine: {
  690. lineStyle: {
  691. type: 'solid',
  692. color: '#fff',
  693. }
  694. }
  695. }
  696. ],
  697. yAxis : [
  698. {
  699. type : 'value',
  700. axisLabel: {
  701. color:'#fff',
  702. },
  703. axisLine: {
  704. lineStyle: {
  705. type: 'solid',
  706. color: '#fff',
  707. }
  708. }
  709. }
  710. ],
  711. series : [
  712. {
  713. name:'维护次数',
  714. type:'bar',
  715. barMaxWidth: 30,
  716. label: {
  717. normal: {
  718. show: true,
  719. position: 'top',
  720. color: '#fff'
  721. }
  722. },
  723. data: deviceCount
  724. }
  725. ]
  726. };
  727. if (deviceOption && typeof deviceOption === "object") {
  728. deviceChart.setOption(deviceOption, true);
  729. }
  730. }
  731. }
  732. // 各地区任务列表
  733. function taskList(type) {
  734. if (province.length > 0) {
  735. if (province.length > 0) {
  736. var list;
  737. if (type == 1) {
  738. list = taskFinishDayList;
  739. } else if (type == 2) {
  740. list = taskFinishWeekList;
  741. } else {
  742. list = taskFinishMonthList;
  743. }
  744. let str = '';
  745. for (var i in list) {
  746. str += '<tr>';
  747. str += '<td>' + list[i]['region'] + '</td>';
  748. str += '<td>' + list[i]['date'] + '</td>';
  749. str += '<td>' + list[i]['count'] + '</td>';
  750. str += '</tr>';
  751. }
  752. $('#task').html(str);
  753. }
  754. $('.task').removeClass('active');
  755. $('#tasks' + type).addClass('active');
  756. }
  757. }
  758. // 各地区隐患列表
  759. function preventionList(type) {
  760. if (province.length > 0) {
  761. var list;
  762. if (type == 1) {
  763. list = preventDayList;
  764. } else if (type == 2) {
  765. list = preventWeekList;
  766. } else {
  767. list = preventMonthList;
  768. }
  769. let str = '';
  770. for (var i in list){
  771. str += '<tr>';
  772. str += '<td>' + list[i]['region'] + '</td>';
  773. str += '<td>'+ list[i]['date'] +'</td>';
  774. str += '<td>'+ list[i]['count'] +'</td>';
  775. str += '</tr>';
  776. }
  777. $('#hiddenDanger').html(str);
  778. }
  779. $('.date').removeClass('active');
  780. $('#date'+type).addClass('active');
  781. }
  782. function patrol(i) {
  783. if (province.length > 0) {
  784. // var str = '';
  785. // for (var o in region){
  786. // if(o == 0){
  787. // str += '<span class="organization-title regions active">'+region[o]+'</span>';
  788. // }else{
  789. // str += '<span class="organization-title regions">'+region[o]+'</span>';
  790. // }
  791. // }
  792. // $('#patrol-title').html(str);
  793. var patrolChart = echarts.init(document.getElementById("patrol"));
  794. patrolOption = null;
  795. patrolOption = {
  796. color: ['#50e2cb', '#137bc4'],
  797. legend: {
  798. data: ['巡查次数'],
  799. textStyle: {color: "#FFFDFE"},
  800. // icon: "circle",
  801. },
  802. tooltip: {},
  803. dataset: {
  804. dimensions: ['day', '巡查次数'],
  805. source: patrolCount[i]
  806. },
  807. xAxis: {
  808. type: 'category',
  809. axisLabel: {
  810. color: '#fff',
  811. }
  812. },
  813. yAxis: {
  814. axisLabel: {
  815. color: '#fff',
  816. }
  817. },
  818. series: [
  819. {
  820. type: 'bar',
  821. barWidth: 30,
  822. label: {
  823. normal: {
  824. show: true,
  825. position: 'top',
  826. color: '#fff'
  827. }
  828. },
  829. }
  830. ]
  831. };
  832. if (patrolOption && typeof patrolOption === "object") {
  833. patrolChart.setOption(patrolOption, true);
  834. }
  835. $('.regions').removeClass('active');
  836. $('#regions'+i).addClass('active');
  837. // regionsList.shift();
  838. // if(regionsListIndex >= region.length){
  839. // regionsListIndex = 0;
  840. // }
  841. // regionsList.push(region[regionsListIndex]);
  842. // regionsListIndex++;
  843. }
  844. }
  845. $(function(){
  846. var text=$("#task:first");
  847. var clear;
  848. text.hover(function(){
  849. clearInterval(clear);
  850. },function(){
  851. clear=setInterval(function(){
  852. var field=text.find("tr:first");
  853. var high=field.height();
  854. text.animate({ marginTop:-high+"px"},600,function(){
  855. field.css("marginTop",0).appendTo(text);
  856. text.css("marginTop",0);
  857. })
  858. },2000)//滚动间隔时间
  859. }).trigger("mouseleave");//自动滚动
  860. });
  861. $(function(){
  862. var text=$("#hiddenDanger:first");
  863. var clear;
  864. text.hover(function(){
  865. clearInterval(clear);
  866. },function(){
  867. clear=setInterval(function(){
  868. var field=text.find("tr:first");
  869. var high=field.height();
  870. text.animate({ marginTop:-high+"px"},600,function(){
  871. field.css("marginTop",0).appendTo(text);
  872. text.css("marginTop",0);
  873. })
  874. },2000)//滚动间隔时间
  875. }).trigger("mouseleave");//自动滚动
  876. });
  877. personnel();
  878. orders(1);
  879. prevention();
  880. taskRatio();
  881. learning(0);
  882. deviceRecord();
  883. taskList(1);
  884. preventionList(1);
  885. patrol(0);
  886. for (var i=1; i<4; i++) {
  887. (function (i) {
  888. setTimeout(() => taskList(i), 10000*i);
  889. setTimeout(() => preventionList(i), 10000*i);
  890. })(i)
  891. }
  892. setInterval(function(){
  893. for (var i=1; i<4; i++) {
  894. (function (i) {
  895. setTimeout(() => taskList(i), 10000*i);
  896. setTimeout(() => preventionList(i), 10000*i);
  897. })(i)
  898. }
  899. },30000);
  900. for (var i=1; i<3; i++) {
  901. (function (i) {
  902. setTimeout(() => orders(i), 5000*i);
  903. })(i)
  904. }
  905. setInterval(function(){
  906. for (var i=1; i<3; i++) {
  907. (function (i) {
  908. setTimeout(() => orders(i), 5000*i);
  909. })(i)
  910. }
  911. },10000);
  912. var len = region.length;
  913. for (var i = 0; i< len; i++) {
  914. (function (i) {
  915. setTimeout(() => learning(i), 5000*i);
  916. setTimeout(() => patrol(i), 5000*i);
  917. })(i)
  918. }
  919. setInterval(function(){
  920. for (var i = 0; i < len; i++) {
  921. (function (i) {
  922. setTimeout(() => learning(i), 5000*i);
  923. setTimeout(() => patrol(i), 5000*i);
  924. })(i)
  925. }
  926. },5000 * len);
  927. // setInterval(function(){
  928. // patrol();
  929. // },5000);