216 lines
8.3 KiB
Plaintext
216 lines
8.3 KiB
Plaintext
|
|
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||
|
|
<!DOCTYPE html>
|
||
|
|
<script type="text/javascript">
|
||
|
|
var doSearchPatrolPoint = function() {
|
||
|
|
$("#table_patrolPoint4Select").bootstrapTable('refresh');
|
||
|
|
};
|
||
|
|
|
||
|
|
function doSelect(dialog,grid) {
|
||
|
|
//var checkedItems = $("#table_user").bootstrapTable('getAllSelections');
|
||
|
|
var datas="";
|
||
|
|
datas_name="";
|
||
|
|
$.each(selectionIds, function(index, item){
|
||
|
|
if(datas!=""){
|
||
|
|
datas+=",";
|
||
|
|
}
|
||
|
|
datas+=item;
|
||
|
|
});
|
||
|
|
$.post(ext.contextPath + '/process/dataVisualMPoint/dosave.do',{frameId:'${param.frameId}',datas:datas,unitId:unitId},function(data) {
|
||
|
|
closeModal("MPointModel");
|
||
|
|
showContent('${param.frameId}');
|
||
|
|
});
|
||
|
|
};
|
||
|
|
|
||
|
|
var $table;
|
||
|
|
var switchStatus=false;
|
||
|
|
var selectionIds = [];
|
||
|
|
|
||
|
|
function queryParams(params) {
|
||
|
|
var temp={
|
||
|
|
rows: params.limit,
|
||
|
|
page: params.offset/params.limit+1,
|
||
|
|
sort: params.sort,
|
||
|
|
order: params.order,
|
||
|
|
search_name: $('#search_mpointcode').val(),
|
||
|
|
signalType:$('#signalType').val(),
|
||
|
|
unitId: '${param.unitId}'
|
||
|
|
}
|
||
|
|
return temp;
|
||
|
|
}
|
||
|
|
|
||
|
|
$(function() {
|
||
|
|
console.log('${param.unitId}')
|
||
|
|
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
|
||
|
|
|
||
|
|
// initialSelectionIds();
|
||
|
|
|
||
|
|
$table=$("#table_patrolPoint4Select").bootstrapTable({
|
||
|
|
url: ext.contextPath + '/work/mpoint/getlistES.do',
|
||
|
|
clickToSelect:true,
|
||
|
|
striped: true,
|
||
|
|
pagination: true,
|
||
|
|
pageList: [10, 20],
|
||
|
|
pageSize: 20,
|
||
|
|
pageNumber: 1,
|
||
|
|
sidePagination: 'server',
|
||
|
|
clickToSelect:true,
|
||
|
|
responseHandler:responseHandler,
|
||
|
|
queryParams: queryParams,
|
||
|
|
queryParamsType: "limit",
|
||
|
|
sortName: 'id',
|
||
|
|
sortOrder: 'asc',
|
||
|
|
columns: [
|
||
|
|
{
|
||
|
|
checkbox: true,
|
||
|
|
formatter: function (i,row) {
|
||
|
|
if($.inArray(row.id,Array.from(selectionIds))!=-1){
|
||
|
|
return {
|
||
|
|
checked : true
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
},{
|
||
|
|
field: 'parmname',
|
||
|
|
title: "名称",
|
||
|
|
align: 'center',
|
||
|
|
valign: 'middle'
|
||
|
|
},{
|
||
|
|
field: 'mpointcode',
|
||
|
|
title: "测量点Code",
|
||
|
|
align: 'center',
|
||
|
|
valign: 'middle'
|
||
|
|
},{
|
||
|
|
field: 'parmvalue',
|
||
|
|
title: "当前值",
|
||
|
|
align: 'center',
|
||
|
|
valign: 'middle'
|
||
|
|
},{
|
||
|
|
field: 'unit',
|
||
|
|
title: "单位",
|
||
|
|
align: 'center',
|
||
|
|
valign: 'middle',
|
||
|
|
},{
|
||
|
|
field: 'measuredt',
|
||
|
|
title: "时间",
|
||
|
|
align: 'center',
|
||
|
|
valign: 'middle',
|
||
|
|
},{
|
||
|
|
field: 'numtail',
|
||
|
|
title: "精度",
|
||
|
|
align: 'center',
|
||
|
|
valign: 'middle',
|
||
|
|
},{
|
||
|
|
field: 'signalType',
|
||
|
|
title: "信号类型",
|
||
|
|
align: 'center',
|
||
|
|
valign: 'middle',
|
||
|
|
},{
|
||
|
|
field: 'signalType',
|
||
|
|
title: "信号类型",
|
||
|
|
align: 'center',
|
||
|
|
valign: 'middle',
|
||
|
|
}
|
||
|
|
],
|
||
|
|
onLoadSuccess: function(){
|
||
|
|
adjustBootstrapTableView("table_patrolPoint4Select");
|
||
|
|
},
|
||
|
|
onLoadError: function(){
|
||
|
|
console.info("加载数据失败");
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
$table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e,rows, obj) {
|
||
|
|
var ids = $.map(!$.isArray(rows) ? [rows] : rows, function (row) {
|
||
|
|
return row.id;
|
||
|
|
});
|
||
|
|
func = $.inArray(e.type, ['check', 'check-all']) > -1 ? 'union' : 'difference';
|
||
|
|
selectionIds = _[func](selectionIds, ids);
|
||
|
|
if('check'==e.type){
|
||
|
|
obj.parent().addClass("checked");
|
||
|
|
}else{
|
||
|
|
obj.parent().removeClass("checked");
|
||
|
|
}
|
||
|
|
});
|
||
|
|
});
|
||
|
|
//选中事件操作数组
|
||
|
|
var union = function(array,ids){
|
||
|
|
$.each(ids, function (i, id) {
|
||
|
|
if($.inArray(id,array)==-1){
|
||
|
|
array[array.length] = id;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
return array;
|
||
|
|
};
|
||
|
|
//取消选中事件操作数组
|
||
|
|
var difference = function(array,ids){
|
||
|
|
$.each(ids, function (i, id) {
|
||
|
|
var index = $.inArray(id,array);
|
||
|
|
if(index!=-1){
|
||
|
|
array.splice(index, 1);
|
||
|
|
}
|
||
|
|
});
|
||
|
|
return array;
|
||
|
|
};
|
||
|
|
var _ = {"union":union,"difference":difference};
|
||
|
|
|
||
|
|
//表格分页之前处理多选框数据
|
||
|
|
function responseHandler(res) {
|
||
|
|
$.each(res.rows, function (i, row) {
|
||
|
|
row.checkStatus = $.inArray(row.id, selectionIds) != -1;
|
||
|
|
});
|
||
|
|
return res;
|
||
|
|
}
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<div class="modal fade" id="MPointModel">
|
||
|
|
<div class="modal-dialog" style="width: 1200px;">
|
||
|
|
<div class="modal-content">
|
||
|
|
<div class="modal-header">
|
||
|
|
<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 " style="width:100%">
|
||
|
|
<div id="alertDiv"></div>
|
||
|
|
|
||
|
|
<div class="form-group " style="margin-bottom:10px;">
|
||
|
|
<input id="search_code" name="search_code" type="hidden" />
|
||
|
|
<span id="company" style="height:31px;color:#000000;border-top-left-radius: 4px;border-bottom-left-radius: 4px;font-weight:bold"></span>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="form-group pull-right form-inline" >
|
||
|
|
|
||
|
|
<div class="form-group pull-left form-inline" style="float: left;width: 120px;margin-top: 5px;">
|
||
|
|
<label class="col-sm-4 control-label" style="line-height: 30px;padding: 0px;">信号</label>
|
||
|
|
<div class="col-sm-8 control-label" >
|
||
|
|
<select id ="signalType" name="signalType" class="form-control select2" style="padding: 0px;width: 60px;height: 30px;border-radius:4px;border:1px solid #aaa;" onchange="changeSignalType(this);">
|
||
|
|
<option value="-1" >全部</option>
|
||
|
|
<option value="AI" >AI</option>
|
||
|
|
<option value="DI" >DI</option>
|
||
|
|
</select>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="form-group pull-left form-inline" style="float: left;width: 250px;margin-top: 5px;">
|
||
|
|
<div class="input-group input-group-sm " style="width: 230px;">
|
||
|
|
<input type="text" id="search_mpointcode" name="search_mpointcode" class="form-control pull-right" placeholder="点位查询">
|
||
|
|
<div class="input-group-btn">
|
||
|
|
<button class="btn btn-default" onclick="doSearchPatrolPoint();"><i class="fa fa-search"></i></button>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<!-- <button type="button" class="btn btn-default" onclick="addFun();"><i class="fa fa-plus"></i> 重置</button> -->
|
||
|
|
</div>
|
||
|
|
<div class="table-scrollable">
|
||
|
|
<table class="table table-bordered table-striped" style="overflow:auto;width:100%" id="table_patrolPoint4Select"></table>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="modal-footer">
|
||
|
|
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||
|
|
<button type="button" class="btn btn-primary" onclick="doSelect()">确认</button>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<!-- /.modal-content -->
|
||
|
|
</div>
|
||
|
|
<!-- /.modal-dialog -->
|
||
|
|
</div>
|