Files
SIPAIIS_WMS_JSSW/WebRoot/jsp/visual/monitorEdit.jsp

171 lines
6.0 KiB
Plaintext
Raw Normal View History

2026-01-16 14:13:44 +08:00
<%@ page language="java" pageEncoding="UTF-8"%>
<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">
var unitId = '${param.unitId}';
function doupdate() {
$("#jspElementForm").bootstrapValidator('validate');//提交验证
setTimeout(function(){
if ($("#jspElementForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
$.post(ext.contextPath + "/smart/monitorUpdate.do", $("#jspElementForm").serialize(), function(data) {
if (data.res == 1){
showAlert('s','修改成功');
initMonitorTreeView();
getMonitorData(unitId,"","");
}else if(data.res == 0){
showAlert('d','修改失败');
}else{
showAlert('d',data.res);
}
},'json');
}
}, 100);
}
var dodel = 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 + '/smart/monitorDeletes.do', { ids: id,unitId:'${param.unitId}' }, function (data) {
var result = data;
if(result === 1){
$("#menuBox").html('');
initTreeView();
}else{
showAlert('d', '删除失败', 'mainAlertdiv');
}
},'json');
}
});
};
//输入框验证
$("#jspElementForm").bootstrapValidator({
live: 'disabled',//验证时机enabled是内容有变化就验证默认disabled和submitted是提交再验证
fields: {
dataName: {
validators: {
notEmpty: {
message: '名称不能为空'
}
}
},
}
});
function selectmpids() {
var mpids = $('#jspElementForm #mpcode').val();
$.post(ext.contextPath + '/work/mpoint/mpointList4LayerES.do', {
mpids: mpids,
// mpids: '',
fucname: 'ckmpidDone'
}, function (data) {
$("#mpSelectDiv").html(data);
openModal('subModalMpoint');
});
}
function ckmpidDone(data) {
var arr = "";
if(data.length>0){
var arrs = data.split(',');
arr = arrs[0]
}
$('#jspElementForm #mpcode').val(arr);
//$('#jspElementForm #value').val(0);
closeModal('subModalMpoint');
}
$(function(){
var pid ='${jspElement.pid}';
if(pid!=null && pid!=undefined && pid!=''){
$("#pid").select2({minimumResultsForSearch: 10}).val(pid).trigger("change");
}else{
$("#pid").select2({minimumResultsForSearch: 10}).val('monitor_pressure').trigger("change");
}
})
</script>
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">详情</h3>
<div class="box-tools pull-right">
<a onclick="doupdate()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i
class="glyphicon glyphicon-floppy-disk"></i></a>
<a onclick="dodel('${jspElement.id}')" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i
class="glyphicon glyphicon-trash"></i></a>
</div>
</div>
<!-- /.box-header -->
<div class="box-body ">
<form class="form-horizontal" id="jspElementForm">
<!-- 界面提醒div强制id为alertDiv -->
<div id="alertDiv"></div>
<input type="hidden" id="id" name="id" value= "${jspElement.id}">
<input type="hidden" id="getValueType" name="getValueType" value= "getCacheData">
<input type="hidden" id="elementCode" name="elementCode" value= "${jspElement.id}">
<input type="hidden" id="unitId" name="unitId" value= "${param.unitId}">
<div class="form-group">
<label class="col-sm-2 control-label">*显示名称</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="name" name ="name" placeholder="名称" value="${jspElement.name}" >
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">类型</label>
<div class="col-sm-6">
<select class="form-control select2" id="pid" name ="pid" style="width: 270px;">
<option value= "monitor_pressure">压力</option>
<option value= "monitor_flow">流量</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">监测点位</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="mpcode" name ="mpcode" placeholder="监测点位" value="${visualCacheData.mpcode}" onclick="selectmpids();" >
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">固定值</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="value" name ="value" placeholder="固定值" value="${visualCacheData.value}" >
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">顺序</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="morder" name ="morder" placeholder="顺序" value="${jspElement.morder}" >
</div>
</div>
</form>
</div>
</div>