208 lines
9.2 KiB
Plaintext
208 lines
9.2 KiB
Plaintext
|
|
<%@ page language="java" pageEncoding="UTF-8" %>
|
|||
|
|
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
|||
|
|
<style type="text/css">
|
|||
|
|
|
|||
|
|
</style>
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
|
|||
|
|
function dosaveMp() {
|
|||
|
|
$("#subFormMp").bootstrapValidator('validate');//提交验证
|
|||
|
|
if ($("#subFormMp").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
|||
|
|
$.post(ext.contextPath + "/report/rptMpSet/doupdate.do", $("#subFormMp").serialize(), function (data) {
|
|||
|
|
console.log(data);
|
|||
|
|
if (data.res == 1) {
|
|||
|
|
closeModal('subModalMp')
|
|||
|
|
$("#tableMp").bootstrapTable('refresh');
|
|||
|
|
} else if (data.res == 0) {
|
|||
|
|
showAlert('d', '保存失败');
|
|||
|
|
} else {
|
|||
|
|
showAlert('d', data.res);
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$("#subFormMp").bootstrapValidator({
|
|||
|
|
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
|||
|
|
fields: {
|
|||
|
|
dataType: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '请选择数据类型'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
collectMode: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '请选择采集方式'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$('#dataType').select2({minimumResultsForSearch: 10}).val('${rptMpSet.dataType}').trigger('change');
|
|||
|
|
//$('#collectMode').select2({minimumResultsForSearch: 10}).val('${rptMpSet.collectMode}').trigger('change');
|
|||
|
|
|
|||
|
|
//异步去查找上下行
|
|||
|
|
$(document).on('input', '#morder', function () {
|
|||
|
|
var morder = $("#morder").val();
|
|||
|
|
$.post(ext.contextPath + "/report/rptMpSet/selectMorder.do",
|
|||
|
|
{
|
|||
|
|
id: '${rptMpSet.id}',
|
|||
|
|
pid: '${rptMpSet.pid}',
|
|||
|
|
unitId: '${rptMpSet.unitId}',
|
|||
|
|
morder: morder
|
|||
|
|
},
|
|||
|
|
function (data) {
|
|||
|
|
$('#previous').html(data.previous);
|
|||
|
|
$('#next').html(data.next);
|
|||
|
|
}, 'json');
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
//排序预览
|
|||
|
|
/* function aaa(){
|
|||
|
|
$.post(ext.contextPath + '/report/rptMpSet/doMorderView.do', {id: id}, function (data) {
|
|||
|
|
$("#subDivMpoint").html(data);
|
|||
|
|
openModal('subModalMp');
|
|||
|
|
});
|
|||
|
|
}*/
|
|||
|
|
|
|||
|
|
$.post(ext.contextPath + "/report/rptCollectMode/getRptCollectMode4Select.do", {unitId: unitId}, function (data) {
|
|||
|
|
$("#collectMode").empty();
|
|||
|
|
var selelct_ = $("#collectMode").select2({
|
|||
|
|
data: data,
|
|||
|
|
placeholder: '请选择',//默认文字提示
|
|||
|
|
allowClear: false,//允许清空
|
|||
|
|
escapeMarkup: function (markup) {
|
|||
|
|
return markup;
|
|||
|
|
}, // 自定义格式化防止xss注入
|
|||
|
|
language: "zh-CN",
|
|||
|
|
minimumInputLength: 0,
|
|||
|
|
minimumResultsForSearch: 10,//数据超过10个启用搜索框
|
|||
|
|
formatResult: function formatRepo(repo) {
|
|||
|
|
return repo.text;
|
|||
|
|
}, // 函数用来渲染结果
|
|||
|
|
formatSelection: function formatRepoSelection(repo) {
|
|||
|
|
return repo.text;
|
|||
|
|
} // 函数用于呈现当前的选择
|
|||
|
|
});
|
|||
|
|
selelct_.val('${rptMpSet.collectMode}').trigger("change");
|
|||
|
|
selelct_.on('change', function () {
|
|||
|
|
//选择事件
|
|||
|
|
})
|
|||
|
|
}, 'json');
|
|||
|
|
|
|||
|
|
|
|||
|
|
</script>
|
|||
|
|
<div class="modal fade" id="subModalMp">
|
|||
|
|
<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强制为subFormMp -->
|
|||
|
|
<form class="form-horizontal" id="subFormMp" autocomplete="off">
|
|||
|
|
|
|||
|
|
<!-- 界面提醒div强制id为alertDiv -->
|
|||
|
|
<div id="alertDiv"></div>
|
|||
|
|
<input type="hidden" class="form-control" name="id" value="${rptMpSet.id}">
|
|||
|
|
<input type="hidden" class="form-control" name="pid" value="${rptMpSet.pid}">
|
|||
|
|
<%--<input type="hidden" class="form-control" name="morder" value="${rptMpSet.morder}">--%>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">变量名</label>
|
|||
|
|
<div class="col-sm-10">
|
|||
|
|
<c:if test="${rptMpSet.mPoint!=null && rptMpSet.mPoint!=''}">
|
|||
|
|
<p class="form-control-static">${rptMpSet.mPoint.mpointcode}</p>
|
|||
|
|
</c:if>
|
|||
|
|
<c:if test="${rptMpSet.mPoint==null || rptMpSet.mPoint==''}">
|
|||
|
|
<p class="form-control-static">${rptMpSet.mpid}</p>
|
|||
|
|
</c:if>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">变量描述</label>
|
|||
|
|
<div class="col-sm-10">
|
|||
|
|
<p class="form-control-static">${rptMpSet.mPoint.parmname}</p>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">单位</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<p class="form-control-static">${rptMpSet.mPoint.unit}</p>
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">数据来源</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<p class="form-control-static">${rptMpSet.mPoint.sourceType}</p>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">*数据类型</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<select class="form-control select2" id="dataType" name="dataType" style="width: 170px;">
|
|||
|
|
<option value="" selected="selected">请选择</option>
|
|||
|
|
<option value="日数据">日数据</option>
|
|||
|
|
<option value="月数据">月数据</option>
|
|||
|
|
<option value="年数据">年数据</option>
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">*采集方式</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<%--<select class="form-control select2" id="collectMode" name="collectMode"
|
|||
|
|
style="width: 170px;">
|
|||
|
|
<option value="" selected="selected">请选择</option>
|
|||
|
|
<option value="first">first</option>
|
|||
|
|
<option value="avg">avg</option>
|
|||
|
|
<option value="sum">sum</option>
|
|||
|
|
<option value="max">max</option>
|
|||
|
|
<option value="diff">diff</option>
|
|||
|
|
<option value="runreourdhour">runreourdhour</option>
|
|||
|
|
<option value="firstpre30minute">firstpre30minute</option>
|
|||
|
|
</select>--%>
|
|||
|
|
|
|||
|
|
<select class="form-control select2" id="collectMode" name="collectMode"
|
|||
|
|
style="width: 170px;" value="">
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">顺序</label>
|
|||
|
|
<div class="col-sm-6">
|
|||
|
|
<input type="number" class="form-control" style="width: 170px;" id="morder" name="morder"
|
|||
|
|
value="${rptMpSet.morder}">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">前一行</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<p class="form-control-static" id="previous"></p>
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">后一行</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<p class="form-control-static" id="next"></p>
|
|||
|
|
</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="dosaveMp()">保存</button>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
<!-- /.modal-content -->
|
|||
|
|
</div>
|
|||
|
|
<!-- /.modal-dialog -->
|
|||
|
|
</div>
|