first commit
This commit is contained in:
92
WebRoot/jsp/work/scadapic/scadaPic_TxtAdd.jsp
Normal file
92
WebRoot/jsp/work/scadapic/scadaPic_TxtAdd.jsp
Normal file
@ -0,0 +1,92 @@
|
||||
<%@ 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">
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/work/scadaPic/saveTxt.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('subModal');
|
||||
showTxt();
|
||||
//$("#table").bootstrapTable('refresh');
|
||||
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败','alertDiv');
|
||||
}else{
|
||||
showAlert('d',data.res,'alertDiv');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
content: {
|
||||
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 type="text" class="form-control" id="content1" name ="content" value="">
|
||||
</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="fsize" name ="fsize" value="12px">
|
||||
</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>
|
||||
</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>
|
||||
Reference in New Issue
Block a user