193 lines
8.5 KiB
Plaintext
193 lines
8.5 KiB
Plaintext
<%@ page import="com.sipai.entity.enums.MeterTypeEnum" %>
|
|
<%@ page language="java" pageEncoding="UTF-8" %>
|
|
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
|
<% request.setAttribute("TYPE_BG", MeterTypeEnum.TYPE_BG.getId());%>
|
|
<!-- bootstrap switch -->
|
|
<link rel="stylesheet"
|
|
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
|
<script type="text/javascript"
|
|
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
|
charset="utf-8"></script>
|
|
<script type="text/javascript">
|
|
var patrolRecordId = "${patrolRecordId}";
|
|
var patrolPointId = "${patrolPointId}";
|
|
var unitId = "${unitId}";
|
|
|
|
var initTreeView1 = function () {
|
|
if (patrolPointorEquipment == "p") {//运行
|
|
var type = $('#type').val();
|
|
$.post(ext.contextPath + '/timeEfficiency/patrolContentsRecord/getPatrolContentsRecord.do', {
|
|
patrolRecordId: patrolRecordId,
|
|
patrolPointId: patrolPointId,
|
|
unitId: unitId
|
|
}, function (data) {
|
|
console.info(data)
|
|
var treeList = data.result;
|
|
$('#tree1').treeview({data: treeList, showTags: true});
|
|
}, 'json');
|
|
} else if (patrolPointorEquipment == "e") {//设备
|
|
var type = $('#type').val();
|
|
$.post(ext.contextPath + '/timeEfficiency/patrolContentsRecord/getPatrolContentsRecord.do', {
|
|
patrolRecordId: patrolRecordId,
|
|
equipmentId: patrolPointId,
|
|
unitId: unitId
|
|
}, function (data) {
|
|
console.info(data)
|
|
var treeList = data.result;
|
|
$('#tree1').treeview({data: treeList, showTags: true});
|
|
}, 'json');
|
|
}
|
|
|
|
};
|
|
|
|
var initTreeView2 = function () {
|
|
if (patrolPointorEquipment == "p") {
|
|
var type = $('#type').val();
|
|
// 请求树状数据
|
|
$.post(ext.contextPath + '/timeEfficiency/patrolMeasurePointRecord/getMeasurePointByPatrolRecord.do', {
|
|
patrolRecordId: patrolRecordId,
|
|
patrolPointId: patrolPointId,
|
|
unitId: unitId
|
|
}, function (data) {
|
|
var treeList = data.result;
|
|
console.info(treeList);
|
|
// 如果返回type为有对比则展示表格
|
|
if (treeList[0].type == ${TYPE_BG}) {
|
|
document.getElementById("btable").style.display = 'block';
|
|
|
|
let html = "<table class='table-striped table-hover table-bordered' style='width: 100%;'>";
|
|
html += "<tr style='height:45px;text-align: center;'>";
|
|
html += "<td >类型</td>";
|
|
html += "<td >检测内容</td>";
|
|
html += "<td >填报内容</td>";
|
|
html += "<td >在线值</td>";
|
|
html += "<td >对比结果</td>";
|
|
html += "<td >对比标准<br>(上限|下限)</td>";
|
|
html += "</tr>";
|
|
|
|
if (treeList.length > 0) {
|
|
for (let i = 0; i < treeList.length; i++) {
|
|
let content = treeList[i];
|
|
let name = content.name;
|
|
|
|
if (content.nodes != null) {
|
|
|
|
for (let j = 0; j < content.nodes.length; j++) {
|
|
html += "<tr style='height:45px;text-align: center;' >";
|
|
if(j==0){
|
|
html += "<td rowspan='" + content.nodes.length + "' style='writing-mode: vertical-rl;'>" + name + "</td>";
|
|
}else{
|
|
|
|
}
|
|
|
|
let content2 = content.nodes[j];
|
|
let name2 = content2.name;
|
|
html += "<td >" + name2 + "</td>";
|
|
console.log("mpvalue is ", content2.mpvalue)
|
|
console.log("mpvalue2 is ", content2.newValue)
|
|
if (content2.tags[0]) {
|
|
html += "<td >" + content2.tags[0] + "</td>";
|
|
} else if(content2.newValue){
|
|
html += "<td >" + content2.newValue + "</td>";
|
|
} else {
|
|
html += "<td >" + '-' + "</td>";
|
|
}
|
|
if (content2.zjValue) {
|
|
html += "<td >" + content2.zjValue + "</td>";
|
|
} else {
|
|
html += "<td >" + '-' + "</td>";
|
|
}
|
|
if (content2.dValue) {
|
|
if (content.nodes[j].type == 'red') {
|
|
html += "<td style='color: red;'>" + content2.dValue + "%</td>";
|
|
} else {
|
|
html += "<td >" + content2.dValue + "</td>";
|
|
}
|
|
} else {
|
|
html += "<td >" + '-' + "</td>";
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (content2.targetValue && content2.targetValue2) {
|
|
html += "<td >" + content2.targetValue + "|" + content2.targetValue2 + "</td>";
|
|
} else {
|
|
html += "<td >" + '-' + "</td>";
|
|
}
|
|
html += "</tr>";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
html += "</table>";
|
|
// console.log(html)
|
|
$('#btable').html(html);
|
|
} else {
|
|
$('#tree2').treeview({data: treeList, showTags: true});
|
|
}
|
|
}, 'json');
|
|
} else if (patrolPointorEquipment == "e") {
|
|
var type = $('#type').val();
|
|
$.post(ext.contextPath + '/timeEfficiency/patrolMeasurePointRecord/getMeasurePointByPatrolRecord.do', {
|
|
patrolRecordId: patrolRecordId,
|
|
equipmentId: patrolPointId,
|
|
unitId: unitId
|
|
}, function (data) {
|
|
var treeList = data.result;
|
|
console.info(treeList);
|
|
$('#tree2').treeview({data: treeList, showTags: true});
|
|
}, 'json');
|
|
}
|
|
};
|
|
|
|
$(function () {
|
|
initTreeView1();
|
|
initTreeView2();
|
|
});
|
|
</script>
|
|
|
|
<div class="modal fade" id="subModal_contents">
|
|
<div class="modal-dialog modal-xlg">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
|
|
<!-- <form class="form-horizontal" id="treeStr" enctype="multipart/form-data">
|
|
<input name="jsonStr" id="jsonStr" type="hidden" value="" />
|
|
</form> -->
|
|
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
<span aria-hidden="true">×</span></button>
|
|
<h4 class="modal-title">巡检情况</h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="col-sm-12">
|
|
<div class="col-sm-6">
|
|
巡检内容
|
|
</div>
|
|
<div class="col-sm-6">
|
|
填报内容
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-12">
|
|
<div class="col-sm-6">
|
|
<div id="tree1"></div>
|
|
</div>
|
|
<div class="col-sm-6">
|
|
<div id="btable" style="display: none;width: 100%;overflow: auto;">
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-6">
|
|
<div id="tree2"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-default " data-dismiss="modal">关闭</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div> |