您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
公共函数
当前为
此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.cn-greasyfork.org/scripts/469866/1213735/00-%E5%85%AC%E5%85%B1%E5%87%BD%E6%95%B0.js
//备注包含CNAS的行就标个颜色 function 公共_CNAS订单加急(html,搜索信息){ //先运行一遍 // html.find('#list').eq(0).find('[aria-describedby=list_seqo_product_company_name]').each(function(){ // if($(this).text()!="北京分公司"){ // $(this).attr('Bgcolor','#AeEEe7') // } // }) html.find('table').find('tr').each(function(){ 备注信息=$(this).find(搜索信息) 备注=$(this).find(搜索信息).text() console.log(备注) if(备注.toUpperCase().indexOf('CNAS')!==-1){ //设置背景颜色 $(this).find('td').attr('Bgcolor','#CDE2F7') } }) //当table出现数据改变的时候 html.find('table').find('tr').on('DOMNodeInserted',function(e) { //$(e.target)代表的每一行 console.log($(this)) 备注信息=$(this).find(搜索信息) 备注=$(this).find(搜索信息).text() console.log(备注) if(备注.toUpperCase().indexOf('CNAS')!==-1){ //设置背景颜色 $(this).find('td').attr('Bgcolor','#CDE2F7') } }); // var table=html.find('table') // html.find('table').find('tr').each(function(){ // 备注信息=$(this).find(搜索信息) // //如果有标记 则退出 // if(备注信息.hasClass('biaoji_cnas_jiaji')===true){ // return false // } // //加个标记 // 备注信息.addClass('biaoji_cnas_jiaji') // 备注=$(this).find(搜索信息).text() // if(备注.toUpperCase().indexOf('CNAS')!==-1){ // //设置背景颜色 // $(this).find('td').attr('Bgcolor','#CDE2F7') // } // }) } //查询年月日的函数 function getday_y_n(d){ var myDate = new Date(); if(d=="yestday" || d==="hecheng_zuotian_riqi" || d=="zuori---"){myDate.setTime(myDate.getTime()-24*60*60*1000);} var year = (myDate.getFullYear()).toString(); //获取当前年 var mon = (myDate.getMonth() + 1).toString(); //获取当前月 var date = (myDate.getDate()).toString(); //获取当前日 if(mon.length==1){ mon="0"+mon } if(date.length==1){ date="0"+date } if(d==="hecheng_zuotian_riqi"){ return year+mon+date }else if(d=="---"){ //---指的格式为XXXX-XX-XX return year+"-"+mon+"-"+date }else if(d=="zuori---"){ //返回昨天的日期 比如 2022-05-13 return year+"-"+mon+"-"+date }else{ return year+mon+date } } //延时函数 var sleep = function(time) { var startTime = new Date().getTime() + parseInt(time, 10); while(new Date().getTime() < startTime) {} };