114 lines
4.3 KiB
Plaintext
114 lines
4.3 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_interfaceAdd").bootstrapValidator('validate');//提交验证
|
||
if ($("#subForm_interfaceAdd").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||
$.post(ext.contextPath + "/work/interfaceModbus/dosave.do", $("#subForm_interfaceAdd").serialize(), function (result) {
|
||
if (result.code == 1) {
|
||
initTreeView();
|
||
// showAlert('s','保存成功');
|
||
} else {
|
||
showAlert('d', result.msg);
|
||
}
|
||
});
|
||
}
|
||
}
|
||
|
||
$("#subForm_interfaceAdd").bootstrapValidator({
|
||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||
fields: {
|
||
name: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '名称不能为空'
|
||
}
|
||
}
|
||
},
|
||
ip: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: 'ip不能为空'
|
||
}
|
||
}
|
||
},
|
||
port: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: 'ip不能为空'
|
||
}
|
||
}
|
||
}
|
||
}
|
||
});
|
||
|
||
$(function () {
|
||
});
|
||
|
||
</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>
|
||
</div>
|
||
</div>
|
||
<!-- /.box-header -->
|
||
<div class="box-body ">
|
||
<form class="form-horizontal " id="subForm_interfaceAdd">
|
||
<!-- 界面提醒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">
|
||
<input type="text" class="form-control" id="name" name="name" placeholder="名称">
|
||
</div>
|
||
<label class="col-sm-2 control-label">状态</label>
|
||
<div class="col-sm-4">
|
||
<select id="status" name="status" class="form-control select2">
|
||
<option value="0">禁用</option>
|
||
<option value="1">启用</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">ip</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="ip" name="ip" placeholder="ip地址">
|
||
</div>
|
||
<label class="col-sm-2 control-label">端口号</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="port" name="port" placeholder="请输入端口号">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">偏移量</label>
|
||
<div class="col-sm-4">
|
||
<input type="number" class="form-control" id="offset" name="offset" placeholder="偏移量">
|
||
</div>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|