322 lines
14 KiB
Plaintext
322 lines
14 KiB
Plaintext
|
|
<%@ page language="java" pageEncoding="UTF-8" %>
|
|||
|
|
<%@page import="com.sipai.entity.data.DataCleaningConfigure" %>
|
|||
|
|
<%request.setAttribute("ReplaceType_previous", DataCleaningConfigure.ReplaceType_previous); %>
|
|||
|
|
<%request.setAttribute("ReplaceType_avg", DataCleaningConfigure.ReplaceType_avg); %>
|
|||
|
|
<%request.setAttribute("ReplaceType_none", DataCleaningConfigure.ReplaceType_none); %>
|
|||
|
|
<%request.setAttribute("ReplaceType_max", DataCleaningConfigure.ReplaceType_previous); %>
|
|||
|
|
<%request.setAttribute("ReplaceType_min", DataCleaningConfigure.ReplaceType_avg); %>
|
|||
|
|
<%request.setAttribute("ReplaceType_same", DataCleaningConfigure.ReplaceType_none); %>
|
|||
|
|
<style type="text/css">
|
|||
|
|
.select2-container .select2-selection--single {
|
|||
|
|
height: 34px;
|
|||
|
|
line-height: 34px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.select2-selection__arrow {
|
|||
|
|
margin-top: 3px;
|
|||
|
|
}
|
|||
|
|
</style>
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
$(function () {
|
|||
|
|
$("#replacetype").select2({minimumResultsForSearch: 10}).val("${dataCleaningPoint.replacetype}").trigger("change");
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
function doupdate() {
|
|||
|
|
$("#subForm").bootstrapValidator('validate');//提交验证
|
|||
|
|
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
|||
|
|
$.post(ext.contextPath + "/data/dataCleaningPoint/doupdate.do", $("#subForm").serialize(), function (data) {
|
|||
|
|
if (data.code == 1) {
|
|||
|
|
showAlert('s', '保存成功');
|
|||
|
|
closeModal('subModal')
|
|||
|
|
$("#table").bootstrapTable('refresh');
|
|||
|
|
|
|||
|
|
} else if (data.code == 0) {
|
|||
|
|
showAlert('d', '保存失败');
|
|||
|
|
} else {
|
|||
|
|
showAlert('d', data.msg);
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$("#subForm").bootstrapValidator({
|
|||
|
|
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
|||
|
|
fields: {
|
|||
|
|
name: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '名称不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
typeid: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '服务器类型不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
status: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '启用不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
$(function () {
|
|||
|
|
$("#conditionTable").bootstrapTable({ // 对应table标签的id
|
|||
|
|
url: ext.contextPath + '/data/dataCleaningCondition/getList.do', // 获取表格数据的url
|
|||
|
|
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
|||
|
|
striped: true, //表格显示条纹,默认为false
|
|||
|
|
pagination: true, // 在表格底部显示分页组件,默认false
|
|||
|
|
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
|||
|
|
pageSize: 50, // 页面数据条数
|
|||
|
|
pageNumber: 1, // 首页页码
|
|||
|
|
sidePagination: 'server', // 设置为服务器端分页
|
|||
|
|
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
|||
|
|
return {
|
|||
|
|
rows: params.limit, // 每页要显示的数据条数
|
|||
|
|
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
|||
|
|
sort: params.sort, // 要排序的字段
|
|||
|
|
order: params.order,
|
|||
|
|
search_name: $('#search_name').val(),
|
|||
|
|
pid: '${dataCleaningPoint.id}',
|
|||
|
|
// pSectionId: $("#processSection").val(),
|
|||
|
|
// statusSelect:$("#statusSelect").val(),
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
// onClickRow: function (row) {//单击行事件,执行查看功能
|
|||
|
|
// viewFun(row.id);
|
|||
|
|
// },
|
|||
|
|
sortName: 'morder', // 要排序的字段
|
|||
|
|
sortOrder: 'asc', // 排序规则
|
|||
|
|
columns: [
|
|||
|
|
{
|
|||
|
|
checkbox: true, // 显示一个勾选框
|
|||
|
|
}, {
|
|||
|
|
field: 'jstype', // 返回json数据中的name
|
|||
|
|
title: '比较类型', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle'
|
|||
|
|
}, {
|
|||
|
|
field: 'jsvalue', // 返回json数据中的name
|
|||
|
|
title: '比较数值', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle'
|
|||
|
|
}, {
|
|||
|
|
title: "操作",
|
|||
|
|
align: 'center',
|
|||
|
|
valign: 'middle',
|
|||
|
|
width: 120, // 定义列的宽度,单位为像素px
|
|||
|
|
formatter: function (value, row, index) {
|
|||
|
|
var buts = "";
|
|||
|
|
|
|||
|
|
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editConditionFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
|||
|
|
buts += '<button class="btn btn-default btn-sm" title="删除" onclick="deleteConditionFun(\'' + row.id + '\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button';
|
|||
|
|
|
|||
|
|
buts = '<div class="btn-group" >' + buts + '</div>';
|
|||
|
|
return buts;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
],
|
|||
|
|
onLoadSuccess: function () { //加载成功时执行
|
|||
|
|
adjustBootstrapTableView("table");
|
|||
|
|
|
|||
|
|
},
|
|||
|
|
onLoadError: function () { //加载失败时执行
|
|||
|
|
console.info("加载数据失败");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
});
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
function selectmpid() {
|
|||
|
|
$.post(ext.contextPath + '/work/mpoint/mpointListSingle4LayerES.do', {
|
|||
|
|
// mpids: mpids,
|
|||
|
|
mpids: '',
|
|||
|
|
fucname: 'ckmpidDone'
|
|||
|
|
}, function (data) {
|
|||
|
|
$("#mpSelectDiv").html(data);
|
|||
|
|
openModal('subModalMpoint');
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function ckmpidDone(data) {
|
|||
|
|
data = JSON.parse(data);
|
|||
|
|
$('#subForm #point').val(data[0].mpid);
|
|||
|
|
closeModal('subModalMpoint');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var addConditionFun = function () {
|
|||
|
|
$.post(ext.contextPath + '/data/dataCleaningCondition/doadd.do', {pid: '${dataCleaningPoint.id}'}, function (data) {
|
|||
|
|
$("#subDetailDiv").html(data);
|
|||
|
|
openModal('subConditionModal');
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
var editConditionFun = function (id) {
|
|||
|
|
stopBubbleDefaultEvent();
|
|||
|
|
$.post(ext.contextPath + '/data/dataCleaningCondition/doedit.do', {id: id}, function (data) {
|
|||
|
|
$("#subDetailDiv").html(data);
|
|||
|
|
openModal('subConditionModal');
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
var deleteConditionFun = function (id) {
|
|||
|
|
swal({
|
|||
|
|
text: "您确定要删除此记录?",
|
|||
|
|
dangerMode: true,
|
|||
|
|
buttons: {
|
|||
|
|
cancel: {
|
|||
|
|
text: "取消",
|
|||
|
|
value: null,
|
|||
|
|
visible: true,
|
|||
|
|
className: "btn btn-default btn-sm",
|
|||
|
|
closeModal: true,
|
|||
|
|
},
|
|||
|
|
confirm: {
|
|||
|
|
text: "确定",
|
|||
|
|
value: true,
|
|||
|
|
visible: true,
|
|||
|
|
className: "btn btn-danger btn-sm",
|
|||
|
|
closeModal: true
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
})
|
|||
|
|
.then(function (willDelete) {
|
|||
|
|
if (willDelete) {
|
|||
|
|
$.post(ext.contextPath + '/data/dataCleaningCondition/dodelete.do', {id: id}, function (data) {
|
|||
|
|
if (data.code == "1") {
|
|||
|
|
$("#conditionTable").bootstrapTable('refresh');
|
|||
|
|
} else {
|
|||
|
|
showAlert('d', '删除失败', 'mainAlertdiv');
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
var deletesConditionFun = function () {
|
|||
|
|
var checkedItems = $("#conditionTable").bootstrapTable('getSelections');
|
|||
|
|
var datas = "";
|
|||
|
|
$.each(checkedItems, function (index, item) {
|
|||
|
|
datas += item.id + ",";
|
|||
|
|
});
|
|||
|
|
if (datas == "") {
|
|||
|
|
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
|||
|
|
} else {
|
|||
|
|
swal({
|
|||
|
|
text: "您确定要删除此记录?",
|
|||
|
|
dangerMode: true,
|
|||
|
|
buttons: {
|
|||
|
|
cancel: {
|
|||
|
|
text: "取消",
|
|||
|
|
value: null,
|
|||
|
|
visible: true,
|
|||
|
|
className: "btn btn-default btn-sm",
|
|||
|
|
closeModal: true,
|
|||
|
|
},
|
|||
|
|
confirm: {
|
|||
|
|
text: "确定",
|
|||
|
|
value: true,
|
|||
|
|
visible: true,
|
|||
|
|
className: "btn btn-danger btn-sm",
|
|||
|
|
closeModal: true
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
})
|
|||
|
|
.then(function (willDelete) {
|
|||
|
|
if (willDelete) {
|
|||
|
|
$.post(ext.contextPath + '/data/dataCleaningCondition/dodeletes.do', {ids: datas}, function (data) {
|
|||
|
|
if (data.code > 0) {
|
|||
|
|
$("#conditionTable").bootstrapTable('refresh');
|
|||
|
|
} else {
|
|||
|
|
showAlert('d', '删除失败', 'mainAlertdiv');
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
};
|
|||
|
|
</script>
|
|||
|
|
<div class="modal fade" id="subModal">
|
|||
|
|
<div class="modal-dialog">
|
|||
|
|
<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">
|
|||
|
|
<!-- 新增界面formid强制为subForm -->
|
|||
|
|
<form class="form-horizontal" id="subForm">
|
|||
|
|
<!-- 界面提醒div强制id为alertDiv -->
|
|||
|
|
<div id="alertDiv"></div>
|
|||
|
|
<input type="hidden" class="form-control" id="id" name="id" value="${dataCleaningPoint.id}">
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">*测量点</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input class="form-control" type="text" id="point" name="point"
|
|||
|
|
value="${dataCleaningPoint.point}" onclick="selectmpid();">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">*时间范围(天)</label>
|
|||
|
|
<div class="col-sm-3">
|
|||
|
|
<input type="text" class="form-control" id="timerange" name="timerange" placeholder="时间范围"
|
|||
|
|
value="${dataCleaningPoint.timerange}"
|
|||
|
|
readonly>
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">*替换类型</label>
|
|||
|
|
<div class="col-sm-3">
|
|||
|
|
<select class="form-control select2" id="replacetype"
|
|||
|
|
name="replacetype">
|
|||
|
|
<option value="${ReplaceType_previous}" selected="selected">第一条</option>
|
|||
|
|
<option value="${ReplaceType_avg}">均值</option>
|
|||
|
|
<option value="${ReplaceType_none}">删除</option>
|
|||
|
|
<option value="${ReplaceType_max}">最大值</option>
|
|||
|
|
<option value="${ReplaceType_min}">最小值</option>
|
|||
|
|
<option value="${ReplaceType_same}">去除相同数据</option>
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</form>
|
|||
|
|
</div>
|
|||
|
|
<div class="box box-solid">
|
|||
|
|
<div class="box-header with-border">
|
|||
|
|
<h3 class="box-title">条件表</h3>
|
|||
|
|
|
|||
|
|
<div class="box-tools pull-right">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="box-body ">
|
|||
|
|
<div>
|
|||
|
|
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
|||
|
|
<button type="button" class="btn btn-default btn-sm" onclick="addConditionFun();"><i
|
|||
|
|
class="fa fa-plus"></i> 新增
|
|||
|
|
</button>
|
|||
|
|
<button type="button" class="btn btn-default btn-sm" onclick="deletesConditionFun();"><i
|
|||
|
|
class="fa fa-trash-o"></i> 删除
|
|||
|
|
</button>
|
|||
|
|
</div>
|
|||
|
|
<br>
|
|||
|
|
<table id="conditionTable"></table>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="modal-footer">
|
|||
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
|||
|
|
<button type="button" class="btn btn-primary" onclick="doupdate()" id="btn_save">保存</button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<!-- /.modal-content -->
|
|||
|
|
</div>
|
|||
|
|
<!-- /.modal-dialog -->
|
|||
|
|
</div>
|