From 47e23cf659d4cc58bc93b44b16e64e82efcfb08d Mon Sep 17 00:00:00 2001 From: zhibing.pu <393733352@qq.com> Date: 星期三, 24 七月 2024 17:34:27 +0800 Subject: [PATCH] Merge branch '2.0' of http://120.76.84.145:10101/gitblit/r/java/PlayPai into 2.0 --- cloud-server-management/src/main/webapp/static/modular/system/tShop/tShopOther.js | 78 ++++++++++++++++++++++++++++++++++++++- 1 files changed, 76 insertions(+), 2 deletions(-) diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tShop/tShopOther.js b/cloud-server-management/src/main/webapp/static/modular/system/tShop/tShopOther.js index 0302161..947d00e 100644 --- a/cloud-server-management/src/main/webapp/static/modular/system/tShop/tShopOther.js +++ b/cloud-server-management/src/main/webapp/static/modular/system/tShop/tShopOther.js @@ -15,6 +15,7 @@ TCompetition.initColumn = function () { return [ {field: 'selectItem', radio: true}, + {title: '序号', field: 'id', visible: true, align: 'center', valign: 'middle'}, {title: '板块名称', field: 'name', visible: role==1?true:false, align: 'center', valign: 'middle', }, {title: '排序', field: 'sort', visible: role==1?true:false, align: 'center', valign: 'middle', @@ -101,6 +102,19 @@ fix: false, //不固定 maxmin: true, content: Feng.ctxPath + '/tShop/tShop_update/' + TCompetition.seItem.id + }); + this.layerIndex = index; + } +}; +TCompetition.openTCompetitionDetail1 = function () { + if (this.check()) { + var index = layer.open({ + type: 2, + title:'编辑', + area: ['100%', '100%'], //宽高 + fix: false, //不固定 + maxmin: true, + content: Feng.ctxPath + '/tShop/tShop_update1/' + TCompetition.seItem.id }); this.layerIndex = index; } @@ -243,6 +257,18 @@ ajax.start(); } }; +TCompetition.del = function () { + if (this.check()) { + var ajax = new $ax(Feng.ctxPath + "/tShop/del", function (data) { + Feng.success("删除成功!"); + TCompetition.table.refresh(); + }, function (data) { + Feng.error("删除失败!" + data.responseJSON.message + "!"); + }); + ajax.set("id",this.seItem.id); + ajax.start(); + } +}; TCompetition.unfreeze = function () { if (this.check()) { var ajax = new $ax(Feng.ctxPath + "/tShop/unfreeze", function (data) { @@ -252,6 +278,19 @@ Feng.error("解冻失败!" + data.responseJSON.message + "!"); }); ajax.set("id",this.seItem.id); + ajax.start(); + } +}; +TCompetition.unfreeze1 = function (e) { + if (this.check()) { + var ajax = new $ax(Feng.ctxPath + "/tShop/unfreeze1", function (data) { + Feng.success("操作成功!"); + TCompetition.table.refresh(); + }, function (data) { + Feng.error("操作失败!" + data.responseJSON.message + "!"); + }); + ajax.set("id",this.seItem.id); + ajax.set("type",e); ajax.start(); } }; @@ -273,8 +312,12 @@ }; +TCompetition.close = function() { + parent.layer.close(parent.layer.getFrameIndex(window.name)); +}; + TCompetition.saveAllImg = function (e) { - var id = $("#id").val() + var id1 = $("#id").val() var px1 = $("#px1").val() var px2 = $("#px2").val() var px3 = $("#px3").val() @@ -299,6 +342,28 @@ var r6 = document.querySelector('input[name="r6"]').checked; var r7 = document.querySelector('input[name="r7"]').checked; var r8 = document.querySelector('input[name="r8"]').checked; + + var json1=[]; + for (let i = 0; i < $('input[name="px9"]').length; i++) { + var arr = {} + var id = $($('input[name="cupId"]')[i]).val() + console.log(i+$("#"+id).val()) + var str = $("#"+id).val(); + if($("#"+id).val() == null || $("#"+id).val() == ""){ + arr['backgroundImage'] = $($('input[name="backgroundImage"]')[i]).val(); + }else { + arr['backgroundImage'] = str; + } + if(document.querySelector('input[name="'+ id +'"]').checked){ + arr['isOpen'] = 1; + }else { + arr['isOpen'] = 0; + } + arr['sort'] = Number($($('input[name="px9"]')[i]).val()); + arr['id'] = Number($($('input[name="cupId"]')[i]).val()); + console.log(arr) + json1.push(arr) + } if(r1){ r1 =1 }else{ @@ -343,6 +408,7 @@ var ajax = new $ax(Feng.ctxPath + "/tShop/saveImgAll", function(data){ if(data.code == 200){ Feng.success("保存成功!"); + TCompetition.close(); }else{ Feng.error(data.msg); } @@ -350,7 +416,7 @@ Feng.error("保存失败!" + data.responseJSON.message + "!"); }); - ajax.set("id",id); + ajax.set("id",id1); ajax.set("px1",px1); ajax.set("px2",px2); ajax.set("px3",px3); @@ -375,6 +441,7 @@ ajax.set("r6",r6); ajax.set("r7",r7); ajax.set("r8",r8); + ajax.set("str",JSON.stringify(json1)); ajax.start(); } @@ -444,6 +511,13 @@ var carPhoto = new $WebUpload("c8"); carPhoto.setUploadBarId("progressBar"); carPhoto.init(); + + for (let i = 0; i < $('input[name="px9"]').length; i++) { + var id = $($('input[name="cupId"]')[i]).val() + var carPhoto = new $WebUpload(id); + carPhoto.setUploadBarId("progressBar"); + carPhoto.init(); + } var carPhoto = new $WebUpload("img"); carPhoto.setUploadBarId("progressBar"); carPhoto.init(); -- Gitblit v1.7.1