personnelList.html 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946
  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. <div class="time-box"></div>
  358. </div> -->
  359. <div class="contents">
  360. <!--当前井下人员-->
  361. <div class="Notice borderRa beforS">
  362. <p class="Stitle centertT">当前井下人员</p>
  363. <div class="" style="width:100%">
  364. <canvas id="downWell" style="width: 100%;margin-top:10px;height:210px"></canvas>
  365. </div>
  366. <!--列表-->
  367. <!-- <nav>
  368. <ul class="nav_title flex-start">
  369. <li>姓名</li>
  370. <li>下井时间</li>
  371. <li>当前位置</li>
  372. </ul>
  373. </nav>
  374. <ul class="downWellPersonnal" id="downWellPersonnal">
  375. </ul> -->
  376. </div>
  377. <!--井下人员(区域分布)-->
  378. <div class="Notice borderRa beforS">
  379. <p class="Stitle centertT">井下人员(区域分布)</p>
  380. <ul class="monitorList" id="monitorList">
  381. </ul>
  382. </div>
  383. <!--人员告警信息-->
  384. <!-- <div class="Notice borderRa beforS">
  385. <p class="Stitle centertT">人员告警信息</p>
  386. <div class="Chart flex-space">
  387. <div style="width:50%" class="canvasParent centertT" onclick="giveAlarmDetails('giveAlarm','超时人数','姓名','部门','当前位置','下井时间',jinfengUrlRouter.getPersonnelTimeoutDetails,'')">
  388. <div class="circularR sales">0人</div>
  389. <span class="canvasTitle">超时人数</span>
  390. </div>
  391. <div class="centertT" style="width:50%" onclick="giveAlarmDetails('giveAlarm','求救人数','姓名','部门','当前位置','下井时间',jinfengUrlRouter.getPersonnelHelpDetails,'')">
  392. <div class="circularR cryhelp" style="border: 4px solid #FF8B8C;">0人</div>
  393. <span class="canvasTitle">求救人数</span>
  394. </div>
  395. </div>
  396. </div> -->
  397. <!--人员定位系统设备运行状态-->
  398. <!-- <div class="Notice borderRa beforS">
  399. <p class="Stitle centertT">人员定位系统设备运行状态</p>
  400. <div class="equipmentStatus">
  401. <ul class="flex-space" id="equipmentStatusList">
  402. </ul>
  403. </div>
  404. </div> -->
  405. <!--井下人员(部门分布)-->
  406. <div class="Notice borderRa beforS">
  407. <p class="Stitle centertT">井下人员(部门分布)</p>
  408. <div style="width:100%" class="canvasParent centertT">
  409. <p class="centertT depTitle" style="margin-top:30px">职能科室</p>
  410. <canvas id="department" style="width: 100%;height:350px"></canvas>
  411. </div>
  412. <div class="centertT" style="width:100%">
  413. <p class="centertT depTitle">基层区队</p>
  414. <canvas id="districtTeam" style="width: 100%;height:350px;"></canvas>
  415. </div>
  416. </div>
  417. <!--全矿周下井趋势-->
  418. <div class="Notice borderRa beforS">
  419. <p class="Stitle centertT">全矿周下井趋势</p>
  420. <div class="Chart">
  421. <div class="" style="width:100%">
  422. <canvas id="moreDownWell" style="width: 100%;margin-top:10px;height:210px"></canvas>
  423. </div>
  424. </div>
  425. </div>
  426. <!--井下重点岗位人员分布-->
  427. <div class="Notice borderRa beforS">
  428. <p class="Stitle centertT">井下重点岗位人员分布</p>
  429. <ul class="flex-space keyPostList" id="keyPostList">
  430. </ul>
  431. </div>
  432. <!--当前各科室井下人数-->
  433. <div class="Notice borderRa">
  434. <div class="Chart" style="margin-top:0">
  435. <div class="flex-start">
  436. <div class="relative screen" style="margin:auto">
  437. <input id="button-value" class="js-picker" value="当前各科室下井人数">
  438. <i class="lower"></i>
  439. </div>
  440. </div>
  441. <div class="" style="width:100%">
  442. <canvas id="getDepartToday" style="width: 100%;"></canvas>
  443. </div>
  444. </div>
  445. </div>
  446. <div id="noJurisdiction"> </div>
  447. </div>
  448. </div>
  449. <!--侧滑 遮罩层-->
  450. <div class="right_side" onclick="recoveryFun()"></div>
  451. <!--列表-->
  452. <div class="list">
  453. <p class="titles">
  454. <span></span>
  455. <i onclick="recoveryFun()"></i>
  456. </p>
  457. <ul class="api_lists" id="api_lists">
  458. <li id="contetnNo">-暂无内容-</li>
  459. </ul>
  460. <div class="loading">
  461. <i class="ico-loading"></i>
  462. </div>
  463. </div>
  464. <script type="text/template" id="template">
  465. {{~it:value}}
  466. <li onclick="seeMonitorList('{{=value.area_id}}','{{=value.area_name}}','')">
  467. <div class="flex-start">
  468. <img src="{{=value.thumb}}" alt="">
  469. <span>{{=value.area_name}}</span>
  470. </div>
  471. <span class="num">{{=value.pepole_num}}人</span>
  472. </li>
  473. {{~}}
  474. </script>
  475. <script type="text/template" id="template01">
  476. {{~it:value}}
  477. <li onclick="personnelDeteila('{{=value.station_name}}','{{=value.station_id}}')">
  478. <p>{{=value.station_name}}</p>
  479. <div class="flex-start">
  480. <p>{{=value.pepole_num}}人</p>
  481. <i class="ico-more"></i>
  482. </div>
  483. </li>
  484. {{~}}
  485. </script>
  486. <script type="text/template" id="downWellTemplate">
  487. {{~it:value}}
  488. <li class="flex-start li-box centertT relative after-border">
  489. <span>{{=value.name}}</span>
  490. <span>{{=value.down_time}}</span>
  491. <span>{{=value.station_name}}</span>
  492. </li>
  493. {{~}}
  494. </script>
  495. <script type="text/template" id="keyPostListTemplate">
  496. {{~it:value}}
  497. <li onclick="giveAlarmDetails('Working','{{=value.name}}','姓名','部门','当前位置','下井时间',jinfengUrlRouter.getPersonnelWorkingDetails,'{{=value.name}}')">
  498. <span>{{=value.pepole_num}}个</span>
  499. <p style="width:{{=it.length<4?'100%':'67px'}}">{{=value.name}}</p>
  500. </li>
  501. {{~}}
  502. </script>
  503. <script type="text/template" id="facilityStatusTemplate">
  504. {{~it:value:index}}
  505. <li onclick="giveAlarmDetails('equipmentStatus','{{=value.name}}','分站','','状态时间','状态',jinfengUrlRouter.getPersonnelFacilityDetails,'{{=value.type}}')">
  506. <span class="hollowCircle">{{=value.num}}台</span>
  507. <p class="canvasTitle">{{=value.name}}</p>
  508. </li>
  509. {{~}}
  510. </script>
  511. <script src="../../script/api.js"></script>
  512. <script src="../../script/doT.min.js"></script>
  513. <script src="../../script/popoPicker.js"></script>
  514. <script src="../../script/f2.js"></script>
  515. <script src="../../script/config.js"></script>
  516. <script>
  517. var toast = new auiToast(),headers;
  518. apiready = function () {
  519. var info = $api.getStorage('data'),
  520. token = JSON.parse(info).data.access_token;
  521. // $api.html($api.dom('.time-box'), getNowFormatDate());
  522. // setInterval(function () {
  523. // $api.html($api.dom('.time-box'), getNowFormatDate());
  524. // }, 1000)
  525. headers = {
  526. "Authorization": "Bearer " + token
  527. };
  528. monitorListFun();
  529. // 当前下井人数
  530. downWell();
  531. // 井下人员(部门分布)
  532. getDepartment();
  533. getDistrit();
  534. // 工作面人数统计
  535. getWorkingTotal();
  536. // 全矿下井人数
  537. downWellFun();
  538. // 各个部门人数统计
  539. getDepartToday('now');
  540. clickGetDepartToday();
  541. // 人员定位系统设备运行状态
  542. equipmentStatus();
  543. // 超时
  544. giveAlarm();
  545. // 求救
  546. giveHelp();
  547. };
  548. function monitorListFun(names) {
  549. $http.fnReuestDataNologing(jinfengUrlRouter.getPersonnalList,headers,'post','',regionFun)
  550. }
  551. function regionFun(ret,err) {
  552. if (ret.code === 0) {
  553. $apis.html(monitorList,'#template',ret.data);
  554. }
  555. }
  556. function seeMonitorList(id,title,name) {
  557. $api.removeCls($api.dom('.loading'), 'hide');
  558. $api.html($api.dom('.titles>span'), title);
  559. var list = document.querySelector('.list'),right_side = document.querySelector('.right_side');
  560. list.style.right = '0';
  561. right_side.style.right = '0';
  562. var regionUuid ={
  563. area_id:id,
  564. };
  565. $http.fnReuestDataNologing(jinfengUrlRouter.getPersonnalDistributionList,headers,'post',regionUuid,function (ret, err) {
  566. if (ret.code === 0) {
  567. if (ret.data.length>0) {
  568. $apis.html(api_lists,'#template01',ret.data);
  569. $api.addCls($api.dom('.loading'), 'hide');
  570. }else {
  571. $api.addCls($api.dom('.loading'), 'hide');
  572. document.getElementById('contetnNo').style.display = 'block';
  573. }
  574. }
  575. })
  576. }
  577. function recoveryFun() {
  578. var list = document.querySelector('.list'),right_side = document.querySelector('.right_side');
  579. list.style.right = '-75%';
  580. right_side.style.right = '-100%';
  581. }
  582. // 人员详情
  583. function personnelDeteila(name,ids) {
  584. var pageParam = {
  585. title:name,
  586. id:ids
  587. }
  588. $event.openWin('personnalDeWin','personnalDeWin',pageParam,'');
  589. };
  590. // 当前井下人数
  591. function downWell() {
  592. $http.fnReuestDataNologing(jinfengUrlRouter.getPeopleNow,'','post','',function (ret,err) {
  593. if (ret.code === 0) {
  594. var data = ret.data.people_distribute;
  595. var map = {};
  596. data.map(function(obj) {
  597. map[obj.depart_name] = obj.pepole_num + '人';
  598. });
  599. var chart = new F2.Chart({
  600. id: 'downWell',
  601. pixelRatio: window.devicePixelRatio,
  602. padding: [20, 'auto']
  603. });
  604. chart.source(data, {
  605. percent: {
  606. formatter: function formatter(val) {
  607. return val + '人';
  608. }
  609. }
  610. });
  611. chart.tooltip(false);
  612. chart.legend({
  613. position: 'right',
  614. itemFormatter: function itemFormatter(val) {
  615. return val + ' ' + map[val];
  616. }
  617. });
  618. chart.coord('polar', {
  619. transposed: true,
  620. innerRadius: 0.7,
  621. radius: 0.85
  622. });
  623. chart.axis(false);
  624. chart.interval().position('const*pepole_num').color('depart_name', ['#1890FF', '#13C2C2', '#2FC25B', '#FACC14', '#F04864', '#8543E0', '#3436C7', '#223273']).adjust('stack');
  625. chart.guide().html({
  626. position: ['50%', '45%'],
  627. 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>'
  628. });
  629. chart.render();
  630. }
  631. })
  632. }
  633. // 井下人员(部门分布)
  634. function getDepartment() {
  635. // 职能科室
  636. $http.fnReuestDataNologing(jinfengUrlRouter.getOfficeTotal,'','post','',function (ret,err) {
  637. if (ret.code === 0) {
  638. var data = ret.data;
  639. var districtTeamChart = new F2.Chart({
  640. id: 'department',
  641. pixelRatio: window.devicePixelRatio
  642. });
  643. districtTeamChart.source(data);
  644. districtTeamChart.coord('polar', {
  645. transposed: true,
  646. innerRadius: 0.6,
  647. radius: 0.75
  648. });
  649. districtTeamChart.axis(false);
  650. districtTeamChart.legend({
  651. position: 'bottom',
  652. align: 'center'
  653. });
  654. districtTeamChart.tooltip(false);
  655. districtTeamChart.guide().html({
  656. position: ['50%', '50%'],
  657. html: '<div style="width: 100px;height: 20px;text-align: center;line-height: 20px;" id="textContent"></div>'
  658. });
  659. // 配置文本饼图
  660. districtTeamChart.pieLabel({
  661. sidePadding: 10,
  662. anchorOffset:10,
  663. activeShape: true,
  664. label1: function label1(data) {
  665. return {
  666. text: data.depart_name,
  667. fill: '#808080'
  668. };
  669. },
  670. label2: function label2(data) {
  671. return {
  672. fill: '#000000',
  673. text: data.pepole_num +'人',
  674. fontWeight: 500,
  675. fontSize: 10
  676. };
  677. },
  678. onClick: function onClick(ev) {
  679. var data = ev.data;
  680. if (data) {
  681. $api.html($api.dom('.title'), data.depart_name);
  682. $api.html($api.dom('.personalNum'), data.pepole_num+'人');
  683. giveAlarmDetails('depart_id',data.depart_name,'姓名','部门','当前位置','下井时间',jinfengUrlRouter.getPersonneldepartDetails,data.depart_id)
  684. }
  685. }
  686. });
  687. districtTeamChart.interval().position('const*pepole_num').color('depart_name', ['#1890FF', '#13C2C2', '#2FC25B', '#FACC14', '#F04864', '#8543E0', '#3436C7', '#223273']).adjust('stack');
  688. districtTeamChart.guide().html({
  689. position: ['50%', '50%'],
  690. 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>'
  691. });
  692. districtTeamChart.render();
  693. districtTeamChart.get('canvas').draw();
  694. }
  695. })
  696. }
  697. // 基层区队
  698. function getDistrit() {
  699. $http.fnReuestDataNologing(jinfengUrlRouter.getBasicTotal,'','post','',function (ret,err) {
  700. if (ret.code === 0) {
  701. // 基层区队
  702. var data = ret.data
  703. var districtTeamChart = new F2.Chart({
  704. id: 'districtTeam',
  705. pixelRatio: window.devicePixelRatio
  706. });
  707. districtTeamChart.source(data);
  708. districtTeamChart.coord('polar', {
  709. transposed: true,
  710. innerRadius: 0.6,
  711. radius: 0.85
  712. });
  713. districtTeamChart.axis(false);
  714. districtTeamChart.legend({
  715. position: 'bottom',
  716. align: 'center'
  717. });
  718. districtTeamChart.tooltip(false);
  719. districtTeamChart.guide().html({
  720. position: ['50%', '50%'],
  721. html: '<div style="width: 100px;height: 20px;text-align: center;line-height: 20px;" id="textContent"></div>'
  722. });
  723. // 配置文本饼图
  724. districtTeamChart.pieLabel({
  725. sidePadding: 10,
  726. activeShape: true,
  727. label1: function label1(data) {
  728. return {
  729. text: data.depart_name,
  730. fill: '#808080'
  731. };
  732. },
  733. label2: function label2(data) {
  734. return {
  735. fill: '#000000',
  736. text: data.pepole_num +'人',
  737. fontWeight: 500,
  738. fontSize: 10
  739. };
  740. },
  741. onClick: function onClick(ev) {
  742. var data = ev.data;
  743. if (data) {
  744. $api.html($api.dom('.title1'), data.depart_name);
  745. $api.html($api.dom('.personalNum1'), data.pepole_num+'人');
  746. giveAlarmDetails('depart_id',data.depart_name,'姓名','部门','当前位置','下井时间',jinfengUrlRouter.getPersonneldepartDetails,data.depart_id)
  747. }
  748. }
  749. });
  750. districtTeamChart.interval().position('const*pepole_num').color('depart_name', ['#1890FF', '#13C2C2', '#2FC25B', '#FACC14', '#F04864', '#8543E0', '#3436C7', '#223273']).adjust('stack');
  751. districtTeamChart.guide().html({
  752. position: ['50%', '50%'],
  753. 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>'
  754. });
  755. districtTeamChart.render();
  756. // 绘制内阴影
  757. districtTeamChart.get('canvas').draw();
  758. }
  759. })
  760. }
  761. // 工作面数据
  762. function getWorkingTotal() {
  763. $http.fnReuestDataNologing(jinfengUrlRouter.getWorkingTotal,'','post','',function (ret,err) {
  764. if (ret.code === 0) {
  765. $apis.html(keyPostList,'#keyPostListTemplate',ret.data);
  766. }
  767. })
  768. }
  769. // 全矿一周周下井趋势
  770. function downWellFun() {
  771. $http.fnReuestDataNologing(jinfengUrlRouter.downWellTotal,'','post','',function(ret,err){
  772. if (ret && ret.code === 0) {
  773. api.refreshHeaderLoadDone();
  774. var data = ret.data;
  775. var chart = new F2.Chart({
  776. id: 'moreDownWell',
  777. pixelRatio: window.devicePixelRatio
  778. });
  779. chart.source(data, {
  780. 'pepole_num': {
  781. tickCount: 5
  782. }
  783. });
  784. chart.tooltip({
  785. custom: false, // 自定义 tooltip 内容框
  786. });
  787. chart.interval().position('dater*pepole_num').color('classes').adjust('stack');
  788. chart.render();
  789. }
  790. });
  791. // 当前人数
  792. $http.fnReuestDataNologing(jinfengUrlRouter.currentPersonalNum,'','post','',function(ret,err){
  793. if (ret && ret.code === 0 && ret.data.length > 0) {
  794. $api.html($api.dom('.currentNum'), '当前下井人数:'+ret.data[0].pepole_num +'人');
  795. }
  796. });
  797. }
  798. // 各个部门人数统计
  799. var chart = ""
  800. function getDepartToday(types) {
  801. $http.fnReuestDataNologing(jinfengUrlRouter.getDepartToday,'','post',{type:types},function(ret,err){
  802. if (ret.code === 0) {
  803. var data = ret.data;
  804. chart = new F2.Chart({
  805. id: 'getDepartToday',
  806. height: 400,
  807. pixelRatio: window.devicePixelRatio
  808. });
  809. chart.source(data, {
  810. pepole_num: {
  811. tickCount: 5
  812. }
  813. });
  814. chart.coord({
  815. transposed: true
  816. });
  817. chart.axis('depart_name', {
  818. line: null,
  819. label: function label(text, index, total) {
  820. var textCfg = {};
  821. if (index === 0) {
  822. textCfg.textAlign = 'end';
  823. } else if (index === total - 1) {
  824. textCfg.textAlign = 'end';
  825. }
  826. textCfg.fontSize = 12
  827. return textCfg;
  828. }
  829. });
  830. chart.tooltip(false);
  831. data.map(function(obj) {
  832. chart.guide().text({
  833. position: [obj.depart_name, obj.pepole_num],
  834. content: obj.pepole_num+'人',
  835. style: {
  836. textBaseline: 'bottom',
  837. textAlign: 'center'
  838. },
  839. offsetY: 7,
  840. offsetX:15
  841. });
  842. });
  843. chart.interval().position('depart_name*pepole_num');
  844. chart.render();
  845. chart.interaction('interval-select', {
  846. selectAxisStyle: {
  847. fill: '#000',
  848. fontWeight: 'bold'
  849. },
  850. startEvent:'tap',
  851. mode: 'range',
  852. onStart: function onEnd(ev) {
  853. var data = ev.data,
  854. selected = ev.selected;
  855. if (data && data.pepole_num != 0) {
  856. if (types === "now") {
  857. giveAlarmDetails('depart_id',data.depart_name,'姓名','部门','当前位置','下井时间',jinfengUrlRouter.getPersonneldepartDetails,data.depart_id)
  858. }
  859. if (types === "today") {
  860. giveAlarmDetails('today',data.depart_name,'姓名','部门','下井时间','上井时间',jinfengUrlRouter.getPersonneltodayDetails,data.depart_id)
  861. }
  862. }
  863. }
  864. });
  865. }
  866. })
  867. }
  868. // 点击切换各个部门人数统计
  869. function clickGetDepartToday() {
  870. new popoPicker('.js-picker',{
  871. container:'.screen',
  872. wheels: [{
  873. infinite: false,
  874. //selected: 3,
  875. data:[
  876. {value:'now',display:'当前各科室下井人数'},
  877. {value:'today',display:'今日各科室下井人数'},
  878. ]
  879. }],
  880. background:'light',
  881. save:function (data) {
  882. if (data.result[0].value === 'now') {
  883. chart.destroy();
  884. getDepartToday('now');
  885. }else if (data.result[0].value === 'today') {
  886. chart.destroy();
  887. getDepartToday('today');
  888. }
  889. }
  890. });
  891. }
  892. // 人员定位系统设备运行状态
  893. function equipmentStatus() {
  894. $http.fnReuestDataNologing(jinfengUrlRouter.getFacilityStatus,'','post','',function (ret,err) {
  895. if (ret.code === 0) {
  896. $apis.html(equipmentStatusList,'#facilityStatusTemplate',ret.data);
  897. }
  898. })
  899. }
  900. // 人员告警信息 超时
  901. function giveAlarm() {
  902. $http.fnReuestDataNologing(jinfengUrlRouter.getTimeout,'','post','',function (ret,err) {
  903. if (ret.code === 0) {
  904. $api.html($api.dom('.sales'), ret.data.timeout_num+'人');
  905. }
  906. })
  907. }
  908. // 人员告警信息 求救人数
  909. function giveHelp() {
  910. $http.fnReuestDataNologing(jinfengUrlRouter.getHelptotal,'','post','',function (ret,err) {
  911. if (ret.code === 0) {
  912. $api.html($api.dom('.cryhelp'), ret.data.pepole_num+'人');
  913. }
  914. })
  915. }
  916. // 详情
  917. // 超时人数详情 // 求救人数详情 // 设备运行状态详情 // 井下重点岗位人员分布详情
  918. function giveAlarmDetails(moduleType,title,name,dep,position,time,url,moduleParam) {
  919. var params = {
  920. moduleType:moduleType,
  921. title:title,
  922. name:name,
  923. dep:dep,
  924. position:position,
  925. time:time,
  926. url:url,
  927. moduleParam:moduleParam
  928. }
  929. $event.openWin('personnelLocationDetails','personnelLocationDetails',params,'');
  930. }
  931. </script>
  932. </body>
  933. </html>