25
2022
07

Compare the Test Standard (Previous and Current job) Main use for Disney Jewelry

//=================================================================Previous=======================================================================================
var previous = [...document.querySelectorAll("#tstdDefinitionTable > table > tbody > tr > td:nth-child(2)")].slice(1,).map(item => item.innerText);
localStorage.setItem('previous'JSON.stringify(previous));

/*

******************************************

*/
//====================================================================Current====================================================================================
function txt_download (contentfilename) { 
  var el = document.createElement('a');
  el.download = filename;
  el.style.display = 'none';
  var blob = new Blob([content]);
  el.href = URL.createObjectURL(blob);
  document.body.appendChild(el);
  el.click();
  document.body.removeChild(el);
};

(function () {
  var previous = JSON.parse(localStorage.getItem('previous'));
  var current = [...document.querySelectorAll("#tstdDefinitionTable > table > tbody > tr > td:nth-child(2)")].slice(1,).map(item => item.innerText);

  var excessData_previous = previous.filter(item => current.indexOf(item) === -1);
  var excessData_current = current.filter(item => previous.indexOf(item) === -1);

  if(excessData_previous.length == 0 && excessData_current.length == 0) {
    console.log("They are the same");
    return;
  }

  var content = "";
  if(excessData_previous.length
    content += "Excess Test Standard_Previous job:\r\n" + excessData_previous.join("\r\n") +"\r\n";

  if(excessData_current.length
    content += "Excess Test Standard_current job:\r\n" + excessData_current.join("\r\n") +"\r\n";

  txt_download(content`${document.querySelector("#ctl00_maincontent_compoheader_lblREF_NO").innerText}_excess.txt`);

})();


« 上一篇 下一篇 »

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。