2.13-安排合成

安排合成

目前為 2024-07-10 提交的版本,檢視 最新版本

此腳本不應該直接安裝,它是一個供其他腳本使用的函式庫。欲使用本函式庫,請在腳本 metadata 寫上: // @require https://update.cn-greasyfork.org/scripts/471357/1408375/213-%E5%AE%89%E6%8E%92%E5%90%88%E6%88%90.js

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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)
		 }); 
	}
}