183 lines
7.7 KiB
Plaintext
183 lines
7.7 KiB
Plaintext
<%@ page language="java" pageEncoding="UTF-8" %>
|
||
<%@page import="com.sipai.entity.timeefficiency.TimeEfficiencyCommStr" %>
|
||
<%request.setAttribute("PatrolType_Product", TimeEfficiencyCommStr.PatrolType_Product);%>
|
||
<%request.setAttribute("PatrolType_Equipment", TimeEfficiencyCommStr.PatrolType_Equipment);%>
|
||
<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 masterId = '${id}';
|
||
var tbName = 'TB_TimeEfficiency_PatrolArea_Floor_file'; //数据表
|
||
var nameSpace = 'patrolfloor';//保存文件夹
|
||
var bucketName = 'patrolfloor';
|
||
var previews = new Array();
|
||
var previewConfigs = new Array();
|
||
|
||
/*function initFileInput_single(ctrlName, uploadUrl) {
|
||
var control = $('#' + ctrlName);
|
||
control.fileinput({
|
||
language: 'zh', //设置语言
|
||
uploadUrl: uploadUrl, //上传的地址
|
||
uploadAsync:true,
|
||
allowedFileExtensions : ['jpg', 'png','gif'],//接收的文件后缀
|
||
showUpload: false, //是否显示上传按钮
|
||
showRemove:false,
|
||
showCaption: false,//是否显示标题
|
||
showClose:false,//右上角关闭按钮
|
||
browseClass: "btn btn-primary", //按钮样式
|
||
maxFileCount: 1, //表示允许同时上传的最大文件个数
|
||
enctype: 'multipart/form-data',
|
||
validateInitialCount:true,
|
||
previewFileIcon: "<i class='fa fa-file'></i>",
|
||
preferIconicPreview: true,//是否强制相关文件展示icon
|
||
initialPreviewAsData: true,
|
||
autoReplace:true,
|
||
dropZoneTitle:'可拖拽文件到选区',
|
||
uploadExtraData:function (previewId, index) { //传参
|
||
//var data = $("#subForm_floor").serialize();
|
||
//console.info(data)
|
||
var data = {
|
||
"masterId": masterId, //此处自定义传参
|
||
"tbName": tbName,
|
||
"nameSpace": nameSpace
|
||
};
|
||
return data;
|
||
},
|
||
layoutTemplates:{
|
||
actionDelete:''
|
||
},
|
||
});
|
||
control.on("filebatchselected", function (event, data, previewId, index) {
|
||
|
||
});
|
||
//导入文件上传完成之后的事件
|
||
control.on("fileuploaded", function (event, data, previewId, index) {
|
||
console.info(data)
|
||
if(data.response.suc) {
|
||
closeModal('subModal_floor');
|
||
}
|
||
});
|
||
}*/
|
||
function doSaveFloor() {
|
||
$("#subForm_floor").bootstrapValidator('validate');//提交验证
|
||
if ($("#subForm_floor").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||
$.post(ext.contextPath + "/timeEfficiency/patrolArea/saveFloor.do", $("#subForm_floor").serialize(), function (data) {
|
||
if (data.res == 1) {
|
||
$("#filelist").fileinput("upload");
|
||
closeModal('subModal_floor')
|
||
$("#table").bootstrapTable('refresh');
|
||
} else if (data.res == 0) {
|
||
showAlert('d', '保存失败', 'alertDiv_floor');
|
||
} else {
|
||
showAlert('d', data.res, 'alertDiv_floor');
|
||
}
|
||
}, 'json');
|
||
}
|
||
;
|
||
}
|
||
|
||
$("#subForm_floor").bootstrapValidator({
|
||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||
fields: {
|
||
name: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '名称不能为空'
|
||
}
|
||
}
|
||
},
|
||
floor: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '楼层不能为空'
|
||
}
|
||
}
|
||
},
|
||
morder: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '顺序不能为空'
|
||
}
|
||
}
|
||
}
|
||
}
|
||
});
|
||
$(function () {
|
||
// initFileInput_single('filelist', ext.contextPath + "/base/inputFile.do");
|
||
});
|
||
</script>
|
||
<div class="modal fade" id="subModal_floor">
|
||
<div class="modal-dialog">
|
||
<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 class="modal-body">
|
||
<!-- 新增界面formid强制为subForm -->
|
||
<form class="form-horizontal" id="subForm_floor" enctype="multipart/form-data">
|
||
<input name="id" id="floorId" type="hidden" value="${id}"/>
|
||
<input name="unitId" type="hidden" value="${param.unitId}"/>
|
||
<!-- <input name="patrolAreaId" type="hidden" value="${param.patrolAreaId}"/> -->
|
||
<!-- 界面提醒div强制id为alertDiv -->
|
||
<div id="alertDiv_floor"></div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">*名称</label>
|
||
<div class="col-sm-10">
|
||
<input type="text" class="form-control" id="name" name="name" placeholder="名称">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">*楼层</label>
|
||
<div class="col-sm-10">
|
||
<input type="number" class="form-control" id="floor" name="floor" placeholder="楼层">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">*顺序</label>
|
||
<div class="col-sm-10">
|
||
<input type="number" class="form-control" id="morder" name="morder" placeholder="顺序">
|
||
</div>
|
||
</div>
|
||
|
||
<%--<div class="form-group" style="margin:8px">
|
||
<button type="button" class="btn btn-default btn-file btn-sm" onclick="fileinput()" id="btn_save"><i class="fa fa-paperclip"></i> 上传图片</button>
|
||
</div>
|
||
<div class="form-group" style="margin:8px;">
|
||
<input type="file" name="filelist" id="filelist" multiple class="file-loading" />
|
||
</div>--%>
|
||
|
||
<div class="form-group" style="margin:8px">
|
||
<button type="button" class="btn btn-default btn-file" onclick="fileinputPic('patrolAreaFloorId')" id="btn_save"><i
|
||
class="fa fa-paperclip"></i>上传图片
|
||
</button>
|
||
</div>
|
||
|
||
<div class="form-group" style="margin:8px;">
|
||
<input type="file" name="patrolAreaFloorId" id="patrolAreaFloorId" multiple
|
||
class="file-loading"/>
|
||
</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="doSaveFloor()">保存</button>
|
||
</div>
|
||
</div>
|
||
<!-- /.modal-content -->
|
||
</div>
|
||
<!-- /.modal-dialog -->
|
||
</div>
|