|
|
|
|
@ -2,20 +2,32 @@
|
|
|
|
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
|
|
|
|
<head>
|
|
|
|
|
<th:block th:include="include :: header('新增亮点产品维护')" />
|
|
|
|
|
<th:block th:include="include :: datetimepicker-css"/>
|
|
|
|
|
<th:block th:include="include :: jasny-bootstrap-css"/>
|
|
|
|
|
</head>
|
|
|
|
|
<body class="white-bg">
|
|
|
|
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
|
|
|
|
<form class="form-horizontal m" id="form-base_picture_location-add">
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="col-sm-3 control-label">图片路径:</label>
|
|
|
|
|
<div class="col-sm-8">
|
|
|
|
|
<input name="picturePath" class="form-control" type="text">
|
|
|
|
|
<div class="fileinput fileinput-new" data-provides="fileinput">
|
|
|
|
|
<div class="fileinput-new thumbnail" style="width: 240px; height: 240px;">
|
|
|
|
|
<img alt="选择图片">
|
|
|
|
|
</div>
|
|
|
|
|
<div class="fileinput-preview fileinput-exists thumbnail"
|
|
|
|
|
style="max-width: 340px; max-height: 340px;"></div>
|
|
|
|
|
<div>
|
|
|
|
|
<span class="btn btn-white btn-file"><span class="fileinput-new">选择图片</span><span
|
|
|
|
|
class="fileinput-exists">更改</span>
|
|
|
|
|
<input type="file" id="imagepath" name="imagepath"></span>
|
|
|
|
|
<a href="#" class="btn btn-white fileinput-exists" data-dismiss="fileinput">清除</a>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="col-sm-3 control-label">显示位置:</label>
|
|
|
|
|
<div class="col-sm-8">
|
|
|
|
|
<select name="pictureLocation" class="form-control m-b" th:with="type=${@dict.getType('picture_location')}">
|
|
|
|
|
<select name="pictureLocation" id="pictureLocation" class="form-control m-b" th:with="type=${@dict.getType('picture_location')}">
|
|
|
|
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
@ -23,6 +35,8 @@
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
<th:block th:include="include :: footer" />
|
|
|
|
|
<th:block th:include="include :: datetimepicker-js"/>
|
|
|
|
|
<th:block th:include="include :: jasny-bootstrap-js"/>
|
|
|
|
|
<script th:inline="javascript">
|
|
|
|
|
var prefix = ctx + "system/base_picture_location"
|
|
|
|
|
$("#form-base_picture_location-add").validate({
|
|
|
|
|
@ -30,9 +44,27 @@
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function submitHandler() {
|
|
|
|
|
if ($.validate.form()) {
|
|
|
|
|
$.operate.save(prefix + "/add", $('#form-base_picture_location-add').serialize());
|
|
|
|
|
}
|
|
|
|
|
// if ($.validate.form()) {
|
|
|
|
|
// $.operate.save(prefix + "/add", $('#form-base_picture_location-add').serialize());
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
var formData = new FormData();
|
|
|
|
|
formData.append('file', $('#imagepath')[0].files[0]);
|
|
|
|
|
var select=document.getElementById('pictureLocation');
|
|
|
|
|
var res_value=select.value;
|
|
|
|
|
formData.append('pictureLocation',res_value);
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: prefix + "/add",
|
|
|
|
|
type: 'post',
|
|
|
|
|
cache: false,
|
|
|
|
|
data: formData,
|
|
|
|
|
processData: false,
|
|
|
|
|
contentType: false,
|
|
|
|
|
dataType: "json",
|
|
|
|
|
success: function(result) {
|
|
|
|
|
$.operate.successCallback(result);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
</body>
|
|
|
|
|
|