personnelList.html 31 KB

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