359 lines
16 KiB
Plaintext
359 lines
16 KiB
Plaintext
<%@page import="com.sipai.tools.CommString"%>
|
||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||
<% request.setAttribute("UNIT_TYPE_COMPANY", CommString.UNIT_TYPE_COMPANY); %>
|
||
<!DOCTYPE html>
|
||
<!-- <html lang="zh-CN"> -->
|
||
<!-- BEGIN HEAD -->
|
||
<head>
|
||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||
<!-- 引用页头及CSS页-->
|
||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||
|
||
<script type="text/javascript">
|
||
$(function() {
|
||
//initTreeView();
|
||
$('#removea').click(function () {
|
||
$('#search_pname').val("");
|
||
$('#search_pid').val("");
|
||
refreshSelect();
|
||
})
|
||
refreshSelect();
|
||
//document.getElementById("search_pname").addEventListener("change", function (event) {alert();});
|
||
});
|
||
function refreshSelect(domId){
|
||
var pid =$('#'+domId).val();
|
||
var selelct=$("#search_code").select2({
|
||
ajax: {
|
||
type:'POST',
|
||
url: ext.contextPath +"/user/getDataManageALLBizs.do",
|
||
dataType: 'json',
|
||
delay: 250,
|
||
data : function(params) {
|
||
return {
|
||
pid : pid,
|
||
search_name : params.term,
|
||
};
|
||
},
|
||
processResults: function (data) {
|
||
return {
|
||
results: data
|
||
}
|
||
},
|
||
cache: true
|
||
},
|
||
placeholder:'企业/水厂',//默认文字提示
|
||
allowClear: false,//允许清空
|
||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||
language: "zh-CN",
|
||
minimumInputLength: 0,
|
||
templateResult: function formatRepo(repo){
|
||
if(repo.syncFlag==false){
|
||
return repo.text+' <i class="fa fa-circle text-danger"></i> ';
|
||
}
|
||
return repo.text;
|
||
}, // 函数用来渲染结果
|
||
templateSelection: function formatRepoSelection(repo){
|
||
if(repo.syncFlag==false){
|
||
return repo.text+' <i class="fa fa-circle text-danger"></i> ';
|
||
}
|
||
return repo.text;
|
||
} // 函数用于呈现当前的选择
|
||
});
|
||
selelct.val('').trigger("change");
|
||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
||
selelct.on("change",function(e){
|
||
var companyId= $(this).val();
|
||
if(companyId==null || companyId==""){
|
||
return;
|
||
}
|
||
$('#search_name_equ').val('');
|
||
$('#search_name_mpoint').val('');
|
||
chosePSection();
|
||
|
||
$("#psection").empty();
|
||
$.post(ext.contextPath + "/work/mpoint/getProcessSectionList4Select.do", {companyId:companyId}, function(data) {
|
||
$.each(data, function(index, item){
|
||
console.info(item)
|
||
var str ='<li id ="'+item.id+'"><a onclick="chosePSection(\''+item.id+'\')"> '+item.text+'</a></li>';
|
||
$("#psection").append(str);
|
||
});
|
||
},'json');
|
||
});
|
||
|
||
}
|
||
var chosePSection = function(pSectionId) {
|
||
$("#psection").children("li").removeClass("active");
|
||
$('#'+pSectionId).addClass('active');
|
||
getEquipList(pSectionId);
|
||
getMpointList(pSectionId);
|
||
};
|
||
var getEquipList = function(pSectionId) {
|
||
$("#table_equ").bootstrapTable('destroy');
|
||
$("#table_equ").bootstrapTable({ // 对应table标签的id
|
||
url: ext.contextPath + '/equipment/getAllEquipmentCard.do', // 获取表格数据的url
|
||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||
striped: true, //表格显示条纹,默认为false
|
||
pagination: true, // 在表格底部显示分页组件,默认false
|
||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||
pageSize: 20, // 页面数据条数
|
||
pageNumber: 1, // 首页页码
|
||
sidePagination: 'server', // 设置为服务器端分页
|
||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||
return {
|
||
rows: params.limit, // 每页要显示的数据条数
|
||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||
sort: params.sort, // 要排序的字段
|
||
order: params.order,
|
||
|
||
companyId: $("#search_code").val(),
|
||
pSectionId: pSectionId,
|
||
search_name : $('#search_name_equ').val(),
|
||
}
|
||
},
|
||
sortName: 'id', // 要排序的字段
|
||
sortOrder: 'desc', // 排序规则
|
||
columns: [
|
||
{
|
||
field: 'equipmentName', // 返回json数据中的name
|
||
title: '名称', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle' // 上下居中
|
||
},{
|
||
field: 'equipmentCardID', // 返回json数据中的name
|
||
title: '厂内编号', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle' // 上下居中
|
||
},{
|
||
field: 'id', // 返回json数据中的name
|
||
title: '统一编号', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle' // 上下居中
|
||
},{
|
||
field: 'equipmentModel', // 返回json数据中的name
|
||
title: '设备型号', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle'
|
||
},{
|
||
field: 'factory', // 返回json数据中的name
|
||
title: '厂家名称', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle'
|
||
}
|
||
],
|
||
onLoadSuccess: function(){ //加载成功时执行
|
||
adjustBootstrapTableView("table_equ");
|
||
},
|
||
onLoadError: function(){ //加载失败时执行
|
||
console.info("加载数据失败");
|
||
}
|
||
|
||
})
|
||
|
||
};
|
||
var getMpointList = function(pSectionId) {
|
||
$("#table_mpoint").bootstrapTable('destroy');
|
||
$("#table_mpoint").bootstrapTable({ // 对应table标签的id
|
||
url: ext.contextPath + '/work/mpoint/getAllMPoints.do', // 获取表格数据的url
|
||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||
striped: true, //表格显示条纹,默认为false
|
||
pagination: true, // 在表格底部显示分页组件,默认false
|
||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||
pageSize: 20, // 页面数据条数
|
||
pageNumber: 1, // 首页页码
|
||
sidePagination: 'server', // 设置为服务器端分页
|
||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||
return {
|
||
rows: params.limit, // 每页要显示的数据条数
|
||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||
sort: params.sort, // 要排序的字段
|
||
order: params.order,
|
||
|
||
companyId: $("#search_code").val(),
|
||
pSectionId: pSectionId,
|
||
search_name : $('#search_name_mpoint').val(),
|
||
}
|
||
},
|
||
sortName: 'id', // 要排序的字段
|
||
sortOrder: 'desc', // 排序规则
|
||
columns: [
|
||
{
|
||
field: 'parmname', // 返回json数据中的name
|
||
title: '名称', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle' // 上下居中
|
||
},{
|
||
field: 'mpointcode', // 返回json数据中的name
|
||
title: '编号', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle' // 上下居中
|
||
},{
|
||
field: 'parmvalue', // 返回json数据中的name
|
||
title: '值', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle' // 上下居中
|
||
},{
|
||
field: 'measuredt', // 返回json数据中的name
|
||
title: '采集时间', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle',
|
||
formatter: function (value, row, index) {
|
||
return value.substring(0,19);
|
||
/* return '<i class="fa fa-edit" onclick="editFun()(\'' + row.id + '\')></i>'; */
|
||
}
|
||
}
|
||
],
|
||
onLoadSuccess: function(){ //加载成功时执行
|
||
adjustBootstrapTableView("table_mpoint");
|
||
},
|
||
onLoadError: function(){ //加载失败时执行
|
||
console.info("加载数据失败");
|
||
}
|
||
})
|
||
};
|
||
var showUnit4SelectFun_ = function() {
|
||
$.post(ext.contextPath + '/user/showUnit4Select.do', {formId:"searchForm",hiddenId:"search_pid",textId:"search_pname",type:'${UNIT_TYPE_COMPANY}'} , function(data) {
|
||
$("#unit4SelectDiv").html(data);
|
||
openModal("unit4SelectModal");
|
||
});
|
||
};
|
||
</script>
|
||
|
||
</head>
|
||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||
<div class="wrapper">
|
||
<!-- 引用top -->
|
||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||
<!-- 菜单栏 -->
|
||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||
<div class="content-wrapper">
|
||
<!-- Content Header (Page header) -->
|
||
<section class="content-header">
|
||
<h1 id ="head_title"></h1>
|
||
<ol class="breadcrumb">
|
||
<li><a id ='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||
<!-- <li class="active">Here</li> -->
|
||
</ol>
|
||
</section>
|
||
<!-- Main content -->
|
||
<section class="content container-fluid">
|
||
<div id="mainAlertdiv"></div>
|
||
<div id="subDiv"></div>
|
||
<div id="menu4SelectDiv"></div>
|
||
<div id="unit4SelectDiv"></div>
|
||
<div >
|
||
<form class="form-group " style="padding:0;" id="searchForm">
|
||
<!-- <label class="col-sm-2 control-label">公司/部门</label> -->
|
||
<div class="form-group form-inline " >
|
||
<div class="form-group has-feedback ">
|
||
<input type="text" class="form-control " id="search_pname" name ="search_pname" placeholder="集团/公司" onclick="showUnit4SelectFun_();" style="height:30px">
|
||
<a class="glyphicon glyphicon-remove form-control-feedback btn-sm" id="removea" style="padding-top:6px;pointer-events: auto"></a>
|
||
</input>
|
||
<input id="search_pid" class="form-control" name="search_pid" type="hidden" onchange="refreshSelect(this.id)"/>
|
||
</div>
|
||
|
||
|
||
<div class="input-group input-group-sm" >
|
||
<select class="form-control select2 " id="search_code" name ="search_code" style="width: 100%;min-width:500px;"></select>
|
||
</div>
|
||
</div>
|
||
|
||
</form>
|
||
|
||
<div class="row">
|
||
<div class="col-md-3">
|
||
|
||
<div class="box box-solid">
|
||
<div class="box-header with-border">
|
||
<h3 class="box-title">工艺段</h3>
|
||
|
||
<div class="box-tools">
|
||
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
|
||
</button>
|
||
</div>
|
||
</div>
|
||
<div class="box-body no-padding">
|
||
<ul id ="psection" class="nav nav-pills nav-stacked">
|
||
</ul>
|
||
</div>
|
||
<!-- /.box-body -->
|
||
</div>
|
||
<!-- /. box -->
|
||
</div>
|
||
<!-- /.col -->
|
||
<div class="col-md-9">
|
||
<div class="box box-primary">
|
||
<div class="box-header with-border">
|
||
<h3 class="box-title">设备</h3>
|
||
|
||
<div class="box-tools pull-right">
|
||
|
||
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
|
||
</div>
|
||
<!-- /.box-tools -->
|
||
</div>
|
||
<!-- /.box-header -->
|
||
<div class="box-body no-padding">
|
||
<div class="mailbox-controls">
|
||
<div class="pull-right">
|
||
<div class="input-group input-group-sm" style="width: 250px;padding-bottom:5px">
|
||
<input type="text" id="search_name_equ" name="search_name_equ" class="form-control pull-right" placeholder="设备名称">
|
||
<div class="input-group-btn">
|
||
<button type="button" class="btn btn-default" onclick="getEquipList();"><i class="fa fa-search"></i></button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-group" style="padding:10px">
|
||
<table id="table_equ"></table>
|
||
</div>
|
||
<!-- /.mail-box-messages -->
|
||
</div>
|
||
</div>
|
||
<!-- /. box -->
|
||
<div class="box box-primary">
|
||
<div class="box-header with-border">
|
||
<h3 class="box-title">测量点</h3>
|
||
|
||
<div class="box-tools pull-right">
|
||
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
|
||
</div>
|
||
<!-- /.box-tools -->
|
||
</div>
|
||
<!-- /.box-header -->
|
||
<div class="box-body no-padding">
|
||
<div class="mailbox-controls">
|
||
<div class="pull-right">
|
||
<div class="input-group input-group-sm" style="width: 250px;padding-bottom:5px">
|
||
<input type="text" id="search_name_mpoint" name="search_name_mpoint" class="form-control pull-right" placeholder="测量点名称">
|
||
<div class="input-group-btn">
|
||
<button type="button" class="btn btn-default" onclick="getMpointList();"><i class="fa fa-search"></i></button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-group" style="padding:10px">
|
||
<table id="table_mpoint"></table>
|
||
</div>
|
||
<!-- /.mail-box-messages -->
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- /.col -->
|
||
</div>
|
||
</div>
|
||
|
||
|
||
|
||
</section>
|
||
<!-- /.content -->
|
||
</div>
|
||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||
</div>
|
||
</body>
|
||
</html> |