安排合成
当前为
此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.gf.qytechs.cn/scripts/471357/1408401/213-%E5%AE%89%E6%8E%92%E5%90%88%E6%88%90.js
function 安排合成(src){
console.log('新的安排合成界面')
var local_李楠和达尔文生物改变颜色=localStorage.getItem('李楠和达尔文生物改变颜色');
var local_圆稀赠引物标签加姓名=localStorage.getItem('圆稀赠引物标签加姓名');
var html=$('iframe[src="'+src+'"]')//页面
html=html.contents().find('body').eq(0)
var toolbar=html.find('.toolbar').eq(0) // 找到了toolbar工具栏
//添加toolbar工具栏按钮
添加toolbar按钮(html)
//添加toolbar工具栏按钮
function 添加toolbar按钮(html){
if (toolbar.find('.weiyiyici').length==0){
//添加标记
toolbar.addClass('weiyiyici')
if (local_李楠和达尔文生物改变颜色=='true'){
安排合成_李楠和达尔文生物_颜色()
}
if(local_圆稀赠引物标签加姓名=='true'){
标签打印按钮=toolbar.find('#a_seq_lable_pr').eq(0)
//点击标签打印按钮
标签打印按钮.click(function(){
安排合成_圆稀赠引物标签加姓名(html)
})
}
}
}
//安排合成_李楠和达尔文生物_颜色
function 安排合成_李楠和达尔文生物_颜色(){
//==============================当table出现数据改变的时候=================================
// 观察器的配置(需要观察什么变动)
var config = {attributes: true}; //, childList: true, subtree: true,characterData:true,characterDataOldValue:true,attributDataOldValue:true
var table变化 = function(mutationRecoard, observer) {
//会有两次变化 根据最终的变化
if ($(html).find('#load_list').css('display')=='none'){
html.find('table').find('tr').each(function(){
课题组信息=$(this).find('[aria-describedby=list_syno_ketizu]')
课题组=课题组信息.text()
if(课题组==="李楠"){
//设置背景颜色
$(this).find('td').attr('Bgcolor','#FF7034')
}
if(课题组==="达尔文生物"){
//设置背景颜色
$(this).find('td').attr('Bgcolor','#C80000')
}
})
}
};
var observer = new MutationObserver(table变化);
// 以上述配置开始观察目标节点
dom=$(html).find('#load_list').get(0)
observer.observe(dom, config);
}
//安排合成_圆稀赠引物标签加姓名
function 安排合成_圆稀赠引物标签加姓名(html){
//弹框加个按钮
$('#uiform').find('#txt_syn_plate').parent().append('<button id="button_addName" onclick="return false">顶部标签加姓名</button>')
//点击按钮
$('#uiform').find('#button_addName').click(function(){
安排合成_圆稀赠引物标签加姓名_详细代码()
})
}
function 安排合成_圆稀赠引物标签加姓名_详细代码(html){
板号=$('#uiform').find('#txt_syn_plate').val()
$.get('/syn/ashx/SynSampleHandler.ashx?_search=true&nd=1720597763777&rows=200&page=1&sidx=syn_s_num&sord=desc&filters={"groupOp":"AND","rules":[{"field":"syn_s_palte","op":"eq","data":"RA8124"}]}',function(data){
var 客户名_arr=文本_取中间文本_批量(data,'"cust_name":"','","')
console.log(客户名_arr)
引物名称_arr=文本_取中间文本_批量(data,'"syn_s_primer":"','","')
OD总量_arr=文本_取中间文本_批量(data,'"syn_s_od":"','","')
单管量_arr=文本_取中间文本_批量(data,'"syn_s_od_tube":"','","')
孔号_arr=文本_取中间文本_批量(data,'"syn_s_hole":"','","')
备注_arr=文本_取中间文本_批量(data,'"syn_s_remark":"','","')
//console.log(客户名_arr)
});
if (客户名_arr.length>=1){
res="<NewDataSet>"
for (var i=0;i<5;i++){
res+="<Table1>"
res+="<syn_s_primer>"+引物名称_arr[i]+"</syn_s_primer>"
res+="<syn_s_hole>"+孔号_arr[i]+客户名_arr[i]+"</syn_s_hole>"
res+="</Table1>"
}
res+="</NewDataSet>"
}
保存文本到本地(res,'down.html')
// $.get("/syn/xmldata/xmlSynYuangLabelReport.aspx?plate="+板号+"&style=xishi&is_normal=5Nmol",function(data){
// console.log(data)
// });
}
//保存文本到本地
function 保存文本到本地(text, filename){
// 创建一个Blob实例,类型为纯文本
var blob = new Blob([text], { type: 'text/plain' });
// 创建一个指向Blob对象的URL
var url = URL.createObjectURL(blob);
// 创建一个a标签
var a = document.createElement("a");
// 设置a标签属性
a.href = url;
a.download =filename;
// 模拟a标签点击,触发下载
document.body.appendChild(a);
a.click();
// 清理临时DOM和对象URL
document.body.removeChild(a);
URL.revokeObjectURL(url);
window.open('http://localhost//addName/print.html')
}
}
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址