baolei 6 місяців тому
батько
коміт
0831b485a9

+ 12 - 0
08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/master/product/controller/ProdController.java

@@ -80,6 +80,7 @@ public class ProdController extends BaseController {
     @PostMapping("/add")
     @ResponseBody
     public AjaxResult addSave(Prod prod) {
+        prod.setProdStatus(EProdStatus.SAVED.getVal());
         return toAjax(prodVoService.insertProd(prod));
     }
 
@@ -120,6 +121,17 @@ public class ProdController extends BaseController {
      * 审核商品
      */
     @RequiresPermissions("master:product:approve")
+    @PostMapping("/submitt")
+    @ResponseBody
+    public AjaxResult submitt(Prod prod) {
+        prod.setProdStatus(EProdStatus.SUBMITTED.getVal());
+        return toAjax(prodVoService.updateProd(prod));
+    }
+
+    /**
+     * 审核商品
+     */
+    @RequiresPermissions("master:product:approve")
     @PostMapping("/approve")
     @ResponseBody
     public AjaxResult approve(Prod prod) {

+ 8 - 0
08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/master/product/mapper/ProdVoMapper.java

@@ -1,6 +1,7 @@
 package com.xingxi.web.controller.master.product.mapper;
 
 import com.xingxi.master.designer.domain.Designer;
+import com.xingxi.master.ipInfo.domain.IpInfo;
 import com.xingxi.master.product.domain.ProdClass;
 import com.xingxi.master.product.mapper.ProdMapper;
 import com.xingxi.web.controller.master.product.domain.ProdVo;
@@ -45,4 +46,11 @@ public interface ProdVoMapper extends ProdMapper {
      * @return 设计师列表
      */
     List<Designer> selectDesignerList();
+
+    /**
+     * 查询文创品牌列表
+     *
+     * @return 文创品牌列表
+     */
+    List<IpInfo> selectIpInfoList();
 }

+ 5 - 0
08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/master/product/service/impl/ProdCommonService.java

@@ -1,6 +1,7 @@
 package com.xingxi.web.controller.master.product.service.impl;
 
 import com.xingxi.master.designer.domain.Designer;
+import com.xingxi.master.ipInfo.domain.IpInfo;
 import com.xingxi.master.product.domain.ProdClass;
 import com.xingxi.web.controller.master.product.mapper.ProdVoMapper;
 import org.springframework.stereotype.Component;
@@ -28,4 +29,8 @@ public class ProdCommonService {
     public List<Designer> getDesigners() {
         return prodVoMapper.selectDesignerList();
     }
+
+    public List<IpInfo> getIpInfos() {
+        return prodVoMapper.selectIpInfoList();
+    }
 }

+ 5 - 0
08.src/Xingxi/xingxi-admin/src/main/resources/mapper/ProdVoMapper.xml

@@ -67,4 +67,9 @@
     <select id="selectDesignerList" parameterType="String" resultType="Designer">
         select * from m_designer where delFlag = '0'
     </select>
+
+    <select id="selectIpInfoList" parameterType="String" resultType="IpInfo">
+        select * from m_ipinfo where delFlag = '0'
+    </select>
+
 </mapper>

+ 401 - 0
08.src/Xingxi/xingxi-admin/src/main/resources/static/js/jsequencing.css

@@ -0,0 +1,401 @@
+@charset "utf-8";.imglist {
+    margin-right: -20px;
+    position: relative;
+    -webkit-touch-callout: none;
+    -webkit-user-select: none;
+    -khtml-user-select: none;
+    -moz-user-select: none;
+    -ms-user-select: none;
+    user-select: none
+}
+
+.imglist .item {
+    margin-right: 20px;
+    width: 150px;
+    height: 150px;
+    margin-top: 20px;
+    position: absolute;
+    left: 0;
+    top: 0;
+    border: solid 1px #ddd;
+    -moz-user-select: -moz-none;
+    -khtml-user-select: none;
+    -webkit-user-select: none;
+    -ms-user-select: none;
+    user-select: none;
+    background-color: #fff
+}
+
+.imglist .checkbox {
+    position: absolute;
+    top: 0;
+    right: 0;
+    z-index: 2;
+    width: 20px;
+    height: 20px;
+    margin: 3px
+}
+
+.imglist .picbox {
+    margin: auto
+}
+
+.imglist .picbox>a {
+    height: 0;
+    display: block;
+    padding-bottom: 100%;
+    position: relative
+}
+
+.imglist .picbox img {
+    position: absolute;
+    left: 0;
+    top: 0;
+    right: 0;
+    bottom: 0;
+    margin: auto;
+    max-width: 100%;
+    max-height: 100%
+}
+
+.imglist .textbox {
+    text-align: center;
+    margin-top: -10px;
+    padding-bottom: 5px;
+    display: none
+}
+
+.imglist .item:hover {
+    height: auto;
+    box-shadow: 0 1px 3px rgba(68,68,68,.3);
+    -moz-box-shadow: 0 1px 3px rgba(68,68,68,.3);
+    -webkit-box-shadow: 0 1px 3px rgba(68,68,68,.3);
+    z-index: 9
+}
+
+.imglist .item:hover .textbox {
+    display: block
+}
+
+.imglist .ident {
+    background-color: #c33;
+    width: 2px;
+    position: absolute;
+    left: 2px;
+    top: 0;
+    z-index: 0;
+    height: 100px;
+    margin-top: 10px;
+    margin-left: -10px;
+    display: none
+}
+
+.imglist .morexy {
+    border: solid 1px #f22;
+    background-color: #fdd;
+    position: absolute;
+    left: 0;
+    top: 0;
+    z-index: 11;
+    opacity: .5;
+    margin: 10px 0 0 -10px;
+    display: none
+}
+
+.chak_box {
+    position: fixed;
+    left: 0;
+    top: 0;
+    background-color: rgba(0,0,0,.618);
+    width: 100%;
+    height: 100%;
+    z-index: 99;
+    -moz-user-select: -moz-none;
+    -webkit-user-select: none;
+    -ms-user-select: none;
+    user-select: none;
+    display: none
+}
+
+.chak_title {
+    position: absolute;
+    top: 0;
+    left: 0;
+    width: 100%;
+    text-align: center;
+    line-height: 50px;
+    color: #fff;
+    font-size: 20px
+}
+
+.chak_img {
+    position: absolute;
+    left: 50px;
+    top: 50px;
+    right: 50px;
+    bottom: 100px;
+    margin: auto;
+    border: solid 1px rgba(255,255,255,.25);
+    border-radius: 10px;
+    overflow: hidden
+}
+
+.chak_img>p {
+    position: absolute;
+    left: 50%;
+    top: 50%;
+    -ms-transform: translate(-50%,-50%);
+    -moz-transform: translate(-50%,-50%);
+    -webkit-transform: translate(-50%,-50%);
+    -o-transform: translate(-50%,-50%);
+    transform: translate(-50%,-50%);
+    width: auto;
+    padding: 10px 20px;
+    background-color: #eee;
+    background-color: rgba(0,0,0,.5);
+    color: #fff;
+    font-size: 20px;
+    border-radius: 5px;
+    display: none
+}
+
+.chak_img>img {
+    position: absolute;
+    left: 50%;
+    top: 50%;
+    max-width: 100%;
+    max-height: 100%;
+    min-width: 10px;
+    -ms-transform: translate(-50%,-50%);
+    -moz-transform: translate(-50%,-50%);
+    -webkit-transform: translate(-50%,-50%);
+    -o-transform: translate(-50%,-50%);
+    transform: translate(-50%,-50%);
+    transform-origin: center
+}
+
+.chak_btn {
+    position: absolute;
+    width: 100%;
+    height: 100px;
+    bottom: 0;
+    left: 0;
+    text-align: center
+}
+
+.chak_btn>button {
+    border: solid 1px #fff;
+    color: #fff;
+    /*background-color: rgba(0,0,0,.33);*/
+    border-radius: 5px;
+    height: 40px;
+    padding: 0 15px;
+    font-size: 16px;
+    margin: 20px 5px;
+    min-width: 50px;
+    cursor: pointer
+}
+
+.chak_btn>button:hover {
+    background-color: rgba(0,0,0,.66)
+}
+
+/*.btn {*/
+/*    padding: 4px 12px;*/
+/*    background-color: #f6f6f6;*/
+/*    border: solid 1px #ddd;*/
+/*    cursor: pointer*/
+/*}*/
+
+.clear {
+    clear: both
+}
+
+.clearb:after {
+    content: "";
+    display: block;
+    clear: both
+}
+
+img {
+    max-width: 100%
+}
+
+.overh {
+    overflow: hidden;
+    position: relative
+}
+
+.f_wein {
+    font-weight: 400
+}
+
+.br_b {
+    border-bottom: solid 1px #eee
+}
+
+.br_t {
+    border-top: solid 1px #eee
+}
+
+.br_n {
+    border: 0
+}
+
+.con_br {
+    background-color: #fff;
+    border-top: solid 4px #d5dbe5;
+    box-shadow: 0 2px 5px 2px rgba(0,0,0,.05)
+}
+
+.con_br_b {
+    border-color: #45a7cf
+}
+
+.con_br_g {
+    border-color: #49a361
+}
+
+.con_br_o {
+    border-color: #e89f3c
+}
+
+.con_br_r {
+    border-color: #cd5542
+}
+
+.con_br_c {
+    border-color: #62cda6
+}
+
+.con_br_n {
+    border-top: 0
+}
+
+.w-p100 {
+    width: 100%
+}
+
+.ft_l {
+    float: left
+}
+
+.ft_r {
+    float: right
+}
+
+.pg_3 {
+    padding: 3px
+}
+
+.pg_5 {
+    padding: 5px
+}
+
+.pg_tb5 {
+    padding-top: 5px;
+    padding-bottom: 5px
+}
+
+.pg_tb6 {
+    padding-top: 6px;
+    padding-bottom: 6px
+}
+
+.pg_tb8 {
+    padding-top: 8px;
+    padding-bottom: 8px
+}
+
+.pg_tb10 {
+    padding-top: 10px;
+    padding-bottom: 10px
+}
+
+.pg_tb15 {
+    padding-top: 15px;
+    padding-bottom: 15px
+}
+
+.pg_tb20 {
+    padding-top: 20px;
+    padding-bottom: 20px
+}
+
+.pg_10 {
+    padding: 10px
+}
+
+.pg_15 {
+    padding: 15px
+}
+
+.pg_20 {
+    padding: 20px
+}
+
+.pg_lr15 {
+    padding-left: 15px;
+    padding-right: 15px
+}
+
+.pg_lr25 {
+    padding-left: 25px;
+    padding-right: 25px
+}
+
+.pg_l15 {
+    padding-left: 15px
+}
+
+.pg_l25 {
+    padding-left: 25px
+}
+
+.pg_r25 {
+    padding-right: 25px
+}
+
+.pg_b15 {
+    padding-bottom: 15px
+}
+
+.pg_b25 {
+    padding-bottom: 25px
+}
+
+.pg_bn {
+    padding-bottom: 0!important
+}
+
+.pg_n {
+    padding: 0!important
+}
+
+.bold {
+    font-weight: 700
+}
+
+.mn_5 {
+    margin: 5px
+}
+
+.mn_n {
+    margin: 0!important
+}
+
+.mb_n {
+    margin-bottom: 0!important
+}
+
+.mb-25 {
+    margin-bottom: 25px
+}
+
+.dis_n {
+    display: none
+}
+
+.dis_block {
+    display: block
+}

+ 616 - 0
08.src/Xingxi/xingxi-admin/src/main/resources/static/js/jsequencing.js

@@ -0,0 +1,616 @@
+function Jsequencing(options) {
+    var defaults = {
+        listid: "img_ul",
+        thumbherf: "",
+        bigherf: options.thumbherf,
+        imgsrcarr: [],
+        jsondata: false,
+        viewimg: true,
+        view_toggle: true,
+        view_zoom: true,
+        view_rotate: true,
+        showtitle: true,
+        IdClass: "__item__",
+    };
+    var opts = $.extend(defaults, options);
+    if ((typeof opts.imgsrcarr[0] == 'string') && opts.imgsrcarr[0].constructor == String) {
+        opts.jsondata = false;
+    } else if ((typeof opts.imgsrcarr[0] == 'object') && opts.imgsrcarr[0].constructor == Object) {
+        opts.jsondata = true;
+    } else if (opts.imgsrcarr[0] !== undefined) {
+        alert("数据格式不正确")
+    }
+    if (!opts.jsondata)
+        opts.showtitle = false;
+    var box = this.box = $("#" + opts.listid);
+    box.append("<div class='itemlist' style='height:100%'></div>" + "<div class='ident'></div>" + "<div class='morexy'></div>");
+    var itemlist = box.find(".itemlist");
+    this.itemhtml = function (imgsrc, imgtitle) {
+        var titlebox = opts.showtitle ? '<div class="textbox">' + imgtitle + '</div>' : "";
+        return '<input class="checkbox" name="" type="checkbox" value="">' + '<div class="picbox">' + '<a class="viewimg" href="' + opts.bigherf + imgsrc + '" title="' + imgtitle + '">' + '<img src="' + opts.thumbherf + imgsrc + '" ondragstart="return false;" />' + '</a>' + '</div>' + titlebox
+    }
+    ;
+    var html = '';
+    for (var j = 0; j < opts.imgsrcarr.length; j++) {
+        var vimgsrc = opts.showtitle ? opts.imgsrcarr[j].src : opts.imgsrcarr[j];
+        var vimgtitle = opts.showtitle ? opts.imgsrcarr[j].title : "";
+        html += '<div class="item ' + opts.IdClass + '" id="' + opts.listid + '_item' + j + '" item="' + j + '">' + this.itemhtml(vimgsrc, vimgtitle) + '</div>';
+    }
+    itemlist.html(html);
+    var box_w = box.width();
+    var item_w, item_h, col_len, few_len, imgnum, box_h;
+    this.info = function (fun) {
+        if (item_w === undefined || item_w === null) {
+            item_w = itemlist.find("." + opts.IdClass).outerWidth(true);
+            item_h = itemlist.find("." + opts.IdClass).outerHeight(true);
+            box.find(".ident").css({
+                height: item_h + "px"
+            });
+            box.find(".morexy").css({
+                width: item_w + "px",
+                height: item_h + "px"
+            });
+        }
+        ;
+        imgnum = itemlist.find("." + opts.IdClass).length;
+        col_len = Math.floor(box_w / item_w);
+        few_len = Math.ceil(imgnum / col_len);
+        box_h = item_h * few_len + 20;
+        box.height(box_h + "px");
+        return true;
+    }
+        .bind(this)
+    var draw = this.draw = function (dom, col, few, slidetime) {
+        dom.css({
+            "transition-duration": slidetime + "ms",
+            "transform": "translate(" + col + "px," + few + "px)",
+        });
+    }
+    this.computat = function (index, domid, slidetime) {
+        var item = $("#" + domid);
+        item.attr({
+            "item": index,
+        });
+        if (chekobj[domid] !== undefined) {
+            chekobj[domid] = index;
+        }
+        var col_aliquot = index % col_len;
+        var row_aliquot = Math.floor(index / col_len);
+        var index_col = item_w * (col_aliquot);
+        var index_few = item_h * row_aliquot;
+        this.draw(item, index_col, index_few, slidetime);
+        item.attr({
+            "col": index_col,
+            "few": index_few
+        })
+    }
+        .bind(this)
+    var redraw = this.redraw = function (strati, ilen, slidetime) {
+        for (var j = strati; j < strati + ilen; j++) {
+            this.computat(j, opts.listid + "_item" + itemidarr[j], slidetime);
+        }
+    }
+        .bind(this)
+    if (this.info(this)) {
+        var chekobj = {};
+        var itemidarr = [];
+        this.imgnewarr = [];
+        for (var i = 0; i < imgnum; i++) {
+            itemidarr.push(i)
+        }
+        ;this.redraw(0, itemidarr.length, 0);
+    }
+    $(window).resize(function () {
+        box_w = box.width();
+        if (this.info(this)) {
+            this.redraw(0, itemidarr.length, 0);
+        }
+    }
+        .bind(this));
+    this.datadel = function () {
+        if (!($.isEmptyObject(chekobj))) {
+            for (indexi in chekobj) {
+                var itemi = parseInt(itemlist.find("#" + indexi).attr("item"));
+                var arr2 = [];
+                for (var i = 0; i < itemidarr.length; i++) {
+                    if (i == itemi) {
+                        itemidarr[i] = null;
+                    } else if (itemidarr[i] != null) {
+                        arr2.push(itemidarr[i]);
+                    }
+                    ;
+                }
+                itemlist.find("#" + indexi).remove();
+                delete chekobj.indexi;
+            }
+            itemidarr = arr2;
+        }
+        this.redraw(0, itemidarr.length, 200);
+        this.info(this);
+    }
+        .bind(this)
+    this.dataempty = function () {
+        itemlist.find("." + opts.IdClass).remove();
+        opts.imgsrcarr.length = 0;
+        itemidarr.length = 0;
+        chekobj = {};
+        box_h = "20";
+        box.height(box_h + "px");
+    }
+        .bind(this)
+    this.addimg = function (imgsrc, imgtitle) {
+        if (opts.jsondata) {
+            opts.imgsrcarr.push({
+                src: imgsrc,
+                title: imgtitle
+            });
+        } else {
+            opts.imgsrcarr.push(imgsrc);
+        }
+        var imgnum = opts.imgsrcarr.length - 1;
+        itemidarr.push(imgnum);
+        var titlebox = opts.showtitle ? '<div class="textbox">' + vimgtitle + '</div>' : "";
+        if (imgtitle === undefined)
+            imgtitle = "";
+        itemlist.append('<div class="item ' + opts.IdClass + '" id="' + opts.listid + '_item' + imgnum + '" item="' + imgnum + '">' + this.itemhtml(imgsrc, imgtitle) + '</div>');
+        this.redraw(itemidarr.length - 1, 1, 0);
+        this.info(this);
+    }
+        .bind(this)
+    this.addimgarr = function (imgobj) {
+        if (Object.prototype.toString.call(imgobj) == '[object Array]') {
+            if (opts.jsondata) {
+                if (!((typeof imgobj[0] == 'object') && imgobj[0].constructor == Object)) {
+                    alert("数据格式不正确,请传入json格式数据!");
+                    return;
+                }
+            } else {
+                if (!((typeof imgobj[0] == 'string') && imgobj[0].constructor == String)) {
+                    alert("数据格式不正确,请传入字符串格式数据!");
+                    return;
+                }
+            }
+            for (var i = 0; i < imgobj.length; i++) {
+                if (opts.jsondata) {
+                    if (imgobj[i].title === undefined)
+                        imgobj[i].title = "";
+                    this.addimg(imgobj[i].src, imgobj[i].title);
+                } else {
+                    this.addimg(imgobj[i]);
+                }
+            }
+        }
+    }.bind(this)
+    this.getnewarr = function () {
+        this.imgnewarr.length = 0;
+        for (var i = 0; i < itemidarr.length; i++) {
+            this.imgnewarr.push(opts.imgsrcarr[itemidarr[i]])
+        }
+        console.log(this.imgnewarr);
+        return this.imgnewarr;
+    }
+        .bind(this)
+    itemlist.on("click", "input.checkbox", function () {
+        var thisid = $(this).parents("." + opts.IdClass).attr("id");
+        if ($(this).prop("checked")) {
+            var index = parseInt($(this).parents("." + opts.IdClass).attr("item"));
+            chekobj[thisid] = index;
+        } else {
+            delete chekobj[thisid];
+        }
+    })
+    var startX = null;
+    var startY = null;
+    var moveDom = null;
+    var checkItem = null;
+    var startIndex = null;
+    var isSelected = false;
+    var oldCol = null;
+    var oldFew = null;
+    var identDom = box.find(".ident");
+    var multipleBox = box.find(".morexy");
+    var isDrag = false;
+    var identMobieX = null;
+    var identMobieY = null;
+
+    function mouseinit() {
+        moveDom = null;
+        isDrag = false;
+        checkItem.css({
+            "opacity": "1",
+            "z-index": ""
+        });
+        multipleBox.hide();
+        identDom.hide();
+    }
+
+    function getchekobj() {
+        var domidarr = [];
+        for (var key in chekobj) {
+            domidarr.push("#" + key);
+        }
+        var chekDomObj = $(domidarr.join(','));
+        if (domidarr.length == 0) {
+            chekDomObj = checkItem;
+        }
+        return chekDomObj;
+    }
+
+    $(document).on("mouseup", function () {
+        if (moveDom != null) {
+            draw(moveDom, oldCol, oldFew, 0);
+            mouseinit();
+            if (isSelected) {
+                for (arri in chekobj) {
+                    var elem = $("#" + arri);
+                    draw(elem, elem.attr("col"), elem.attr("few"), 300);
+                }
+            }
+        }
+    })
+    box.on({
+        mousedown: function (e) {
+            e.preventDefault();
+            if (e.target.localName == "input") {
+                return false;
+            }
+            var isIdclass = $(e.target).hasClass(opts.IdClass);
+            var pIdClass = $(e.target).parents("." + opts.IdClass)[0];
+            if (!isIdclass && pIdClass == undefined) {
+                return false;
+            }
+            if (isIdclass) {
+                checkItem = $(e.currentTarget);
+            } else {
+                checkItem = $(pIdClass);
+            }
+            if (checkItem.find("input.checkbox").prop("checked")) {
+                isSelected = true;
+                moveDom = multipleBox;
+            } else {
+                isSelected = false;
+                moveDom = checkItem;
+            }
+            startX = e.pageX;
+            startY = e.pageY;
+            startIndex = parseInt(checkItem.attr("item"));
+            oldCol = parseInt(checkItem.attr("col"));
+            oldFew = parseInt(checkItem.attr("few"));
+            checkItem = getchekobj();
+            checkItem.css({
+                "opacity": "0.8",
+                "z-index": "10"
+            });
+            draw(identDom, oldCol, oldFew, 0);
+        },
+        mousemove: function (e) {
+            if (moveDom == null) {
+                return;
+            }
+            if (e.which != 1) {
+                return;
+            }
+            var gapX = e.pageX - startX;
+            var gapY = e.pageY - startY;
+            var mobiex = oldCol + gapX;
+            var mobiey = oldFew + gapY;
+            if (mobiex > box_w - item_w) {
+                mobiex = box_w - item_w;
+            } else if (mobiex < 0) {
+                mobiex = 0;
+            }
+            if (mobiey > box_h - item_h) {
+                mobiey = box_h - item_h;
+            } else if (mobiey < 0) {
+                mobiey = 0;
+            }
+            if (Math.abs(gapX) > 10 || Math.abs(gapY) > 10) {
+                if (!isDrag) {
+                    if (isSelected) {
+                        draw(moveDom, oldCol, oldFew, 0);
+                        for (arri in chekobj) {
+                            $("#" + arri).css({
+                                "opacity": "0.25",
+                                "z-index": "10"
+                            });
+                            draw($("#" + arri), oldCol, oldFew, 300);
+                        }
+                        moveDom.show();
+                    }
+                }
+                draw(moveDom, mobiex, mobiey, 0);
+                identMobieX = Math.abs(Math.ceil((mobiex - item_w / 2) / item_w));
+                identMobieY = Math.abs(Math.ceil((mobiey - item_h / 2) / item_h));
+                identDom.show();
+                draw(identDom, identMobieX * item_w, identMobieY * item_h, 0);
+                isDrag = true;
+            }
+        },
+        mouseup: function (e) {
+            if (moveDom == null) {
+                return;
+            } else if (isDrag) {
+                draw(moveDom, oldCol, oldFew, 0);
+                var toposion = identMobieY * col_len + identMobieX;
+                if (isSelected) {
+                    var min = itemidarr.length;
+                    var max = 0;
+                    var transsh = [];
+                    for (indexi in chekobj) {
+                        itemlist.find("#" + indexi).css({
+                            "opacity": "1",
+                            "z-index": ""
+                        });
+                        for (var i = 0; i < itemidarr.length; i++) {
+                            if (i == chekobj[indexi]) {
+                                min = i < min ? i : min;
+                                max = i + 1 > max ? i + 1 : max;
+                                transsh.push(itemidarr[i]);
+                                itemidarr[i] = null;
+                            }
+                            ;
+                        }
+                        ;
+                    }
+                    for (var i = 0; i < transsh.length; i++) {
+                        itemidarr.splice(toposion + i, 0, transsh[i]);
+                    }
+                    for (var i = itemidarr.length - 1; i >= 0; i--) {
+                        if (itemidarr[i] == null) {
+                            itemidarr.splice(i, 1);
+                        }
+                        ;
+                    }
+                    min = toposion < min ? toposion : min;
+                    max = toposion > max ? toposion : max;
+                    if (max - min != transsh.length) {
+                        redraw(min, max - min, 200);
+                    } else {
+                        for (arri in chekobj) {
+                            var elem = $("#" + arri);
+                            draw(elem, elem.attr("col"), elem.attr("few"), 300);
+                        }
+                    }
+                } else {
+                    var difference = toposion - startIndex;
+                    if (difference > 1) {
+                        var changesitem = itemidarr.splice(startIndex, 1)[0];
+                        itemidarr.splice(toposion - 1, 0, changesitem);
+                        redraw(startIndex, startIndex + difference, 200);
+                    } else if (difference < 0) {
+                        var changesitem = itemidarr.splice(startIndex, 1)[0];
+                        itemidarr.splice(toposion, 0, changesitem);
+                        difference = Math.abs(difference) + 1;
+                        redraw(toposion, toposion + difference, 200);
+                    }
+                }
+                mouseinit();
+            }
+        },
+        mouseleave: function (e) {
+            if (moveDom == null) {
+                return;
+            }
+        },
+    })
+    var ismove = false;
+    var eimgx, eimgy;
+    itemlist.on({
+        click: function (e) {
+            e.preventDefault();
+            if (!ismove) {
+                var item = parseInt($(this).parents("." + opts.IdClass).attr("item"));
+                if (opts.viewimg) {
+                    chakshow(item)
+                }
+            }
+        },
+        mousedown: function (e) {
+            eimgx = e.pageX;
+            eimgy = e.pageY;
+            ismove = false;
+        },
+        mouseup: function (e) {
+            eimgx = Math.abs(e.pageX - eimgx);
+            eimgy = Math.abs(e.pageY - eimgy);
+            ismove = false;
+            if (eimgx > 5 || eimgy > 5)
+                ismove = true;
+        },
+        mouseleave: function () {
+            ismove = false;
+        },
+    }, "a");
+    if (opts.viewimg) {
+        var chak_btn = "";
+        if (opts.view_toggle)
+            chak_btn += '<button class="chak_prev">上一个</button><button class="chak_next">下一个</button>';
+        if (opts.view_rotate)
+            chak_btn += '<button class="chak_turn_l">向左转</button><button class="chak_turn_r">向右转</button>';
+        chak_btn += '<button class="chak_close">关闭</button>';
+        box.append('<div class="chak_box">' + '<div class="chak_title"></div>' + '<div class="chak_img">' + '<img draggable="false" src="" ondragstart="return false;" />' + '<p></p></div>' + '<div class="chak_btn">' + chak_btn + '</div>' + '</div>');
+        var chak_box = box.find(".chak_box");
+        chak_box.on({
+            click: function (e) {
+                chakhide();
+            }
+        });
+        chak_box.find(".chak_img > img").on({
+            click: function (e) {
+                e.stopPropagation();
+            }
+        });
+        if (opts.view_toggle) {
+            chak_box.find(".chak_prev").on({
+                click: function (e) {
+                    e.stopPropagation();
+                    var item = parseInt(chak_box.find(".chak_img").attr("item")) - 1;
+                    chakshow(item);
+                }
+            });
+            chak_box.find(".chak_next").on({
+                click: function (e) {
+                    e.stopPropagation();
+                    var item = parseInt(chak_box.find(".chak_img").attr("item")) + 1;
+                    chakshow(item);
+                }
+            });
+        }
+        ;
+        var isview = false;
+        var pisshow = false;
+        var chakshow = function (imgitem) {
+            isview = true;
+            var chak_ptog = function (text) {
+                var chak_p = chak_box.find(".chak_img > p");
+                if (!pisshow) {
+                    pisshow = true;
+                    chak_p.html(text).show();
+                    setTimeout(function () {
+                        pisshow = false;
+                        chak_p.hide();
+                    }, 1000);
+                }
+            }
+            if (imgitem < 0) {
+                chak_ptog("已经是第一张图片");
+                return;
+            } else if (imgitem > itemidarr.length - 1) {
+                chak_ptog("已经是最后一张图片");
+                return;
+            } else {
+                chak_box.find(".chak_img > p").hide()
+            }
+            var viewimgdom = itemlist.find("." + opts.IdClass + "[item='" + imgitem + "'] .viewimg")
+            var imgsrc = viewimgdom.attr("href");
+            var imgtitle = viewimgdom.attr("title");
+            chak_box.find(".chak_img").attr("item", imgitem);
+            chak_box.find(".chak_img > img").attr({
+                "src": imgsrc,
+                "style": ""
+            });
+            chak_box.find(".chak_title").html(imgtitle);
+            $("body").css({
+                "overflow": "hidden"
+            });
+            $("body", parent.document).css({
+                "overflow": "hidden"
+            });
+            chak_box.show();
+        };
+        var chakhide = this.chakhide = function () {
+                isview = false;
+                chak_box.find(".chak_img").attr("item", "");
+                chak_box.find(".chak_img > img").attr("src", "");
+                $("body").css({
+                    "overflow": "auto"
+                });
+                chak_box.hide();
+            }
+        ;
+        if (opts.view_zoom) {
+            var viewimg_zoom = function (solls, zoomval) {
+                var imgdom = chak_box.find(".chak_img > img");
+                var img = new Image();
+                img.src = imgdom.attr("src");
+                var imgWidth = img.width;
+                var ckimg_w = parseInt(imgdom.width());
+                imgdom.css({
+                    "max-width": imgWidth + "px",
+                    "max-height": "none"
+                });
+                solls > 0 ? ckimg_w += zoomval : ckimg_w -= zoomval;
+                imgdom.css({
+                    "width": ckimg_w + "px"
+                });
+            };
+            chak_box.find(".chak_img > img").on({
+                click: function (event) {
+                    event.stopPropagation();
+                },
+                mousedown: function (e) {
+                    viewmove = true;
+                    var marginx = parseInt($(this).css("margin-left"));
+                    var marginy = parseInt($(this).css("margin-top"));
+                    var _x = e.pageX - marginx;
+                    var _y = e.pageY - marginy;
+                    $(this).off("mousemove").on({
+                        mousemove: function (e) {
+                            if (viewmove) {
+                                var x = e.pageX - _x;
+                                var y = e.pageY - _y;
+                                $(this).css({
+                                    "margin-top": y + "px",
+                                    "margin-left": x + "px"
+                                });
+                            }
+                        }
+                    });
+                },
+                mouseup: function (e) {
+                    viewmove = false;
+                },
+                mouseout: function (e) {
+                    viewmove = false;
+                },
+            });
+            $(document).on('mousewheel', function (event) {
+                if (isview) {
+                    var solls = event.originalEvent.wheelDelta;
+                    viewimg_zoom(solls, 50);
+                }
+            });
+            document.addEventListener("DOMMouseScroll", function (event) {
+                if (isview) {
+                    var solls = event.detail;
+                    solls = 0 - solls;
+                    viewimg_zoom(solls, 50);
+                }
+            });
+        }
+        ;
+        if (opts.view_rotate) {
+            function getmatrix(a, b, c, d, e, f) {
+                var aa = Math.round(180 * Math.asin(a) / Math.PI);
+                var bb = Math.round(180 * Math.acos(b) / Math.PI);
+                var cc = Math.round(180 * Math.asin(c) / Math.PI);
+                var dd = Math.round(180 * Math.acos(d) / Math.PI);
+                var deg = 0;
+                if (aa == bb || -aa == bb) {
+                    deg = dd;
+                } else if (-aa + bb == 180) {
+                    deg = 180 + cc;
+                } else if (aa + bb == 180) {
+                    deg = 360 - cc || 360 - dd;
+                }
+                return deg >= 360 ? 0 : deg;
+            }
+
+            var chak_turn = function (dom, step) {
+                var _img = chak_box.find(".chak_img > img");
+                var deg = eval('get' + _img.css('transform'));
+                _img.css({
+                    'transform': 'translate(-50%,-50%) rotate(' + (deg + step) % 360 + 'deg)'
+                });
+                dom.attr({
+                    "disabled": "true"
+                });
+                setTimeout(function () {
+                    dom.removeAttr("disabled");
+                }, 60)
+            }
+            chak_box.find(".chak_turn_l").on({
+                click: function (e) {
+                    e.stopPropagation();
+                    chak_turn($(this), -90)
+                }
+            });
+            chak_box.find(".chak_turn_r").on({
+                click: function (e) {
+                    e.stopPropagation();
+                    chak_turn($(this), 90)
+                }
+            });
+        }
+    }
+}

+ 11 - 11
08.src/Xingxi/xingxi-admin/src/main/resources/templates/master/product/prod/add.html

@@ -30,7 +30,7 @@
             </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">
                         <select name="ipId" class="form-control m-b" th:with="ipInfos=${@ipInfo.getIpInfos()}" >
                             <option value="">所有</option>
@@ -50,16 +50,16 @@
                     </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">
-                        <img id="picUrlImg" width="30%" height="30%">
-                        <input type="file" class="form-control" name="picUrlImgUrl" id="picUrlImgUrl" accept="image/*"/>
-                        <input type="hidden" lass="form-control" name="picUrl" id="picUrl" />
-                    </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">-->
+<!--                        <img id="picUrlImg" width="30%" height="30%">-->
+<!--                        <input type="file" class="form-control" name="picUrlImgUrl" id="picUrlImgUrl" accept="image/*"/>-->
+<!--                        <input type="hidden" lass="form-control" name="picUrl" id="picUrl" />-->
+<!--                    </div>-->
+<!--                </div>-->
+<!--            </div>-->
             <div class="col-xs-12">
                 <div class="form-group">
                     <label class="col-sm-3 control-label">商品描述:</label>

+ 31 - 17
08.src/Xingxi/xingxi-admin/src/main/resources/templates/master/product/prod/prod.html

@@ -25,28 +25,36 @@
                             <input type="text" class="form-control" name="prodName">
                         </div>
                         <div style="margin-left: 15px; width: 100px; float: left;">
-                            <label class="control-label">文创名称:</label>
+                            <label class="control-label">文创品牌:</label>
                         </div>
                         <div style="width: 150px; float: left;">
-                            <input type="text" class="form-control" name="ipName">
-                        </div>
-                        <div style="margin-left: 15px; width: 100px; float: left;">
-                            <label class="control-label">设计师名称:</label>
-                        </div>
-                        <div style="width: 150px; float: left;">
-                            <input type="text" class="form-control" name="designerName">
-                        </div>
-                        <div style="margin-left: 15px; width: 100px; float: left;">
-                            <label class="control-label">商品描述:</label>
-                        </div>
-                        <div style="width: 150px; float: left;">
-                            <input type="text" class="form-control" name="description">
+<!--                            <input type="text" class="form-control" name="ipName">-->
+                            <select name="ipId" class="form-control m-b" th:with="ips=${@product.getIpInfos()}" >
+                                <option value="">所有</option>
+                                <option th:each="ip : ${ips}" th:text="${ip.ipName}" th:value="${ip.ipId}"></option>
+                            </select>
                         </div>
+<!--                        <div style="margin-left: 15px; width: 100px; float: left;">-->
+<!--                            <label class="control-label">设计师名称:</label>-->
+<!--                        </div>-->
+<!--                        <div style="width: 150px; float: left;">-->
+<!--                            <input type="text" class="form-control" name="designerName">-->
+<!--                        </div>-->
+<!--                        <div style="margin-left: 15px; width: 100px; float: left;">-->
+<!--                            <label class="control-label">商品描述:</label>-->
+<!--                        </div>-->
+<!--                        <div style="width: 150px; float: left;">-->
+<!--                            <input type="text" class="form-control" name="description">-->
+<!--                        </div>-->
                         <div style="margin-left: 15px; width: 100px; float: left;">
                             <label class="control-label">商品状态:</label>
                         </div>
                         <div style="width: 150px; float: left;">
-                            <input type="text" class="form-control" name="prodStatus">
+<!--                            <input type="text" class="form-control" name="prodStatus">-->
+                            <select name="prodStatus" class="form-control m-b" th:with="prodStatuses=${@dict.getType('prod_status')}" >
+                                <option value="">所有</option>
+                                <option th:each="prodStatus : ${prodStatuses}" th:text="${prodStatus.dictLabel}" th:value="${prodStatus.dictValue}"></option>
+                            </select>
                         </div>
                         <div style="margin-left: 15px; float: left;">
                             <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
@@ -119,12 +127,13 @@
                         align: 'center',
                         formatter: function(value, row, index) {
                             var actions = [];
-                            if (row.prodStatus === 'SAVED') {
+                            if (row.prodStatus === 'SAVED' || row.prodStatus === 'REJECTED') {
                                 actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                                 actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> ');
                                 actions.push('<a class="btn btn-warning btn-xs ' + editAttrFlag + '" href="javascript:void(0)" onclick="editAttr(\'' + row.id + '\')"><i class="fa fa-at"></i>编辑属性</a> ');
-                                actions.push('<a class="btn btn-info btn-xs ' + editTagFlag + '" href="javascript:void(0)" onclick="editTag(\'' + row.id + '\')"><i class="fa fa-info"></i>编辑标签</a> ');
+                                // actions.push('<a class="btn btn-info btn-xs ' + editTagFlag + '" href="javascript:void(0)" onclick="editTag(\'' + row.id + '\')"><i class="fa fa-info"></i>编辑标签</a> ');
                                 actions.push('<a class="btn btn-primary btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="editPic(\'' + row.id + '\')"><i class="fa fa-file-picture-o"></i>商品图片</a> ');
+                                actions.push('<a class="btn btn-info btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="submitt(\'' + row.id + '\')"><i class="fa fa-file-picture-o"></i>提交</a> ');
                             }
                             if (row.prodStatus === 'SUBMITTED') {
                                 actions.push('<a class="btn btn-warning btn-xs ' + approveFlag + '" href="javascript:void(0)" onclick="approve(\'' + row.id + '\')"><i class="fa fa-thumbs-o-up"></i>审核</a> ');
@@ -150,6 +159,11 @@
             $.modal.openTab("商品图片信息", ctx + "master/product/prodPic/editPic/" + id);
         }
 
+        function submitt(id) {
+            $.modal.confirm("确认提交该商品吗?", function() {
+                $.operate.post(prefix + "/submitt", {"id": id});
+            });
+        }
         function approve(id) {
             $.modal.confirm("确认同意该商品的申请吗?", function() {
                 $.operate.post(prefix + "/approve", {"id": id});