128 lines
5.3 KiB
Plaintext
128 lines
5.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"%>
|
||
<script type="text/javascript">
|
||
|
||
var selectEM = function(companyId) {
|
||
$.post(ext.contextPath + '/equipment/showEquipmentCardForSelect.do', {companyId:companyId,equipmentId:$("#equipid").val()} , function(data) {
|
||
$("#emSubDiv").html(data);
|
||
openModal('emSubModal');
|
||
});
|
||
};
|
||
|
||
|
||
|
||
function dosave() {
|
||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||
$.post(ext.contextPath + "/work/scadaPic/saveEM.do", $("#subForm").serialize(), function(data) {
|
||
if (data.res == 1) {
|
||
closeModal('subModal');
|
||
showEM()
|
||
//$("#table").bootstrapTable('refresh');
|
||
|
||
}else if(data.res == 0){
|
||
showAlert('d','保存失败');
|
||
}else{
|
||
showAlert('d',data.res);
|
||
}
|
||
},'json');
|
||
}
|
||
|
||
}
|
||
|
||
$("#subForm").bootstrapValidator({
|
||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||
fields: {
|
||
equipid: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '设备不能为空'
|
||
}
|
||
}
|
||
},
|
||
}
|
||
});
|
||
</script>
|
||
|
||
<div class="modal fade" id="subModal">
|
||
<div class="modal-dialog modal-md">
|
||
<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强制id为alertDiv -->
|
||
<div id="alertDiv"></div>
|
||
|
||
<div class="modal-body">
|
||
|
||
<!-- 新增界面formid强制为subForm -->
|
||
<form class="form-horizontal" id="subForm">
|
||
|
||
<input name="containerwidth" type="hidden" value="${param.containerwidth}"/>
|
||
<input name="containerheight" type="hidden" value="${param.containerheight}"/>
|
||
<input name="pid" type="hidden" value="${param.pid}"/>
|
||
<input name="companyId" id="companyId" type="hidden" value="${param.companyId}"/>
|
||
<div class="form-group">
|
||
<label class="col-sm-3 control-label">设备名称</label>
|
||
<div class="col-sm-7">
|
||
<input id="equipid" name="equipid" type="hidden" value="" />
|
||
<input type="text" class="form-control" id="equipname" name ="equipname" onclick="selectEM('${param.companyId}')" placeholder="单击选择" readonly>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-3 control-label">posx</label>
|
||
<div class="col-sm-7">
|
||
<input type="text" class="form-control" id="posx" name ="posx" value="0">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-3 control-label">posy</label>
|
||
<div class="col-sm-7">
|
||
<input type="text" class="form-control" id="posy" name ="posy" value="0" >
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-3 control-label">宽度</label>
|
||
<div class="col-sm-7">
|
||
<input type="text" class="form-control" id="width" name ="width" value="200" >
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-3 control-label">高度</label>
|
||
<div class="col-sm-7">
|
||
<input type="text" class="form-control" id="height" name ="height" value="100" >
|
||
</div>
|
||
</div>
|
||
<!-- <div class="box box-primary" id="box">
|
||
<div class="box-header">
|
||
<h3 class="box-title">表达式
|
||
</h3>
|
||
tools box
|
||
<div class="pull-right box-tools">
|
||
<button type="button" class="btn btn-primary btn-sm" onclick="addFun();" title="添加">
|
||
<i class="fa fa-plus"></i></button>
|
||
<button type="button" class="btn btn-primary btn-sm" onclick="deletesFun();" title="删除">
|
||
<i class="fa fa-minus"></i></button>
|
||
</div>
|
||
/. tools
|
||
</div>
|
||
/.box-header
|
||
<div class="box-body pad" style="">
|
||
<table id="table_express" class="table" style="overflow:auto;width:100%" ></table>
|
||
</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="dosave()" id="btn_save">保存</button>
|
||
</div>
|
||
</div>
|
||
<!-- /.modal-content -->
|
||
</div>
|
||
<!-- /.modal-dialog -->
|
||
</div>
|