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

📄 weith_oa_scrip.js

📁 一个漂亮的OA 界面d
💻 JS
📖 第 1 页 / 共 2 页
字号:
/*显示时间*/
function showTime(){var obj=document.getElementById('U_T_T_TIME');var noon; var time=new Date(); var hour=time.getHours(); var minute=time.getMinutes(); var seconds=time.getSeconds();var today=new Date;var week=new Array(7); week[0]="天"; week[1]="一"; week[2]="二"; week[3]="三"; week[4]="四"; week[5]="五"; week[6]="六"; if (hour<5) noon="凌晨";if (hour>4 & hour<8) noon="早晨";if (hour>7 & hour<12) noon="上午";if (hour==12) noon="中午";if (hour>12 & hour<19) noon="下午";if (hour>18 & hour<23) noon="晚上";if (hour>22) noon="深夜";if (hour>12) hour=hour;if (hour<10) hour="0"+hour;if (minute<10) minute="0"+minute;if (seconds<10) seconds="0"+seconds; obj.innerHTML=today.getYear()+"年"+(today.getMonth()+1)+"月"+today.getDate()+"日&nbsp;星期"+week[today.getDay()]+"&nbsp;"+noon+"&nbsp;"+hour+":"+minute+":"+seconds; setTimeout("showTime();",1000);}
/*设置菜单提示标题*/
function setMenuAlt(strName){document.getElementById("M_TOP_ICO").innerText = strName;}
/*设置当前位置标题*/
function setLocationAlt(strName){document.getElementById("MY_POSITION").innerText = strName;}
/*设置ICO图片*/
function setIco(obj, xy, intSize){var icoXY = xy.split(',');obj.scrollTop=(icoXY[0]-1) * intSize;obj.scrollLeft=(icoXY[1]-1) * intSize;};
/*设置功能提示*/
function setModuleDepict(strModuleName, strDepict){
	//document.getElementById("SYS_Module").innerText = strModuleName;document.getElementById("SYS_Depict").innerText = strDepict;
	};
/*获得浏览器可用尺寸*/
function getClientWidthHeight(){var cw = document.getElementsByTagName("html")[0].clientHeight;var ch = document.getElementsByTagName("html")[0].clientWidth;cw = cw>0 ? cw : document.body.clientWidth;ch = ch>0 ? ch : document.body.clientHeight;return {'width':cw, 'height':ch}}
/*获得指定值的对像*/
function getParentKeyObj(eo, key){try{window.event.cancelBubble=true;}catch(e){try{SYS_BODY.window.event.cancelBubble=true;}catch(e){SYS_HELP.window.event.cancelBubble=true;}}if(eo.tagName=='BODY')return null;if(eo.className == key)return eo;return getParentKeyObj(eo.parentNode, key);};
/*获得附加随机数后的URL*/
function getNewURL(sURL){var url = sURL;url += url.indexOf("?") == -1 ? "?" : "&";url += "tmp=" + Math.random().toString().substr(2);return url;};
/*设置功能链接及帮助URL*/
function setURL(bodyURL, helpURL){
	if(bodyURL!=null)document.getElementById("SYS_BODY").src=getNewURL(bodyURL);
	if(helpURL!=null)document.getElementById("SYS_HELP").src=helpURL;
};
/*跟据文件名设置帮助文档*/
function setMenu(arrData, def){
	__MSO=null;
	var o=(def=='' || def==null)?0:def;
	CreateLeftBottomMenu(document.getElementById("MENU_BODY_GROUP"), arrData, o);
};
function HelpLoad(obj,defName){
	var FileName;
	var fn=obj.src.replace(/.+\/(.+\.\w+).*/,'$1');
	FileName =(fn.lastIndexOf('/')==fn.length-1 || fn=='about:blank' || fn=='')?defName:fn;
	document.getElementById("SYS_HELP").src='./none.htm?FN='+FileName;
}
/*显示/隐藏菜单*/
function ShowHideToc(booMode){
	var L = document.getElementById('UI_LEFT_BOX');
	var R = document.getElementById('UI_RIGHT_BOX');
	var RH= document.getElementById('UI_BODY');
	var ZK= document.getElementById("UI_TOC");
	//document.getElementById('HELP_BODY').style.display = "none";
	if(booMode){
		R.style.width=WinSize.width-175;
		RH.style.height=(document.getElementById('HELP_BODY').currentStyle.display == "none")?WinSize.height-99:WinSize.height-(99+parseInt(document.getElementById('HELP_BODY').currentStyle.height,10));
		L.style.display = "block";
		ZK.style.display = "none";
	}else{
		L.style.display = "none";
		ZK.style.display = "block";
		R.style.width=WinSize.width-12;
		RH.style.height=(document.getElementById('HELP_BODY').currentStyle.display == "none")?WinSize.height-99:WinSize.height-(99+parseInt(document.getElementById('HELP_BODY').currentStyle.height,10));
	}
};

