128 lines
5.7 KiB
Plaintext
128 lines
5.7 KiB
Plaintext
<%@ page language="java" pageEncoding="UTF-8"%>
|
||
<%@page import="com.sipai.entity.scada.MPointPropTarget"%>
|
||
<% request.setAttribute("Type_time_hour_1", MPointPropTarget.Type_time_hour_1);%>
|
||
<% request.setAttribute("Type_time_hour_8", MPointPropTarget.Type_time_hour_8);%>
|
||
<% request.setAttribute("Type_time_day", MPointPropTarget.Type_time_day);%>
|
||
<% request.setAttribute("Type_time_month", MPointPropTarget.Type_time_month);%>
|
||
<% request.setAttribute("Type_time_year", MPointPropTarget.Type_time_year);%>
|
||
<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 doupdatePropTarget() {
|
||
$("#subTargetForm").bootstrapValidator('validate');//提交验证
|
||
if ($("#subTargetForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||
$.post(ext.contextPath + "/work/mPointProp/doupdatePropTarget.do?companyId="+'${companyId}',$("#subTargetForm").serialize(), function(data) {
|
||
if (data.res == 1){
|
||
closeModal('subTargetModal');
|
||
$("#table_target").bootstrapTable('refresh');
|
||
}else if(data.res == 0){
|
||
showAlert('d','保存失败','alertTargetDiv');
|
||
}else{
|
||
showAlert('d',data.res,'alertTargetDiv');
|
||
}
|
||
},'json');
|
||
}
|
||
}
|
||
//选择测量点
|
||
var selectMPint = function(pid) {
|
||
$.post(ext.contextPath + '/work/mpoint/showlistForSelect.do', {formId:'subTargetForm',hiddenId:'mpid',textId:'mpname',valueId :'value',mpid:$("#mpid").val()} , function(data) {
|
||
$("#mpSubDiv").html(data);
|
||
openModal('mpSubModal');
|
||
});
|
||
};
|
||
//初始化统计时间范围选择框
|
||
var refreshTimeSelect = function() {
|
||
var select = $("#time").select2({
|
||
data: null,
|
||
placeholder:'请选择',//默认文字提示
|
||
allowClear: false,//允许清空
|
||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||
language: "zh-CN",
|
||
minimumInputLength: 0,
|
||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||
});
|
||
select.val('${mPointPropTarget.time}').trigger("change");
|
||
|
||
};
|
||
$(function(){
|
||
refreshTimeSelect();
|
||
})
|
||
//输入框验证
|
||
$("#subTargetForm").bootstrapValidator({
|
||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||
fields: {
|
||
mpid: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '测量点编号不能为空'
|
||
},
|
||
},
|
||
},
|
||
mpname: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '测量点名称不能为空'
|
||
},
|
||
},
|
||
},
|
||
}
|
||
});
|
||
</script>
|
||
<div class="modal fade" id="subTargetModal">
|
||
<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="subTargetForm">
|
||
<!-- 界面提醒div强制id为alertDiv -->
|
||
<div id="alertTargetDiv"></div>
|
||
<input name="pid" type="hidden" value="${mPointPropTarget.pid}"/>
|
||
<input name="id" type="hidden" value="${mPointPropTarget.id}"/>
|
||
<div class="form-group">
|
||
<label class="col-sm-3 control-label">*测量点编号</label>
|
||
<div class="col-sm-6">
|
||
<input type="text" class="form-control" id="mpid" name ="mpid" onclick="selectMPint()" placeholder="单击选择" value="${mPointPropTarget.mpid}" readonly>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-3 control-label">*测量点名称</label>
|
||
<div class="col-sm-6">
|
||
<input type="text" class="form-control" id="mpname" name ="mpname" placeholder="测量点名称" value="${mPointPropTarget.mpname}" readonly>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-3 control-label">*统计时间范围</label>
|
||
<div class="col-sm-6">
|
||
<select class="form-control select2"name ="time" id ="time"style="width: 270px;">
|
||
<option value="${Type_time_hour_1 }">${Type_time_hour_1 }</option>
|
||
<option value="${Type_time_hour_8 }">${Type_time_hour_8 }</option>
|
||
<option value="${Type_time_day }">${Type_time_day }</option>
|
||
<option value="${Type_time_month }">${Type_time_month }</option>
|
||
<option value="${Type_time_year }">${Type_time_year }</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
</form>
|
||
</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="doupdatePropTarget()" id="btn_save">保存</button>
|
||
</div>
|
||
</div>
|
||
<!-- /.modal-content -->
|
||
</div>
|
||
<!-- /.modal-dialog -->
|
||
</div>
|