You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
90 lines
3.2 KiB
90 lines
3.2 KiB
2 years ago
|
<!DOCTYPE html>
|
||
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||
|
<head>
|
||
|
<th:block th:include="include :: header('新增图纸资料')" />
|
||
|
<th:block th:include="include :: bootstrap-fileinput-css"/>
|
||
|
</head>
|
||
|
<style>
|
||
|
.m{
|
||
|
display: block;
|
||
|
}
|
||
|
.m .form-group{
|
||
|
width: 100%;
|
||
|
}
|
||
|
.col-sm-3 {
|
||
|
width: 20%;
|
||
|
}
|
||
|
</style>
|
||
|
<body class="white-bg">
|
||
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||
|
<form class="form-horizontal m" id="form-drawing-add">
|
||
|
<div class="form-group">
|
||
|
<label class="col-sm-3 control-label">图纸编码:</label>
|
||
|
<div class="col-sm-8">
|
||
|
<input name="drawingCode" class="form-control" type="text">
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="form-group">
|
||
|
<label class="col-sm-3 control-label">图纸类别:</label>
|
||
|
<div class="col-sm-8">
|
||
|
<input name="drawingMaterialCategory" class="form-control" type="text">
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="form-group">
|
||
|
<label class="col-sm-3 control-label">备注:</label>
|
||
|
<div class="col-sm-8">
|
||
|
<textarea name="drawingRemarks" class="form-control"></textarea>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="form-group">
|
||
|
<label class="col-sm-3 control-label">上传人:</label>
|
||
|
<div class="col-sm-8">
|
||
|
<input name="uploadPerson" class="form-control" type="text">
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="form-group">
|
||
|
<label class="col-sm-3 control-label">图纸上传:</label>
|
||
|
<div class="col-sm-8">
|
||
|
<input type="hidden" name="drawingUpload">
|
||
|
<div class="file-loading">
|
||
|
<input class="form-control file-upload" id="drawingUpload" name="file" type="file">
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</form>
|
||
|
</div>
|
||
|
<th:block th:include="include :: footer" />
|
||
|
<th:block th:include="include :: bootstrap-fileinput-js"/>
|
||
|
<script th:inline="javascript">
|
||
|
var prefix = ctx + "system/drawing"
|
||
|
$("#form-drawing-add").validate({
|
||
|
focusCleanup: true
|
||
|
});
|
||
|
|
||
|
function submitHandler() {
|
||
|
if ($.validate.form()) {
|
||
|
$.operate.save(prefix + "/add", $('#form-drawing-add').serialize());
|
||
|
}
|
||
|
}
|
||
|
|
||
|
let userName = [[${@permission.getPrincipalProperty('userName')}]];
|
||
|
$("#form-drawing-add input[name='uploadPerson']").val(userName)
|
||
|
|
||
|
$(".file-upload").fileinput({
|
||
|
uploadUrl: prefix + '/upload',
|
||
|
maxFileCount: 1,
|
||
|
autoReplace: true,
|
||
|
overwriteInitial: false,
|
||
|
initialPreviewAsData: true,
|
||
|
}).on('fileuploaded', function (event, data, previewId, index) {
|
||
|
// console.log(event.currentTarget.id)
|
||
|
$("input[name='" + event.currentTarget.id + "']").val(data.response.url)
|
||
|
}).on('fileremoved', function (event, id, index) {
|
||
|
$("input[name='" + event.currentTarget.id + "']").val('')
|
||
|
})
|
||
|
|
||
|
|
||
|
</script>
|
||
|
|
||
|
</body>
|
||
|
</html>
|