/*显示/隐藏帮助信息*/
function ShowHideHelp(){
	var B = document.getElementById('UI_BODY');
	var H = document.getElementById('HELP_BODY');
	var T = document.getElementById('UI_HELP');
	var B_h=parseInt(B.style.height,10);
	var H_h=parseInt(H.currentStyle.height,10);
	var Z=(H.currentStyle.display=='none')?true:false;
	if(Z){
		H.style.display = "block";
		B.style.height = B_h - H_h;
		T.title="隐藏帮助信息";
		T.firstChild.src='./images/ui_public/UI_HELP_JT_2.gif';
	}else{
		H.style.display = "none";
		B.style.height = B_h + H_h;
		T.title="显示帮助信息";
		T.firstChild.src='./images/ui_public/UI_HELP_JT_1.gif';
	}
}

/*创建菜单按钮*/
var __onC=false; var __onO=null;
function CreateMenu(objMenuDiv, arrMenuData, intDefaultOption, intMode){
	if(typeof(objMenuDiv)!='object' || !arrMenuData.constructor==Array)return;
	objMenuDiv.innerHTML='';
	//var listWidth=135;
	//if(arrMenuData.length>7 && intMode!=1){objMenuDiv.style.height='210';listWidth=110;}
	var Css1={
			"index":	0,
			"M_DIV":	'M_DIV_1',
			"M_IMG":	'M_IMG_1',
			"M_FON":	'M_FON_1',
			"M_m_dow":	'background:'+MO_C.BG_1_w+';border-color:'+MO_C.BC_1_w+';',
			"M_m_eup":	'background:'+MO_C.BG_1_p+';border-color:'+MO_C.BC_1_p+';',
			"M_m_ove":	'background:'+MO_C.BG_1_e+';border-color:'+MO_C.BC_1_e+';',
			"M_m_out":	'background:'+MO_C.BG_1_t+';border-color:'+MO_C.BC_1_t+';',
			"M_m_fon":	MO_C.FT_1_c
		}
	var Css2={
			"index":	1,
			"M_DIV":	'M_DIV_2',
			"M_IMG":	'M_IMG_2',
			"M_FON":	'M_FON_2',
			"M_m_dow":	'background:'+MO_C.BG_2_w+';border-color:'+MO_C.BC_2_w+';',
			"M_m_eup":	'background:'+MO_C.BG_2_p+';border-color:'+MO_C.BC_2_p+';',
			"M_m_ove":	'background:'+MO_C.BG_2_e+';border-color:'+MO_C.BC_2_e+';',
			"M_m_out":	'background:'+MO_C.BG_2_t+';border-color:'+MO_C.BC_2_t+';',
			"M_m_fon":	MO_C.FT_2_c
		}
	var sys = (intMode==1)?Css1:Css2;
	for(var i=sys.index; i<arrMenuData.length; i++){
		var MenuBody = '<div class="'+sys.M_IMG+'"><img src="'+ico16+'" onload="setIco(this.parentNode,\''+arrMenuData[i].ico+'\', 16)" /></div>';
			MenuBody+= '<div class="'+sys.M_FON+'">'+arrMenuData[i].text+'</div><div class="L_M_ACT"></div>';

		var DivBox = document.createElement('div'); 
			DivBox.className = sys.M_DIV;
			//DivBox.style.width = listWidth;
			DivBox.innerHTML = MenuBody;

			DivBox.childNodes[2].innerText= (typeof(arrMenuData[i].hint)!='undefined')?arrMenuData[i].hint:'...';
		var ev ="window.event.cancelBubble=true;";
			ev+="__onC=true; __onO=this;";
			ev+="if(__T_M_F_D!=null){__onC=false;DelNode();return;};";
			if(intMode!=1)ev+="setLocationAlt(this.childNodes[1].innerText);setModuleDepict(this.childNodes[1].innerText, this.childNodes[2].innerText);";
			DivBox.onclick = new Function(ev + arrMenuData[i].action);
			DivBox.onmousedown=function(){
				this.style.cssText= sys.M_m_dow;
				this.childNodes[1].style.color = sys.M_m_fon;
			}
			DivBox.onmouseup=function(){
				this.style.cssText = sys.M_m_eup;
				this.childNodes[1].style.color='#000';				
			}
			DivBox.onmouseover=function(){
				this.style.cssText = sys.M_m_ove;
			}
			DivBox.onmouseout=function(){
				if(__T_M_F_D!=null && __onO==this)return;
				this.style.cssText = sys.M_m_out;
				this.childNodes[1].style.color='#000';
			}
		objMenuDiv.insertAdjacentElement('beforeEnd', DivBox);
	}
	if(intDefaultOption !=null){
		objMenuDiv.childNodes[intDefaultOption-1].fireEvent("onclick");
	}
};

