提交 6f8de669 authored 作者: 潘鹏's avatar 潘鹏

activity

上级 8dd931a7
...@@ -18,6 +18,7 @@ import org.springframework.web.multipart.MultipartFile; ...@@ -18,6 +18,7 @@ import org.springframework.web.multipart.MultipartFile;
import java.io.IOException; import java.io.IOException;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -324,5 +325,6 @@ public class TbCfStationItemController extends ApiBaseAction { ...@@ -324,5 +325,6 @@ public class TbCfStationItemController extends ApiBaseAction {
int total = tbCfStationItemService.countItemByIds(idArr); int total = tbCfStationItemService.countItemByIds(idArr);
PageUtils pageUtil = new PageUtils(itemList, total, query.getLimit(), query.getPage()); PageUtils pageUtil = new PageUtils(itemList, total, query.getLimit(), query.getPage());
return R.ok().put("page", pageUtil); return R.ok().put("page", pageUtil);
} }
} }
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
<foreach item="itemId" collection="ids" open="(" separator="," close=")"> <foreach item="itemId" collection="ids" open="(" separator="," close=")">
#{itemId} #{itemId}
</foreach> </foreach>
<if test="offset != null and limit != null"> <if test="page != null and limit != null">
limit #{page}, #{limit} limit #{page}, #{limit}
</if> </if>
</select> </select>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#jdbc.username=root #jdbc.username=root
#jdbc.password=diaoyun666 #jdbc.password=diaoyun666
jdbc.url: jdbc:mysql://159.138.48.71:3306/test?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false jdbc.url: jdbc:mysql://159.138.48.71:3306/chinafrica_ref?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false
jdbc.username: root jdbc.username: root
jdbc.password: Diaoyunnuli.8 jdbc.password: Diaoyunnuli.8
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#jdbc.username=root #jdbc.username=root
#jdbc.password=diaoyun666 #jdbc.password=diaoyun666
jdbc.url: jdbc:mysql://159.138.48.71:3306/test?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false jdbc.url: jdbc:mysql://159.138.48.71:3306/chinafrica_ref?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false
jdbc.username: root jdbc.username: root
jdbc.password: Diaoyunnuli.8 jdbc.password: Diaoyunnuli.8
......
...@@ -179,7 +179,7 @@ let vm = new Vue({ ...@@ -179,7 +179,7 @@ let vm = new Vue({
vm.changeGoodstype(); vm.changeGoodstype();
vm.changeGoodstype2(); vm.changeGoodstype2();
vm.clearItemids(1); vm.clearItemids(1);
vm.AllItems(); // vm.AllItems();
} }
}); });
}, },
...@@ -279,9 +279,18 @@ let vm = new Vue({ ...@@ -279,9 +279,18 @@ let vm = new Vue({
}, },
clearItemids(i){ clearItemids(i){
if(i==1){ if(i==1){
vm.activity.itemIds = vm.activity.itemIds.split(',') if(vm.activity.itemIds){
vm.activity.itemIds = vm.activity.itemIds.split(',')
}else {
vm.activity.itemIds = []
}
}else if(i==0){ }else if(i==0){
vm.activity.itemIds = vm.activity.itemIds.toString() if(vm.activity.itemIds.length>0){
vm.activity.itemIds = vm.activity.itemIds.toString()
}else {
vm.activity.itemIds = null
}
} }
}, },
addCondition(){ addCondition(){
...@@ -422,7 +431,7 @@ let vm = new Vue({ ...@@ -422,7 +431,7 @@ let vm = new Vue({
return; return;
} }
console.log(ids) console.log(ids)
// console.log(vm.activity.itemIds)
ids.forEach(item=>{ ids.forEach(item=>{
vm.activity.itemIds.push(item) vm.activity.itemIds.push(item)
}) })
...@@ -451,41 +460,50 @@ let vm = new Vue({ ...@@ -451,41 +460,50 @@ let vm = new Vue({
// }); // });
}, },
AllItems(){ AllItems(){
console.log(vm.Allitemids) // console.log(vm.activity.itemIds)
$("#adItemjqGrid").Grid({ Ajax.request({
url: '../tbcfstationitem/queryItemByIds', url: "../tbcfstationitem/queryItemByIds?page=1&limit=10&sidx=&order=",
colModel: [ async: true,
{label: 'itemId', name: 'itemId', key: true, index: 'item_id', hidden: true}, type: "POST",
{label: '序号', name: 'itemSort', index: 'itemSort', width: 100}, params: JSON.stringify(vm.activity.itemIds),
{label: '商品图片', name: 'itemImg', index: 'item_img', width: 100, formatter: imageFormat}, contentType: "application/json",
{label: '商品编号', name: 'itemCode', index: 'item_code', width: 160}, successCallback: function (r) {
{label: '商品名称', name: 'itemName', index: 'item_name', width: 160}, console.log(r)
/* {label: '商品标题', name: 'itemBrief', index: 'item_brief', width: 120},*/ }
/*{label: '商品链接', name: 'itemUrl', index: 'item_url', width: 80,formatter:linkFormat},*/
{label: '商品原价', name: 'itemPrice', index: 'item_price', width: 100},
{label: '商品现价', name: 'discountPrice', index: 'discount_price', width: 100},
/*{label: '所属平台', name: 'platformCode', index: 'platform_code', width: 80},
{label: '平台名', name: 'platformName', index: 'platform_name', width: 80},*/
{label: '供应商', name: 'supplier', index: 'supplier', width: 120},
{label: '商品一级分类', name: 'goodtype', index: 'goodtype', width: 120},
{label: '商品二级分类', name: 'title', index: 'title', width: 120},
{label: '商品品名', name: 'dname', index: 'itemDescritionId', width: 120},
{
label: '操作', index: 'operate', width: 160, formatter: function (value, grid, rows) {
return '<span class="label label-info pointer" onclick="vm.delItem(\'' + rows.itemId + '\')">移除</span>&nbsp;&nbsp;'
// '<span class="label label-info pointer" onclick="vm.sortItem(\'' + rows.itemId + '\')">排序</span>&nbsp;&nbsp;'
}
} // beforeSelectRow: beforeSelectRow,
],
multiboxonly: true,
postData: {"value":vm.activity.itemIds.toString()},
mtype:"POST",
datatype:'json',
// beforeSelectRow: beforeSelectRow,
}); });
// $("#adItemjqGrid").Grid({
// url: '../tbcfstationitem/queryItemByIds',
// colModel: [
// {label: 'itemId', name: 'itemId', key: true, index: 'item_id', hidden: true},
// {label: '序号', name: 'itemSort', index: 'itemSort', width: 100},
// {label: '商品图片', name: 'itemImg', index: 'item_img', width: 100, formatter: imageFormat},
// {label: '商品编号', name: 'itemCode', index: 'item_code', width: 160},
// {label: '商品名称', name: 'itemName', index: 'item_name', width: 160},
// /* {label: '商品标题', name: 'itemBrief', index: 'item_brief', width: 120},*/
// /*{label: '商品链接', name: 'itemUrl', index: 'item_url', width: 80,formatter:linkFormat},*/
// {label: '商品原价', name: 'itemPrice', index: 'item_price', width: 100},
// {label: '商品现价', name: 'discountPrice', index: 'discount_price', width: 100},
// /*{label: '所属平台', name: 'platformCode', index: 'platform_code', width: 80},
// {label: '平台名', name: 'platformName', index: 'platform_name', width: 80},*/
// {label: '供应商', name: 'supplier', index: 'supplier', width: 120},
// {label: '商品一级分类', name: 'goodtype', index: 'goodtype', width: 120},
// {label: '商品二级分类', name: 'title', index: 'title', width: 120},
// {label: '商品品名', name: 'dname', index: 'itemDescritionId', width: 120},
// {
// label: '操作', index: 'operate', width: 160, formatter: function (value, grid, rows){
// return '<span class="label label-info pointer" onclick="vm.delItem(\'' + rows.itemId + '\')">移除</span>&nbsp;&nbsp;'
// // '<span class="label label-info pointer" onclick="vm.sortItem(\'' + rows.itemId + '\')">排序</span>&nbsp;&nbsp;'
// }
// } // beforeSelectRow: beforeSelectRow,
//
// ],
// multiboxonly: true,
// postData: {value:vm.activity.itemIds.toString()},
// // postData:vm.activity.itemIds.toString(),
// mtype:"POST",
// datatype:'json',
// // beforeSelectRow: beforeSelectRow,
// });
} }
}, },
created(){ created(){
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论