2.13-安排合成

安排合成

当前为 2024-07-10 提交的版本,查看 最新版本

此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.cn-greasyfork.org/scripts/471357/1408375/213-%E5%AE%89%E6%8E%92%E5%90%88%E6%88%90.js

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

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/xmldata/xmlSynYuangLabelReport.aspx?plate="+板号+"&style=xishi&is_normal=5Nmol",function(data){
		     console.log(data)
		 }); 
	}
}