1var asinArr = [];//ç»ææ°ç» 2var dom = !$('#page-type').length; 3var isAba = dom ? 20 : 100; 4var leaveAsin = isAba; 5var placeholderText = 'å©ä½å¯è¾å ¥'+leaveAsin+'个ASIN',defultText = 'ASINæäº§å龿¥ï¼å¦ï¼B00FLYWNYQï¼æå¤'+ (dom ? 20 : 100) +'个ï¼å¯ç´æ¥ä»txtæExcelæåå¤å¶ç²è´´'; 6function fIsBAsin(asin) { 7 return /^[B|b]0[a-zA-Z0-9]{8,10}$/.test(asin); 8} 9function fIsAsin(asin) { 10 return fIsBAsin(asin) || /^[0-9]{7,11}[a-zA-Z0-9]{1,2}$/.test(asin); 11} 12 13function getInputChange(event, type) { 14 if (type) { 15 var arr = event.split(' '); 16 } else { 17 var arr = event.target.value.split(' '); 18 } 19 var list = [];//è¾å ¥ 20 for (j = 0; j < arr.length; j++) { 21 // console.log(arr[j]); 22 //æ§å¶è¾å ¥æ°é 23 if (asinArr.length >= isAba) break;// && fIsAsin(arr[j]) 24 if (!asinArr.includes(arr[j])) { 25 if(fIsAsin(arr[j].split("\t")[0].toUpperCase())){ 26 asinArr.push(arr[j].split("\t")[0].toUpperCase()); 27 list.push(arr[j].split("\t")[0].toUpperCase()) 28 } 29 } 30 } 31 if (!list.length) return; 32 leaveAsin = leaveAsin - list.length; 33 var div = '' 34 for (var i = 0; i < asinArr.length; i++) { 35 // if(fIsAsin(asinArr[i])){iconfont icon-shanchu 36 div += `<span class="tag-asin">` + asinArr[i] + `<i class="asin-del">x</i></span>` 37 // } 38 }; 39 leastAsin (); 40 $('#dialog-batch-input-asin').val(''); 41 $('.input-tag-asins-box').find('.tag-asin').remove(); 42 $('#dialog-batch-input-asin').before(div); 43 $('#dialog-batch-input-asin').attr('placeholder', placeholderText); 44 singleDel(); 45} 46function leastAsin(){ 47 switch (window.GLOBAL_MOMENT_LANGUAGE) { 48 case 'en': 49 placeholderText = `${(dom ? 20 : 100)-leaveAsin}/${(dom ? 20 : 100)}`; 50 defultText = 'Enter up to '+ (dom ? 20 : 100) + ' product ASINs'; 51 break; 52 case 'jp': 53 placeholderText =`${(dom ? 20 : 100)-leaveAsin}/${(dom ? 20 : 100)}ã®ASINãè¨å ¥ããã¾ãã`; 54 defultText = 'ASINã¾ãã¯ååãªã³ã¯(æå¤§'+ (dom ? 20 : 100) +'å)ä¾:B00FLYWNYQãç´æ¥txtã¾ãã¯Excelããåãã¨ã«ã³ãããããã¨ãã§ãã¾ãã'; 55 break; 56 default: 57 placeholderText = `å·²å½å ¥${(dom ? 20 : 100)-leaveAsin}/${(dom ? 20 : 100)}个ASIN`; 58 defultText = 'ASINæäº§å龿¥ï¼å¦ï¼B00FLYWNYQï¼æå¤'+ (dom ? 20 : 100) +'个ï¼å¯ç´æ¥ä»txtæExcelæåå¤å¶ç²è´´'; 59 break; 60 } 61} 62// å个asinå é¤ 63function singleDel() { 64 $('.input-tag-asins-box').on('click', '.asin-del', function () { 65 let asin = $(this).parent('.tag-asin').text(); 66 let index = asinArr.indexOf(asin); 67 var spliceArr = asinArr.splice(index, 1); 68 $(this).parent('.tag-asin').remove(); 69 leaveAsin = leaveAsin + 1; 70 leastAsin(); 71 $('#dialog-batch-input-asin').attr('placeholder', placeholderText); 72 }) 73} 74$(function () { 75 // æ¥è¯¢åå² 76 var module = ''; 77 $('#queryHistory').click(function () { 78 module = $(this).attr('data-module').replace(/\s*/g, "") 79 terminal = $(this).attr('data-terminal').replace(/\s*/g, "") 80 $('#sidebar-history').show() 81 window.getAccount.getAccount() 82 if (module == 'CL' || module == 'PR') { 83 loadQueryHistoryLogs(1, module, module) 84 } else { 85 loadQueryHistoryLogs(1, module) 86 } 87 88 }); 89 // åè´¦å·çé 90 $('.account-dropdown-menu').on('click', '.dropdown-item', function (e) { 91 $('#dropdownMenuButton').text($(this).text()) 92 $('.account-dropdown-menu').hide() 93 var page = 1; 94 var id = $(this).attr('data-accountid'); 95 // æ¥ç«å CL 96 // é产å PR 97 if (module == 'CL' || module == 'PR') { 98 loadQueryHistoryLogs(page, module, module, id) 99 } else { 100 loadQueryHistoryLogs(page, module, '', id) 101 } 102 103 }) 104 //æ¥è¯¢åå² 105 function loadQueryHistoryLogs(page, module, isModule, id) { 106 if (!page) page = 1; 107 if (!id) id = '' 108 if (!isModule) isModule = '' 109 var t; 110 if (terminal == 'W' || terminal == 'E') { 111 t = terminal; 112 } else { 113 t = null; 114 } 115 page = parseInt(page, 10); 116 page = page - 1; 117 var pageSize = 20; 118 $('#querylog-pg-nv').html(''); 119 $.ajax({ 120 type: "post", 121 url: "/v2/query-log/history", 122 data: { 123 "startIndex": pageSize * page, 124 "parentModule": module, 125 "module": isModule, 126 "terminal": t, 127 "familyClientId": id 128 }, 129 cache: false, 130 async: true, 131 dataType: "json", 132 beforeSend: function () { 133 $('#querylog-tbody').html($('#querylog-tbody-loading').tmpl({})); 134 $('#querylog-op-tbody').hide(); 135 } 136 }).then(function (ajaxData) { 137 $('#querylog-tbody-loading').hide() 138 $('#querylog-tbody').html(''); 139 if (ajaxData && ajaxData.code == "OK" && ajaxData.data) { 140 //æ¥è¯¢æ ç»æ 141 if (!ajaxData.data.items || ajaxData.data.items.length <= 0) { 142 $('#querylog-tbody').html($('#querylog-tbody-noitem-tmp').tmpl({})); 143 $('#querylog-op-tbody').hide(); 144 return; 145 } 146 $('#querylog-tbody').html($('#querylog-tbody-tmp').tmpl({ 147 pg: ajaxData.data 148 })); 149 $('#querylog-pg-nv').html($('#querylog-pg-nv-tmp').tmpl({ 150 pg: ajaxData.data 151 })); 152 $('#querylog-op-tbody').show(); 153 //tooltip 154 $('[data-tips]').each(tips_popover); 155 //å页æé®ç¹å»äºä»¶ 156 $('#querylog-pg-nv').find('.page-item').unbind('click').bind('click', function (e) { 157 e.stopPropagation(); 158 var page = $(this).attr('data-page'); 159 if (module == 'CL' || module == 'PR') { 160 loadQueryHistoryLogs(page, module, module, id) 161 } else { 162 loadQueryHistoryLogs(page, module, '', id) 163 } 164 }); 165 } else { 166 swal({ 167 title: 'æä½å¤±è´¥',
168 text: 'æ¥è¯¢åå²è·å失败ï¼è¯·ç¨ååè¯ï¼', 169 type: 'error' 170 }); 171 } 172 }); 173 174 } 175 176 // æ¹éè¾å ¥asin start 177 // ç¹å»æ¹éæ¥è¯¢å¼¹çª 178 $('#batch-input-dialog').click(function () { 179 $('#modal-batch-input-asin').modal(); 180 let asinList = $('input[name=textareaValue]').val(); 181 if (asinList) { 182 getInputChange(asinList, 1); 183 } 184 }); 185 // æ¸ ç©ºå¼¹çªå 容 186 $('.button-box').on('click', '.btn-del-asin-list', function () { 187 $('#dialog-batch-input-asin').val('') 188 $('.input-tag-asins-box').find('.tag-asin').remove(); 189 asinArr = []; 190 leaveAsin = dom ? 20 : 100; 191 leastAsin(); 192 $('#dialog-batch-input-asin').attr('placeholder', defultText); 193 }) 194 195 // æ¹éæ¥è¯¢ 196 $('.button-box').on('click', '.btn-batch-search', function () { 197 $('input[name=textareaValue]').val(asinArr.join(' ')) 198 $('#form-condition-search').submit(); 199 }) 200 // å±ç¤ºå½¢å¼åæ¢ 201 $('.monthly-asin-grid-liebiao-btn').on('click', '.monthly-asin-grid-type', function () { 202 let type = $(this).attr('data-grid'); 203 if (!$(this).hasClass('grid-is-active')) { 204 $(this).siblings().removeClass('grid-is-active'); 205 $(this).addClass('grid-is-active'); 206 } 207 if (type == 'liebiao') { 208 $('.input-tag-asins-box').addClass('grid-is-liebiao'); 209 } else { 210 $('.input-tag-asins-box').removeClass('grid-is-liebiao'); 211 } 212 }) 213 // æ¹éè¾å ¥asin end 214})
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.