<!DOCTYPE html>
|
<html lang="en">
|
<head>
|
<meta charset="UTF-8">
|
<title>拉西瓦水电站监测展示后台</title>
|
<link rel="stylesheet" href="../css/zxx/indexPublic.css">
|
<link rel="stylesheet" href="../css/zxx/index.css">
|
<link rel="stylesheet" href="/layui/css/layui.css">
|
<script src="../js/jquery-1.10.1.min.js"></script>
|
<script src="../js/echarts.js"></script>
|
<script src="../js/zxx/flexible.js"></script>
|
<script type="text/javascript" src="../js/jplayer/js/jquery.jplayer.min.js"></script>
|
<script src="../layui/layui.js"></script>
|
<style>
|
*{
|
font-family: "微软雅黑 Light";
|
}
|
.work-tanBox{
|
position: fixed;
|
left: 0;
|
top: 0;
|
width: 100%;
|
height: 100%;
|
background-color: rgba(0,0,0,0.7);
|
}
|
.work-tanBox-inside{
|
width: 100%;
|
height: 100%;
|
position: relative;
|
}
|
.work-tanBox-bj{
|
background:url("../img/zxx/work-tanImg.png") no-repeat center;
|
background-size: 100% 100%;
|
width: 4.53125rem;
|
height: 4rem;
|
position: absolute;
|
left: calc(50% - 2.265625rem);
|
top:calc(50% - 1.7448rem);
|
padding: 0.2083rem;
|
box-sizing: border-box;
|
}
|
.work-tanBox-title{
|
position: absolute;
|
left: calc(50% - 2.265625rem);
|
top:calc(45% - 1.7448rem);
|
width: 4.53125rem;
|
text-align: center;
|
color: #fff;
|
font-size: 0.1354rem;
|
}
|
.work-tan-line{
|
display: flex;
|
align-items: center;
|
}
|
.work-tan-block{
|
display: flex;
|
align-items: center;
|
margin-right: 0.2604rem;
|
}
|
.work-tan-line h1{
|
color: #00f0ff;
|
font-size: 0.09375rem;
|
line-height: 2;
|
}
|
.work-tan-line h2{
|
color: #fff;
|
font-size: 0.09375rem;
|
margin-left: 0.0521rem;
|
line-height: 2.5;
|
}
|
.work-tan-line h3{
|
color: #fff;
|
font-size: 0.0729rem;
|
margin-left: 0.1042rem;
|
line-height: 2.5;
|
}
|
.work-tan-top{
|
border-bottom: 2px dotted #00eaff; /*no*/
|
}
|
.work-tan-bottom{
|
display: flex;
|
flex-direction: column;
|
}
|
.work-tab-bottom-line{
|
display: flex;
|
}
|
.work-tab-bottom-line h1{
|
color: #00f0ff;
|
font-size: 0.09375rem;
|
flex: 1;
|
text-align: center;
|
margin-top: 0.1042rem;
|
line-height: 2.5;
|
}
|
.work-tab-bottom-line h2{
|
color: #fff;
|
font-size: 0.0729rem;
|
flex: 1;
|
text-align: center;
|
line-height: 2.5;
|
}
|
.work-tab-bottom-scroll{
|
max-height:1.4rem;
|
overflow-y: scroll;
|
}
|
.work-tab-bottom-scroll::-webkit-scrollbar{
|
width: 0!important;
|
}
|
.work-tab-bottom-scroll{
|
-ms-overflow-style: none;
|
}
|
.work-tab-bottom-scroll{
|
scrollbar-width:none;
|
}
|
.closeButton{
|
position: absolute;
|
right: -0.15625rem;
|
top:-0.15625rem;
|
width: 0.0833rem;
|
height: 0.0833rem;
|
cursor: pointer;
|
}
|
.button1 {
|
|
width: 100px;
|
|
height: 30px;
|
|
font-size: 18px;
|
|
font-family: 微软雅黑;
|
|
letter-spacing: 8px;
|
|
padding-left: 12px;
|
|
border-radius: 5px;
|
|
background: -webkit-linear-gradient(top, #66B5E6, #2e88c0);
|
|
background: -moz-linear-gradient(top, #66B5E6, #2e88c0);
|
|
background: linear-gradient(top, #66B5E6, #2e88c0);
|
|
background: -ms-linear-gradient(top, #66B5E6, #2e88c0);
|
|
border: 1px solid #2576A8;
|
|
box-shadow: 0 1px 2px #B8DCF1 inset, 0 -1px 0 #316F96 inset;
|
|
color: #fff;
|
|
text-shadow: 1px 1px 0.5px #22629B;
|
|
}
|
|
.button1:hover {
|
|
background: -webkit-linear-gradient(top, #8DC9EF, #4E9FD1);
|
|
background: -moz-linear-gradient(top, #8DC9EF, #4E9FD1);
|
|
background: linear-gradient(top, #8DC9EF, #4E9FD1);
|
|
background: -ms-linear-gradient(top, #8DC9EF, #4E9FD1);
|
|
}
|
.shouquandidian{
|
max-height: 0.7rem;
|
overflow-y: scroll;
|
align-items: baseline;
|
}
|
#o_areaName{
|
width: 78%;
|
}
|
</style>
|
</head>
|
<body>
|
<div class="index-wrap">
|
<!-- <img class="bjGif" src="../img/zxx/bjGif.gif" alt="">-->
|
<script src="../js/zxx/header.js"></script>
|
<!--<div class="index-header">
|
<div class="titlesBox">
|
<img class="hearLogo" src="../img/zxx/hearLogo.png" alt="">
|
</div>
|
<ul class="nav-left">
|
<li class="nav-block"><a class="active" href="">首页</a></li>
|
<li class="nav-block"><a href="">组织人员管理</a></li>
|
<li class="nav-block"><a href="">设备管理</a></li>
|
</ul>
|
<ul class="nav-right">
|
<li class="nav-block"><a href="">首页</a></li>
|
<li class="nav-block"><a href="">组织人员管理</a></li>
|
<li class="nav-block"><img src="./image/openBtn.png" alt=""></li>
|
</ul>
|
</div>-->
|
<div class="index-name">
|
<h1 id="operate"></h1>
|
</div>
|
<div class="index-main">
|
<div class="main-left">
|
<div class="main-number">
|
<div class="title-box">
|
<img src="../img/zxx/titleIcon1.png" alt="">
|
<h1>门禁授权总数</h1>
|
</div>
|
<div class="main-number2">
|
<h1 id="work_num"></h1>
|
<!--<h2>当前工作区总人数</h2>-->
|
</div>
|
<div class="main-number3" id="main-number3">
|
</div>
|
</div>
|
<div class="main-number numberTop" onclick="toLog1(1)">
|
<div class="title-box">
|
<img src="../img/zxx/titleIcon2.png" alt="">
|
<h1>工作区人员记录</h1>
|
</div>
|
<div class="main-number4">
|
<!--<h1>05-20 14:10 <font class="name">张三丰</font>离开6F机组技术供水</h1>-->
|
</div>
|
</div>
|
</div>
|
<div class="main-middle">
|
<div class="middle-box1">
|
<div class="title-box">
|
<img src="../img/zxx/titleIcon5.png" alt="">
|
<h1>监控预警</h1>
|
</div>
|
<div class="middle-number1">
|
<div class="middleBox-main1">
|
<div class="middle-box-left">
|
<div class="middleIcon-box">
|
<img class="middleIcon1" src="../img/zxx/middleIcon1.png" alt="">
|
<img class="middleIcon2" src="../img/zxx/middleIcon2.gif" alt="">
|
</div>
|
<div>
|
<h1>硬件对接</h1>
|
<h1 id="duijie">运行正常</h1>
|
</div>
|
</div>
|
<div class="middle-box-left">
|
<div class="middleIcon-box">
|
<img class="middleIcon1" src="../img/zxx/middleIcon3.gif" alt="">
|
</div>
|
<div>
|
<h1>核心进程</h1>
|
<h1>运行正常</h1>
|
</div>
|
</div>
|
</div>
|
<div class="middleBox-main2">
|
<div class="middleBox-block">
|
<img src="..//img/zxx/middleImg1.png" alt="">
|
<div class="middle-content">
|
<h1><font class="ts1" id="online">0</font> <span class="s23">/</span> <font class="ts2" id="noOnline">200</font></h1>
|
<h2>指纹读头</h2>
|
</div>
|
</div>
|
<div class="middleBox-block">
|
<img src="../img/zxx/middleImg2.png" alt="">
|
<div class="middle-content">
|
<h1><font class="ts1">0</font> <span class="s23">/</span> <font class="ts2" id="countSum">200</font></h1>
|
<h2>门禁</h2>
|
</div>
|
</div>
|
</div>
|
<div class="middleBox-main3" id="readHeadStatusContent" onclick="toLog1(3)">
|
<!--<h1 class="errorRizhi">异常日志</h1>
|
<div class="middle-content-box">
|
<div class="middle-line errorLine">
|
<span></span>
|
<h1>02-09 14:20 5号指纹读头恢复正常02-09 14:20 5号指纹读头恢复正常</h1>
|
</div>
|
<div class="middle-line">
|
<span></span>
|
<h1>02-09 14:20 5号指纹读头恢复正常</h1>
|
</div>
|
<div class="middle-line errorLine">
|
<span></span>
|
<h1>02-09 14:20 5号指纹读头恢复正常</h1>
|
</div>
|
</div>-->
|
|
</div>
|
</div>
|
</div>
|
<div class="middle-number2">
|
<div class="title-box">
|
<img src="../img/zxx/titleIcon6.png" alt="">
|
<h1>门禁许可</h1>
|
</div>
|
<div class="middleBox-main4">
|
<div class="cj-mj" onclick="goMjxk()">
|
<img src="../img/zxx/middle-mj.png" alt="">
|
<h1>创建门禁许可</h1>
|
</div>
|
<!--<div class="cj-mj2">
|
<h1>2020-05-20 14:10</h1>
|
<h2>6F机组技术供水1号、2号、3号、4号、5号、6号、7
|
</h2>
|
</div>
|
<div class="cj-mj2 nowzx">
|
<h1>2020-05-20 14:10</h1>
|
<h2>6F机组技术供水1号、2号、3号、4号、5号、6号、7
|
</h2>
|
</div>-->
|
</div>
|
</div>
|
|
</div>
|
<div class="main-left">
|
<div class="main-number numberBetween">
|
<div class="clock-top redFont" onclick="openDoor()">
|
<img src="../img/zxx/clockImg1.png" alt="">
|
<h1>全厂门禁系统一键解锁</h1>
|
</div>
|
<div class="clock-top greenFont" onclick="closeDoor()">
|
<img src="../img/zxx/clockImg2.png" alt="">
|
<h1>全厂门禁系统一键恢复</h1>
|
</div>
|
<!--<div class="title-box">
|
<img src="../img/zxx/titleIcon3.png" alt="">
|
<h1>授权数据统计</h1>
|
</div>
|
<div class="main-number2">
|
<h1 id="auth_count"></h1>
|
<h2>授权总次数</h2>
|
</div>
|
<div class="main-number3">
|
<div class="number3-block">
|
<h1 id="long_auth_data"></h1>
|
<h2>长期授权</h2>
|
</div>
|
<div class="number3-block">
|
<h1 id="short_auth_data"></h1>
|
<h2>临时授权</h2>
|
</div>
|
<div class="number3-block">
|
<h1 id="ERP_auth_data"></h1>
|
<h2>ERP授权</h2>
|
</div>
|
</div>-->
|
</div>
|
<div class="main-number numberTop">
|
<div class="title-box">
|
<img src="../img/zxx/titleIcon4.png" alt="">
|
<h1>门禁开启数据统计</h1>
|
</div>
|
<div class="main-number2">
|
<h1 id="mj_open_count"></h1>
|
<h2>门禁开启总次数 </h2>
|
</div>
|
<div class="main-number3">
|
<div class="number3-block">
|
<h1 id="long_auth_mj"></h1>
|
<h2>长期授权</h2>
|
</div>
|
<div class="number3-block">
|
<h1 id="short_auth_mj"></h1>
|
<h2>临时授权</h2>
|
</div>
|
<div class="number3-block">
|
<h1 id="ERP_auth_mj"></h1>
|
<h2>工作票授权</h2>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
|
<div class="work-tanBox" style="display: none">
|
<div class="work-tanBox-inside">
|
<h1 class="work-tanBox-title">工作票执行情况</h1>
|
<div class="work-tanBox-bj">
|
<img class="closeButton" src="/img/zxx/closeBtn.png" alt="">
|
<div class="work-tan-top">
|
<div class="work-tan-line">
|
<button style="float: right" class="button1" onclick="quxiao()">取消</button>
|
<button style="float: right" class="button1" onclick="zhongzhi()">终止</button>
|
</div>
|
<div class="work-tan-line">
|
<h1>工作票名称 :</h1>
|
<h2 id="o_name">6F机组蜗壳盘型阀关闭</h2>
|
<h3 id="o_time">2020-10-21 09:25——2020-10-21 10:25</h3>
|
</div>
|
<div class="work-tan-line">
|
<div class="work-tan-block">
|
<h1>工作票类型 :</h1>
|
<h2 id="o_type">临时授权</h2>
|
</div>
|
<div class="work-tan-block">
|
<h1>工作票编号 :</h1>
|
<h2 id="o_no">25362486356</h2>
|
</div>
|
</div>
|
<div class="work-tan-line">
|
<h1>负责人 :</h1>
|
<h2 id="o_fuzeren">张三丰</h2>
|
</div>
|
<div class="work-tan-line">
|
<h1>同行人 :</h1>
|
<h2 id="o_tongxingren">胡康宝</h2>
|
</div>
|
<div class="work-tan-line">
|
<div class="work-tan-block">
|
<h1>工作票授权人 :</h1>
|
<h2 id="o_shouquanren">吴丽丽</h2>
|
</div>
|
<div class="work-tan-block">
|
<h1>工作票授权时间 :</h1>
|
<h2 id="o_shouquanTime">2020-10-21 14:00</h2>
|
</div>
|
</div>
|
<div class="work-tan-line shouquandidian">
|
<h1>授权地点 :</h1>
|
<h2 id="o_areaName"></h2>
|
</div>
|
</div>
|
<div class="work-tan-bottom">
|
<div class="work-tab-bottom-line">
|
<h1>点位</h1>
|
<h1>进门时间</h1>
|
<h1>出门时间</h1>
|
<h1>工作时长</h1>
|
</div>
|
<div class="work-tab-bottom-scroll" id="logContent">
|
<div class="work-tab-bottom-line">
|
<h2>6F机组技术供水1号</h2>
|
<h2>2020-10-21 14:00</h2>
|
<h2>2020-10-21 16:45</h2>
|
<h2>2小时45分钟</h2>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
|
<!-- 播放声音 -->
|
<div class="jp-audio" style="width: 0px; height: 0px;">
|
<div class="jp-type-single">
|
<div id="jquery_jplayer_1" class="jp-jplayer"></div>
|
</div>
|
<div id="jp_playlist_1" class="jp-playlist"></div>
|
</div>
|
|
<script src="../js/zxx/ajaxUtil.js"></script>
|
<script>
|
|
// 授权饼状图
|
function pie1(res,num){
|
var myChart = echarts.init(document.getElementById('main-number3'));
|
var datas = res
|
|
var colors = ['#08a4ed', '#f93e60', '#36d4a7']
|
var legendData = []
|
for (var j = 0; j < datas.length; j++) {
|
var data = {
|
name: datas[j].name,
|
icon: 'circle',
|
textStyle: {
|
fontSize: 14,
|
color: colors[j]
|
}
|
}
|
legendData.push(data)
|
}
|
var objData = array2obj(datas, 'name')
|
console.log(objData)
|
option = {
|
legend: {
|
orient: 'vertical',
|
top: 'center',
|
left: '40%',
|
itemGap: 20,
|
data: legendData,
|
formatter: function (name) {
|
return ` ${name} ${objData[name].value} 人`
|
},
|
textStyle: {
|
rich: {
|
value: {
|
color: '#82baff',
|
fontSize: 24,
|
fontWeight: 600,
|
fontFamily: 'HuaKang',
|
padding: [0, 10, 0, 30]
|
},
|
unit: {
|
color: '#82baff',
|
fontSize: 14,
|
fontWeight: 600,
|
fontFamily: 'HuaKang',
|
padding: [0, 50, 0, 0]
|
},
|
percent: {
|
color: '#82baff',
|
fontSize: 24,
|
fontWeight: 600,
|
fontFamily: 'HuaKang',
|
padding: [0, 10, 0, 0]
|
}
|
}
|
}
|
},
|
tooltip: {
|
trigger: 'item',
|
formatter: '{a} <br/>{b} : {c} ({d}%)'
|
},
|
color: colors,
|
visualMap: {
|
show: false,
|
min: 50,
|
max: 600,
|
inRange: {
|
//colorLightness: [0, 1]
|
}
|
},
|
series: [
|
{
|
name: '访问来源',
|
type: 'pie',
|
radius: '60%',
|
center: ['20%', '50%'],
|
label:{
|
normal: {
|
show: false,
|
fontSize:14
|
},
|
},
|
labelLine:{
|
normal: {
|
show: false,
|
lineStyle: {
|
color: 'rgba(255, 255, 255, 0.3)'
|
},
|
}
|
},
|
data: datas,
|
roseType: 'radius',
|
animationType: 'scale',
|
animationEasing: 'elasticOut',
|
animationDelay: function (idx) {
|
return Math.random() * 200
|
}
|
}
|
]
|
}
|
|
/**
|
* @introduction 把数组中key值相同的那一项提取出来,组成一个对象
|
* @description 详细描述
|
* @param {参数类型} array 传入的数组 [{a:"1",b:"2"},{a:"2",b:"3"}]
|
* @param {参数类型} key 属性名 a
|
* @return {返回类型说明}
|
* @exception [违例类型] [违例类型说明]
|
*/
|
function array2obj (array, key) {
|
var resObj = {}
|
for (var i = 0; i < array.length; i++) {
|
resObj[array[i][key]] = array[i]
|
}
|
return resObj
|
}
|
|
myChart.setOption(option);
|
};
|
|
var visitForm = {};
|
visitForm.pageNum = 1
|
visitForm.pageSize = 30
|
$(function () {
|
//获取操作人和操作时间
|
//$.operate.post("/station/workUser/getWorkUserAuthorizationType", {}, getWorkUserAuthorizationType);
|
$.operate.post("/station/workUser/getUserAndTime", {}, getUserAndTime);
|
//获取门禁许可(工单)
|
$.operate.post("/station/order/getOrderList", {validFlag:1}, getOrderList);
|
//统计读头在线状态
|
$.operate.post("/station/head/countShowStatus", {}, getShowStatus);
|
//读头在线状态内容
|
$.operate.post("/station/equipment/list", {}, getEquipmentStatus);
|
//门禁数量
|
$.operate.post("/station/door/countSum", {}, getCountSum);
|
//统计
|
$.operate.post("/station/statistic/list", {}, getStatistic);
|
$.operate.post("/station/log/list", visitForm, getVisitLog);
|
|
setInterval(function () {
|
//统计读头在线状态
|
$.operate.post("/station/head/countShowStatus", {}, getShowStatus);
|
//读头在线状态内容
|
$.operate.post("/station/equipment/list", {}, getEquipmentStatus);
|
//门禁数量
|
$.operate.post("/station/door/countSum", {}, getCountSum);
|
}, 1000*60*2);
|
|
setInterval(function () {
|
//统计
|
$.operate.post("/station/statistic/list", {}, getStatistic);
|
$.operate.post("/station/log/list", visitForm, getVisitLog);
|
}, 1000*10);
|
|
$(document).ready(function () {
|
$("#jquery_jplayer_1").jPlayer({
|
ready: function (event) {
|
$(this).jPlayer("setMedia", {
|
oga: "/mp3/baojing.mp3"
|
});
|
},
|
swfPath: "${ctx}/jplayer/js",
|
supplied: " oga",
|
wmode: "window"
|
});
|
|
});
|
});
|
|
function getVisitLog(res){
|
if(res.rows) {
|
$(".main-number4").empty();
|
var userWorkStr = [];
|
var visitLogList = res.rows;
|
$.each(visitLogList, function (key, value) {
|
var direction = value.direction == 0 ? " 进门" : " 出门"
|
userWorkStr.push("<h1>"+value.createTime+" <font class='name'>"+value.userName+"</font> 在"+value.doorName+direction+"</h1>");
|
});
|
|
$(".main-number4").append(userWorkStr.join(''));
|
}
|
}
|
|
var tl = null;
|
function getStatistic(res) {
|
if(res.statu1==0){
|
$('#duijie').html('<font style="color:red">运行异常</font>')
|
clearInterval(tl);
|
$(document.body).removeAttr("style");
|
tl = setInterval("shanShuo()", 500);
|
$("#jquery_jplayer_1").jPlayer("play");
|
}else{
|
clearInterval(tl);
|
$(document.body).removeAttr("style");
|
$('#duijie').html('运行正常')
|
$("#jquery_jplayer_1").jPlayer("stop");
|
}
|
$("#long_auth_mj").text(res.teamopen);
|
$("#short_auth_mj").text(res.orderopen1);
|
$("#ERP_auth_mj").text(res.orderopen2);
|
$("#mj_open_count").text(res.teamopen+res.orderopen1+res.orderopen2);
|
|
$("#work_num").text(res.teamnum+res.ordernum1+res.ordernum2);
|
var jsonPie = [{value: res.teamnum, name: "长期授权"}, {value: res.ordernum1, name: "临时授权"}, {value: res.ordernum2, name: "工作票授权"}]
|
pie1(jsonPie,$("#work_num").val());
|
}
|
|
var ssflag=0;
|
function shanShuo(){
|
if(ssflag==0){
|
$(document.body).css({ width: '100%', height: '100%', zIndex: '99999', position: 'fixed',
|
filter: 'Alpha(opacity=60)', backgroundColor: 'red', top: '0', left: '0', opacity: '0.6'
|
});
|
ssflag=1;
|
}else{
|
$(document.body).css({ width: '100%', height: '100%', zIndex: '99999', position: 'fixed',
|
filter: 'Alpha(opacity=60)', backgroundColor: 'black', top: '0', left: '0', opacity: '0.6'
|
});
|
ssflag=0;
|
}
|
}
|
|
//获取操作人和操作时间
|
function getUserAndTime(res) {
|
if(res.code == 0) {
|
var user = res.data.user;
|
// var time = res.data.time;
|
if(user == null || user == "" || typeof user =="undefined") {
|
$("#operate").text("当前操作员:未知");
|
}else {
|
$("#operate").text("当前操作员:"+user.userName);
|
}
|
/* if(time == null || time == "" || typeof time =="undefined") {
|
$("#operatTime").text("未知");
|
}else {
|
$("#operatTime").text(time);
|
}
|
$("#operatTime").text(time);*/
|
}
|
}
|
|
//获取工作区人数
|
function getWorkNum(res) {
|
if(res.code == 0) {
|
var workNum = res.data;
|
// $("#work_num").text(workNum);
|
}
|
}
|
|
//获取用户授权方式(当前有效授权人数)
|
function getWorkUserAuthorizationType(res) {
|
pie1(res.data.model,res.data.num)
|
if(res.code == 0) {
|
var longAuth = res.data.longAuth;
|
var shortAuth = res.data.shortAuth;
|
var ERPAuth = res.data.ERPAuth;
|
$("#long_auth").text(longAuth);
|
$("#short_auth").text(shortAuth);
|
$("#ERP_auth").text(ERPAuth);
|
$("#work_num").text(res.data.num);
|
}
|
}
|
|
//授权总次数
|
function getAuthCount(res) {
|
if(res.code == 0) {
|
var authCount = res.data;
|
$("#auth_count").text(authCount);
|
}
|
}
|
|
//授权数据统计-》授权方式
|
function getAuthDataType(res) {
|
if(res.code == 0) {
|
var longAuth = res.data.longAuth;
|
var shortAuth = res.data.shortAuth;
|
var ERPAuth = res.data.ERPAuth;
|
$("#long_auth_data").text(longAuth);
|
$("#short_auth_data").text(shortAuth);
|
$("#ERP_auth_data").text(ERPAuth);
|
}
|
}
|
|
//门禁开启总次数
|
function getMjOpenCount(res) {
|
if(res.code == 0) {
|
var mjOpenCount = res.data;
|
// $("#mj_open_count").text(mjOpenCount);
|
}
|
}
|
|
//门禁开启数据统计-》授权方式
|
function getMjOpenAuthType(res) {
|
console.log(res)
|
if(res.code == 0) {
|
var longAuth = res.data.longAuth;
|
var shortAuth = res.data.shortAuth;
|
var ERPAuth = res.data.ERPAuth;
|
var totalCount = res.data.num;
|
console.log(shortAuth)
|
console.log(ERPAuth)
|
$("#long_auth_mj").text(longAuth);
|
$("#short_auth_mj").text(shortAuth);
|
$("#ERP_auth_mj").text(ERPAuth);
|
$("#mj_open_count").text(totalCount);
|
}
|
}
|
|
//工作区人员记录
|
function getUserWorkLog(res) {
|
if(res.code == 0) {
|
var userWorkStr = [];
|
var visitLogList = res.data;
|
$.each(visitLogList, function (key, value) {
|
var direction = value.direction == 0 ? "进门执行" : "出门结束"
|
if(value.expandStatus == 1) {
|
userWorkStr.push("<h1>"+value.createTime+" <font class='name'>"+value.userName+"</font>"+direction+"任务</h1>");
|
}else {
|
userWorkStr.push("<h1>"+value.createTime+" <font class='name'>"+value.userName+"</font>"+direction+""+value.workOrderName+"</h1>");
|
}
|
});
|
|
$(".main-number4").append(userWorkStr.join(''));
|
}
|
}
|
|
//获取门禁许可(工单)
|
function getOrderList(res) {
|
if(res.code == 0) {
|
var orderStr = [];
|
var orderlist = res.data;
|
$.each(orderlist, function (key, value) {
|
// var area = value.areaNames==null?"":value.areaNames;
|
// var content = value.taskName + "区域" + area;
|
orderStr.push("<div onclick='toLog2("+value.id+")' class='cj-mj2' style='width: 160px;'>");
|
orderStr.push("<h1>"+value.createTime+"</h1>");
|
orderStr.push("<h2>"+value.taskName+"</h2>");
|
//orderStr.push("<button onclick='toLog1(2)'>查看详情</button>");
|
orderStr.push("</div>");
|
});
|
|
$(".middleBox-main4").append(orderStr.join(''));
|
}
|
}
|
|
function goMjxk(){
|
window.location.href = "/createOrderLogin";
|
}
|
|
//读头状态统计
|
function getShowStatus(res){
|
$("#online").text(res.count2);
|
$("#noOnline").text(res.count1);
|
|
}
|
|
//读头详细内容
|
function getEquipmentStatus(res) {
|
var content=''
|
content+='<h1 class="errorRizhi">异常日志</h1>'
|
content+='<div class="middle-content-box">'
|
$.each(res, function (key, value) {
|
if(value.status==1){
|
content+='<div class="middle-line"> <span></span><h1>'+value.content+' 网络中断恢复</h1></div>'
|
}else{
|
content+='<div class="middle-line"> <span></span><h1>'+value.content+' 网络中断</h1></div>'
|
}
|
|
});
|
content+='<div>'
|
$('#readHeadStatusContent').html(content);
|
}
|
|
|
function goIndexBack(){
|
window.location.href = "/indexBack";
|
}
|
|
function getCountSum(res){
|
$("#countSum").text(res.countSum);
|
}
|
|
//一键开门
|
function openDoor(){
|
var msg=confirm("确认开锁吗!");
|
if (msg==false) {
|
return false;
|
}if (msg==true) {
|
$.operate.post("/station/opendoor/openDoor", {},function a(res) {
|
alert("操作成功")
|
});
|
}
|
}
|
|
//一键关门
|
function closeDoor(){
|
var msg=confirm("确认恢复吗!");
|
if (msg==false) {
|
return false;
|
}if (msg==true) {
|
$.operate.post("/station/opendoor/openDoor", {},function a(res) {
|
alert("操作成功")
|
});
|
}
|
|
}
|
function operatLog() {
|
window.location.href = "/api/visit/goLogQuery";
|
}
|
function areaUnlock() {
|
window.location.href = "/api/visit/areaUnlock";
|
}
|
|
function getzf(num) {
|
if (parseInt(num) < 10) {
|
num = '0' + num;
|
}
|
return num;
|
}
|
|
|
$(function () {
|
setInterval(function(){
|
var now = new Date();
|
var year = now.getFullYear();
|
var month = now.getMonth()+1;
|
var date = now.getDate();
|
var hours = now.getHours();
|
var minutes = now.getMinutes();
|
var seconds = now.getSeconds();
|
var currentTime = year + "年" + getzf(month) + "月" + getzf(date) + "日 " + getzf(hours) + "时" + getzf(minutes) + "分" + getzf(seconds)+"秒";
|
$("#operatTime").text(currentTime);
|
},1000)
|
|
/*setInterval(function () {
|
//10秒刷新页面
|
location.reload();
|
} ,1000*10);*/
|
});
|
|
function toLog1(type) {
|
window.location.href = "/api/visit/goLogQuery";
|
}
|
|
var o_id = "";
|
function toLog2(id) {
|
o_id = id;
|
$.operate.post("/station/pushLog/findById", {id:id}, getPushLog);
|
$.operate.post("/station/log/list2", {workOrderId:id}, pushLogByOrderId);
|
$(".work-tanBox").show()
|
}
|
|
function getPushLog(v){
|
$('#o_name').html(v.taskName);
|
$('#o_time').html(v.startTime+" -- "+v.endTime);
|
$('#o_fuzeren').html(v.userName);
|
$('#o_tongxingren').html(v.togetherUserNames);
|
|
$('#o_no').html(v.orderNo);
|
if(v.openMode==0){
|
$('#o_type').html("临时授权");
|
}
|
if(v.openMode==1){
|
$('#o_type').html("工作票授权");
|
}
|
if(v.openMode==2){
|
$('#o_type').html("外包工程工作票授权");
|
}
|
$('#o_shouquanTime').html(v.createTime);
|
$('#o_shouquanren').html(v.createBy);
|
$('#o_areaName').html(v.areaName);
|
|
}
|
|
$(".closeButton").click(function () {
|
$(".work-tanBox").hide()
|
})
|
|
function pushLogByOrderId(res) {
|
$('#logContent').html("")
|
var contents = "";
|
for(var i=0;i<res.length;i++){
|
var data = res[i];
|
var endTime = "";
|
if(data.endTime){
|
endTime = data.endTime;
|
}
|
contents+='<div class="work-tab-bottom-line"><h2>'+data.areaName+'</h2><h2>'+data.createTime+'0</h2><h2>'+endTime+'</h2><h2>'+data.deptName+'</h2></div>';
|
}
|
$('#logContent').html(contents)
|
}
|
|
function quxiao() {
|
var msg=confirm("确认取消吗!");
|
if (msg==false) {
|
return false;
|
}if (msg==true) {
|
$.operate.post("/station/order/quxiao", {id:o_id},function a(res) {
|
alert("操作成功")
|
location.reload();
|
});
|
}
|
}
|
|
function zhongzhi(){
|
var msg=confirm("确认终止吗!");
|
if (msg==false) {
|
return false;
|
}if (msg==true) {
|
$.operate.post("/station/order/quxiao", {id:o_id},function a(res) {
|
alert("操作成功")
|
location.reload();
|
});
|
}
|
}
|
</script>
|
</body>
|
</html>
|