1/* 2 * @Description: 3 * @Author: [email protected] 4 * @Date: 2023-08-23 15:13:01 5 */ 6 7// éå toFixedæ¹æ³ 8Number.prototype.toFixed = function (d) { 9 var s1 = this + ''; 10 if (!d) { 11 d = 0; 12 } 13 if (s1.indexOf('.') == -1) { 14 s1 += '.'; 15 } 16 s1 += new Array(d + 1).join('0'); 17 if (new RegExp('^(-|\\+)?(\\d+(\\.\\d{0,' + (d + 1) + '})?)\\d*$').test(s1)) { 18 var s = '0' + RegExp.$2, 19 pm = RegExp.$1, 20 a = RegExp.$3.length, 21 b = true; 22 if (a == d + 2) { 23 a = s.match(/\d/g); 24 if (parseInt(a[a.length - 1]) > 4) { 25 for (var i = a.length - 2; i >= 0; i--) { 26 a[i] = parseInt(a[i]) + 1; 27 if (a[i] == 10) { 28 a[i] = 0; 29 b = i != 1; 30 } else { 31 break; 32 } 33 } 34 } 35 s = a.join('').replace(new RegExp('(\\d+)(\\d{' + d + '})\\d$'), '$1.$2'); 36 } 37 if (b) { 38 s = s.substr(1); 39 } 40 return (pm + s).replace(/\.$/, ''); 41 } 42 return this + ''; 43}; 44 45 46// éå¯¹å ¬å ±ç产åé ç½®ï¼ç¼åçæ¥æä¸ç°å¨æ¥ææ¯è¾ï¼å¦æç¸å·®å¤§äºä¸å¤©ï¼æ´æ°ç¼å 47let expose_pro_data = JSON.parse(sessionStorage.getItem('pro_config')); 48let past_date = JSON.parse(sessionStorage.getItem('config_date')); //ä¸ä¸æ¬¡ç¼åè®°å½çæ¶é´ 49var nowTime = moment().format('YYYYMMDD'); 50if (!expose_pro_data) { 51 requestProduct_config(); 52 expose_pro_data = JSON.parse(sessionStorage.getItem('pro_config')); 53} else { 54 if (nowTime - past_date >= 1) { 55 requestProduct_config(); 56 expose_pro_data = JSON.parse(sessionStorage.getItem('pro_config')); 57 } 58} 59 60// éå¯¹å ¬å ±çweb_config.datæä»¶è¿è¡ç¼åï¼ç¼åçæ¥æä¸ç°å¨æ¥ææ¯è¾ï¼å¦æç¸å·®å¤§äºä¸å¤©ï¼æ´æ°ç¼å 61let expose_web_data = JSON.parse(sessionStorage.getItem('web_config_json')); 62if (!expose_web_data) { 63 requestWeb_config(); 64 expose_web_data = JSON.parse(sessionStorage.getItem('web_config_json')); 65} else { 66 if (nowTime - past_date >= 1) { 67 requestWeb_config(); 68 expose_web_data = JSON.parse(sessionStorage.getItem('web_config_json')); 69 } 70} 71 72 73 74let report_config_json = JSON.parse(sessionStorage.getItem('report_config_cn')); 75let report_config_json_en = JSON.parse(sessionStorage.getItem('report_config_en')); 76window.language_type = enumObj.language.cn; 77if ((language_type === enumObj.language.en && !report_config_json_en) || (language_type === enumObj.language.cn && !report_config_json)) { 78 handleConfigStorage(window.language_type); 79} 80 81// å¤çæ¥è¡¨å¤æ³¨ç¼åï¼åæ¢ä¸è±æ 82function handleConfigStorage(language) { 83 if (language === enumObj.language.en) { 84 // è±æ 85 if (!report_config_json_en) { 86 queryReportMemo(language); 87 } else { 88 if (nowTime - past_date >= 1) { 89 queryReportMemo(language); 90 } 91 } 92 } else { 93 // 䏿 94 if (!report_config_json) { 95 queryReportMemo(language); 96 } else { 97 if (nowTime - past_date >= 1) { 98 queryReportMemo(language); 99 } 100 } 101 } 102} 103 104/** 105 * 夿³¨è¯·æ± 106 * @param {*} language è¯è¨å¯¹åºçå¼ ä¾å¦ï¼cnãen, é»è®¤cn 107 */ 108function queryReportMemo(language) { 109 $.ajax({ 110 url: api_shfe_report_config(language), 111 dataType: 'json', 112 async: false, 113 success: function (json) { 114 if (language === enumObj.language.en) { 115 // è±æ 116 sessionStorage.setItem('report_config_en', JSON.stringify(json)); 117 sessionStorage.setItem('config_date', moment().format('YYYYMMDD')); 118 report_config_json_en = JSON.parse(sessionStorage.getItem('report_config_en')); 119 } else { 120 // 䏿 121 sessionStorage.setItem('report_config_cn', JSON.stringify(json)); 122 sessionStorage.setItem('config_date', moment().format('YYYYMMDD')); 123 report_config_json = JSON.parse(sessionStorage.getItem('report_config_cn')); 124 } 125 126 }, 127 error: function () {} 128 }); 129} 130 131 132 133/** 134 * 135 * @param {} json 产åé ç½®æä»¶è¯»å 136 * @returns 137 */ 138function requestProduct_config() { 139 $.ajax({
140 url: api_shfe_product_config(), 141 dataType: 'json', 142 async: false, 143 success: function (json) { 144 const pro_json = JSON.parse(JSON.stringify(json)); 145 // æ·»å productid_classåæ®µï¼ ä¾ï¼productidï¼ag_f 146 Object.keys(json).forEach(item => { 147 pro_json[item].productid = item; 148 }); 149 sessionStorage.setItem('pro_config', JSON.stringify(pro_json)); 150 sessionStorage.setItem('config_date', moment().format('YYYYMMDD')); 151 }, 152 error: function () {} 153 }); 154} 155 156requestWeb_config(); 157 158/** 159 * 160 * @param {} json web_configé ç½®æä»¶è¯»å 161 * @returns 162 */ 163function requestWeb_config() { 164 $.ajax({ 165 url: api_shfe_web_config(), 166 dataType: 'json', 167 async: false, 168 success: function (json) { 169 const web_config_json = JSON.parse(JSON.stringify(json)); 170 // å°åä½åå¤ç 171 let weightunit_cn = json.weightunit_cn.split(',').map(item => { 172 return item.split('|')[1]; 173 }) 174 let weightunit_en = json.weightunit_en.split(',').map(item => { 175 return item.split('|')[1]; 176 }) 177 let weightunits_en = json.weightunits_en.split(',').map(item => { 178 return item.split('|')[1]; 179 }) 180 let currency_cn = json.currency_cn.split(',').map(item => { 181 return item.split('|')[1]; 182 }) 183 let currency_en = json.currency_en.split(',').map(item => { 184 return item.split('|')[1]; 185 }) 186 web_config_json.weightunit_cn = weightunit_cn; 187 web_config_json.weightunit_en = weightunit_en; 188 web_config_json.weightunits_en = weightunits_en; 189 web_config_json.currency_cn = currency_cn; 190 web_config_json.currency_en = currency_en; 191 sessionStorage.setItem('web_config_json', JSON.stringify(web_config_json)); 192 }, 193 error: function () {} 194 }); 195} 196 197 198/** 199 * @description è·åå ·ä½çweb_config对åºçå¼ 200 * @param {*} key 屿§å¼ ä¾ï¼weightunit_cn 201 */ 202 203function getWebConfigPropValue(key) { 204 let value = expose_web_data[key] ? expose_web_data[key] : ''; 205 return value ? value : ''; 206} 207 208 209 210 211/** 212 * @description è·ååç§å±æ§ 213 * @param {*} productid 产åidï¼ ä¾ï¼cu_f 214 * @param {*} propkey 产å对åºç屿§ ä¾ï¼decimal_number 215 */ 216function getProductProp(productid, propkey) { 217 let value = expose_pro_data[productid] ? expose_pro_data[productid][propkey] : ''; 218 return value ? value : ''; 219} 220 221/** 222 * @description éè¿åç§ç»ä»£ç è·åproductid 223 * @param {*} productgroupid åç§ç»ä»£ç ï¼ ä¾ï¼cu 224 * @param {*} productclass // ç¨äºåºåæè´§/ææ 1 ==> æè´§ 2 ==> ææ 225 * @return ä¾ï¼ cu_f 226 */ 227function getProductByGroup(productgroupid, productclass) { 228 let str = productgroupid.trim(); 229 if( str.includes('_') ) { 230 return str 231 } else { 232 str = str + (productclass === enumObj.productclass._f ? enumObj.productclass_f : enumObj.productclass_o); 233 return str; 234 } 235} 236 237 238 239/** 240 * @description éè¿å约代ç è·åproductid 241 * @param {*} instrumentid: å约代ç ä¾ï¼cu1203ãcu1203C45000 242 */ 243function getProductGroupIDByInstr(instrumentid) { 244 let reg = /[0-9]/; 245 if( reg.test(instrumentid)) { 246 return instrumentid.substring(0, instrumentid.match(/[0-9]/).index); 247 } else { 248 return instrumentid; 249 } 250} 251 252 253 254/** 255 * @description è·åtableç夿³¨ 256 * @param {*} reportid æ¥ååç±» ä¾å¦ï¼shfe_kx 257 * @param {*} propkey 对åºç屿§ ä¾å¦ï¼report_1_note_total 258 * @param {*} querydate æ¥è¯¢æ¥æ ä¾å¦ï¼20230628 259 * @param {*} language è¯è¨ ä¾å¦ï¼cnãen 260 */ 261function getReportMemo(reportid, propkey, querydate, language) { 262 let today_data = []; 263 if (language === enumObj.language.en) { 264 if (!(report_config_json_en[reportid] && report_config_json_en[reportid][propkey])) { 265 return {} 266 } 267 report_config_json_en[reportid][propkey].forEach(item => { 268 if ( item && (querydate >= item.begineffectivedate || !item.begineffectivedate) && 269 (querydate < item.endeffectivedate || !item.endeffectivedate)) { 270 today_data.push(item); 271 } 272 });
273 } else { 274 if (!(report_config_json[reportid] && report_config_json[reportid][propkey])) { 275 return {} 276 } 277 report_config_json[reportid][propkey].forEach(item => { 278 if ( item && (querydate >= item.begineffectivedate || !item.begineffectivedate) && 279 (querydate < item.endeffectivedate || !item.endeffectivedate)) { 280 today_data.push(item); 281 } 282 }); 283 } 284 285 return today_data.length ? today_data[today_data.length - 1] : {}; 286} 287 288 289 290/** 291 * @description è·åæ¥è¡¨å¤æ³¨çåå边对åºçå¼ 292 * @param {*} reportid æ¥ååç±» ä¾å¦ï¼shfe_kx 293 * @param {*} propkey 对åºç屿§ ä¾å¦ï¼'singlenote' 294 */ 295 296function getReportSingleDoubleMemo(reportid, propkey) { 297 let obj_report_info = {}; 298 if( report_config_json[reportid][propkey] ) { 299 for(let index= 0; index < report_config_json[reportid][propkey].length; index++ ) { 300 if( report_config_json[reportid][propkey][index] ) { 301 obj_report_info = report_config_json[reportid][propkey][index] 302 break; 303 } 304 } 305 } 306 return obj_report_info; 307} 308 309 310/** 311 * @description è·ååç§å表ï¼ç¨äºæ¥è¯¢ 312 * @param {*} exchangegroupid // ç¨äºåºå䏿ãè½æº ä¾å¦ 'shfe', 'ine' 313 * @param {*} productclass // ç¨äºåºåæè´§/ææ 1 ==> æè´§ 2 ==> ææ 314 */ 315 316function getProductList(exchangegroupid, productclass) { 317 let pro_list_query = { 318 name: [], 319 list: [] 320 }; // è®°å½å¸æçå¾å°ç»æ 321 let json_data = JSON.parse(JSON.stringify(expose_pro_data)); 322 323 if (exchangegroupid === 'ine') { 324 // é坹䏿åè½æºåºååççé 325 Object.keys(expose_pro_data).forEach(item => { 326 if (expose_pro_data[item].exchangegroupid !== exchangegroupid) { 327 delete json_data[item]; 328 } 329 }); 330 } 331 let pro_cate_name = []; // è®°å½éå±ç大类åç§åå 332 let pro_cate = []; // è®°å½å ·ä½çåç§ 333 Object.values(json_data).forEach(item => { 334 if (item.productclass == productclass) { 335 pro_cate.push(item); 336 pro_cate_name.push({ 337 name: item.product_type_cn, 338 sort_type: item.product_type_sort_cn 339 }); 340 } 341 }); 342 const uniqueCateList = pro_cate_name.filter((item, index) => 343 pro_cate_name.findIndex(i => i.name === item.name) === index); 344 setArraySort(uniqueCateList, 'sort_type'); // é对大类è¿è¡æåº 345 pro_list_query.name = uniqueCateList; 346 347 // é对åç§è¿è¡åç» 348 uniqueCateList.forEach((item, index) => { 349 pro_list_query.list.push([]); 350 pro_cate.forEach(m => { 351 if (m.product_type_cn === item.name) { 352 pro_list_query.list[index].push(m); 353 } 354 }); 355 }); 356 // é对åç§è¿è¡æåº 357 pro_list_query.list.forEach((_, index) => { 358 setArraySort(pro_list_query.list[index], 'product_sort'); 359 }); 360 return pro_list_query; 361} 362 363 364/** 365 * @description è·åææåç§å表é»è®¤ç¬¬ä¸é¡¹ 366 * @param {*} productclass // ç¨äºåºåæè´§/ææ 1 ==> æè´§ 2 ==> ææ 367 */ 368function pro_default_first() { 369 let select_doc = getProductList(enumObj.originalType.shfe, '2'); 370 let select_arr1 = select_doc.list[0][0].productid; // å°ç±» ï¼é 371 return select_arr1; 372} 373 374 375 376 377/** 378 * è·åç½ç«é ç½®ä¿¡æ¯ 379 */ 380function getSysConfig(exchangegroupid, propkey) {} 381 382/** 383 * @description è·åå°å ·ä½æä¸ªäº§åéè¦ä¿çç精度, å¹¶æ·»å 对åºçç²¾åº¦åæ®µ 384 * @param {*} list æ°æ® -- å¯è½æ¯æ°ç»ï¼å¯è½æ¯å个对象 385 * @param {*} precision_type 代表çç²¾åº¦åæ®µ 386 * å¯ä¸ºå个å ç´ ï¼ä¹å¯ä¸ºæ°ç» 387 * 妿æ¯å个å ç´ ï¼ç»ä¸å¢å åæ®µï¼precision 388 * å¦ææ¯æ°ç»ï¼å¢å å¤ä¸ªåæ®µï¼ åæ®µå¯¹åºçkey为precision_typeä¸çæ¯ä¸ªå ç´ 389 * ä¾ï¼decimal_numberï¼ discountrate_decimal_numberï¼ 390 * [ decimal_number, discountrate_decimal_number ]ç 391 */ 392function pro_precision(list, precision_type) { 393 // æ°ç»çæ åµ 394 if (Array.isArray(list)) { 395 list.map(a => { 396 var str = a.PRODUCTID.trim(); 397 if (expose_pro_data[str]) { 398 if (Array.isArray(precision_type)) { 399 precision_type.map(item => { 400 if (item) { 401 a[item] = expose_pro_data[str][item]; 402 } 403 }) 404 } else { 405 a.precision = expose_pro_data[str][precision_type]; 406 } 407 } 408 });
409 return list; 410 } else { 411 // åæ¡æ°æ®çæ åµ 412 var str = list.PRODUCTID && list.PRODUCTID.trim(); 413 if (expose_pro_data[str]) { 414 if (Array.isArray(precision_type)) { 415 precision_type.map(item => { 416 if (item) { 417 list[item] = expose_pro_data[str][item]; 418 } 419 }) 420 } else { 421 list.precision = expose_pro_data[str][precision_type]; 422 } 423 } 424 return list; 425 } 426} 427 428/** 429 * @description éå¯¹æ°æ®è¿è¡ç²¾åº¦å¤ç 430 * @param {*} value ä¼ è¿æ¥çéè¦å¤ççå¼ 431 * @param {*} num ä¿çå ä½å°æ° 432 */ 433function handleDataPrecision(value, num) { 434 let val = ''; 435 if (value === '' || value === undefined || value === null ) { 436 return val 437 } else { 438 val = Number(value); 439 } 440 441 if (num === '' || num === undefined || num === null ) { 442 num = 0 443 } 444 445 const number = Number(num); 446 if (val && val.toString().includes('.')) { 447 return val ? val.toFixed(number) : (val === 0 ? val.toFixed(number) : ''); 448 } else { 449 return val.toFixed(number); 450 } 451} 452 453// æ ¹æ®å¯¹è±¡ä¸çæä¸ªå段è¿è¡æåº setArraySort() compare() 454function setArraySort(c, type_text) { 455 c.sort(compare(type_text)); 456 return c; 457} 458// æ ¹æ®å¯¹è±¡ä¸çæä¸ªå段è¿è¡æåº setArraySort() compare() 459function compare(property) { 460 return function (a, b) { 461 return a[property] - b[property]; 462 }; 463} 464 465/** 466 * @description å°æ°ç»ä¸çåä¸ªå¯¹è±¡æ ¹æ®æå®å段å»é 467 * @param {*} list éè¦å»éç对象æ°ç» 468 * @param {*} item æ ¹æ®æ°ç»é颿¯ä¸ä¸ªå¯¹è±¡æå®å段è¿è¡å»é 469 * @returns 470 */ 471function listParamsRepeat(list, item) { 472 if (list) { 473 list.forEach(obj => { 474 obj[item] = obj[item] ? obj[item].trim() : ''; 475 }); 476 let list_pro_only = noRepeat(list, item); 477 return list_pro_only; 478 } else { 479 return []; 480 } 481} 482 483// æ ¹æ®æ°ç»ä¸çæä¸ªå段ï¼é对æ°ç»è¿è¡å»éæä½ 484function noRepeat(arr, attr) { 485 const res = new Map(); 486 return arr.filter((item) => { 487 var attrItem = item[attr]; 488 return !res.has(attrItem) && res.set(attrItem, 1); 489 }); 490} 491 492 493 494 495// æ´ä¸ªé¡µé¢æå° / å±é¨æå° 496function printTable(id) { 497 if (id) { 498 // è·åæå°DOM 499 let el = document.getElementById(id); 500 // å½å页颿 ·å¼ 501 let headDom = document.getElementsByTagName("head")[0]; 502 // å建iframe 503 let iframe = document.createElement("iframe"); 504 // 设置iframeæ ·å¼ 505 iframe.setAttribute("id", id); 506 iframe.setAttribute("src", 'javascript:'); 507 iframe.setAttribute( 508 "style", 509 "position:absolute;width:0px;height:0px;left:-500px;top:-500px;" 510 ); 511 // å¨é¡µé¢æå ¥iframe 512 document.body.appendChild(iframe); 513 // è·åiframeå çhtml 514 let doc = iframe.contentWindow.document; 515 516 // ç»éè¦æå°çDOMæå ¥iframe 517 let printMain = document.createElement("div"); 518 printMain.setAttribute("id", id); 519 printMain.innerHTML = el.innerHTML; 520 doc.body.appendChild(printMain); 521 // 设置iframeå çheaderï¼æ·»å æ ·å¼æä»¶ 522 setTimeout(() => { 523 doc.getElementsByTagName("head")[0].innerHTML = headDom.innerHTML; 524 const table = doc.querySelectorAll('.el-table__header,.el-table__body'); 525 const table1 = doc.querySelectorAll('.el-table'); 526 const table2 = doc.querySelectorAll('.el-table__body-wrapper'); 527 for (let i = 0; i < table2.length; i++) { 528 const tableItem = table2[i]; 529 tableItem.style.maxHeight = 'unset'; 530 } 531 for (let i = 0; i < table1.length; i++) { 532 const tableItem = table1[i]; 533 tableItem.style.maxHeight = 'unset'; 534 } 535 setTimeout(() => { 536 //el-table æå°ä¸å ¨çé®é¢ 537 for (let i = 0; i < table.length; i++) { 538 const tableItem = table[i]; 539 tableItem.style.width = '100%'; 540 const child = tableItem.childNodes; 541 for (let j = 0; j < child.length; j++) { 542 const element = child[j]; 543 if (element.localName == 'colgroup') { 544 element.innerHTML = ''; 545 } 546 } 547 } 548 setTimeout(function () { 549 iframe.contentWindow.focus(); 550 iframe.contentWindow.print(); 551 // å ³éiframe 552 doc.close(); 553 document.body.removeChild(iframe); 554 }, 1000); 555 }, 1000) 556 }, 0) 557 } else { 558 let allDomObj1 = $('html'); 559 // è·å页é¢ä¸çtable 560 let tableList1 = allDomObj1.find(".el-table"); 561 if( tableList1.length > 0 ) { 562 let tableList = $('#js_index').find(".el-table"); 563 for (let k4 = 0; k4 < tableList.length; k4++) { 564 var table = tableList.eq(k4); 565 let header = table.find('.el-table__header tr').clone(); 566 table.find('.el-table__header').remove(); 567 let body = table.find('.el-table__body'); 568 let tbody = body.find('tbody'); 569 tbody.prepend(header); 570 } 571 window.print(); //æå°æ¹æ³ 572 // Print('#js_index', { 573 // noPrint: '.noPrint' 574 // }); 575 } else { 576 window.print(); //æå°æ¹æ³ 577 } 578 } 579} 580 581 582function toPrint() { 583 Print('#out_content', { 584 noPrint: '.noPrint' 585 }); 586} 587 588// 导åºexcellåtxt 589function exportExcel(name, type, id) {
590 let domId = '#export-table' 591 if (id) { 592 domId = `#${ id }`; 593 } 594 595 596 let dimIdStr = domId + ' .el-table' 597 let dimIdStr_fixed = domId + ' .el-table .el-table__fixed' 598 599 /* ä»è¡¨çæå·¥ä½ç°¿å¯¹è±¡ */ 600 var wb = '' 601 602 603 604 var hope_el_table_list = $(dimIdStr).filter( function() { 605 return $('.el-table__fixed', this).length >0; 606 }) 607 608 609 let fix_dom = $(dimIdStr_fixed); 610 611 if( fix_dom && fix_dom.length > 0 ) { 612 hope_el_table_list.each( function(index, ele) { 613 fix_dom[index].remove(); 614 }) 615 616 wb = XLSX.utils.table_to_book(document.querySelector(domId)); 617 618 hope_el_table_list.each( function(index, ele) { 619 ele.append( fix_dom[index] ) 620 }) 621 } else { 622 wb = XLSX.utils.table_to_book(document.querySelector(domId), { raw: true }); 623 } 624 625 /* è·åäºè¿å¶å符串ä½ä¸ºè¾åº */ 626 var wbout; 627 if(type === 'txt'){ 628 let wbout1 = XLSX.write(wb, { bookType: type, bookSST: true, type: "binary" }); 629 if( wbout1.includes('"')) { 630 wbout = wbout1.replace(/"/g, '') 631 } else { 632 wbout = wbout1; 633 } 634 }else{ 635 var wbout = XLSX.write(wb, { bookType: type, bookSST: true, type: "array" }); 636 } 637 638 try { 639 window.saveAs( 640 //Blob 对象表示ä¸ä¸ªä¸å¯åãåå§æ°æ®çç±»æä»¶å¯¹è±¡ã 641 //Blob 表示çä¸ä¸å®æ¯JavaScriptåçæ ¼å¼çæ°æ®ã 642 //File æ¥å£åºäºBlobï¼ç»§æ¿äº blob çåè½å¹¶å°å ¶æ©å±ä½¿å ¶æ¯æç¨æ·ç³»ç»ä¸çæä»¶ã 643 //è¿åä¸ä¸ªæ°å建ç Blob 对象ï¼å ¶å 容ç±åæ°ä¸ç»å®çæ°ç»ä¸²èç»æã 644 new Blob([wbout], { 645 type: type == 'txt' ? 'text/plain;charset=utf-8' : "application/octet-stream" 646 }), 647 //è®¾ç½®å¯¼åºæä»¶åç§° 648 name + "." + type 649 ); 650 } catch (e) { 651 if (typeof console !== "undefined") console.log(e, wbout); 652 } 653 return wbout; 654} 655 656 657 658// è§£å³el-tableæå°å¯¹ä¸é½çæ åµ 659function loadTable() { 660 let html_dom = $('html'); 661 console.log(); 662 let allDomObj = html_dom.clone(); 663 // è·å页é¢ä¸çtable 664 let tableList = allDomObj.find(".el-table"); 665 for (let i = 0; i < tableList.length; i++) { 666 var table = tableList.eq(i); 667 let header = table.find('.el-table__header tr').clone(); 668 table.find('.el-table__header').remove(); 669 let body = table.find('.el-table__body'); 670 let tbody = body.find('tbody'); 671 // header.find('tr,td,th,div,style,span').removeAttr('class').removeAttr('style'); 672 // tbody.find('tr,td,th,div,style,span').removeAttr('class').removeAttr('style'); 673 // tbody.find('span').each(function(e){ 674 // let $this = $(e); 675 // $this.closest('td').html($this.html()); 676 // }); 677 // tbody.find('div').each(function(e){ 678 // let $this = $(e); 679 // $this.closest('td').html($this.html()); 680 // }); 681 // body.width(1700).attr('border', 0); 682 tbody.prepend(header); 683 } 684 tableList.find('colgroup,.hidden-columns,.el-table__header-wrapper,.el-table__column-resize-proxy,.gutter,.el-scrollbar__thumb,.el-scrollbar__bar,.el-table__border-left-patch').remove(); 685 686 let iframe = $("<iframe></iframe>"); 687 iframe.css( { 688 'position':'absolute', 689 'width':'0px', 690 'height':'0px', 691 'left':'-500px', 692 'top':'-500px', 693 } ) 694 // 设置iframeæ ·å¼ 695 // iframe.setAttribute("id", id) 696 697 iframe.attr('srcdoc', allDomObj[0].outerHTML) 698 699 // å¨é¡µé¢æå ¥iframe 700 $('body').append( iframe[0] ) 701 // document.body.appendChild(iframe); 702 703 // è·åiframeå çhtml 704 let doc = iframe[0].contentWindow.document; 705 // iframe.srcdoc = allDomObj.outerHTML; 706 setTimeout(function () { 707 iframe[0].contentWindow.focus(); 708 iframe[0].contentWindow.print(); 709 // å ³éiframe 710 doc.close(); 711 $('body').remove( iframe[0] ) 712 // document.body.removeChild(iframe); 713 }, 1000); 714} 715 716 717 718// 计ç®ä¸¤ä¸ªæ¥æä¹é´çæææ¥æ 719function enumerateDaysBetweenDates(startDate, endDate) { // åå®ä½ å·²ç»ä¿è¯äºstartDate å°äºendDateï¼ä¸äºè ä¸ç¸ç 720 let daysList = []; 721 let SDate = moment(startDate); 722 let EDate = moment(endDate); 723 let xt; 724 daysList.push(SDate.format("YYYYMMDD")); 725 while (SDate.add(1, "days").isBefore(EDate)) { // 注æè¿éaddæ¹æ³å¤çåSDateå¯¹è±¡å·²ç»æ¹åã 726 daysList.push(SDate.format("YYYYMMDD")); 727 } 728 daysList.push(EDate.format("YYYYMMDD")); 729 return daysList; 730} 731 732// é对æµè§å¨urlæºå¸¦çåæ°è¿è¡è§£æ 733function pro_analysisUrl() { 734 //console.log(window.location.href); 735 736 var url = window.location.href.includes("?") 737 ? window.location.href.split("?")[1] 738 : ""; //æªåï¼åé¢çå 容 739 740 if (url == "") { 741 return ''; 742 } 743 744 var paramsArr = url.split("&"); //ç¬¬ä¸æ¬¡åå² 745 746 var paramsObj = {}; 747 748 for (var i = 0; i < paramsArr.length; i++) { 749 var combina = paramsArr[i].split("="); //ç¬¬äºæ¬¡åå² 750 751 paramsObj[combina[0]] = combina[1]; 752 } 753 754 if (paramsObj.query_options) { 755 return paramsObj.query_options; 756 } else { 757 return '' 758 } 759} 760/** 761 * @description éè¿å¥å©å约代ç è·åproductid 762 * @param {*} spreadInstrumentID: å¥å©å约代ç ä¾ï¼cu1203-luu1203 è¿å[cu,luu] 763 */ 764function getProductGroupIDBySpreadInstr(sid) { 765 let reg = /[a-zA-Z]+/g; 766 let arrproducts=sid.match(reg) 767 return arrproducts 768} 769 770 771
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.