|
@@ -4,6 +4,142 @@
|
|
<head>
|
|
<head>
|
|
<title>资料管理</title>
|
|
<title>资料管理</title>
|
|
<meta name="decorator" content="default"/>
|
|
<meta name="decorator" content="default"/>
|
|
|
|
+ <%--<style>
|
|
|
|
+ .clearfix::after{
|
|
|
|
+ content: "";
|
|
|
|
+ display: block;
|
|
|
|
+ clear: both;
|
|
|
|
+ }
|
|
|
|
+ .iconBox{
|
|
|
|
+ font-size: 0;
|
|
|
|
+ }
|
|
|
|
+ .controls{
|
|
|
|
+ margin-left: 0 !important;
|
|
|
|
+ }
|
|
|
|
+ .controls .conList{
|
|
|
|
+ display: inline-block;
|
|
|
|
+ margin-right: 15px;
|
|
|
|
+ }
|
|
|
|
+ .conList .btn:nth-of-type(1){
|
|
|
|
+ margin-left: 25px;
|
|
|
|
+ }
|
|
|
|
+ .select2-choice{
|
|
|
|
+ width: 100px;
|
|
|
|
+ }
|
|
|
|
+ .upload-content {
|
|
|
|
+ float: left;
|
|
|
|
+ margin-top: -100px;
|
|
|
|
+ margin-right: -40px;
|
|
|
|
+ }
|
|
|
|
+ .upload-content .conList .btn:nth-of-type(1) {
|
|
|
|
+ width: 90px;
|
|
|
|
+ height: 100px;
|
|
|
|
+ border: 2px solid #eee;
|
|
|
|
+ background: #fff;
|
|
|
|
+ position: relative;
|
|
|
|
+ }
|
|
|
|
+ .upload-content .conList .btn:nth-of-type(1)>div {
|
|
|
|
+ position: absolute;
|
|
|
|
+ top: 50%;
|
|
|
|
+ left: 50%;
|
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
|
+ color: #666;
|
|
|
|
+ }
|
|
|
|
+ .upload-content .conList .btn:nth-of-type(1) span {
|
|
|
|
+ font-size: 35px;
|
|
|
|
+ }
|
|
|
|
+ .upload-content .conList .btn:nth-of-type(1) h5 {
|
|
|
|
+ color: #666;
|
|
|
|
+ }
|
|
|
|
+ .cancel-upload {
|
|
|
|
+ background: transparent;
|
|
|
|
+ border: none;
|
|
|
|
+ box-shadow: none;
|
|
|
|
+ position: relative;
|
|
|
|
+ top: -38px;
|
|
|
|
+ left: -25px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ z-index: 100;
|
|
|
|
+ }
|
|
|
|
+ .upload-content .conList ol li {
|
|
|
|
+ width: 114px;
|
|
|
|
+ min-height: 80px;
|
|
|
|
+ text-align: center;
|
|
|
|
+ background: #fff;
|
|
|
|
+ position: relative;
|
|
|
|
+ top: 120px;
|
|
|
|
+ margin-left: 2px;
|
|
|
|
+ }
|
|
|
|
+ .hide-pic {
|
|
|
|
+ display: none !important;
|
|
|
|
+ }
|
|
|
|
+ .upload-image-list{
|
|
|
|
+ width: 600px;
|
|
|
|
+ float: left;
|
|
|
|
+ }
|
|
|
|
+ </style>--%>
|
|
|
|
+ <style>
|
|
|
|
+ .iconBox{
|
|
|
|
+ font-size: 0;
|
|
|
|
+ }
|
|
|
|
+ .controls .conList{
|
|
|
|
+ display: inline-block;
|
|
|
|
+ margin-right: 15px;
|
|
|
|
+ }
|
|
|
|
+ .conList .btn:nth-of-type(1){
|
|
|
|
+ margin-left: 25px;
|
|
|
|
+ }
|
|
|
|
+ .select2-choice{
|
|
|
|
+ width: 100px;
|
|
|
|
+ }
|
|
|
|
+ .upload-content {
|
|
|
|
+ float: left;
|
|
|
|
+ margin-top: -70px;
|
|
|
|
+ margin-left: 20px !important;
|
|
|
|
+ }
|
|
|
|
+ .upload-content .conList .btn:nth-of-type(1) {
|
|
|
|
+ width: 90px;
|
|
|
|
+ height: 100px;
|
|
|
|
+ border: 2px solid #eee;
|
|
|
|
+ background: #fff;
|
|
|
|
+ position: relative;
|
|
|
|
+ }
|
|
|
|
+ .upload-content .conList .btn:nth-of-type(1)>div {
|
|
|
|
+ position: absolute;
|
|
|
|
+ top: 50%;
|
|
|
|
+ left: 50%;
|
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
|
+ color: #666;
|
|
|
|
+ }
|
|
|
|
+ .upload-content .conList .btn:nth-of-type(1) span {
|
|
|
|
+ font-size: 35px;
|
|
|
|
+ }
|
|
|
|
+ .upload-content .conList .btn:nth-of-type(1) h5 {
|
|
|
|
+ color: #666;
|
|
|
|
+ }
|
|
|
|
+ .cancel-upload {
|
|
|
|
+ background: transparent;
|
|
|
|
+ border: none;
|
|
|
|
+ box-shadow: none;
|
|
|
|
+ position: relative;
|
|
|
|
+ top: -38px;
|
|
|
|
+ left: -25px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ z-index: 100;
|
|
|
|
+ }
|
|
|
|
+ .upload-content .conList ol li {
|
|
|
|
+ width: 114px;
|
|
|
|
+ min-height: 80px;
|
|
|
|
+ text-align: center;
|
|
|
|
+ background: #fff;
|
|
|
|
+ position: relative;
|
|
|
|
+ top: 120px;
|
|
|
|
+ margin-left: 2px;
|
|
|
|
+ }
|
|
|
|
+ .hide-pic {
|
|
|
|
+ display: none !important;
|
|
|
|
+ }
|
|
|
|
+ </style>
|
|
<script type="text/javascript">
|
|
<script type="text/javascript">
|
|
$(document).ready(function() {
|
|
$(document).ready(function() {
|
|
//$("#name").focus();
|
|
//$("#name").focus();
|
|
@@ -27,28 +163,157 @@
|
|
</head>
|
|
</head>
|
|
<body>
|
|
<body>
|
|
<ul class="nav nav-tabs">
|
|
<ul class="nav nav-tabs">
|
|
- <li><a href="${ctx}/archive/cmProductArchiveContent/">资料列表</a></li>
|
|
|
|
|
|
+ <li><a href="${ctx}/archive/cmProductArchiveContent/?type=1">资料列表</a></li>
|
|
<li class="active"><a href="${ctx}/archive/cmProductArchiveContent/form?id=${cmProductArchiveContent.id}">资料${not empty cmProductArchiveContent.id?'编辑':'添加'}</a></li>
|
|
<li class="active"><a href="${ctx}/archive/cmProductArchiveContent/form?id=${cmProductArchiveContent.id}">资料${not empty cmProductArchiveContent.id?'编辑':'添加'}</a></li>
|
|
</ul><br/>
|
|
</ul><br/>
|
|
|
|
+
|
|
|
|
+
|
|
<form:form id="inputForm" modelAttribute="cmProductArchiveContent" action="${ctx}/archive/cmProductArchiveContent/save" method="post" class="form-horizontal">
|
|
<form:form id="inputForm" modelAttribute="cmProductArchiveContent" action="${ctx}/archive/cmProductArchiveContent/save" method="post" class="form-horizontal">
|
|
<form:hidden path="id"/>
|
|
<form:hidden path="id"/>
|
|
|
|
+ <form:hidden path="type" value="1"/>
|
|
<sys:message content="${message}"/>
|
|
<sys:message content="${message}"/>
|
|
<div class="control-group">
|
|
<div class="control-group">
|
|
<label class="control-label"><font color="red">*</font>标题:</label>
|
|
<label class="control-label"><font color="red">*</font>标题:</label>
|
|
<div class="controls">
|
|
<div class="controls">
|
|
- <form:input path="title" htmlEscape="false" maxlength="50" class="input-xlarge "/>
|
|
|
|
|
|
+ <form:input path="title" htmlEscape="false" maxlength="50" class="input-xlarge " style="position:relative"/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div class="control-group">
|
|
|
|
|
|
+ <div class="control-group" style="width: 1000px">
|
|
<label class="control-label"><font color="red">*</font>图片:</label>
|
|
<label class="control-label"><font color="red">*</font>图片:</label>
|
|
- <div class="controls">
|
|
|
|
- <form:input path="title" htmlEscape="false" maxlength="50" class="input-xlarge "/>
|
|
|
|
|
|
+<%-- <c:if test="${not empty cmProductArchiveContent.imageList}">--%>
|
|
|
|
+ <div class="upload-image-list" style="display: flex;flex-wrap: wrap">
|
|
|
|
+ <c:forEach items="${cmProductArchiveContent.imageList}" var="image" varStatus="index">
|
|
|
|
+ <div class="controls upload-content iconBox" id="imageBox${index.index}">
|
|
|
|
+ <div class="conList">
|
|
|
|
+ <form:hidden id="pImage${index.index}" path="imageList[${index.index}].ossUrl" htmlEscape="false"
|
|
|
|
+ maxlength="255"
|
|
|
|
+ class="input-xlarge required"/>
|
|
|
|
+ <sys:ckfinder input="pImage${index.index}" type="images" uploadPath="/photo"
|
|
|
|
+ selectMultiple="false"
|
|
|
|
+ maxWidth="100" maxHeight="100"/><br>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </c:forEach>
|
|
|
|
+ <c:set var="size" value="${empty cmProductArchiveContent.imageList?0:cmProductArchiveContent.imageList.size()}"/>
|
|
|
|
+ <c:forEach var="emptyIndex" begin="${size}" end="${11}">
|
|
|
|
+ <div class="controls upload-content iconBox conList ${emptyIndex eq 0?'':'hide-pic'}" id="imageBox${emptyIndex}" >
|
|
|
|
+ <div class="conList">
|
|
|
|
+ <form:hidden id="pImage${emptyIndex}" path="imageList[${emptyIndex}].ossUrl" htmlEscape="false"
|
|
|
|
+ maxlength="255"
|
|
|
|
+ class="input-xlarge required"/>
|
|
|
|
+ <sys:ckfinder input="pImage${emptyIndex}" type="images" uploadPath="/photo"
|
|
|
|
+ selectMultiple="false"
|
|
|
|
+ maxWidth="100" maxHeight="100"/><br>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </c:forEach>
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+<%-- </div>--%>
|
|
|
|
+
|
|
|
|
+ <%--</c:if>
|
|
|
|
+ <c:if test="${empty cmProductArchiveContent.imageList}">
|
|
|
|
+ 111
|
|
|
|
+ </c:if>--%>
|
|
</div>
|
|
</div>
|
|
<div class="form-actions">
|
|
<div class="form-actions">
|
|
<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>
|
|
<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>
|
|
<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
|
|
<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
|
|
</div>
|
|
</div>
|
|
</form:form>
|
|
</form:form>
|
|
|
|
+<script>
|
|
|
|
+ var imageSize = 0;
|
|
|
|
+ var imageList = [];
|
|
|
|
+ $(function () {
|
|
|
|
+ <c:forEach items="${cmProductArchiveContent.imageList}" var="floorImage" varStatus="index">
|
|
|
|
+ imageList.push({
|
|
|
|
+ id: "${floorImage.id}",
|
|
|
|
+ ossUrl: "${floorImage.ossUrl}"
|
|
|
|
+ });
|
|
|
|
+ </c:forEach>
|
|
|
|
+ imageSize = imageList.length
|
|
|
|
+ $('.upload-content .conList .btn:nth-of-type(1)').html('<div><span>+</span><h5>选择图片</h5></div>');
|
|
|
|
+ $('.upload-content .conList .btn:nth-of-type(2)').after('<img class="cancel-upload" src="/static/images/close-btn1.png">').remove();
|
|
|
|
+ $('.upload-content .conList').find('.cancel-upload').hide();
|
|
|
|
+ var MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
|
|
|
|
+ var MutationObserverConfig = {
|
|
|
|
+ childList: true,
|
|
|
|
+ subtree: true,
|
|
|
|
+ characterData: true
|
|
|
|
+ };
|
|
|
|
+ var observer = new MutationObserver(function (mutations) {
|
|
|
|
+ $.each(mutations, function (index, item) {
|
|
|
|
+ if (item.type === 'childList') {
|
|
|
|
+ debugger
|
|
|
|
+ // 在创建新的 element 时调用
|
|
|
|
+ var target = $(item.target),
|
|
|
|
+ thisWrapper = target.closest('.conList'),
|
|
|
|
+ nextEle = thisWrapper.parents('.controls').next();
|
|
|
|
+ thisWrapper.find('li').css('z-index', 99);
|
|
|
|
+ thisWrapper.find('.cancel-upload').show();
|
|
|
|
+ if (nextEle.hasClass('hide-pic')) {
|
|
|
|
+ nextEle.removeClass('hide-pic');
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ });
|
|
|
|
+ var observeEle = document.getElementsByClassName('upload-image-list')[0];
|
|
|
|
+ observer.observe(observeEle, MutationObserverConfig);
|
|
|
|
+
|
|
|
|
+ $('body').on('click', '.cancel-upload',function() {
|
|
|
|
+ debugger
|
|
|
|
+ var wrapper = $(this).closest('.controls');
|
|
|
|
+ wrapper.find('li').css('z-index','-1');
|
|
|
|
+ wrapper.find('input').val('');
|
|
|
|
+ $(this).hide();
|
|
|
|
+ if ($('.cancel-upload:visible').length < 12) {
|
|
|
|
+ wrapper.addClass("hide-pic");
|
|
|
|
+ }else{
|
|
|
|
+ wrapper.removeClass("hide-pic");
|
|
|
|
+ }
|
|
|
|
+ wrapper.parent().append(wrapper.clone());
|
|
|
|
+ wrapper.remove();
|
|
|
|
+ $(".controls").each(function(i,ele){
|
|
|
|
+ if($(ele).find("input.input-xlarge").val()){
|
|
|
|
+ $(ele).next().removeClass("hide-pic")
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ console.log(--imageSize)
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ $('body').on('click','.upload-content li',function() {
|
|
|
|
+ var index = $(this).closest('.conList').index() + 1,
|
|
|
|
+ str = 'image'+index+'FinderOpen';
|
|
|
|
+ eval(str+'()');
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ $(window).on("load", function () {
|
|
|
|
+ setTimeout(function () {
|
|
|
|
+ for (var i = 0; i < 12; i++) {
|
|
|
|
+ $("#imageBox"+i).find("input.input-xlarge").each(function (i, ele) {
|
|
|
|
+ if ($(ele).val()) {
|
|
|
|
+ $(ele).next().find("li").css("z-index", "99");
|
|
|
|
+ $(ele).parents(".conList").find(".cancel-upload").show();
|
|
|
|
+ $(ele).parent().parents(".controls").next().removeClass("hide-pic")
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }, 200);
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ function showImage() {
|
|
|
|
+ var html = '';
|
|
|
|
+ imageList.forEach(function (item,index) {
|
|
|
|
+ html += appendImage(item, index);
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function appendImage(item, index) {
|
|
|
|
+ alert(1)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+</script>
|
|
</body>
|
|
</body>
|
|
</html>
|
|
</html>
|