$(function(){ tabFlagMap["randomBag"] = false; tabFuncMap.randomBag = function(){ var index = 1 ; $.each(itemrandombag,function(itemId,randombagId){ var itemMap = itemtable[itemId]; //实在没有,直接返回 if(!itemMap){ console.log("缺少数据,直接返回,ID:"+itemId); return ; } var randomMap = randombagodds[randombagId]; var randomIndex = -1; if(!randomMap){ console.log("宝箱ID不存在:"+randombagId); return ; } var tr = $(""); $("#randomBagTable tbody").append(tr); var x = parseInt(itemMap.ICON%15); var y = parseInt(itemMap.ICON/15); var icon = $("
"); var mtpis=getMtpis(itemMap.DESCRIPT); mtpisListener(icon,mtpis); icon.append(""+itemMap["PY"]+""); var indexTd = $(""+index+""); var equipLevelDiv = $("
Lv:"+itemMap["Level"]+"
"); var randomName = $("" + itemMap.NAME+"").append(equipLevelDiv); randomName.prepend(icon); tr.append($(""+randomMap.INDEX+"")); tr.append(indexTd); //tr.append(icon); tr.append(randomName); icon.append(""+randomMap["PY"]+""); var headArr = ["物品Id1","物品ID2","物品ID3","物品ID4","物品Id5","物品ID6","物品Id7","物品Id8"]; var itemTd = $(""); tr.append(itemTd); //去掉重复物品显示 var hasArr = {}; for(var i=0;i"); itemTd.append(itemDiv); if(item && item.type1 == "203"){ itemDiv.append(item203Tips(item)); }else{ itemDiv.append(findMapTips(itemIdHas)); } } } //来源 var itemFrom = $(""); $.each(itemMap.SOURCE_FROM,function(key,sourceId){ //是否有隐藏产物的配方来源 if(hideProduct[sourceId]){ return; } itemFrom.append($("
").append(findMapTips(sourceId))); }); tr.append(itemFrom); index++; }); /*randomBag*/ $('#randomBagTable').dataTable( { "pagingType": "full_numbers", "language": { "lengthMenu": "每页 _MENU_ 条记录", "zeroRecords": "没有找到法宝技能,难道我遗漏了?!", "info": "第 _PAGE_ 页 ( 总共 _PAGES_ 页 )", "infoEmpty": "没有法宝技能", "infoFiltered": "(从 _MAX_ 条宝箱过滤)", "search": "搜索(可用名称首字母):", "paginate": { "first": "首页(W)", "last": "末页(S)", "next": "下一页(D)", "previous": "上一页(A)" }, }, // 默认按照索引排序,且隐藏索引列 "order": [[ 0, "asc" ]], "columnDefs": [ { "targets": [ 0 ], "visible": false, "searchable": false }, ] }); $('#randomBagTable th').css("text-align","center"); } });