personnelList.html 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta
  6. name="viewport"
  7. content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"
  8. />
  9. <meta
  10. name="format-detection"
  11. content="telephone=no,email=no,date=no,address=no"
  12. />
  13. <title></title>
  14. <link rel="stylesheet" type="text/css" href="../../css/api.css" />
  15. <link rel="stylesheet" type="text/css" href="../../css/popoPicker.css" />
  16. <link rel="stylesheet" type="text/css" href="../../css/style.css" />
  17. <link rel="stylesheet" href="../../css/aui.css" />
  18. <link rel="stylesheet" href="../../css/projeck.css" />
  19. <style>
  20. body,html{
  21. background: #F3F3F3;
  22. overflow: hidden;
  23. -webkit-box-sizing: border-box;
  24. -moz-box-sizing: border-box;
  25. box-sizing: border-box;
  26. position: relative;
  27. }
  28. .api_layout{
  29. height: 100%;
  30. overflow-y: scroll;
  31. -webkit-overflow-scrolling: touch;
  32. }
  33. .contents{
  34. padding: 7px;
  35. }
  36. .monitorList{
  37. padding: 14px;
  38. }
  39. .monitorList li{
  40. display: flex;
  41. display: -webkit-flex;
  42. justify-content: space-between;
  43. -webkit-justify-content: space-between;
  44. height: 56px;
  45. line-height: 56px;
  46. align-items: center;
  47. color: #5a5a5a;
  48. font-size: 14px;
  49. position: relative;
  50. }
  51. .monitorList li:after{
  52. content: '';
  53. display: table;
  54. position: absolute;
  55. width: 100%;
  56. height: 1px;
  57. background: #e8e9ea;
  58. bottom: 0;
  59. left: 0;
  60. }
  61. .monitorList li img{
  62. width: 42px;
  63. height: 42px;
  64. display: block;
  65. -webkit-border-radius: 50%;
  66. -moz-border-radius: 50%;
  67. border-radius: 50%;
  68. margin-right: 19px;
  69. }
  70. .right_side{
  71. position: absolute;
  72. top: 0;
  73. right: -100%;
  74. width: 100%;
  75. height: 100%;
  76. background: rgba(0,0,0,.6);
  77. transition: .5ms;
  78. }
  79. .list{
  80. position: absolute;
  81. top: 0;
  82. right: -75%;
  83. width: 75%;
  84. right:0;
  85. height: 100%;
  86. background: #fff;
  87. transition: .3s;
  88. }
  89. .titles{
  90. height: 38px;
  91. line-height: 38px;
  92. padding-left: 15px;
  93. font-size: 15px;
  94. color: #2c3e50;
  95. position: relative;
  96. }
  97. .titles:after{
  98. content: '';
  99. display: table;
  100. position: absolute;
  101. bottom: 0;
  102. left: 0;
  103. width: 100%;
  104. height: 1px;
  105. background: #009fe8;
  106. }
  107. .titles i{
  108. display: block;
  109. width: 19px;
  110. height: 19px;
  111. line-height: 19px;
  112. background: url("../../image/close.png") no-repeat;
  113. background-size: cover;
  114. text-align: center;
  115. -webkit-box-sizing: border-box;
  116. -moz-box-sizing: border-box;
  117. box-sizing: border-box;
  118. position: absolute;
  119. top: 8px;
  120. right: 10px;
  121. color: #ced3d6;
  122. font-size: 8px;
  123. }
  124. .api_lists{
  125. padding: 0 14px;
  126. height: 100%;
  127. overflow-y: scroll;
  128. padding-bottom: 38px;
  129. -webkit-overflow-scrolling: touch;
  130. }
  131. .api_lists li{
  132. display: flex;
  133. display: -webkit-flex;
  134. justify-content: space-between;
  135. -webkit-justify-content:space-between;
  136. height: 45px;
  137. align-items: center;
  138. position: relative;
  139. }
  140. .info p{
  141. font-size: 15px;
  142. }
  143. .api_lists li:after{
  144. content: '';
  145. display: table;
  146. position: absolute;
  147. bottom: 0;
  148. left: 0;
  149. width: 100%;
  150. height: 1px;
  151. background: #e8e9ea;
  152. }
  153. .api_lists li p{
  154. color: #2c3e50;
  155. font-size: 13px;
  156. }
  157. .api_lists #contetnNo{
  158. text-align: center;
  159. font-size: 14px;
  160. color: #bdc3c7;
  161. height: 50px;
  162. margin-top:20px;
  163. /*justify-content: center;
  164. -webkit-justify-content: center;*/
  165. display: none;
  166. }
  167. .api_lists #contetnNo:after{
  168. content: '';
  169. display: table;
  170. position: absolute;
  171. bottom: 0;
  172. left: 0;
  173. width: 100%;
  174. height: 0;
  175. background: #e8e9ea;
  176. }
  177. #noJurisdiction{
  178. background: url('../../image/no.png') no-repeat;
  179. background-size: contain;
  180. position: absolute;
  181. top: -50%;
  182. left: 0;
  183. bottom: 0;
  184. right: 0;
  185. margin: auto;
  186. width: 125px;
  187. height: 142px;
  188. display: none;
  189. }
  190. .num{
  191. color: #27AE60;
  192. font-size: 14px;
  193. }
  194. .ico-more{
  195. width: 13px;
  196. height: 13px;
  197. background: url("../../image/more.png") no-repeat;
  198. background-size: cover;
  199. background-position: center;
  200. margin-left: 5px;
  201. }
  202. .loading{
  203. position: absolute;
  204. width: 100%;
  205. height: 100%;
  206. background: rgba(255,255,255,.3);
  207. top: 0;
  208. left: 0;
  209. }
  210. .Notice{
  211. margin-bottom: 7px;
  212. }
  213. .ico-loading{
  214. position: absolute;
  215. top: 0;
  216. left: 0;
  217. bottom: 0;
  218. right: 0;
  219. margin: auto;
  220. width: 35px;
  221. height: 35px;
  222. background: url("../../icon/loading.gif") no-repeat;
  223. background-size: cover;
  224. background-position: center;
  225. }
  226. .time-box{
  227. position: absolute;
  228. bottom: 7px;
  229. right: 7px;
  230. font-size: 16px;
  231. color: #3B3B4D;
  232. font-weight: bold;
  233. line-height: initial;
  234. }
  235. .nav_title{
  236. padding: 0 5px;
  237. background: #F3F6FA;
  238. }
  239. .nav_title li{
  240. text-align: center;
  241. font-size: 14px;
  242. padding: 9px 0 ;
  243. color: #232627;
  244. }
  245. .nav_title li:nth-child(1),.nav_title li:nth-child(2){
  246. width: 25%;
  247. }
  248. .nav_title li:nth-child(3){
  249. width: 50%;
  250. text-align: right;
  251. }
  252. .downWellPersonnal{
  253. background: #fff;
  254. }
  255. .li-box{
  256. height: 39px;
  257. line-height: 39px;
  258. font-size: 14px;
  259. color: #232627;
  260. }
  261. .li-box span:nth-child(1),.li-box span:nth-child(2){
  262. width: 25%;
  263. }
  264. .li-box span:nth-child(3){
  265. width: 50%;
  266. text-align: right;
  267. }
  268. .keyPostList{
  269. margin-top: 30px;
  270. }
  271. .keyPostList p{
  272. color: #3B4A74;
  273. font-size: 14px;
  274. width: 67px;
  275. text-align: center;
  276. margin-top: 10px;
  277. }
  278. .keyPostList span{
  279. display: block;
  280. width: 60px;
  281. height: 60px;
  282. -webkit-border-radius: 50%;
  283. -moz-border-radius: 50%;
  284. border-radius: 50%;
  285. line-height: 60px;
  286. text-align: center;
  287. color: #fff;
  288. margin: auto;
  289. }
  290. .keyPostList li:nth-child(1) span:first-child{
  291. background: #E74C3C;
  292. }.keyPostList li:nth-child(2) span:first-child{
  293. background: #2C3E50;
  294. }.keyPostList li:nth-child(3) span:first-child{
  295. background: #1ABC9C;
  296. }.keyPostList li:nth-child(4) span:first-child{
  297. background: #2873FF;
  298. }
  299. .depTitle{
  300. margin-top: 20px;
  301. color: #232627;
  302. font-size: 16px;
  303. margin-bottom: 10px;
  304. }
  305. #button-value{
  306. width: 194px;
  307. padding-left:24px;
  308. }
  309. .lower{
  310. top: 13px;
  311. }
  312. .equipmentStatus{
  313. margin-top: 30px;
  314. text-align: center;
  315. }
  316. .hollowCircle{
  317. display: block;
  318. width: 60px;
  319. height: 60px;
  320. -webkit-border-radius: 50%;
  321. -moz-border-radius: 50%;
  322. border-radius: 50%;
  323. line-height: 55px;
  324. text-align: center;
  325. border: 4px solid #6C6F74;
  326. margin-bottom: 10px;
  327. color: #3B3B4D;
  328. font-size: 14px;
  329. }
  330. .equipmentStatus li:nth-child(2) .hollowCircle{
  331. border: 4px solid #14D2B8;
  332. }
  333. .equipmentStatus li:nth-child(3) .hollowCircle{
  334. border: 4px solid #FF8B8C;
  335. }
  336. .circularR{
  337. width: 85px;
  338. height: 85px;
  339. -webkit-border-radius: 50%;
  340. -moz-border-radius: 50%;
  341. border-radius: 50%;
  342. line-height: 78px;
  343. text-align: center;
  344. border: 4px solid #14D2B8;
  345. margin: auto;
  346. margin-bottom: 10px;
  347. color: #3B3B4D;
  348. font-size: 16px;
  349. }
  350. .Chart{
  351. margin-top: 30px;
  352. }
  353. #equipmentStatusList{
  354. padding: 0 15px;
  355. }
  356. </style>
  357. </head>
  358. <body>
  359. <div class="api_layout">
  360. <!-- 图片展示 -->
  361. <div class="banners relative">
  362. <img
  363. src="http://jiewei-icon.oss-cn-beijing.aliyuncs.com/banner.png"
  364. alt=""
  365. />
  366. <!--时间-->
  367. <div class="time-box"></div>
  368. </div>
  369. <div class="contents">
  370. <!--当前井下人员-->
  371. <div class="Notice borderRa beforS">
  372. <p class="Stitle centertT">当前井下人员</p>
  373. <div class="" style="width: 100%;">
  374. <canvas
  375. id="downWell"
  376. style="width: 100%; margin-top: 10px; height: 210px;"
  377. ></canvas>
  378. </div>
  379. <!--列表-->
  380. <!-- <nav>
  381. <ul class="nav_title flex-start">
  382. <li>姓名</li>
  383. <li>下井时间</li>
  384. <li>当前位置</li>
  385. </ul>
  386. </nav>
  387. <ul class="downWellPersonnal" id="downWellPersonnal">
  388. </ul> -->
  389. </div>
  390. <!--井下人员(区域分布)-->
  391. <div class="Notice borderRa beforS">
  392. <p class="Stitle centertT">井下人员(区域分布)</p>
  393. <ul class="monitorList" id="monitorList"></ul>
  394. </div>
  395. <!--人员告警信息-->
  396. <div class="Notice borderRa beforS">
  397. <p class="Stitle centertT">人员告警信息</p>
  398. <div class="Chart flex-space">
  399. <div
  400. style="width: 50%;"
  401. class="canvasParent centertT"
  402. onclick="giveAlarmDetails('giveAlarm','超时人数','姓名','部门','当前位置','下井时间',zaoquanUrlRouter.getPersonnelTimeoutDetails,'')"
  403. >
  404. <div class="circularR sales">0人</div>
  405. <span class="canvasTitle">超时人数</span>
  406. </div>
  407. <div
  408. class="centertT"
  409. style="width: 50%;"
  410. onclick="giveAlarmDetails('giveAlarm','求救人数','姓名','部门','当前位置','下井时间',zaoquanUrlRouter.getPersonnelHelpDetails,'')"
  411. >
  412. <div class="circularR cryhelp" style="border: 4px solid #ff8b8c;">
  413. 0人
  414. </div>
  415. <span class="canvasTitle">求救人数</span>
  416. </div>
  417. </div>
  418. </div>
  419. <!--人员定位系统设备运行状态-->
  420. <div class="Notice borderRa beforS">
  421. <p class="Stitle centertT">人员定位系统设备运行状态</p>
  422. <div class="equipmentStatus">
  423. <ul class="flex-space" id="equipmentStatusList"></ul>
  424. </div>
  425. </div>
  426. <!--井下人员(部门分布)-->
  427. <div class="Notice borderRa beforS">
  428. <p class="Stitle centertT">井下人员(部门分布)</p>
  429. <div style="width: 100%;" class="canvasParent centertT">
  430. <p class="centertT depTitle" style="margin-top: 30px;">职能科室</p>
  431. <canvas
  432. id="department"
  433. style="width: 100%; height: 350px;"
  434. ></canvas>
  435. </div>
  436. <div class="centertT" style="width: 100%;">
  437. <p class="centertT depTitle">基层区队</p>
  438. <canvas
  439. id="districtTeam"
  440. style="width: 100%; height: 350px;"
  441. ></canvas>
  442. </div>
  443. </div>
  444. <!--全矿周下井趋势-->
  445. <div class="Notice borderRa beforS">
  446. <p class="Stitle centertT">全矿周下井趋势</p>
  447. <div class="Chart">
  448. <div class="" style="width: 100%;">
  449. <canvas
  450. id="moreDownWell"
  451. style="width: 100%; margin-top: 10px; height: 210px;"
  452. ></canvas>
  453. </div>
  454. </div>
  455. </div>
  456. <!--井下重点岗位人员分布-->
  457. <div class="Notice borderRa beforS">
  458. <p class="Stitle centertT">井下重点岗位人员分布</p>
  459. <ul class="flex-space keyPostList" id="keyPostList"></ul>
  460. </div>
  461. <!--当前各科室井下人数-->
  462. <div class="Notice borderRa">
  463. <div class="Chart" style="margin-top: 0;">
  464. <div class="flex-start">
  465. <div class="relative screen" style="margin: auto;">
  466. <input
  467. id="button-value"
  468. class="js-picker"
  469. value="当前各科室下井人数"
  470. />
  471. <i class="lower"></i>
  472. </div>
  473. </div>
  474. <div class="" style="width: 100%;">
  475. <canvas id="getDepartToday" style="width: 100%;"></canvas>
  476. </div>
  477. </div>
  478. </div>
  479. <div id="noJurisdiction"></div>
  480. </div>
  481. </div>
  482. <!--侧滑 遮罩层-->
  483. <div class="right_side" onclick="recoveryFun()"></div>
  484. <!--列表-->
  485. <div class="list">
  486. <p class="titles">
  487. <span></span>
  488. <i onclick="recoveryFun()"></i>
  489. </p>
  490. <ul class="api_lists" id="api_lists">
  491. <li id="contetnNo">-暂无内容-</li>
  492. </ul>
  493. <div class="loading">
  494. <i class="ico-loading"></i>
  495. </div>
  496. </div>
  497. <script type="text/template" id="template">
  498. {{~it:value}}
  499. <li onclick="seeMonitorList('{{=value.area_id}}','{{=value.area_name}}','')">
  500. <div class="flex-start">
  501. <img src="{{=value.thumb}}" alt="">
  502. <span>{{=value.area_name}}</span>
  503. </div>
  504. <span class="num">{{=value.pepole_num}}人</span>
  505. </li>
  506. {{~}}
  507. </script>
  508. <script type="text/template" id="template01">
  509. {{~it:value}}
  510. <li onclick="personnelDeteila('{{=value.station_name}}','{{=value.station_id}}')">
  511. <p>{{=value.station_name}}</p>
  512. <div class="flex-start">
  513. <p>{{=value.pepole_num}}人</p>
  514. <i class="ico-more"></i>
  515. </div>
  516. </li>
  517. {{~}}
  518. </script>
  519. <script type="text/template" id="downWellTemplate">
  520. {{~it:value}}
  521. <li class="flex-start li-box centertT relative after-border">
  522. <span>{{=value.name}}</span>
  523. <span>{{=value.down_time}}</span>
  524. <span>{{=value.station_name}}</span>
  525. </li>
  526. {{~}}
  527. </script>
  528. <script type="text/template" id="keyPostListTemplate">
  529. {{~it:value}}
  530. <li onclick="giveAlarmDetails('Working','{{=value.name}}','姓名','部门','当前位置','下井时间',zaoquanUrlRouter.getPersonnelWorkingDetails,'{{=value.name}}')">
  531. <span>{{=value.pepole_num}}个</span>
  532. <p style="width:{{=it.length<4?'100%':'67px'}}">{{=value.name}}</p>
  533. </li>
  534. {{~}}
  535. </script>
  536. <script type="text/template" id="facilityStatusTemplate">
  537. {{~it:value:index}}
  538. <li onclick="giveAlarmDetails('equipmentStatus','{{=value.name}}','分站','','状态时间','状态',zaoquanUrlRouter.getPersonnelFacilityDetails,'{{=value.type}}')">
  539. <span class="hollowCircle">{{=value.num}}台</span>
  540. <p class="canvasTitle">{{=value.name}}</p>
  541. </li>
  542. {{~}}
  543. </script>
  544. <script src="../../script/api.js"></script>
  545. <script src="../../script/doT.min.js"></script>
  546. <script src="../../script/popoPicker.js"></script>
  547. <script src="../../script/f2.js"></script>
  548. <script src="../../script/config.js"></script>
  549. <script>
  550. var toast = new auiToast(),
  551. headers;
  552. apiready = function () {
  553. var info = $api.getStorage('data'),
  554. token = JSON.parse(info).data.access_token;
  555. $api.html($api.dom('.time-box'), getNowFormatDate());
  556. setInterval(function () {
  557. $api.html($api.dom('.time-box'), getNowFormatDate());
  558. }, 1000);
  559. headers = {
  560. Authorization: 'Bearer ' + token,
  561. };
  562. monitorListFun();
  563. // 当前下井人数
  564. downWell();
  565. // 井下人员(部门分布)
  566. getDepartment();
  567. getDistrit();
  568. // 工作面人数统计
  569. getWorkingTotal();
  570. // 全矿下井人数
  571. downWellFun();
  572. // 各个部门人数统计
  573. getDepartToday('now');
  574. clickGetDepartToday();
  575. // 人员定位系统设备运行状态
  576. equipmentStatus();
  577. // 超时
  578. giveAlarm();
  579. // 求救
  580. giveHelp();
  581. };
  582. function monitorListFun(names) {
  583. $http.fnReuestDataNologing(
  584. zaoquanUrlRouter.getPersonnalList,
  585. headers,
  586. 'post',
  587. '',
  588. regionFun
  589. );
  590. }
  591. function regionFun(ret, err) {
  592. if (ret.code === 0) {
  593. $apis.html(monitorList, '#template', ret.data);
  594. }
  595. }
  596. function seeMonitorList(id, title, name) {
  597. $api.removeCls($api.dom('.loading'), 'hide');
  598. $api.html($api.dom('.titles>span'), title);
  599. var list = document.querySelector('.list'),
  600. right_side = document.querySelector('.right_side');
  601. list.style.right = '0';
  602. right_side.style.right = '0';
  603. var regionUuid = {
  604. area_id: id,
  605. };
  606. $http.fnReuestDataNologing(
  607. zaoquanUrlRouter.getPersonnalDistributionList,
  608. headers,
  609. 'post',
  610. regionUuid,
  611. function (ret, err) {
  612. if (ret.code === 0) {
  613. if (ret.data.length > 0) {
  614. $apis.html(api_lists, '#template01', ret.data);
  615. $api.addCls($api.dom('.loading'), 'hide');
  616. } else {
  617. $api.addCls($api.dom('.loading'), 'hide');
  618. document.getElementById('contetnNo').style.display = 'block';
  619. }
  620. }
  621. }
  622. );
  623. }
  624. function recoveryFun() {
  625. var list = document.querySelector('.list'),
  626. right_side = document.querySelector('.right_side');
  627. list.style.right = '-75%';
  628. right_side.style.right = '-100%';
  629. }
  630. // 人员详情
  631. function personnelDeteila(name, ids) {
  632. var pageParam = {
  633. title: name,
  634. id: ids,
  635. };
  636. $event.openWin('personnalDeWin', 'personnalDeWin', pageParam, '');
  637. }
  638. // 当前下井人数
  639. function downWell() {
  640. $http.fnReuestDataNologing(
  641. zaoquanUrlRouter.getPeopleNow,
  642. '',
  643. 'post',
  644. '',
  645. function (ret, err) {
  646. if (ret.code === 0) {
  647. var data = ret.data.people_distribute;
  648. // $apis.html(downWellPersonnal,'#downWellTemplate',ret.data.people_list);
  649. var map = {};
  650. data.map(function (obj) {
  651. map[obj.depart_name] = obj.pepole_num + '人';
  652. });
  653. var chart = new F2.Chart({
  654. id: 'downWell',
  655. pixelRatio: window.devicePixelRatio,
  656. padding: [20, 'auto'],
  657. });
  658. chart.source(data, {
  659. percent: {
  660. formatter: function formatter(val) {
  661. return val + '人';
  662. },
  663. },
  664. });
  665. chart.tooltip(false);
  666. chart.legend({
  667. position: 'right',
  668. itemFormatter: function itemFormatter(val) {
  669. return val + ' ' + map[val];
  670. },
  671. });
  672. chart.coord('polar', {
  673. transposed: true,
  674. innerRadius: 0.7,
  675. radius: 0.85,
  676. });
  677. chart.axis(false);
  678. chart
  679. .interval()
  680. .position('const*pepole_num')
  681. .color('depart_name', [
  682. '#1890FF',
  683. '#13C2C2',
  684. '#2FC25B',
  685. '#FACC14',
  686. '#F04864',
  687. '#8543E0',
  688. '#3436C7',
  689. '#223273',
  690. ])
  691. .adjust('stack');
  692. chart.guide().html({
  693. position: ['50%', '45%'],
  694. html:
  695. '<div style="width: 250px;height: 40px;text-align: center;">' +
  696. '<div style="font-size: 16px">总人数</div>' +
  697. '<div style="font-size: 18px">' +
  698. ret.data.people_total +
  699. '人</div>' +
  700. '</div>',
  701. });
  702. chart.render();
  703. }
  704. }
  705. );
  706. }
  707. // 井下人员(部门分布)
  708. function getDepartment() {
  709. // 职能科室
  710. $http.fnReuestDataNologing(
  711. zaoquanUrlRouter.getOfficeTotal,
  712. '',
  713. 'post',
  714. '',
  715. function (ret, err) {
  716. if (ret.code === 0) {
  717. var data = ret.data;
  718. var districtTeamChart = new F2.Chart({
  719. id: 'department',
  720. pixelRatio: window.devicePixelRatio,
  721. });
  722. districtTeamChart.source(data);
  723. districtTeamChart.coord('polar', {
  724. transposed: true,
  725. innerRadius: 0.6,
  726. radius: 0.75,
  727. });
  728. districtTeamChart.axis(false);
  729. districtTeamChart.legend({
  730. position: 'bottom',
  731. align: 'center',
  732. });
  733. districtTeamChart.tooltip(false);
  734. districtTeamChart.guide().html({
  735. position: ['50%', '50%'],
  736. html:
  737. '<div style="width: 100px;height: 20px;text-align: center;line-height: 20px;" id="textContent"></div>',
  738. });
  739. // 配置文本饼图
  740. districtTeamChart.pieLabel({
  741. sidePadding: 10,
  742. anchorOffset: 10,
  743. activeShape: true,
  744. label1: function label1(data) {
  745. return {
  746. text: data.depart_name,
  747. fill: '#808080',
  748. };
  749. },
  750. label2: function label2(data) {
  751. return {
  752. fill: '#000000',
  753. text: data.pepole_num + '人',
  754. fontWeight: 500,
  755. fontSize: 10,
  756. };
  757. },
  758. onClick: function onClick(ev) {
  759. var data = ev.data;
  760. if (data) {
  761. $api.html($api.dom('.title'), data.depart_name);
  762. $api.html($api.dom('.personalNum'), data.pepole_num + '人');
  763. giveAlarmDetails(
  764. 'depart_id',
  765. data.depart_name,
  766. '姓名',
  767. '部门',
  768. '当前位置',
  769. '下井时间',
  770. zaoquanUrlRouter.getPersonneldepartDetails,
  771. data.depart_id
  772. );
  773. }
  774. },
  775. });
  776. districtTeamChart
  777. .interval()
  778. .position('const*pepole_num')
  779. .color('depart_name', [
  780. '#1890FF',
  781. '#13C2C2',
  782. '#2FC25B',
  783. '#FACC14',
  784. '#F04864',
  785. '#8543E0',
  786. '#3436C7',
  787. '#223273',
  788. ])
  789. .adjust('stack');
  790. districtTeamChart.guide().html({
  791. position: ['50%', '50%'],
  792. html:
  793. '<div style="width: 250px;height: 40px;text-align: center;">' +
  794. '<div style="font-size: 17px" class="title">总人数</div>' +
  795. '<div style="font-size: 17px" class="personalNum">' +
  796. ret.people_total +
  797. '人</div>' +
  798. '</div>',
  799. });
  800. districtTeamChart.render();
  801. districtTeamChart.get('canvas').draw();
  802. }
  803. }
  804. );
  805. }
  806. // 基层区队
  807. function getDistrit() {
  808. $http.fnReuestDataNologing(
  809. zaoquanUrlRouter.getBasicTotal,
  810. '',
  811. 'post',
  812. '',
  813. function (ret, err) {
  814. if (ret.code === 0) {
  815. // 基层区队
  816. var data = ret.data;
  817. var districtTeamChart = new F2.Chart({
  818. id: 'districtTeam',
  819. pixelRatio: window.devicePixelRatio,
  820. });
  821. districtTeamChart.source(data);
  822. districtTeamChart.coord('polar', {
  823. transposed: true,
  824. innerRadius: 0.6,
  825. radius: 0.85,
  826. });
  827. districtTeamChart.axis(false);
  828. districtTeamChart.legend({
  829. position: 'bottom',
  830. align: 'center',
  831. });
  832. districtTeamChart.tooltip(false);
  833. districtTeamChart.guide().html({
  834. position: ['50%', '50%'],
  835. html:
  836. '<div style="width: 100px;height: 20px;text-align: center;line-height: 20px;" id="textContent"></div>',
  837. });
  838. // 配置文本饼图
  839. districtTeamChart.pieLabel({
  840. sidePadding: 10,
  841. activeShape: true,
  842. label1: function label1(data) {
  843. return {
  844. text: data.depart_name,
  845. fill: '#808080',
  846. };
  847. },
  848. label2: function label2(data) {
  849. return {
  850. fill: '#000000',
  851. text: data.pepole_num + '人',
  852. fontWeight: 500,
  853. fontSize: 10,
  854. };
  855. },
  856. onClick: function onClick(ev) {
  857. var data = ev.data;
  858. if (data) {
  859. $api.html($api.dom('.title1'), data.depart_name);
  860. $api.html(
  861. $api.dom('.personalNum1'),
  862. data.pepole_num + '人'
  863. );
  864. giveAlarmDetails(
  865. 'depart_id',
  866. data.depart_name,
  867. '姓名',
  868. '部门',
  869. '当前位置',
  870. '下井时间',
  871. zaoquanUrlRouter.getPersonneldepartDetails,
  872. data.depart_id
  873. );
  874. }
  875. },
  876. });
  877. districtTeamChart
  878. .interval()
  879. .position('const*pepole_num')
  880. .color('depart_name', [
  881. '#1890FF',
  882. '#13C2C2',
  883. '#2FC25B',
  884. '#FACC14',
  885. '#F04864',
  886. '#8543E0',
  887. '#3436C7',
  888. '#223273',
  889. ])
  890. .adjust('stack');
  891. districtTeamChart.guide().html({
  892. position: ['50%', '50%'],
  893. html:
  894. '<div style="width: 250px;height: 40px;text-align: center;">' +
  895. '<div style="font-size: 17px" class="title1">总人数</div>' +
  896. '<div style="font-size: 17px" class="personalNum1">' +
  897. ret.people_total +
  898. '人</div>' +
  899. '</div>',
  900. });
  901. districtTeamChart.render();
  902. // 绘制内阴影
  903. districtTeamChart.get('canvas').draw();
  904. }
  905. }
  906. );
  907. }
  908. // 工作面数据
  909. function getWorkingTotal() {
  910. $http.fnReuestDataNologing(
  911. zaoquanUrlRouter.getWorkingTotal,
  912. '',
  913. 'post',
  914. '',
  915. function (ret, err) {
  916. if (ret.code === 0) {
  917. $apis.html(keyPostList, '#keyPostListTemplate', ret.data);
  918. }
  919. }
  920. );
  921. }
  922. // 全矿一周周下井趋势
  923. function downWellFun() {
  924. $http.fnReuestDataNologing(
  925. zaoquanUrlRouter.downWellTotal,
  926. '',
  927. 'post',
  928. '',
  929. function (ret, err) {
  930. if (ret && ret.code === 0) {
  931. api.refreshHeaderLoadDone();
  932. var data = ret.data;
  933. var chart = new F2.Chart({
  934. id: 'moreDownWell',
  935. pixelRatio: window.devicePixelRatio,
  936. });
  937. chart.source(data, {
  938. pepole_num: {
  939. tickCount: 5,
  940. },
  941. });
  942. chart.tooltip({
  943. custom: false, // 自定义 tooltip 内容框
  944. });
  945. chart
  946. .interval()
  947. .position('dater*pepole_num')
  948. .color('classes')
  949. .adjust('stack');
  950. chart.render();
  951. }
  952. }
  953. );
  954. // 当前人数
  955. $http.fnReuestDataNologing(
  956. zaoquanUrlRouter.currentPersonalNum,
  957. '',
  958. 'post',
  959. '',
  960. function (ret, err) {
  961. if (ret && ret.code === 0 && ret.data.length > 0) {
  962. $api.html(
  963. $api.dom('.currentNum'),
  964. '当前下井人数:' + ret.data[0].pepole_num + '人'
  965. );
  966. }
  967. }
  968. );
  969. }
  970. // 各个部门人数统计
  971. var chart = '';
  972. function getDepartToday(types) {
  973. $http.fnReuestDataNologing(
  974. zaoquanUrlRouter.getDepartToday,
  975. '',
  976. 'post',
  977. {type: types},
  978. function (ret, err) {
  979. if (ret.code === 0) {
  980. var data = ret.data;
  981. chart = new F2.Chart({
  982. id: 'getDepartToday',
  983. height: 1500,
  984. pixelRatio: window.devicePixelRatio,
  985. });
  986. chart.source(data, {
  987. pepole_num: {
  988. tickCount: 5,
  989. },
  990. });
  991. chart.coord({
  992. transposed: true,
  993. });
  994. chart.axis('depart_name', {
  995. line: null,
  996. label: function label(text, index, total) {
  997. var textCfg = {};
  998. if (index === 0) {
  999. textCfg.textAlign = 'end';
  1000. } else if (index === total - 1) {
  1001. textCfg.textAlign = 'end';
  1002. }
  1003. textCfg.fontSize = 12;
  1004. return textCfg;
  1005. },
  1006. });
  1007. chart.tooltip(false);
  1008. data.map(function (obj) {
  1009. chart.guide().text({
  1010. position: [obj.depart_name, obj.pepole_num],
  1011. content: obj.pepole_num + '人',
  1012. style: {
  1013. textBaseline: 'bottom',
  1014. textAlign: 'center',
  1015. },
  1016. offsetY: 7,
  1017. offsetX: 15,
  1018. });
  1019. });
  1020. chart.interval().position('depart_name*pepole_num');
  1021. chart.render();
  1022. chart.interaction('interval-select', {
  1023. selectAxisStyle: {
  1024. fill: '#000',
  1025. fontWeight: 'bold',
  1026. },
  1027. startEvent: 'tap',
  1028. mode: 'range',
  1029. onStart: function onEnd(ev) {
  1030. var data = ev.data,
  1031. selected = ev.selected;
  1032. if (data && data.pepole_num != 0) {
  1033. if (types === 'now') {
  1034. giveAlarmDetails(
  1035. 'depart_id',
  1036. data.depart_name,
  1037. '姓名',
  1038. '部门',
  1039. '当前位置',
  1040. '下井时间',
  1041. zaoquanUrlRouter.getPersonneldepartDetails,
  1042. data.depart_id
  1043. );
  1044. }
  1045. if (types === 'today') {
  1046. giveAlarmDetails(
  1047. 'today',
  1048. data.depart_name,
  1049. '姓名',
  1050. '部门',
  1051. '下井时间',
  1052. '上井时间',
  1053. zaoquanUrlRouter.getPersonneltodayDetails,
  1054. data.depart_id
  1055. );
  1056. }
  1057. }
  1058. },
  1059. });
  1060. }
  1061. }
  1062. );
  1063. }
  1064. // 点击切换各个部门人数统计
  1065. function clickGetDepartToday() {
  1066. new popoPicker('.js-picker', {
  1067. container: '.screen',
  1068. wheels: [
  1069. {
  1070. infinite: false,
  1071. //selected: 3,
  1072. data: [
  1073. {value: 'now', display: '当前各科室下井人数'},
  1074. {value: 'today', display: '今日各科室下井人数'},
  1075. ],
  1076. },
  1077. ],
  1078. background: 'light',
  1079. save: function (data) {
  1080. if (data.result[0].value === 'now') {
  1081. chart.destroy();
  1082. getDepartToday('now');
  1083. } else if (data.result[0].value === 'today') {
  1084. chart.destroy();
  1085. getDepartToday('today');
  1086. }
  1087. },
  1088. });
  1089. }
  1090. // 人员定位系统设备运行状态
  1091. function equipmentStatus() {
  1092. $http.fnReuestDataNologing(
  1093. zaoquanUrlRouter.getFacilityStatus,
  1094. '',
  1095. 'post',
  1096. '',
  1097. function (ret, err) {
  1098. if (ret.code === 0) {
  1099. $apis.html(
  1100. equipmentStatusList,
  1101. '#facilityStatusTemplate',
  1102. ret.data
  1103. );
  1104. }
  1105. }
  1106. );
  1107. }
  1108. // 人员告警信息 超时
  1109. function giveAlarm() {
  1110. $http.fnReuestDataNologing(
  1111. zaoquanUrlRouter.getTimeout,
  1112. '',
  1113. 'post',
  1114. '',
  1115. function (ret, err) {
  1116. if (ret.code === 0) {
  1117. $api.html($api.dom('.sales'), ret.data.timeout_num + '人');
  1118. }
  1119. }
  1120. );
  1121. }
  1122. // 人员告警信息 求救人数
  1123. function giveHelp() {
  1124. $http.fnReuestDataNologing(
  1125. zaoquanUrlRouter.getHelptotal,
  1126. '',
  1127. 'post',
  1128. '',
  1129. function (ret, err) {
  1130. if (ret.code === 0) {
  1131. $api.html($api.dom('.cryhelp'), ret.data.pepole_num + '人');
  1132. }
  1133. }
  1134. );
  1135. }
  1136. // 详情
  1137. // 超时人数详情 // 求救人数详情 // 设备运行状态详情 // 井下重点岗位人员分布详情
  1138. function giveAlarmDetails(
  1139. moduleType,
  1140. title,
  1141. name,
  1142. dep,
  1143. position,
  1144. time,
  1145. url,
  1146. moduleParam
  1147. ) {
  1148. var params = {
  1149. moduleType: moduleType,
  1150. title: title,
  1151. name: name,
  1152. dep: dep,
  1153. position: position,
  1154. time: time,
  1155. url: url,
  1156. moduleParam: moduleParam,
  1157. };
  1158. $event.openWin(
  1159. 'personnelLocationDetails',
  1160. 'personnelLocationDetails',
  1161. params,
  1162. ''
  1163. );
  1164. }
  1165. </script>
  1166. </body>
  1167. </html>