1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8" />
- <meta
- name="viewport"
- content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"
- />
- <meta
- name="format-detection"
- content="telephone=no,email=no,date=no,address=no"
- />
- <title></title>
- <link rel="stylesheet" type="text/css" href="../../css/api.css" />
- <link rel="stylesheet" type="text/css" href="../../css/popoPicker.css" />
- <link rel="stylesheet" type="text/css" href="../../css/style.css" />
- <link rel="stylesheet" href="../../css/aui.css" />
- <link rel="stylesheet" href="../../css/projeck.css" />
- <style>
- body,html{
- background: #F3F3F3;
- overflow: hidden;
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- position: relative;
- }
- .api_layout{
- height: 100%;
- overflow-y: scroll;
- -webkit-overflow-scrolling: touch;
- }
- .contents{
- padding: 7px;
- }
- .monitorList{
- padding: 14px;
- }
- .monitorList li{
- display: flex;
- display: -webkit-flex;
- justify-content: space-between;
- -webkit-justify-content: space-between;
- height: 56px;
- line-height: 56px;
- align-items: center;
- color: #5a5a5a;
- font-size: 14px;
- position: relative;
- }
- .monitorList li:after{
- content: '';
- display: table;
- position: absolute;
- width: 100%;
- height: 1px;
- background: #e8e9ea;
- bottom: 0;
- left: 0;
- }
- .monitorList li img{
- width: 42px;
- height: 42px;
- display: block;
- -webkit-border-radius: 50%;
- -moz-border-radius: 50%;
- border-radius: 50%;
- margin-right: 19px;
- }
- .right_side{
- position: absolute;
- top: 0;
- right: -100%;
- width: 100%;
- height: 100%;
- background: rgba(0,0,0,.6);
- transition: .5ms;
- }
- .list{
- position: absolute;
- top: 0;
- right: -75%;
- width: 75%;
- right:0;
- height: 100%;
- background: #fff;
- transition: .3s;
- }
- .titles{
- height: 38px;
- line-height: 38px;
- padding-left: 15px;
- font-size: 15px;
- color: #2c3e50;
- position: relative;
- }
- .titles:after{
- content: '';
- display: table;
- position: absolute;
- bottom: 0;
- left: 0;
- width: 100%;
- height: 1px;
- background: #009fe8;
- }
- .titles i{
- display: block;
- width: 19px;
- height: 19px;
- line-height: 19px;
- background: url("../../image/close.png") no-repeat;
- background-size: cover;
- text-align: center;
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- position: absolute;
- top: 8px;
- right: 10px;
- color: #ced3d6;
- font-size: 8px;
- }
- .api_lists{
- padding: 0 14px;
- height: 100%;
- overflow-y: scroll;
- padding-bottom: 38px;
- -webkit-overflow-scrolling: touch;
- }
- .api_lists li{
- display: flex;
- display: -webkit-flex;
- justify-content: space-between;
- -webkit-justify-content:space-between;
- height: 45px;
- align-items: center;
- position: relative;
- }
- .info p{
- font-size: 15px;
- }
- .api_lists li:after{
- content: '';
- display: table;
- position: absolute;
- bottom: 0;
- left: 0;
- width: 100%;
- height: 1px;
- background: #e8e9ea;
- }
- .api_lists li p{
- color: #2c3e50;
- font-size: 13px;
- }
- .api_lists #contetnNo{
- text-align: center;
- font-size: 14px;
- color: #bdc3c7;
- height: 50px;
- margin-top:20px;
- /*justify-content: center;
- -webkit-justify-content: center;*/
- display: none;
- }
- .api_lists #contetnNo:after{
- content: '';
- display: table;
- position: absolute;
- bottom: 0;
- left: 0;
- width: 100%;
- height: 0;
- background: #e8e9ea;
- }
- #noJurisdiction{
- background: url('../../image/no.png') no-repeat;
- background-size: contain;
- position: absolute;
- top: -50%;
- left: 0;
- bottom: 0;
- right: 0;
- margin: auto;
- width: 125px;
- height: 142px;
- display: none;
- }
- .num{
- color: #27AE60;
- font-size: 14px;
- }
- .ico-more{
- width: 13px;
- height: 13px;
- background: url("../../image/more.png") no-repeat;
- background-size: cover;
- background-position: center;
- margin-left: 5px;
- }
- .loading{
- position: absolute;
- width: 100%;
- height: 100%;
- background: rgba(255,255,255,.3);
- top: 0;
- left: 0;
- }
- .Notice{
- margin-bottom: 7px;
- }
- .ico-loading{
- position: absolute;
- top: 0;
- left: 0;
- bottom: 0;
- right: 0;
- margin: auto;
- width: 35px;
- height: 35px;
- background: url("../../icon/loading.gif") no-repeat;
- background-size: cover;
- background-position: center;
- }
- .time-box{
- position: absolute;
- bottom: 7px;
- right: 7px;
- font-size: 16px;
- color: #3B3B4D;
- font-weight: bold;
- line-height: initial;
- }
- .nav_title{
- padding: 0 5px;
- background: #F3F6FA;
- }
- .nav_title li{
- text-align: center;
- font-size: 14px;
- padding: 9px 0 ;
- color: #232627;
- }
- .nav_title li:nth-child(1),.nav_title li:nth-child(2){
- width: 25%;
- }
- .nav_title li:nth-child(3){
- width: 50%;
- text-align: right;
- }
- .downWellPersonnal{
- background: #fff;
- }
- .li-box{
- height: 39px;
- line-height: 39px;
- font-size: 14px;
- color: #232627;
- }
- .li-box span:nth-child(1),.li-box span:nth-child(2){
- width: 25%;
- }
- .li-box span:nth-child(3){
- width: 50%;
- text-align: right;
- }
- .keyPostList{
- margin-top: 30px;
- }
- .keyPostList p{
- color: #3B4A74;
- font-size: 14px;
- width: 67px;
- text-align: center;
- margin-top: 10px;
- }
- .keyPostList span{
- display: block;
- width: 60px;
- height: 60px;
- -webkit-border-radius: 50%;
- -moz-border-radius: 50%;
- border-radius: 50%;
- line-height: 60px;
- text-align: center;
- color: #fff;
- margin: auto;
- }
- .keyPostList li:nth-child(1) span:first-child{
- background: #E74C3C;
- }.keyPostList li:nth-child(2) span:first-child{
- background: #2C3E50;
- }.keyPostList li:nth-child(3) span:first-child{
- background: #1ABC9C;
- }.keyPostList li:nth-child(4) span:first-child{
- background: #2873FF;
- }
- .depTitle{
- margin-top: 20px;
- color: #232627;
- font-size: 16px;
- margin-bottom: 10px;
- }
- #button-value{
- width: 194px;
- padding-left:24px;
- }
- .lower{
- top: 13px;
- }
- .equipmentStatus{
- margin-top: 30px;
- text-align: center;
- }
- .hollowCircle{
- display: block;
- width: 60px;
- height: 60px;
- -webkit-border-radius: 50%;
- -moz-border-radius: 50%;
- border-radius: 50%;
- line-height: 55px;
- text-align: center;
- border: 4px solid #6C6F74;
- margin-bottom: 10px;
- color: #3B3B4D;
- font-size: 14px;
- }
- .equipmentStatus li:nth-child(2) .hollowCircle{
- border: 4px solid #14D2B8;
- }
- .equipmentStatus li:nth-child(3) .hollowCircle{
- border: 4px solid #FF8B8C;
- }
- .circularR{
- width: 85px;
- height: 85px;
- -webkit-border-radius: 50%;
- -moz-border-radius: 50%;
- border-radius: 50%;
- line-height: 78px;
- text-align: center;
- border: 4px solid #14D2B8;
- margin: auto;
- margin-bottom: 10px;
- color: #3B3B4D;
- font-size: 16px;
- }
- .Chart{
- margin-top: 30px;
- }
- #equipmentStatusList{
- padding: 0 15px;
- }
- </style>
- </head>
- <body>
- <div class="api_layout">
- <!-- 图片展示 -->
- <div class="banners relative">
- <img
- src="http://jiewei-icon.oss-cn-beijing.aliyuncs.com/banner.png"
- alt=""
- />
- <!--时间-->
- <div class="time-box"></div>
- </div>
- <div class="contents">
- <!--当前井下人员-->
- <div class="Notice borderRa beforS">
- <p class="Stitle centertT">当前井下人员</p>
- <div class="" style="width: 100%;">
- <canvas
- id="downWell"
- style="width: 100%; margin-top: 10px; height: 210px;"
- ></canvas>
- </div>
- <!--列表-->
- <!-- <nav>
- <ul class="nav_title flex-start">
- <li>姓名</li>
- <li>下井时间</li>
- <li>当前位置</li>
- </ul>
- </nav>
- <ul class="downWellPersonnal" id="downWellPersonnal">
- </ul> -->
- </div>
- <!--井下人员(区域分布)-->
- <div class="Notice borderRa beforS">
- <p class="Stitle centertT">井下人员(区域分布)</p>
- <ul class="monitorList" id="monitorList"></ul>
- </div>
- <!--人员告警信息-->
- <div class="Notice borderRa beforS">
- <p class="Stitle centertT">人员告警信息</p>
- <div class="Chart flex-space">
- <div
- style="width: 50%;"
- class="canvasParent centertT"
- onclick="giveAlarmDetails('giveAlarm','超时人数','姓名','部门','当前位置','下井时间',zaoquanUrlRouter.getPersonnelTimeoutDetails,'')"
- >
- <div class="circularR sales">0人</div>
- <span class="canvasTitle">超时人数</span>
- </div>
- <div
- class="centertT"
- style="width: 50%;"
- onclick="giveAlarmDetails('giveAlarm','求救人数','姓名','部门','当前位置','下井时间',zaoquanUrlRouter.getPersonnelHelpDetails,'')"
- >
- <div class="circularR cryhelp" style="border: 4px solid #ff8b8c;">
- 0人
- </div>
- <span class="canvasTitle">求救人数</span>
- </div>
- </div>
- </div>
- <!--人员定位系统设备运行状态-->
- <div class="Notice borderRa beforS">
- <p class="Stitle centertT">人员定位系统设备运行状态</p>
- <div class="equipmentStatus">
- <ul class="flex-space" id="equipmentStatusList"></ul>
- </div>
- </div>
- <!--井下人员(部门分布)-->
- <div class="Notice borderRa beforS">
- <p class="Stitle centertT">井下人员(部门分布)</p>
- <div style="width: 100%;" class="canvasParent centertT">
- <p class="centertT depTitle" style="margin-top: 30px;">职能科室</p>
- <canvas
- id="department"
- style="width: 100%; height: 350px;"
- ></canvas>
- </div>
- <div class="centertT" style="width: 100%;">
- <p class="centertT depTitle">基层区队</p>
- <canvas
- id="districtTeam"
- style="width: 100%; height: 350px;"
- ></canvas>
- </div>
- </div>
- <!--全矿周下井趋势-->
- <div class="Notice borderRa beforS">
- <p class="Stitle centertT">全矿周下井趋势</p>
- <div class="Chart">
- <div class="" style="width: 100%;">
- <canvas
- id="moreDownWell"
- style="width: 100%; margin-top: 10px; height: 210px;"
- ></canvas>
- </div>
- </div>
- </div>
- <!--井下重点岗位人员分布-->
- <div class="Notice borderRa beforS">
- <p class="Stitle centertT">井下重点岗位人员分布</p>
- <ul class="flex-space keyPostList" id="keyPostList"></ul>
- </div>
- <!--当前各科室井下人数-->
- <div class="Notice borderRa">
- <div class="Chart" style="margin-top: 0;">
- <div class="flex-start">
- <div class="relative screen" style="margin: auto;">
- <input
- id="button-value"
- class="js-picker"
- value="当前各科室下井人数"
- />
- <i class="lower"></i>
- </div>
- </div>
- <div class="" style="width: 100%;">
- <canvas id="getDepartToday" style="width: 100%;"></canvas>
- </div>
- </div>
- </div>
- <div id="noJurisdiction"></div>
- </div>
- </div>
- <!--侧滑 遮罩层-->
- <div class="right_side" onclick="recoveryFun()"></div>
- <!--列表-->
- <div class="list">
- <p class="titles">
- <span></span>
- <i onclick="recoveryFun()"></i>
- </p>
- <ul class="api_lists" id="api_lists">
- <li id="contetnNo">-暂无内容-</li>
- </ul>
- <div class="loading">
- <i class="ico-loading"></i>
- </div>
- </div>
- <script type="text/template" id="template">
- {{~it:value}}
- <li onclick="seeMonitorList('{{=value.area_id}}','{{=value.area_name}}','')">
- <div class="flex-start">
- <img src="{{=value.thumb}}" alt="">
- <span>{{=value.area_name}}</span>
- </div>
- <span class="num">{{=value.pepole_num}}人</span>
- </li>
- {{~}}
- </script>
- <script type="text/template" id="template01">
- {{~it:value}}
- <li onclick="personnelDeteila('{{=value.station_name}}','{{=value.station_id}}')">
- <p>{{=value.station_name}}</p>
- <div class="flex-start">
- <p>{{=value.pepole_num}}人</p>
- <i class="ico-more"></i>
- </div>
- </li>
- {{~}}
- </script>
- <script type="text/template" id="downWellTemplate">
- {{~it:value}}
- <li class="flex-start li-box centertT relative after-border">
- <span>{{=value.name}}</span>
- <span>{{=value.down_time}}</span>
- <span>{{=value.station_name}}</span>
- </li>
- {{~}}
- </script>
- <script type="text/template" id="keyPostListTemplate">
- {{~it:value}}
- <li onclick="giveAlarmDetails('Working','{{=value.name}}','姓名','部门','当前位置','下井时间',zaoquanUrlRouter.getPersonnelWorkingDetails,'{{=value.name}}')">
- <span>{{=value.pepole_num}}个</span>
- <p style="width:{{=it.length<4?'100%':'67px'}}">{{=value.name}}</p>
- </li>
- {{~}}
- </script>
- <script type="text/template" id="facilityStatusTemplate">
- {{~it:value:index}}
- <li onclick="giveAlarmDetails('equipmentStatus','{{=value.name}}','分站','','状态时间','状态',zaoquanUrlRouter.getPersonnelFacilityDetails,'{{=value.type}}')">
- <span class="hollowCircle">{{=value.num}}台</span>
- <p class="canvasTitle">{{=value.name}}</p>
- </li>
- {{~}}
- </script>
- <script src="../../script/api.js"></script>
- <script src="../../script/doT.min.js"></script>
- <script src="../../script/popoPicker.js"></script>
- <script src="../../script/f2.js"></script>
- <script src="../../script/config.js"></script>
- <script>
- var toast = new auiToast(),
- headers;
- apiready = function () {
- var info = $api.getStorage('data'),
- token = JSON.parse(info).data.access_token;
- $api.html($api.dom('.time-box'), getNowFormatDate());
- setInterval(function () {
- $api.html($api.dom('.time-box'), getNowFormatDate());
- }, 1000);
- headers = {
- Authorization: 'Bearer ' + token,
- };
- monitorListFun();
- // 当前下井人数
- downWell();
- // 井下人员(部门分布)
- getDepartment();
- getDistrit();
- // 工作面人数统计
- getWorkingTotal();
- // 全矿下井人数
- downWellFun();
- // 各个部门人数统计
- getDepartToday('now');
- clickGetDepartToday();
- // 人员定位系统设备运行状态
- equipmentStatus();
- // 超时
- giveAlarm();
- // 求救
- giveHelp();
- };
- function monitorListFun(names) {
- $http.fnReuestDataNologing(
- zaoquanUrlRouter.getPersonnalList,
- headers,
- 'post',
- '',
- regionFun
- );
- }
- function regionFun(ret, err) {
- if (ret.code === 0) {
- $apis.html(monitorList, '#template', ret.data);
- }
- }
- function seeMonitorList(id, title, name) {
- $api.removeCls($api.dom('.loading'), 'hide');
- $api.html($api.dom('.titles>span'), title);
- var list = document.querySelector('.list'),
- right_side = document.querySelector('.right_side');
- list.style.right = '0';
- right_side.style.right = '0';
- var regionUuid = {
- area_id: id,
- };
- $http.fnReuestDataNologing(
- zaoquanUrlRouter.getPersonnalDistributionList,
- headers,
- 'post',
- regionUuid,
- function (ret, err) {
- if (ret.code === 0) {
- if (ret.data.length > 0) {
- $apis.html(api_lists, '#template01', ret.data);
- $api.addCls($api.dom('.loading'), 'hide');
- } else {
- $api.addCls($api.dom('.loading'), 'hide');
- document.getElementById('contetnNo').style.display = 'block';
- }
- }
- }
- );
- }
- function recoveryFun() {
- var list = document.querySelector('.list'),
- right_side = document.querySelector('.right_side');
- list.style.right = '-75%';
- right_side.style.right = '-100%';
- }
- // 人员详情
- function personnelDeteila(name, ids) {
- var pageParam = {
- title: name,
- id: ids,
- };
- $event.openWin('personnalDeWin', 'personnalDeWin', pageParam, '');
- }
- // 当前下井人数
- function downWell() {
- $http.fnReuestDataNologing(
- zaoquanUrlRouter.getPeopleNow,
- '',
- 'post',
- '',
- function (ret, err) {
- if (ret.code === 0) {
- var data = ret.data.people_distribute;
- // $apis.html(downWellPersonnal,'#downWellTemplate',ret.data.people_list);
- var map = {};
- data.map(function (obj) {
- map[obj.depart_name] = obj.pepole_num + '人';
- });
- var chart = new F2.Chart({
- id: 'downWell',
- pixelRatio: window.devicePixelRatio,
- padding: [20, 'auto'],
- });
- chart.source(data, {
- percent: {
- formatter: function formatter(val) {
- return val + '人';
- },
- },
- });
- chart.tooltip(false);
- chart.legend({
- position: 'right',
- itemFormatter: function itemFormatter(val) {
- return val + ' ' + map[val];
- },
- });
- chart.coord('polar', {
- transposed: true,
- innerRadius: 0.7,
- radius: 0.85,
- });
- chart.axis(false);
- chart
- .interval()
- .position('const*pepole_num')
- .color('depart_name', [
- '#1890FF',
- '#13C2C2',
- '#2FC25B',
- '#FACC14',
- '#F04864',
- '#8543E0',
- '#3436C7',
- '#223273',
- ])
- .adjust('stack');
- chart.guide().html({
- position: ['50%', '45%'],
- 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>',
- });
- chart.render();
- }
- }
- );
- }
- // 井下人员(部门分布)
- function getDepartment() {
- // 职能科室
- $http.fnReuestDataNologing(
- zaoquanUrlRouter.getOfficeTotal,
- '',
- 'post',
- '',
- function (ret, err) {
- if (ret.code === 0) {
- var data = ret.data;
- var districtTeamChart = new F2.Chart({
- id: 'department',
- pixelRatio: window.devicePixelRatio,
- });
- districtTeamChart.source(data);
- districtTeamChart.coord('polar', {
- transposed: true,
- innerRadius: 0.6,
- radius: 0.75,
- });
- districtTeamChart.axis(false);
- districtTeamChart.legend({
- position: 'bottom',
- align: 'center',
- });
- districtTeamChart.tooltip(false);
- districtTeamChart.guide().html({
- position: ['50%', '50%'],
- html:
- '<div style="width: 100px;height: 20px;text-align: center;line-height: 20px;" id="textContent"></div>',
- });
- // 配置文本饼图
- districtTeamChart.pieLabel({
- sidePadding: 10,
- anchorOffset: 10,
- activeShape: true,
- label1: function label1(data) {
- return {
- text: data.depart_name,
- fill: '#808080',
- };
- },
- label2: function label2(data) {
- return {
- fill: '#000000',
- text: data.pepole_num + '人',
- fontWeight: 500,
- fontSize: 10,
- };
- },
- onClick: function onClick(ev) {
- var data = ev.data;
- if (data) {
- $api.html($api.dom('.title'), data.depart_name);
- $api.html($api.dom('.personalNum'), data.pepole_num + '人');
- giveAlarmDetails(
- 'depart_id',
- data.depart_name,
- '姓名',
- '部门',
- '当前位置',
- '下井时间',
- zaoquanUrlRouter.getPersonneldepartDetails,
- data.depart_id
- );
- }
- },
- });
- districtTeamChart
- .interval()
- .position('const*pepole_num')
- .color('depart_name', [
- '#1890FF',
- '#13C2C2',
- '#2FC25B',
- '#FACC14',
- '#F04864',
- '#8543E0',
- '#3436C7',
- '#223273',
- ])
- .adjust('stack');
- districtTeamChart.guide().html({
- position: ['50%', '50%'],
- 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>',
- });
- districtTeamChart.render();
- districtTeamChart.get('canvas').draw();
- }
- }
- );
- }
- // 基层区队
- function getDistrit() {
- $http.fnReuestDataNologing(
- zaoquanUrlRouter.getBasicTotal,
- '',
- 'post',
- '',
- function (ret, err) {
- if (ret.code === 0) {
- // 基层区队
- var data = ret.data;
- var districtTeamChart = new F2.Chart({
- id: 'districtTeam',
- pixelRatio: window.devicePixelRatio,
- });
- districtTeamChart.source(data);
- districtTeamChart.coord('polar', {
- transposed: true,
- innerRadius: 0.6,
- radius: 0.85,
- });
- districtTeamChart.axis(false);
- districtTeamChart.legend({
- position: 'bottom',
- align: 'center',
- });
- districtTeamChart.tooltip(false);
- districtTeamChart.guide().html({
- position: ['50%', '50%'],
- html:
- '<div style="width: 100px;height: 20px;text-align: center;line-height: 20px;" id="textContent"></div>',
- });
- // 配置文本饼图
- districtTeamChart.pieLabel({
- sidePadding: 10,
- activeShape: true,
- label1: function label1(data) {
- return {
- text: data.depart_name,
- fill: '#808080',
- };
- },
- label2: function label2(data) {
- return {
- fill: '#000000',
- text: data.pepole_num + '人',
- fontWeight: 500,
- fontSize: 10,
- };
- },
- onClick: function onClick(ev) {
- var data = ev.data;
- if (data) {
- $api.html($api.dom('.title1'), data.depart_name);
- $api.html(
- $api.dom('.personalNum1'),
- data.pepole_num + '人'
- );
- giveAlarmDetails(
- 'depart_id',
- data.depart_name,
- '姓名',
- '部门',
- '当前位置',
- '下井时间',
- zaoquanUrlRouter.getPersonneldepartDetails,
- data.depart_id
- );
- }
- },
- });
- districtTeamChart
- .interval()
- .position('const*pepole_num')
- .color('depart_name', [
- '#1890FF',
- '#13C2C2',
- '#2FC25B',
- '#FACC14',
- '#F04864',
- '#8543E0',
- '#3436C7',
- '#223273',
- ])
- .adjust('stack');
- districtTeamChart.guide().html({
- position: ['50%', '50%'],
- 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>',
- });
- districtTeamChart.render();
- // 绘制内阴影
- districtTeamChart.get('canvas').draw();
- }
- }
- );
- }
- // 工作面数据
- function getWorkingTotal() {
- $http.fnReuestDataNologing(
- zaoquanUrlRouter.getWorkingTotal,
- '',
- 'post',
- '',
- function (ret, err) {
- if (ret.code === 0) {
- $apis.html(keyPostList, '#keyPostListTemplate', ret.data);
- }
- }
- );
- }
- // 全矿一周周下井趋势
- function downWellFun() {
- $http.fnReuestDataNologing(
- zaoquanUrlRouter.downWellTotal,
- '',
- 'post',
- '',
- function (ret, err) {
- if (ret && ret.code === 0) {
- api.refreshHeaderLoadDone();
- var data = ret.data;
- var chart = new F2.Chart({
- id: 'moreDownWell',
- pixelRatio: window.devicePixelRatio,
- });
- chart.source(data, {
- pepole_num: {
- tickCount: 5,
- },
- });
- chart.tooltip({
- custom: false, // 自定义 tooltip 内容框
- });
- chart
- .interval()
- .position('dater*pepole_num')
- .color('classes')
- .adjust('stack');
- chart.render();
- }
- }
- );
- // 当前人数
- $http.fnReuestDataNologing(
- zaoquanUrlRouter.currentPersonalNum,
- '',
- 'post',
- '',
- function (ret, err) {
- if (ret && ret.code === 0 && ret.data.length > 0) {
- $api.html(
- $api.dom('.currentNum'),
- '当前下井人数:' + ret.data[0].pepole_num + '人'
- );
- }
- }
- );
- }
- // 各个部门人数统计
- var chart = '';
- function getDepartToday(types) {
- $http.fnReuestDataNologing(
- zaoquanUrlRouter.getDepartToday,
- '',
- 'post',
- {type: types},
- function (ret, err) {
- if (ret.code === 0) {
- var data = ret.data;
- chart = new F2.Chart({
- id: 'getDepartToday',
- height: 1500,
- pixelRatio: window.devicePixelRatio,
- });
- chart.source(data, {
- pepole_num: {
- tickCount: 5,
- },
- });
- chart.coord({
- transposed: true,
- });
- chart.axis('depart_name', {
- line: null,
- label: function label(text, index, total) {
- var textCfg = {};
- if (index === 0) {
- textCfg.textAlign = 'end';
- } else if (index === total - 1) {
- textCfg.textAlign = 'end';
- }
- textCfg.fontSize = 12;
- return textCfg;
- },
- });
- chart.tooltip(false);
- data.map(function (obj) {
- chart.guide().text({
- position: [obj.depart_name, obj.pepole_num],
- content: obj.pepole_num + '人',
- style: {
- textBaseline: 'bottom',
- textAlign: 'center',
- },
- offsetY: 7,
- offsetX: 15,
- });
- });
- chart.interval().position('depart_name*pepole_num');
- chart.render();
- chart.interaction('interval-select', {
- selectAxisStyle: {
- fill: '#000',
- fontWeight: 'bold',
- },
- startEvent: 'tap',
- mode: 'range',
- onStart: function onEnd(ev) {
- var data = ev.data,
- selected = ev.selected;
- if (data && data.pepole_num != 0) {
- if (types === 'now') {
- giveAlarmDetails(
- 'depart_id',
- data.depart_name,
- '姓名',
- '部门',
- '当前位置',
- '下井时间',
- zaoquanUrlRouter.getPersonneldepartDetails,
- data.depart_id
- );
- }
- if (types === 'today') {
- giveAlarmDetails(
- 'today',
- data.depart_name,
- '姓名',
- '部门',
- '下井时间',
- '上井时间',
- zaoquanUrlRouter.getPersonneltodayDetails,
- data.depart_id
- );
- }
- }
- },
- });
- }
- }
- );
- }
- // 点击切换各个部门人数统计
- function clickGetDepartToday() {
- new popoPicker('.js-picker', {
- container: '.screen',
- wheels: [
- {
- infinite: false,
- //selected: 3,
- data: [
- {value: 'now', display: '当前各科室下井人数'},
- {value: 'today', display: '今日各科室下井人数'},
- ],
- },
- ],
- background: 'light',
- save: function (data) {
- if (data.result[0].value === 'now') {
- chart.destroy();
- getDepartToday('now');
- } else if (data.result[0].value === 'today') {
- chart.destroy();
- getDepartToday('today');
- }
- },
- });
- }
- // 人员定位系统设备运行状态
- function equipmentStatus() {
- $http.fnReuestDataNologing(
- zaoquanUrlRouter.getFacilityStatus,
- '',
- 'post',
- '',
- function (ret, err) {
- if (ret.code === 0) {
- $apis.html(
- equipmentStatusList,
- '#facilityStatusTemplate',
- ret.data
- );
- }
- }
- );
- }
- // 人员告警信息 超时
- function giveAlarm() {
- $http.fnReuestDataNologing(
- zaoquanUrlRouter.getTimeout,
- '',
- 'post',
- '',
- function (ret, err) {
- if (ret.code === 0) {
- $api.html($api.dom('.sales'), ret.data.timeout_num + '人');
- }
- }
- );
- }
- // 人员告警信息 求救人数
- function giveHelp() {
- $http.fnReuestDataNologing(
- zaoquanUrlRouter.getHelptotal,
- '',
- 'post',
- '',
- function (ret, err) {
- if (ret.code === 0) {
- $api.html($api.dom('.cryhelp'), ret.data.pepole_num + '人');
- }
- }
- );
- }
- // 详情
- // 超时人数详情 // 求救人数详情 // 设备运行状态详情 // 井下重点岗位人员分布详情
- function giveAlarmDetails(
- moduleType,
- title,
- name,
- dep,
- position,
- time,
- url,
- moduleParam
- ) {
- var params = {
- moduleType: moduleType,
- title: title,
- name: name,
- dep: dep,
- position: position,
- time: time,
- url: url,
- moduleParam: moduleParam,
- };
- $event.openWin(
- 'personnelLocationDetails',
- 'personnelLocationDetails',
- params,
- ''
- );
- }
- </script>
- </body>
- </html>
|