/*创建主菜单按钮项*/
function CreateMostlyMenu(obj, arrData){
	if(typeof(obj)!='object' || !arrData.constructor==Array)return;
	for(var i=2; i<arrData.length; i++){
		var DivBox = document.createElement('div');
		var BoxHtm ='<div class="GNK_IMG"><img src="'+ico64+'" onload="setIco(this.parentNode, \''+arrData[i].dico+'\', 64);" /></div><div class="GNK_TXT">'+arrData[i].text+'</div>';
			DivBox.className='UI_GNK';
			DivBox.insertAdjacentHTML('beforeEnd', BoxHtm);
			DivBox.onmousedown=function(){with(this.style){background=MO_C.BG_2_w;borderColor=MO_C.BC_2_w;}}
			DivBox.onmouseup=function(){with(this.style){background=MO_C.BG_2_p;borderColor=MO_C.BC_2_p;}}
			DivBox.onmouseover=function(){with(this.style){background=MO_C.BG_2_e;borderColor=MO_C.BC_2_e;}}
			DivBox.onmouseout=function(){with(this.style){background='#FFF';borderColor='#FFF';}}
			DivBox.onclick=new Function(arrData[i].action);
			obj.insertAdjacentElement('beforeEnd', DivBox);
			//if((i-1)%5==0)obj.insertAdjacentHTML('beforeEnd', '<br class="c_b" />');
		}
};

/*创建左边菜单按钮项(组)*/
/*菜单选中项*/
var __MSO = null; var __MenuBody = document.createElement('div'); __MenuBody.style.cssText="margin-bottom:-8px;padding:15px 0px;border-bottom:1px solid #7d7d7d;";
function CreateLeftBottomMenu(objMenuDiv, arrMenuData, intDefaultOption){
	if(typeof(objMenuDiv)!='object' || !arrMenuData.constructor==Array)return;
	objMenuDiv.innerHTML='';
	var arrLength = arrMenuData.length;
	var intDO = (intDefaultOption > arrLength || intDefaultOption < 0) ?  1 : intDefaultOption;

	for(var i=0; i<arrLength; i++){
		var MenuBody = '<div class="L_M_IMG"><img src="'+ico24+'" onload="setIco(this.parentNode, \''+arrMenuData[i][0].ico+'\', 24)" /></div>';
			MenuBody+= '<div class="L_M_FON">'+arrMenuData[i][0].text+'</div><div class="L_M_ACT"></div>';

		var DivBox = document.createElement('div'); 
			DivBox.className = 'L_M_BOX';
			DivBox.innerHTML = MenuBody;

			//DivBox.childNodes[2].innerText=arrMenuData[i][0].hint;
			DivBox.childNodes[2].onclick = new Function("window.event.cancelBubble=true;" + arrMenuData[i][0].action);
			DivBox.onclick = function(){
				setMenuAlt(this.childNodes[1].innerText);
				//setModuleDepict(this.childNodes[1].innerText, this.childNodes[2].innerText);
				this.childNodes[2].fireEvent("onclick");
				this.insertAdjacentElement('afterEnd', __MenuBody);
				if(__MSO === this)return;
				if(__MSO === null){
					__MSO = this;
					__MSO.style.background='#D4D5D8';
					__MSO.childNodes[1].style.color='#000';
					return;
				}else{
					__MSO.style.background='url(./images/ui_'+US+'/UI_F_L_T_ML_BG.gif) repeat-x left center;';
					__MSO.childNodes[1].style.color='#000';
					__MSO = this;
					__MSO.style.background='#D4D5D8';
					__MSO.childNodes[1].style.color='#000';					
				}
			}
			DivBox.onmousedown=function(){
				this.style.backgroundColor='#8592B5';
				this.childNodes[1].style.color='#FFF';
			}
			DivBox.onmouseup=function(){
				this.style.backgroundColor='#B6BDD2';
				this.childNodes[1].style.color='#000';				
			}
			DivBox.onmouseover=function(){
				this.style.background='#B6BDD2';
				if(__MSO == this){
					this.style.background='#8592B5';
					this.childNodes[1].style.color='#FFF';
				}
			}
			DivBox.onmouseout=function(){
				if(__MSO !=this){
					this.style.background='url(./images/ui_'+US+'/UI_F_L_T_ML_BG.gif) repeat-x left center;';
					this.childNodes[1].style.color='#000';
				}else{
					this.style.background='#D4D5D8';
					this.childNodes[1].style.color='#000';
				}
			}
		objMenuDiv.insertAdjacentElement('beforeEnd', DivBox);
	}

⌨️ 快捷键说明

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