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

📄 user_manage.js

📁 学生选课系统 赶快来下载啊啊好东西 呵呵啊啊 啊啊啊啊啊
💻 JS
字号:
//弹出搜索用户页面
function showusersearch(obj){
	var userId = document.all("EF_USER_MANAGE_RECOMMEND_DETAIL.user_id").value;
	window.showModalDialog(__CONTEXT_PATH+"/c?_view=EFV_USER_MANAGE_USER_SEARCH&searchUserId="+userId,obj,"dialogHeight:640px;dialogWidth:800px;");
}


//用户搜索中的用户提交;
function submitusersearch(){
	//获取被选择用户名;
	var userNames = document.all("EF_USER_MANAGE_USER_LIST._check");
	var userName = "";
	if(userNames.length != undefined){
		for(var i = 0 ; i < userNames.length ; i++){
			if(userNames[i].checked == true){
				userName = userNames[i].value.substring(8);

			}
		}
	}else{
		userName = userNames.value.substring(8);
	}

	//获取传递给子窗口的参数,参数是一段html代码
	var parenthtml = window.dialogArguments.innerHTML.toLowerCase();

	//把参数中的html代码中的value替换成value=userName
	var tempParentHtml = "";
	if(parenthtml.indexOf("value") >= 0){
		var valueBegin = parenthtml.indexOf("value");
		var valueEnd = parenthtml.substring(parseInt(valueBegin)).indexOf(" ");
		var textEnd = parenthtml.indexOf(">");
		if(parseInt(textEnd) > parseInt(valueEnd)){
			tempParentHtml = parenthtml.substring(0,valueBegin);
			tempParentHtml += " value=" + userName + " ";
			tempParentHtml += parenthtml.substring(parseInt(valueBegin) + parseInt(valueEnd));
		}else{
			tempParentHtml = parenthtml.substring(0,valueBegin);
			tempParentHtml += " value=" + suerName + " ";
			tempParentHtml += parenthtml.substring(parseInt(valueBegin) + parseInt(textEnd));
		}
	}else{
		tempParentHtml = parenthtml.substring(0,parenthtml.indexOf(">"));
		tempParentHtml += " value=" + userName;
		tempParentHtml += parenthtml.substring(parenthtml.indexOf(">"));
	}

	//把 parentnode 替换成 parentNode
	var re = /parentnode/g;
	parenthtml = tempParentHtml.replace(re,"parentNode");

	//把 name 中的Unit的编号转换成大写;
	var temp = parenthtml.substring(parenthtml.indexOf("name=") + 5,parenthtml.indexOf(".user_id"));
	var returnHtml = parenthtml.substring(0,parenthtml.indexOf("name="));
	returnHtml += " name=" + temp.toUpperCase();
	returnHtml += parenthtml.substring(parenthtml.indexOf(".user_id"));

	window.dialogArguments.innerHTML = returnHtml;
	window.close();
}

//新增推荐之星中的返回;
function backRecommendList(){
	window.location = __CONTEXT_PATH+"/c?_view=EFV_USER_MANAGE_RECOMMEND";
}

//设置showModalDialog中页面里base的target属性,使页面不弹出新的窗口
function setHeadTarget() {
  var head = document.all.tags("HEAD");
  var elment = document.createElement("base");
  eval("elment.target='_self'")
  head[0].appendChild(elment);
}

//检查输入的IP地址的前两位是否符合IP地址规范;
function ipAddressTwoNodes(ip){
	if(ip.length == 0){
		return true;
	}
	if(ip.indexOf(".") <= 0){
		alert("IP地址不正确!");
		return false;
	}
	var sub1 = ip.substring(0,ip.indexOf("."));
	if(parseInt(sub1) > 255 || parseInt(sub1) < 0){
		alert("IP地址不正确!");
		return false;
	}
	var sub2 = ip.substring(ip.indexOf(".") + 1); 
	if(parseInt(sub2) > 255 || parseInt(sub1) < 0){
		alert("IP地址不正确!");
		return false;
	}

	return true;
}

//判断IP地址;
//1. 如果四节都为空,则返回正确;否则,继续第二步;
function ipAddress(obj1,obj2,obj3,obj4){
	if(obj1.length == 0 && obj2.length == 0 && obj3.length == 0 && obj4.length == 0){
		return true;
	}

	var reg =/^(\d+)\.(\d+|\*)\.(\d+|\*)\.(\d+|\*)$/g;
	var ip = obj1 + "." + obj2 + "." + obj3 + "." + obj4;
	if(!reg.test(ip)){
		alert("IP地址不符合规范!");
		return false;
	}

	if( RegExp.$1 <256&& (RegExp.$2<256 || "*" == RegExp.$2) && 
		(RegExp.$3<256 || "*" == RegExp.$3)&& (RegExp.$4<256 || "*" == RegExp.$4)) {
		return true;
	}
	alert("IP地址不符合规范!");
	return false;
}

//积分奖惩的查询;
function submitCreditRewardSearch(){
	
	//检查注册 IP 开头
	if(!ipAddressTwoNodes(document.all("EF_USER_MANAGE_CREDITREWARD_SEARCH.user_regip").value)){
		return ;
	}

	//上次访问 IP 开头
	if(!ipAddressTwoNodes(document.all("EF_USER_MANAGE_CREDITREWARD_SEARCH.user_lastvisitip").value)){
		return ;
	}

	doFind();
}

