157 lines
6.0 KiB
Plaintext
157 lines
6.0 KiB
Plaintext
<%@ page language="java" pageEncoding="UTF-8" %>
|
||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||
<%@ page import="com.sipai.entity.base.ServerObject" %>
|
||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
||
<%@page import="com.sipai.entity.data.DataCurve" %>
|
||
<% request.setAttribute("Type_group", DataCurve.Type_group);%>
|
||
<% request.setAttribute("Type_sys", DataCurve.Type_sys);%>
|
||
<% request.setAttribute("Type_user", DataCurve.Type_user);%>
|
||
<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 dosave() {
|
||
$("#subForm_Edit").bootstrapValidator('validate');//提交验证
|
||
if ($("#subForm_Edit").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||
$.post(ext.contextPath + "/process/dataPatrol/doUpdate.do", $("#subForm_Edit").serialize(), function (result) {
|
||
var data= $.parseJSON(result);
|
||
if (data.code == 1) {
|
||
initTreeView();
|
||
// showAlert('s','保存成功');
|
||
} else {
|
||
showAlert('d', data.msg);
|
||
}
|
||
});
|
||
}
|
||
}
|
||
|
||
function dodel() {
|
||
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 + '/process/dataPatrol/doDel.do', $("#subForm_Edit").serialize(), function (result) {
|
||
if (result.code == 1) {
|
||
console.log(222)
|
||
initTreeView();
|
||
} else {
|
||
showAlert('d', result.msg);
|
||
}
|
||
}, 'json');
|
||
|
||
}
|
||
});
|
||
}
|
||
|
||
$("#subForm_Edit").bootstrapValidator({
|
||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||
fields: {
|
||
name: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '名称不能为空'
|
||
}
|
||
}
|
||
}
|
||
}
|
||
});
|
||
|
||
$(function () {
|
||
if ($('#type').val() == 0) {
|
||
$('#mpid').hide()
|
||
$('#mpidtag').hide()
|
||
} else {
|
||
$('#mpid').show()
|
||
$('#mpidtag').show()
|
||
}
|
||
});
|
||
$('#type').change(function () {
|
||
if ($('#type').val() == 0) {
|
||
$('#mpid').hide()
|
||
$('#mpidtag').hide()
|
||
} else {
|
||
$('#mpid').show()
|
||
$('#mpidtag').show()
|
||
}
|
||
})
|
||
|
||
var selectMPint = function(pid) {
|
||
$.post(ext.contextPath + '/work/mpoint/showlistForSelect.do', {formId:'subForm_Add',hiddenId:'mpid',codeId:'mpcode',textId:'name', valueId :'value',mpid:$("#mpid").val()} , function(data) {
|
||
$("#mpSubDiv").html(data);
|
||
openModal('mpSubModal');
|
||
});
|
||
};
|
||
|
||
</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="dosave()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i
|
||
class="glyphicon glyphicon-floppy-disk"></i></a>
|
||
<a onclick="dodel()" 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="subForm_Edit">
|
||
<input id="id" name="id" type="hidden" value="${dataPatrol.id}"/>
|
||
<!-- 界面提醒div强制id为alertDiv -->
|
||
<div id="alertDiv"></div>
|
||
<div id="menu4SelectDiv"></div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">节点类型</label>
|
||
<div class="col-sm-4">
|
||
<select id="type" name="type" class="form-control select2">
|
||
<option value="0" <c:if test="${dataPatrol.type==0}">selected</c:if>>节点</option>
|
||
<option value="1" <c:if test="${dataPatrol.type==1}">selected</c:if>>测量点节点</option>
|
||
</select>
|
||
</div>
|
||
<label class="col-sm-2 control-label">顺序</label>
|
||
<div class="col-sm-4">
|
||
<input type="number" class="form-control" id="morder" name="morder" placeholder="顺序" value="${dataPatrol.morder}">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">名称</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="name" name="name" placeholder="名称" value="${dataPatrol.name}">
|
||
</div>
|
||
<label class="col-sm-2 control-label" id="mpidtag">测量点</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="mpid" name="mpid" onclick="selectMPint()" placeholder="测量点" readonly value="${dataPatrol.mpid}">
|
||
</div>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|