RuoYi/ruoyi-admin/src/main/resources/templates/system/material/add.html

148 lines
5.2 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-material-add">
<div class="form-group">
<label class="col-sm-3 control-label">标题:</label>
<div class="col-sm-8">
<input name="title" 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="imgUrl" type="text" value="" hidden>
<input type="file" name="imgUrlImg" id="imgUrlImg" multiple class="file" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">详情页:</label>
<div class="col-sm-8">
<input name="detail" type="text" value="" hidden>
<input type="file" name="detailImg" id="detailImg" multiple class="file" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">视频:</label>
<div class="col-sm-8">
<input name="videoImg" type="text" value="" hidden>
<input type="file" name="videoImgImg" id="videoImgImg" multiple class="file" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">标签:</label>
<div class="col-sm-8">
<input name="labels" 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="applyNum" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">来源App</label>
<div class="col-sm-8">
<input name="sourceApp" 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="text" class="form-control" name="clewContent">
</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/material"
$("#form-material-add").validate({
focusCleanup: true
});
// 素材logo
$('#imgUrlImg').fileinput({
language: 'zh', //设置语言
dropZoneEnabled: false, //是否显示拖拽区域
showPreview: false,
uploadExtraData: {
"name": "imgUrlImg"
},
dropZoneTitle: "可以将图片拖放到这里", //拖拽区域显示文字
uploadUrl: ctx + 'tool/qiniu/upload', //上传路径
allowedFileExtensions: ['jpg', 'png', 'gif', 'jpeg'], //指定上传文件类型
maxFileSize: 0,
maxFileSize: 10240, //上传文件最大值单位kb
uploadAsync: true, //异步上传
maxFileCount: 1 //上传文件最大个数。
}).on("fileuploaded", function(event,data) { //异步上传成功后回调
if(data.response.code === 0){
$("input[name='imgUrl']").val(data.response.url)
}else {
alert("上传失败!");
}
});
// 详情页
$('#detailImg').fileinput({
language: 'zh', //设置语言
dropZoneEnabled: false, //是否显示拖拽区域
showPreview: false,
uploadExtraData: {
"name": "detailImg"
},
dropZoneTitle: "可以将图片拖放到这里", //拖拽区域显示文字
uploadUrl: ctx + 'tool/qiniu/upload', //上传路径
allowedFileExtensions: ['jpg', 'png', 'gif', 'jpeg'], //指定上传文件类型
maxFileSize: 0,
maxFileSize: 10240, //上传文件最大值单位kb
uploadAsync: true, //异步上传
maxFileCount: 1 //上传文件最大个数。
}).on("fileuploaded", function(event,data) { //异步上传成功后回调
if(data.response.code === 0){
$("input[name='detail']").val(data.response.url)
}else {
alert("上传失败!");
}
});
// 视频素材
$('#videoImgImg').fileinput({
language: 'zh', //设置语言
dropZoneEnabled: false, //是否显示拖拽区域
showPreview: false,
uploadExtraData: {
"name": "videoImgImg"
},
dropZoneTitle: "可以将视频拖放到这里", //拖拽区域显示文字
uploadUrl: ctx + 'tool/qiniu/upload', //上传路径
allowedFileExtensions: ['mp4', 'wmv', 'm4v', 'avi'], //指定上传文件类型
maxFileSize: 0,
maxFileSize: 204800, //上传文件最大值单位kb
uploadAsync: true, //异步上传
maxFileCount: 1 //上传文件最大个数。
}).on("fileuploaded", function(event,data) { //异步上传成功后回调
if(data.response.code === 0){
$("input[name='videoImg']").val(data.response.url)
}else {
alert("上传失败!");
}
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-material-add').serialize());
}
}
</script>
</body>
</html>