⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 opform.js

📁 OA.....其他人不需帐号就可自由下载此源码其他人不需帐号就可自由下载此源码
💻 JS
字号:
// JavaScript Document
var oldTrBgColor = "#FAFAFA";
function AlterTrBgColor(tr,i) {
	var over = "#DDEEFF";
	if(i == 0) {
		oldTrBgColor = tr.bgColor;
		tr.bgColor = over;
	}else{
		tr.bgColor = oldTrBgColor;
	}
}

function delForm(url) {
	var f = document.ActionForm;
	var ids = document.all.ids;
	var select = false;
	if(ids == undefined) {
		alert("请选择一条记录!");
		return;
	}
	if(ids.length==undefined && ids.checked)
		select = true;
	for(var i=0;i<ids.length;i++) {
		var temp = ids[i];
		if(temp.checked) {
			select = true;
			break;
		}
	}
	if(select) {
		if(confirm("您确定删除吗?(删除后是不可恢复的)")) {
			f.action = url;
			f.submit();
		}
	}else{
		alert("请选择一条记录!");
	}
}

function changeStatus(url) {
	var f = document.ActionForm;
	var ids = document.all.ids;
	var select = false;
	if(ids == undefined) {
		alert("请选择一条记录!");
		return;
	}
	if(ids.length==undefined && ids.checked)
		select = true;
	for(var i=0;i<ids.length;i++) {
		var temp = ids[i];
		if(temp.checked) {
			select = true;
			break;
		}
	}
	if(select) {
		if(confirm("您确定继续吗?(启用或停用后将改变记录状态)")) {
			f.action = url;
			f.submit();
		}
	}else{
		alert("请选择一条记录!");
	}
}

function recordMove(url) {
	var f = document.ActionForm;
	var id = "";
	var select = false;
	for(var i=0;i<f.elements.length;i++) {
		var temp = f.elements[i];
		if(temp.name=="ids" && temp.checked) {
			select = true;
			id += temp.value+",";
		}
	}
	id = id.substring(0,id.length-1);
	if(select) {
		if(id.indexOf(",")!=-1) {
			alert("只能同时对一条记录进行移动!");
		}
		else if(confirm("您确定移动您选择的记录吗?")) {
			url = url + id;
			window.location = url;
		}
	}else{
		alert("请选择一条记录!");
	}
}

//submit ActionForm
function doSubmit(url) {
	var f = document.ActionForm;
	if(url!=null)
		f.action = url;
	f.submit();
}

//check all checkbox
function checkAll(checked) {
	var f = document.all.ids;
	if(f != undefined) {
		for(var i=0;i<f.length;i++) {
			f[i].checked = checked;
		}
	}
}

//submit SearchForm
function doSearch() {
	var f = document.SearchForm;
	f.submit();
}

function getIds() {
	var f = document.ActionForm;
	var ids = document.all.ids;
	var s = "";
	if(ids == null)
		s = "";
	else if(ids.length==undefined && ids.checked)
		s = ids.value;
	else

	for(var i=0;i<ids.length;i++) {
		var temp = ids[i];
		if(temp.checked) {
			if(s == "")
				s = temp.value;
			else
				s += ","+temp.value;
		}
	}

	return s;
}

function showadv(checks){
	if(checks==0)
	{
	   document.all.base.style.display = "none";
	   document.all.adv.style.display = "";
	   if (document.all.base1) {
	   	document.all.base1.style.display = "none";
	   	document.all.adv1.style.display = "";
	   }
	}
	else
	{
	   document.all.base.style.display = "";
	   document.all.adv.style.display = "none";
	   if (document.all.adv1) {
		   document.all.base1.style.display = "";
		   document.all.adv1.style.display = "none";
	   }
	}
	changeAdvanced(checks);
}

// 用于保持高级查询项是否展开状态用
function changeAdvanced(type){
	try{
		if(type==0){
			document.getElementById("isAdvanced0").value = "Y";
			document.getElementById("isAdvanced1").value = "Y";
		}else if(type==1){
			document.getElementById("isAdvanced0").value = "N";
			document.getElementById("isAdvanced1").value = "N";
		}
	}catch(e){
		// do nothing
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -