|
@@ -1,80 +1,23 @@
|
|
|
<!DOCTYPE html>
|
|
<!DOCTYPE html>
|
|
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
|
|
<head>
|
|
<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" />
|
|
|
|
|
|
|
+ <th:block th:include="include :: header('编辑商品标签')" />
|
|
|
</head>
|
|
</head>
|
|
|
<body class="white-bg">
|
|
<body class="white-bg">
|
|
|
- <div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
|
|
|
|
- <form class="form-horizontal m" id="form-prod-edit" th:object="${prodVo}">
|
|
|
|
|
- <input name="id" th:field="*{id}" type="hidden">
|
|
|
|
|
- <ul>
|
|
|
|
|
- <li>
|
|
|
|
|
- <label>品牌名:</label>
|
|
|
|
|
- <input type="text" name="ipName"/>
|
|
|
|
|
- </li>
|
|
|
|
|
- <li>
|
|
|
|
|
- <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
|
|
|
|
- <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
|
|
|
|
- </li>
|
|
|
|
|
- </ul>
|
|
|
|
|
- </form>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <form class="form-horizontal m" id="form-prodTag-edit">
|
|
|
|
|
+ <div class="wrapper wrapper-content animated fadeInRight">
|
|
|
|
|
+ <div class="row" id="ibox-container">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </form>
|
|
|
<th:block th:include="include :: footer" />
|
|
<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">
|
|
<script th:inline="javascript">
|
|
|
- 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']]
|
|
|
|
|
- ],
|
|
|
|
|
|
|
+ var prefix = ctx + "master/product/prod";
|
|
|
|
|
+ var prodTagVoList = [[${prodTagVoList}]];
|
|
|
|
|
+ prodTagVoList.forEach(item => {
|
|
|
|
|
+ var card = "<div class='col-sm-1'><div class='ibox'><div class='ibox-title'><i class='fa fa-remove pull-right'></i><h5>"+item.tagName+"</h5></div></div></div>";
|
|
|
|
|
+ $("#ibox-container").append(card);
|
|
|
});
|
|
});
|
|
|
- $('.summernote').summernote('code', [[${prodVo.description}]]);
|
|
|
|
|
|
|
|
|
|
$("#form-prod-edit").validate({
|
|
$("#form-prod-edit").validate({
|
|
|
focusCleanup: true
|
|
focusCleanup: true
|