|
|
@@ -2,47 +2,138 @@
|
|
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
|
|
<head>
|
|
|
<th:block th:include="include :: header('修改推荐商品')" />
|
|
|
+ <th:block th:include="include :: select2-css" />
|
|
|
+ <th:block th:include="include :: bootstrap-select-css" />
|
|
|
+ <th:block th:include="include :: summernote-css" />
|
|
|
</head>
|
|
|
<body class="white-bg">
|
|
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
|
|
- <form class="form-horizontal m" id="form-prod-edit" th:object="${tSuggestProd}">
|
|
|
+ <form class="form-horizontal m" id="form-prod-edit" th:object="${prodVo}">
|
|
|
<input name="id" th:field="*{id}" type="hidden">
|
|
|
<div class="col-xs-12">
|
|
|
<div class="form-group">
|
|
|
- <label class="col-sm-3 control-label">商品ID:</label>
|
|
|
+ <label class="col-sm-3 control-label">商品分类:</label>
|
|
|
<div class="col-sm-8">
|
|
|
- <input name="prodId" th:field="*{prodId}" class="form-control" type="text">
|
|
|
+ <select name="prodClassId" class="form-control" th:with="prodClasses=${@product.getProdClasses()}" th:field="*{prodClassId}" >
|
|
|
+ <option value="">所有</option>
|
|
|
+ <option th:each="prodClass : ${prodClasses}" th:text="${prodClass.className}" th:value="${prodClass.prodClassId}"></option>
|
|
|
+ </select>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="col-xs-12">
|
|
|
<div class="form-group">
|
|
|
- <label class="col-sm-3 control-label">顺序:</label>
|
|
|
+ <label class="col-sm-3 control-label">商品名称:</label>
|
|
|
<div class="col-sm-8">
|
|
|
- <input name="sort" th:field="*{sort}" class="form-control" type="text">
|
|
|
+ <input name="prodName" class="form-control" type="text" th:field="*{prodName}">
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="col-xs-12">
|
|
|
<div class="form-group">
|
|
|
- <label class="col-sm-3 control-label">删除标志:</label>
|
|
|
+ <label class="col-sm-3 control-label">文创名称:</label>
|
|
|
<div class="col-sm-8">
|
|
|
- <input name="delFlag" th:field="*{delFlag}" class="form-control" type="text">
|
|
|
+ <select name="ipId" class="form-control m-b" th:with="ipInfos=${@ipInfo.getIpInfos()}" th:field="*{ipId}" >
|
|
|
+ <option value="">所有</option>
|
|
|
+ <option th:each="ipInfo : ${ipInfos}" th:text="${ipInfo.ipName}" th:value="${ipInfo.ipId}"></option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="col-xs-12">
|
|
|
+ <div class="form-group">
|
|
|
+ <label class="col-sm-3 control-label">设计师:</label>
|
|
|
+ <div class="col-sm-8">
|
|
|
+ <select name="designerId" class="form-control m-b" th:with="designers=${@product.getDesigners()}" th:field="*{designerId}" >
|
|
|
+ <option value="">所有</option>
|
|
|
+ <option th:each="designer : ${designers}" th:text="${designer.designerName}" th:value="${designer.id}"></option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="col-xs-12">
|
|
|
+ <div class="form-group">
|
|
|
+ <label class="col-sm-3 control-label">商品描述:</label>
|
|
|
+ <div class="col-sm-10" style="margin-left: 80px">
|
|
|
+ <div class="summernote" style="border: red;" id="summernote"></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</form>
|
|
|
</div>
|
|
|
<th:block th:include="include :: footer" />
|
|
|
+ <th:block th:include="include :: select2-js" />
|
|
|
+ <th:block th:include="include :: bootstrap-select-js" />
|
|
|
+ <th:block th:include="include :: summernote-js" />
|
|
|
<script th:inline="javascript">
|
|
|
- var prefix = ctx + "system/prod";
|
|
|
+ var prefix = ctx + "master/product/prod"
|
|
|
+ $(".summernote").summernote({
|
|
|
+ lang: 'zh-CN',
|
|
|
+ callbacks:{
|
|
|
+ onImageUpload: function (files) {
|
|
|
+ var fileSize = 0;
|
|
|
+ fileSize = files[0].size;
|
|
|
+ fileSize=Math. round( fileSize/1024*100)/100;
|
|
|
+
|
|
|
+ if(fileSize>2048){
|
|
|
+ layer.msg('上传文件不得大于2M,请重新上传。', {time: 3000, icon:6});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!/image\/\w+/.test(files[0].type)) {
|
|
|
+ layer.msg('上传的不是图片文件,请重新上传。', {time: 3000, icon:6});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ var formData = new FormData();
|
|
|
+ formData.append('imageFile', files[0]);
|
|
|
+ $.ajax({
|
|
|
+ url : ctx + "common/upload/file/image",
|
|
|
+ type : 'POST',
|
|
|
+ data : formData,
|
|
|
+ processData : false,
|
|
|
+ contentType : false,
|
|
|
+ success : function(result) {
|
|
|
+ $('.summernote').summernote('insertImage', result.imageUrl);
|
|
|
+ },error:function(){
|
|
|
+ $.modal.alertError("上传失败");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ height: 600,
|
|
|
+ toolbar: [
|
|
|
+ ['style', ['fontname', 'bold', 'italic', 'underline', 'clear']],
|
|
|
+ ['font', ['strikethrough', 'superscript', 'subscript']],
|
|
|
+ ['fontsize', ['fontsize', 'undo', 'redo']],
|
|
|
+ ['color', ['color']],
|
|
|
+ ['para', ['ul', 'ol', 'paragraph']],
|
|
|
+ ['height', ['height']],
|
|
|
+ ['insert', ['picture', 'table']],
|
|
|
+ ['search', ['findnreplace', 'changecolor']]
|
|
|
+ ],
|
|
|
+ });
|
|
|
+ $('.summernote').summernote('code', [[${prodVo.description}]]);
|
|
|
+
|
|
|
$("#form-prod-edit").validate({
|
|
|
focusCleanup: true
|
|
|
});
|
|
|
|
|
|
function submitHandler() {
|
|
|
if ($.validate.form()) {
|
|
|
- $.operate.save(prefix + "/edit", $('#form-prod-edit').serialize());
|
|
|
+ var form = document.getElementById("form-prod-edit");
|
|
|
+ var formData = new FormData(form);
|
|
|
+ formData.append("description", $('#summernote').summernote('code'));
|
|
|
+ $.ajax({
|
|
|
+ url: prefix + "/edit",
|
|
|
+ data: formData,
|
|
|
+ type: "post",
|
|
|
+ processData: false,
|
|
|
+ contentType: false,
|
|
|
+ success: function(result) {
|
|
|
+ $.operate.successCallback(result);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
</script>
|