监测点按运行状态、前置机统计数据
This commit is contained in:
@@ -9,6 +9,7 @@ import com.njcn.pojo.commons.DatePojo;
|
||||
import com.njcn.pojo.commons.HttpResult;
|
||||
import com.njcn.pojo.commons.device.DeviceGeneral;
|
||||
import com.njcn.pojo.commons.device.LineDetailInfo;
|
||||
import com.njcn.pojo.commons.runmanage.IntegrityAnalysisData;
|
||||
import com.njcn.pojo.commons.runmanage.IntergralityData;
|
||||
import com.njcn.pojo.configuration.*;
|
||||
import com.njcn.service.configuration.DeviceService;
|
||||
@@ -37,6 +38,7 @@ import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.net.Socket;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
@@ -115,7 +117,7 @@ public class IntegralityController {
|
||||
*/
|
||||
@PostMapping("getIntegrityData")
|
||||
@ResponseBody
|
||||
public HttpResult getIntegrityData(String startTime, String endTime, String area,Integer devflag,Integer powerId, HttpServletRequest request) {
|
||||
public HttpResult getIntegrityData(String startTime, String endTime, String area,Integer devflag,Integer powerId, Integer runFlag, HttpServletRequest request) {
|
||||
HttpResult result = PubUtils.initResult(TokenManager.getToken().getLoginName(), request, LogTypeEnum.BUSSINESS.toString(), 0);
|
||||
DatePojo datePojo;
|
||||
datePojo = PubUtils.validateDate(startTime, endTime, "getIntegrityData");
|
||||
@@ -125,7 +127,7 @@ public class IntegralityController {
|
||||
}
|
||||
IntergralityData intergralityData;
|
||||
try {
|
||||
intergralityData = deviceService.getDataIntegralityTable(datePojo.getStartTime(), datePojo.getEndTime(), area,devflag,powerId);
|
||||
intergralityData = deviceService.getDataIntegralityTable(datePojo.getStartTime(), datePojo.getEndTime(), area,devflag,powerId,runFlag);
|
||||
if (null == intergralityData) {
|
||||
result = PubUtils.assignmentResultLog(null, 500, "获取监测点数据完整性数据为空", "查询完整性列表", "成功", result);
|
||||
} else {
|
||||
@@ -327,4 +329,35 @@ public class IntegralityController {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 数据完整性列表-》统计分析
|
||||
*/
|
||||
@PostMapping("statisticalAnalysis")
|
||||
@ResponseBody
|
||||
public HttpResult statisticalAnalysis(String startTime, String endTime, String area,Integer postType, Integer powerId, HttpServletRequest request) {
|
||||
HttpResult result = PubUtils.initResult(TokenManager.getToken().getLoginName(), request, LogTypeEnum.BUSSINESS.toString(), 0);
|
||||
DatePojo datePojo;
|
||||
datePojo = PubUtils.validateDate(startTime, endTime, "statisticalAnalysis");
|
||||
if (!StringUtils.isEmpty(datePojo.getMsg())) {
|
||||
result = PubUtils.assignmentResult(null, 500, datePojo.getMsg());
|
||||
return result;
|
||||
}
|
||||
try {
|
||||
List<IntegrityAnalysisData> data = deviceService.getStatisticalAnalysis(startTime,endTime,area,powerId,postType);
|
||||
if (null == data) {
|
||||
result = PubUtils.assignmentResultLog(null, 500, "获取统计分析数据为空", "查看统计分析", "成功", result);
|
||||
} else {
|
||||
result = PubUtils.assignmentResultLog(data, 200, "获取统计分析数据成功", "查看统计分析", "成功", result);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("查看统计分析数据异常,异常为:" + e.toString());
|
||||
userLog.getLog("查看统计分析数据异常", "失败", PubUtils.getIpAddr(request), LogTypeEnum.BUSSINESS.toString(), 0);
|
||||
result = PubUtils.assignmentResultLog(null, 500, "查看统计分析数据异常", "查看统计分析", "失败", result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -458,4 +458,12 @@ public class BusinessController {
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳转按地市统计监测点运行状态、前置机统计
|
||||
*/
|
||||
@RequestMapping("statisticalAnalysis")
|
||||
public String statisticalAnalysis() {
|
||||
return "business/manage/statisticalAnalysis";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -83,7 +83,8 @@
|
||||
T2.NAME lineName,
|
||||
T2.line_index lineId,
|
||||
T1.integrity integrity,
|
||||
T9.dic_name devType
|
||||
T9.dic_name devType,
|
||||
T10.NODE_NAME frontDev
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
@@ -109,7 +110,8 @@
|
||||
PQ_GDINFORMATION T6,
|
||||
PQ_SUBSTATION T7,
|
||||
PQS_DICDATA T8,
|
||||
PQS_DICDATA T9
|
||||
PQS_DICDATA T9,
|
||||
NODEINFORMATION T10
|
||||
WHERE
|
||||
T1.LINE_INDEX = T2.LINE_INDEX
|
||||
AND T2.DEV_INDEX = T3.DEV_INDEX
|
||||
@@ -119,6 +121,7 @@
|
||||
AND T2.SUB_INDEX=T7.SUB_INDEX
|
||||
AND T2.SCALE=T8.DIC_INDEX
|
||||
AND T9.DIC_INDEX = T3.DEVTYPE
|
||||
AND T3.NODE_INDEX = T10.NODE_INDEX
|
||||
</select>
|
||||
|
||||
<select id="selectGWIntegrityData" resultType="intergralityTable" >
|
||||
@@ -136,7 +139,8 @@
|
||||
T2.NAME lineName,
|
||||
T2.line_index lineId,
|
||||
T1.integrity integrity,
|
||||
T9.dic_name devType
|
||||
T9.dic_name devType,
|
||||
T10.NODE_NAME frontDev
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
@@ -162,7 +166,8 @@
|
||||
PQ_GDINFORMATION T6,
|
||||
PQ_SUBSTATION T7,
|
||||
PQS_DICDATA T8,
|
||||
PQS_DICDATA T9
|
||||
PQS_DICDATA T9,
|
||||
NODEINFORMATION T10
|
||||
WHERE
|
||||
T1.LINE_INDEX = T2.LINE_INDEX
|
||||
AND T2.DEV_INDEX = T3.DEV_INDEX
|
||||
@@ -172,6 +177,33 @@
|
||||
AND T2.SUB_INDEX=T7.SUB_INDEX
|
||||
AND T2.SCALE=T8.DIC_INDEX
|
||||
AND T9.DIC_INDEX = T3.DEVTYPE
|
||||
AND T3.NODE_INDEX = T10.NODE_INDEX
|
||||
</select>
|
||||
|
||||
<select id="getLineInfo" resultType="com.njcn.pojo.commons.device.LineInfo">
|
||||
SELECT
|
||||
PL.LINE_INDEX AS line_index,
|
||||
PL.NAME AS lineName,
|
||||
n.NODE_NAME AS devName,
|
||||
PL.STATUS AS status
|
||||
FROM
|
||||
PQ_LINE PL
|
||||
JOIN PQ_DEVICE pd ON PL.DEV_INDEX = pd.DEV_INDEX
|
||||
JOIN NODEINFORMATION n ON pd.NODE_INDEX = n.NODE_INDEX
|
||||
JOIN PQ_LINEDETAIL pl2 ON PL.LINE_INDEX = pl2.LINE_INDEX
|
||||
<where>
|
||||
PL.LINE_INDEX IN <foreach collection="list" item="item" open="(" close=")" separator=",">#{item}</foreach>
|
||||
<if test="postType != null and postType != ' '">
|
||||
<if test="postType == 0">
|
||||
AND pl2.MONITOR_ID IS NOT NULL
|
||||
</if>
|
||||
<if test="postType == 1">
|
||||
AND pl2.MONITOR_ID IS NULL
|
||||
</if>
|
||||
</if>
|
||||
<if test="powerId != null and powerId != ' '">
|
||||
AND pl2.POWERID = #{powerId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -79,6 +79,13 @@
|
||||
<option value="2">退运</option>
|
||||
</select> <label class="form-group">
|
||||
|
||||
<label class="form-group">通讯状态:</label>
|
||||
<select class="form-control" id="runFlag">
|
||||
<option value="">全部</option>
|
||||
<option value="0">中断</option>
|
||||
<option value="1">正常</option>
|
||||
</select> <label class="form-group">
|
||||
|
||||
<div class="form-inline disinlineb wanzhengdiv">
|
||||
<div class="form-group has-feedback mr10">
|
||||
<label>统计类型:</label>
|
||||
@@ -101,10 +108,22 @@
|
||||
<button id="helper" type="button" class="btn btn-primary tip tip-bottom" data-tip="数据完整性详解">
|
||||
<i class="glyphicon glyphicon-info-sign" style="margin-left: -3px;margin-right: -3px;"></i>
|
||||
</button>
|
||||
<div id="onlineNumber" type="button" class="btn themeBGColor">
|
||||
在线数:
|
||||
<div style="float: right" id="online"></div>
|
||||
</div>
|
||||
<div id="offlineNumber" type="button" class="btn themeBGColor">
|
||||
离线数:
|
||||
<div style="float: right" id="offline"></div>
|
||||
</div>
|
||||
<div id="analysis" type="button" class="btn themeBGColor" onclick="showAnalysis()">
|
||||
<i class="glyphicon glyphicon-info-sign"></i>
|
||||
<div style="float: right;margin-left: 5px">统计分析</div>
|
||||
</div>
|
||||
<div class="form-group fr mr10" id="fliteData">
|
||||
<label>筛选数据:</label>
|
||||
<input type="text" class="form-control" onkeyup="searchResult(this.value)"
|
||||
placeholder="空格分开多条件筛选数据">
|
||||
placeholder="多条件筛选数据" style="width: 120px">
|
||||
</div>
|
||||
</div>
|
||||
<table id="integritylist" class="table table-striped table-bordered dataTable no-footer width100">
|
||||
@@ -115,6 +134,7 @@
|
||||
<th>变电站</th>
|
||||
<th>监测点名称</th>
|
||||
<th>终端IP</th>
|
||||
<th>所属前置机</th>
|
||||
<th>终端状态</th>
|
||||
<th>通讯状态</th>
|
||||
<th>最新数据时间</th>
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
<%--
|
||||
Created by IntelliJ IDEA.
|
||||
User: 徐扬
|
||||
Date: 2024/7/25
|
||||
Time: 18:50
|
||||
To change this template use File | Settings | File Templates.
|
||||
--%>
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
|
||||
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
|
||||
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<title>监测点分类统计</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport"
|
||||
content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
|
||||
<link rel="stylesheet" href="${ctx}/css/plugin/bootstrap/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="${ctx}/css/plugin/datatables/buttons.dataTables.min.css">
|
||||
<link rel="stylesheet" href="${ctx}/css/plugin/datatables/datatables.bootstrap.css">
|
||||
<link rel="stylesheet" href="${ctx}/css/plugin/datatimepicker/bootstrap-datetimepicker.css">
|
||||
<link rel="stylesheet" href="${ctx}/css/plugin/basicButton.css">
|
||||
<link rel="stylesheet" href="${ctx}/css/plugin/bootstrapSwitch/bootstrap-switch.min.css">
|
||||
<link rel="stylesheet" href="${ctx}/css/plugin/ztree/zTreeStyle.css">
|
||||
<link rel="stylesheet" href="${ctx}/css/plugin/fontawesome/font-awesome.min.css">
|
||||
<link rel="stylesheet" href="${ctx}/css/basic.css">
|
||||
<link rel="stylesheet" href="${ctx}/css/plugin/datatables/bootstrap-select.css"/>
|
||||
|
||||
<style>
|
||||
html, body {
|
||||
background-color: #F9F9F9 !important;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container-fluid">
|
||||
<div class="form-inline header mt10">
|
||||
<label class="form-group">区域:</label>
|
||||
<div class="form-group has-feedback mr10">
|
||||
<div class="disinlineb">
|
||||
<input id="area" class="form-control" style="width: 140px" readonly>
|
||||
<i class="fa fa-caret-down areaicon"></i>
|
||||
<i class="fa fa-caret-up treeUpIcon disnone"
|
||||
style="color: #C9CBCE;position: absolute;left: 60px;font-size: 18px;z-index: 9999;top: 20px"></i>
|
||||
<div class=" ztree treeUpDiv disnone " id="areaTree"
|
||||
style="position: absolute;width: 140px;height: 147px;border: 2px solid #C9CBCE;overflow: auto;top: 32px;background: #fff;z-index: 100;border-radius: 2px">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%@include file="../../include/time.jsp"%>
|
||||
<label class="form-group">上报类型:</label>
|
||||
<select class="form-control" id="postType">
|
||||
<option value="">全部</option>
|
||||
<option value="0">国网上报</option>
|
||||
<option value="1">非国网上报</option>
|
||||
</select>
|
||||
<label class="form-group">监测点性质:</label>
|
||||
<select class="form-control" id="powerId">
|
||||
<option value="">全部</option>
|
||||
<option value="0">电网侧</option>
|
||||
<option value="1">非电网侧</option>
|
||||
</select>
|
||||
<label class="form-group">
|
||||
<button id="query" type="button" class="btn btn-primary ml5">
|
||||
<i class="glyphicon glyphicon-search"></i>
|
||||
</button>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-inline mt5">
|
||||
<table id="tongji" style="text-align: center" class="table table-striped table-bordered dataTable no-footer">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script src="${ctx}/js/plugin/jquery/jquery.min.js"></script>
|
||||
<script src="${ctx}/js/plugin/bootstrap/bootstrap.min.js"></script>
|
||||
<script src="${ctx}/js/plugin/bootstrap/bootstrap-datetimepicker.js"></script>
|
||||
<script src="${ctx}/js/plugin/bootstrap/bootstrap-datetimepicker.zh-CN.js"></script>
|
||||
<script src="${ctx}/js/plugin/datatables/datatables.jquery.js"></script>
|
||||
<script src="${ctx}/js/plugin/datatables/dataTables.buttons.min.js"></script>
|
||||
<script src="${ctx}/js/plugin/datatables/datatables.bootstrap.js"></script>
|
||||
<script src="${ctx}/js/plugin/datatables/buttons.html5.min.js"></script>
|
||||
<script src="${ctx}/js/plugin/layui/layer.js"></script>
|
||||
<script src="${ctx}/jspJS/utils/loading.js"></script>
|
||||
<script src="${ctx}/jspJS/utils/timeControl.js"></script>
|
||||
<script src="${ctx}/jspJS/utils/judgeAjaxStatus.js"></script>
|
||||
<script src="${ctx}/js/plugin/bootstrapSwitch/bootstrap-switch.min.js"></script>
|
||||
<script src="${ctx}/js/plugin/ztree/jquery.ztree.core.js"></script>
|
||||
<script src="${ctx}/js/area.js"></script>
|
||||
<script src="${ctx}/js/color.js"></script>
|
||||
<script src="${ctx}/jspJS/area/statisticalAnalysis.js"></script>
|
||||
<script src="${ctx}/js/plugin/jquery/jquery.cleverTabs.js"></script>
|
||||
<script src="${ctx}/js/plugin/bootstrap/3.3.7/bootstrap.min.js"></script>
|
||||
<script src="${ctx}/js/plugin/bootstrap/bootstrap-select.js"></script>
|
||||
</html>
|
||||
|
||||
279
pqs9000/src/main/webapp/jspJS/area/statisticalAnalysis.js
Normal file
279
pqs9000/src/main/webapp/jspJS/area/statisticalAnalysis.js
Normal file
@@ -0,0 +1,279 @@
|
||||
var $area=$("#area");
|
||||
var $startTime=$("#startTime");
|
||||
var $endTime=$("#endTime");
|
||||
var $postType = $("#postType")
|
||||
var $powerId = $("#powerId")
|
||||
$("#interval").val("月份");
|
||||
|
||||
var buttonname;
|
||||
var companyname;
|
||||
var tigName;
|
||||
var volData;
|
||||
var dataTable=null;
|
||||
var startTime,endTime,area,postType,powerId;
|
||||
|
||||
$(function () {
|
||||
startTime = $startTime.eq(0).val();
|
||||
endTime = $endTime.eq(0).val();
|
||||
area = $area.eq(0).val();
|
||||
postType = $postType.eq(0).val();
|
||||
powerId = $powerId.eq(0).val();
|
||||
loadselect("电压等级","vollevel");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
data:{
|
||||
start: startTime,
|
||||
end: endTime
|
||||
},
|
||||
async:false,
|
||||
url: "/pqs9000/device/getMsgInfo",
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
buttonname = data.body.name;
|
||||
tigName = data.body.name;
|
||||
}
|
||||
})
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/pqs9000/theme/getThemeInfo",
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
companyname = data.body.name;
|
||||
}
|
||||
})
|
||||
|
||||
//初始化按钮开关
|
||||
$(".checkbox").bootstrapSwitch({
|
||||
onText: buttonname, // 设置ON文本
|
||||
offText: companyname, // 设置OFF文本
|
||||
onColor: "primary",// 设置ON文本颜色 (info/success/warning/danger/primary)
|
||||
offColor: "primary", // 设置OFF文本颜色 (info/success/warning/danger/primary)
|
||||
size: "small", // 设置控件大小,从小到大 (mini/small/normal/large)
|
||||
handleWidth: "60",//设置控件宽度
|
||||
// 当开关状态改变时触发
|
||||
onSwitchChange: function (event, state) {
|
||||
if (state === true) {
|
||||
tigName = buttonname;
|
||||
refresh(area, startTime, endTime,postType,powerId);
|
||||
} else {
|
||||
tigName = companyname;
|
||||
refresh(area, startTime, endTime,postType,powerId);
|
||||
}
|
||||
}
|
||||
});
|
||||
//初始化区域
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/pqs9000/user/getAreasInfo",
|
||||
dataType:'json',
|
||||
success:function (data) {
|
||||
$("#area").val(data[0].name);
|
||||
$("#area").attr("index", data[0].id);
|
||||
areaTree = $.fn.zTree.init($("#areaTree"), settingAreaTree, data);
|
||||
//初始化页面内容
|
||||
area = $area.eq(0).attr("index");
|
||||
startTime = $startTime.eq(0).val();
|
||||
endTime = $endTime.eq(0).val();
|
||||
postType = $postType.eq(0).val();
|
||||
powerId = $powerId.eq(0).val();
|
||||
refresh(area, startTime, endTime,postType,powerId);
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
//点击确定,去后台请求参数
|
||||
$("#query").click(function() {
|
||||
area = $area.eq(0).attr("index");
|
||||
startTime = $startTime.eq(0).val();
|
||||
endTime = $endTime.eq(0).val();
|
||||
postType = $postType.eq(0).val();
|
||||
powerId = $powerId.eq(0).val();
|
||||
refresh(area,startTime,endTime,postType,powerId);
|
||||
});
|
||||
|
||||
//获取表格数据
|
||||
function refresh(area,startTime,endTime,postType,powerId){
|
||||
var i ;
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "/pqs9000/area/statisticalAnalysis",
|
||||
dataType : "json",
|
||||
data : {
|
||||
startTime : startTime,
|
||||
endTime : endTime,
|
||||
area: area,
|
||||
postType: postType,
|
||||
powerId: powerId
|
||||
},
|
||||
beforeSend: function () {
|
||||
i = ityzl_SHOW_LOAD_LAYER();
|
||||
},
|
||||
success : function(data) {
|
||||
if (data.code === 500) {
|
||||
layer.msg(data.message,{icon:2,time:2000})
|
||||
volData=null;
|
||||
} else {
|
||||
translateData(data.body);
|
||||
}
|
||||
//***********关闭loading
|
||||
ityzl_CLOSE_LOAD_LAYER(i);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function translateData(data) {
|
||||
var tableData = '';
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
for (var j = 0; j < data[i].typeLists.length; j++) {
|
||||
for (var k = 0; k < data[i].typeLists[j].dataLists.length; k++) {
|
||||
tableData += '["","' + data[i].deptName + '", "' + data[i].typeLists[j].name + '","'
|
||||
+ data[i].typeLists[j].dataLists[k].name + '","' + data[i].typeLists[j].dataLists[k].allLineCount + '","' + data[i].typeLists[j].dataLists[k].runLineCount + '","'
|
||||
+ data[i].typeLists[j].dataLists[k].checkLineCount + '","' + data[i].typeLists[j].dataLists[k].backLineCount + '","';
|
||||
if (k === 0) {
|
||||
var n = 0;
|
||||
if (j === 0) {
|
||||
for (var l = 0; l < data[i].typeLists.length; l++) {
|
||||
for (var m = 0; m < data[i].typeLists[l].dataLists.length; m++) {
|
||||
n++;
|
||||
}
|
||||
}
|
||||
}
|
||||
tableData += n + '","' + data[i].typeLists[j].dataLists.length + '"],';
|
||||
} else {
|
||||
tableData += '0","0"],'; //前面表示所有行,后面表示自己的行
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
tableData = tableData.substring(0, tableData.lastIndexOf(','));
|
||||
tableData = eval('[' + tableData + ']');
|
||||
console.log("tableData==:" + tableData)
|
||||
initTable(tableData);
|
||||
}
|
||||
|
||||
function initTable(data) {
|
||||
$('#tongji').dataTable({
|
||||
"columns": [
|
||||
{"title": "序号"},
|
||||
{"title": "区域"},
|
||||
{"title": "类型"},
|
||||
{"title": "分类型"},
|
||||
{"title": "监测点总数"},
|
||||
{"title": "监测点投运数"},
|
||||
{"title": "监测点检修数"},
|
||||
{"title": "监测点退运数"}
|
||||
],
|
||||
paging: false,
|
||||
scrollY: ($(window).height() * 0.83),
|
||||
lengthChange: false,
|
||||
language: {
|
||||
url: '/pqs9000/json/chine.json',
|
||||
},
|
||||
searching: false,
|
||||
info: false,
|
||||
ordering: false,
|
||||
destroy: true,
|
||||
data: data,
|
||||
fnDrawCallback: function () {
|
||||
this.api().column(0).nodes().each(function (cell, i) {
|
||||
cell.innerHTML = i + 1;
|
||||
});
|
||||
},
|
||||
columnDefs: [{
|
||||
targets: 1,
|
||||
createdCell: function (td, cellData, rowData, row, col) {
|
||||
var rowspan = rowData[8];
|
||||
|
||||
if (rowspan > 1) {
|
||||
$(td).attr('rowspan', rowspan)
|
||||
}
|
||||
if (rowspan == 0) {
|
||||
$(td).remove();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
targets: 2,
|
||||
createdCell: function (td, cellData, rowData, row, col) {
|
||||
var rowspan = rowData[9];
|
||||
|
||||
if (rowspan > 1) {
|
||||
$(td).attr('rowspan', rowspan)
|
||||
}
|
||||
if (rowspan == 0) {
|
||||
$(td).remove();
|
||||
}
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function loadselect(dictypeName,div){
|
||||
var part='#'+div;
|
||||
$(part).find("option").remove();
|
||||
$.ajax({
|
||||
method : "post",
|
||||
url : "/pqs9000/device/getselect",
|
||||
data : {
|
||||
dictypeName:dictypeName
|
||||
},
|
||||
async:false,
|
||||
success : function(data) {
|
||||
if(data == null){
|
||||
var message = dictypeName + '信息加载失败';
|
||||
layer.msg(message,{icon:1,time:1000});
|
||||
}else{
|
||||
var option0 = $("<option selected value='"
|
||||
+ null + "'>"
|
||||
+ "全部" + "</option>");
|
||||
$(part).append(option0);
|
||||
$.each(data, function(i, item) {
|
||||
var option = $("<option value='"
|
||||
+ item.dicIndex + "'>"
|
||||
+ item.dicName + "</option>");
|
||||
$(part).append(option);
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//特殊处理,表头紧缩问题--start
|
||||
var it=null;
|
||||
function startQuery() {
|
||||
//实时刷新时间单位为毫秒
|
||||
it= setInterval('refreshQuery()',100);
|
||||
|
||||
}
|
||||
/* 刷新查询 */
|
||||
function refreshQuery(){
|
||||
var width=$("#vdlist").width();
|
||||
if(width>100){
|
||||
initTable(resultData);
|
||||
window.clearInterval(it)
|
||||
}
|
||||
}
|
||||
//特殊处理,表头紧缩问题--end
|
||||
|
||||
//制保留2位小数,如:2,会在2后面补上00.即2.00
|
||||
function toDecimal2(x) {
|
||||
var f = parseFloat(x);
|
||||
if (isNaN(f)) {
|
||||
return false;
|
||||
}
|
||||
var f = Math.round(x*100)/100;
|
||||
var s = f.toString();
|
||||
var rs = s.indexOf('.');
|
||||
if (rs < 0) {
|
||||
rs = s.length;
|
||||
s += '.';
|
||||
}
|
||||
while (s.length <= rs + 2) {
|
||||
s += '0';
|
||||
}
|
||||
return s;
|
||||
}
|
||||
@@ -10,6 +10,10 @@ var companyname;
|
||||
var tiggleValue = "";
|
||||
var allNetsData = [];
|
||||
var countryNetsData = [];
|
||||
var data1;
|
||||
var data2;
|
||||
var data3;
|
||||
var data4;
|
||||
$("#interval").val("月份");
|
||||
/**
|
||||
* 电压等级排序自定义比较start
|
||||
@@ -116,9 +120,13 @@ $(function () {
|
||||
if (state === true) {
|
||||
tiggleValue = buttonname;
|
||||
initTable(allNetsData);
|
||||
$('#online').text(data1===null?0:data1);
|
||||
$('#offline').text(data2===null?0:data2);
|
||||
} else {
|
||||
tiggleValue = companyname;
|
||||
initTable(countryNetsData);
|
||||
$('#online').text(data3===null?0:data3);
|
||||
$('#offline').text(data4===null?0:data4);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -132,11 +140,12 @@ $("#query").click(function () {
|
||||
var endTime = $endTime.eq(0).val();
|
||||
var devflag = $("#devflag").val();
|
||||
var powerId = $("#powerId").val();
|
||||
refresh(area, startTime, endTime,devflag,powerId);
|
||||
var runFlag = $("#runFlag").val();
|
||||
refresh(area, startTime, endTime,devflag,powerId,runFlag);
|
||||
});
|
||||
|
||||
//获取表格数据
|
||||
function refresh(area, startTime, endTime,devflag,powerId) {
|
||||
function refresh(area, startTime, endTime,devflag,powerId,runFlag) {
|
||||
var i;
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
@@ -147,7 +156,8 @@ function refresh(area, startTime, endTime,devflag,powerId) {
|
||||
endTime: endTime,
|
||||
area: area,
|
||||
devflag:devflag,
|
||||
powerId:powerId
|
||||
powerId:powerId,
|
||||
runFlag:runFlag
|
||||
},
|
||||
beforeSend: function () {
|
||||
i = ityzl_SHOW_LOAD_LAYER();
|
||||
@@ -158,9 +168,17 @@ function refresh(area, startTime, endTime,devflag,powerId) {
|
||||
//没有数据
|
||||
allNetsData = null;
|
||||
countryNetsData = null;
|
||||
data1 = null;
|
||||
data2 = null;
|
||||
data3 = null;
|
||||
data4 = null;
|
||||
} else {
|
||||
allNetsData = data.body.allNets;
|
||||
countryNetsData = data.body.countryNets;
|
||||
data1 = data.body.allOnlineNum;
|
||||
data2 = data.body.allOfflineNum;
|
||||
data3 = data.body.countryOnlineNum;
|
||||
data4 = data.body.countryOfflineNum;
|
||||
}
|
||||
startQuery();
|
||||
//***********关闭loading
|
||||
@@ -219,8 +237,9 @@ function initTable(data) {
|
||||
}
|
||||
},
|
||||
{width: "8%", data: "deviceIp"},
|
||||
{width: "6%", data: "frontDev"},
|
||||
{
|
||||
width: "8%", data: "devFlag", render: function (data, type, full, meta) {
|
||||
width: "5%", data: "devFlag", render: function (data, type, full, meta) {
|
||||
var temp = Number(data);
|
||||
switch (temp) {
|
||||
case 0:
|
||||
@@ -233,7 +252,7 @@ function initTable(data) {
|
||||
}
|
||||
},
|
||||
{
|
||||
width: "8%", data: "status", render: function (data, type, full, meta) {
|
||||
width: "5%", data: "status", render: function (data, type, full, meta) {
|
||||
var temp = Number(data);
|
||||
switch (temp) {
|
||||
case 0:
|
||||
@@ -243,7 +262,7 @@ function initTable(data) {
|
||||
}
|
||||
}
|
||||
},
|
||||
{width: "8%", data: "updateTime"},
|
||||
{width: "10%", data: "updateTime"},
|
||||
{
|
||||
width: "8%", data: "integrity",
|
||||
render: function (data, type, full, meta) {
|
||||
@@ -258,7 +277,7 @@ function initTable(data) {
|
||||
}
|
||||
},
|
||||
{width: "8%", data: "device"},
|
||||
{width: "10%", data: "company"},
|
||||
{width: "8%", data: "company"},
|
||||
{width: "5%", data: "voltage", type: "number-fate"},
|
||||
{
|
||||
width: "12%", data: "", render: function (data, type, full, meta) {
|
||||
@@ -376,6 +395,18 @@ function showDetail(lineId) {
|
||||
}
|
||||
}
|
||||
|
||||
function showAnalysis() {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '监测点统计分析',
|
||||
maxmin: false,
|
||||
shadeClose: true, // 点击遮罩关闭层
|
||||
area: ['100%', '100%'],
|
||||
content: '/pqs9000/business/statisticalAnalysis',
|
||||
scrollbar: false
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
function modifyCss(dataTable) {
|
||||
@@ -407,8 +438,12 @@ function refreshQuery() {
|
||||
if (width > 100) {
|
||||
if (tiggleValue === buttonname) {
|
||||
initTable(allNetsData);
|
||||
$('#online').text(data1===null?0:data1);
|
||||
$('#offline').text(data2===null?0:data2);
|
||||
} else {
|
||||
initTable(countryNetsData);
|
||||
$('#online').text(data3===null?0:data3);
|
||||
$('#offline').text(data4===null?0:data4);
|
||||
}
|
||||
window.clearInterval(it)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user