//用户信息维护的查询;
function submitUserManageSearch(){
	
	//检查注册 IP 开头
	if(!ipAddressTwoNodes(document.all("EF_USER_MANAGE_USERINFO_SEARCH.user_regip").value)){
		return ;
	}

	//上次访问 IP 开头
	if(!ipAddressTwoNodes(document.all("EF_USER_MANAGE_USERINFO_SEARCH.user_lastvisitip").value)){
		return ;
	}

	doFind();
}

//判断一个数是空或者是非负数
//如果此数为空,则返回正确;
function checkPositiveInt(obj,obj2){
	if(obj.length == 0){
		return true;
	}

	if(parseInt(obj) >= 0){
		return true;
	}

	alert(obj2 + "必须为非负数!");
	return false;
}

//审核注册用户的查询;
function submitAuditNewUser(){

	//审核次数大于
	if(!checkPositiveInt(document.all("EF_USER_MANAGE_USER_AUDIT_SEARCH.audit_number").value,"审核次数")){
		return ;
	}

	//注册日期于多少天前
	if(!checkPositiveInt(document.all("EF_USER_MANAGE_USER_AUDIT_SEARCH.audit_regbeforedaynum").value,"天数")){
		return ;
	}

	//上次审核于多少天前
	if(!checkPositiveInt(document.all("EF_USER_MANAGE_USER_AUDIT_SEARCH.audit_beforedaynum").value,"天数")){
		return ;
	}

	//注册IP
	if(!ipAddress(document.all("EF_USER_MANAGE_USER_AUDIT_SEARCH.ip1").value,
		document.all("EF_USER_MANAGE_USER_AUDIT_SEARCH.ip2").value,
		document.all("EF_USER_MANAGE_USER_AUDIT_SEARCH.ip3").value,
		document.all("EF_USER_MANAGE_USER_AUDIT_SEARCH.ip4").value)){
		return ;
	}

	doFind();
}

function submitIpBanned(){
 	//注册IP
	var ip1 = document.all("EF_USER_MANAGE_IP_BANNED_ADD.ip_1");
	var ip2 = document.all("EF_USER_MANAGE_IP_BANNED_ADD.ip_2");
	var ip3 = document.all("EF_USER_MANAGE_IP_BANNED_ADD.ip_3");
	var ip4 = document.all("EF_USER_MANAGE_IP_BANNED_ADD.ip_4")
 	if(ip1.value==""){
 	  alert("IP地址不可为空!");
 	  ip1.focus();
 	  return false;
 	}else if(ip2.value==""){
 		alert("IP地址不可为空!");
 	  ip2.focus();
 	  return false;	
 	}else if(ip3.value==""){
 		alert("IP地址不可为空!");
 	  ip3.focus();
 	  return false;
 	}else if(ip4.value==""){
 		alert("IP地址不可为空!");
 	  ip4.focus();
 	  return false;
 	}
	if(!ipAddress(ip1.value,ip2.value,ip3.value,ip4.value)){
		return ;
	}
	doAction('EF_USER_MANAGE_IP_BANNED_ADD._submit');
}

function userBannedSubmit(){
  var banned_days = document.all("EF_USER_MANAGE_USER_BANNED_ADD.banned_days");
  var banned_reason = document.all("EF_USER_MANAGE_USER_BANNED_ADD.banned_reason");
  var user_id = document.all("EF_USER_MANAGE_USER_BANNED_ADD.user_id");
  if(user_id.value==""){
   alert("用户名必须填写!");
   user_id.focus();
   return false;
  }else if(banned_reason.value==""){
   alert("禁止原因必须填写!");
   banned_reason.focus();
   return false;
  }else if(banned_days.value != ""){
    if(banned_days.value <=0){
       alert("有效天数不可小于0!");
       banned_days.focus();
       return false;
    }  
  }
   doAction("EF_USER_MANAGE_USER_BANNED_ADD._submit");
}

//用户组管理详情提交验证
function userGroupConfigSubmit(){
  var USERGROUP_CREDIT_LIMIT = document.all("EF_CONFIG_USERGROUP.USERGROUP_CREDIT_LIMIT");
  var USERGROUP_TITLE = document.all("EF_CONFIG_USERGROUP.USERGROUP_TITLE");
   //判断是否是整数的正则表达式
  var zs =  /^-?[0-9]\d*$/
  if(USERGROUP_TITLE.value==""){
      alert('用户组头衔必须填写!');
      USERGROUP_TITLE.focus();
      return false;
  }else if(USERGROUP_CREDIT_LIMIT.value==""){
      alert('积分下限必须填写!');
      return false;
  }else if(!zs.test(USERGROUP_CREDIT_LIMIT.value)){
      alert("积分下限必须是一个整数!");
      USERGROUP_CREDIT_LIMIT.focus();
      return false;
 	}
 	doAction('EF_CONFIG_USERGROUP._submit');
}

//标签关联的主题
function linkToUserBlog(userId){
  window.open(getContextPath(false)+"/blog.do?_fn=Index&user_id="+userId,"_blank","",true);
}

⌨️ 快捷键说明

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