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

📄 userrole.js

📁 学生选课系统 赶快来下载啊啊好东西 呵呵啊啊 啊啊啊啊啊
💻 JS
字号:
function deleterole(userid,roleid){
	if (confirm("删除操作不可恢复,你确认吗?")){	document.forms[0].action=getContextPath() + '/c?_view=_user_role_assign_list&_user_role_assign_list.actiontype=delete&_user_role_list.euserid='+userid+"&_user_role_assign_list.eroleid="+roleid;
	document.forms[0].submit();
	}
}


function addrole(){
	document.forms[0].action=getContextPath() + '/c?_view=_ur_assign_add';
	document.forms[0].submit();
}



function doRoleAdd(action){
	//判断是否需要做删除动作
	var needDelete = false
	var unitid = getUnitId(getEventElement());
	//alert("unitid="+unitid);
	var head = unitid+"._check";
	//var checks = document.all(head);
	var checks = getAllElements(head);
	if(!checks) return ;
	/*
	if(!checks.length){	
			if(checks.checked){
				needDelete = true;
			}
		
	}else{
		*/
		for(var i=0;i<checks.length;i++){		
			if(checks[i].checked){
				needDelete = true;
			}
		}
		/*
	}
	*/
	if(!needDelete) return ;
	//做删除操作
	deleteRow();
	doAction(action);
	
}

//获取给定角色已分配的用户列表
function getRoleUserList(action,features){
	
	var flag = false
	var count = 0;
	var roleId = "";
	var unitid = getUnitId(getEventElement());
	//alert("unitid="+unitid);
	var head = unitid+"._check";
	//var checks = document.all(head);
	var checks = document.getElementsByName(head);
	if(!checks) return;
			
			/*
	if(!checks.length){	
			if(checks.checked){
				flag = true;
				roleId = checks.value;
			}else{
				alert("请选择一个角色!");
				return;
			}
		
	}else{
		*/
		for(var i=0;i<checks.length;i++){		
			if(checks[i].checked){
				count++;
				if(count > 1){
					flag = false;
					alert("每次只能选择一个角色!");
					return;
				}else{
					flag = true;
					roleId = checks[i].value;
				}
			}
		}

		if(!flag){
			alert("请选择一个角色!");
			return;
		}
		/*
	} 
	*/

	//替换“eroleid,admin”字符串中的“,”号
	var regExp = /,/g;
	roleId = roleId.replace(regExp,"=");
	doDialogAction(action,roleId,features);
}

⌨️ 快捷键说明

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