2.9-测序文件

测序文件

目前為 2023-07-05 提交的版本,檢視 最新版本

此腳本不應該直接安裝,它是一個供其他腳本使用的函式庫。欲使用本函式庫,請在腳本 metadata 寫上: // @require https://update.cn-greasyfork.org/scripts/470210/1215671/29-%E6%B5%8B%E5%BA%8F%E6%96%87%E4%BB%B6.js

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

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

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

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

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

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

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

function 测序文件(){
	console.log('新的测序文件界面')
	var local_同一个版号中根据实验状态总结=localStorage.getItem('同一个版号中根据实验状态总结');
	var html=$('iframe[src="/seq/AutoFileUploadList.aspx"]')//测序样品页面
	html=html.contents().find('body').eq(0)
	var toolbar=html.find('.toolbar').eq(0)  // 找到了toolbar工具栏
	//var table=html.find('.ui-jqgrid-btable').eq(0)  // 找到了样品的table
	//添加toolbar工具栏按钮
	添加toolbar按钮(html)
	//添加toolbar工具栏按钮
	function 添加toolbar按钮(html){
		if (toolbar.find('.weiyiyici').length==0){
			//添加标记
			toolbar.addClass('weiyiyici')
			//添加修改样品名称按钮
			if (local_同一个版号中根据实验状态总结=='true'){
				toolbar.append('<span><input type="text" id="text_banhao"   placeholder="板号" size="5"/><button id="button_zongjie" onclick="return false">总结</font></button></span>')
				
				//点击添加样品前缀按钮执行如下函数
				toolbar.find('#button_zongjie').click(function(){
					根据实验状态总结()
				})
			}
		}
	}
	//根据实验状态总结
	function 根据实验状态总结(){
		板号=html.find('#text_banhao').eq(0).val()
		if(板号===""){console.log('空板号');return false}
		//报告生产界面查询BDT 数据
		$.ajaxSettings.async = false; //get请求默认是异步的,在这里改为同步
		$.get("/seq/xmldata/xmlSeqDBT.aspx?banhao="+板号,
			function (data,status) {
				console.log(data)
			});
	}
	//添加前后缀
	function 添加前后缀(前后缀,id){
		//如果没有选择的行,那么退出
		if(table.find('tbody').find("[aria-selected='true']").size()==0){return false} 
		if(html.find(id).eq(0).val()===""){return false}
		selecteds=table.find('tbody').find("[aria-selected='true']")
		selecteds.each(function(){
			ids=$(this).find('[aria-describedby=list_undefined]').text()  //获取生产编号
			product_number=$(this).find('[aria-describedby=list_seqs_sam_num]').text()  //获取最开始的样品编号
			if (前后缀=='前缀'){
				new_product_number=toolbar.find('#text_qianzhui').eq(0).val()+product_number  //获取最新的样品编号
			}
			if (前后缀=='后缀'){
				new_product_number=product_number+toolbar.find('#text_houzhui').eq(0).val()  //获取最新的样品编号
			}
			//post请求 更改样品编号
			$.post("/seq/ashx/SeqSampleHandler.ashx",
				{action:"piliang_edit",ids:ids.slice(2),newValue:"seqs_sam_num="+new_product_number,rules_txt:"样品编号"},
				function (data,status) {console.log(data);}
			);
			html.find('.ui-pg-input').eq(0).focus()
			alert('修改了 '+table.find('tbody').find("[aria-selected='true']").size()+' 条反应的样品名称,光标自动定位在页数,直接按回车或更改页数可以查看更改结果')
			return false
		})
	}
	
	
}