update
This commit is contained in:
672
ebpm-process-manage/webapp/pages/user_org_select.jsp
Normal file
672
ebpm-process-manage/webapp/pages/user_org_select.jsp
Normal file
@@ -0,0 +1,672 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
|
||||
<%@ include file="/commons/taglibs.jsp" %>
|
||||
<%@ include file="/commons/meta.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<title>组织用户</title>
|
||||
<script type="text/javascript" src="${ctx_js_plugins}/zTree/js/jquery.ztree.core-3.4.min.js"></script>
|
||||
<script type="text/javascript" src="${ctx_js_plugins}/zTree/js/jquery.ztree.exhide-3.4.min.js"></script>
|
||||
<script type="text/javascript" src="${ctx_js_plugins}/userSelect/js/application.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="${ctx_js_plugins}/zTree/css/zTreeStyle/zTreeStyle.css" />
|
||||
<link rel="stylesheet" type="text/css" href="${ctx_js_plugins}/userSelect/css/usStyle/usStyle.css" />
|
||||
|
||||
<!-- 全局初始化变量定义 -->
|
||||
<script type="text/javascript">
|
||||
var roleFlag = "${param.roleFlag}";
|
||||
var multiselect = "${param.multiselect}";
|
||||
if(null==multiselect || ""==multiselect){
|
||||
multiselect = true;
|
||||
}else{
|
||||
multiselect = false;
|
||||
}
|
||||
var isSelectOrg = "${param.isSelectOrg}";
|
||||
if(null == isSelectOrg || "" == isSelectOrg){
|
||||
isSelectOrg = true;
|
||||
}else{
|
||||
isSelectOrg = false;
|
||||
}
|
||||
var actId = "${param.actId}";
|
||||
var isShowGroup = true;//是否需要分组(不需要:false,需要:true)
|
||||
var isShowBodyBackgroundImg = false;//是否需要设置背景图片(不需要:false,需要:true )
|
||||
var getUserTreeAjaxURL = "${ctx}/pages/user/getUserOrgTree.do";//初始化用户树url
|
||||
//var queryUserInfoByUserIdsAjaxURL = "${ctx}/pages/user/queryUserInfoByUserIdsAjax.do";//根据用户id集合获取用户信息url
|
||||
var queryUserInfoByUserIdsAjaxURL = "${ctx}/pages/user/getUserByUserIdsAjax.do";//根据用户id集合获取用户信息url
|
||||
//var queryUserInfoByUserIdsAjaxURL = "${ctx}/pages/user/getUserOrgTree.do";//根据用户id集合获取用户信息url
|
||||
var getRoleTreeAjaxURL = "${ctx}/pages/user/getRoleTree.do";//初始化用户自定义分组树url
|
||||
var bodyBackgroundImgPath = "${ctx_js_plugins}/userSelect/css/usStyle/img/bg_damo_fsdx.jpg";//全局背景图片路径
|
||||
var loadImgPath = "${ctx_js_plugins}/userSelect/css/usStyle/img/load.gif";//加载图标路径
|
||||
var orgImgPath = "${ctx_js_plugins}/zTree/css/zTreeStyle/img/diy/1_open.png";//组织图标路径
|
||||
var roleImgPath = "${ctx_js_plugins}/zTree/css/zTreeStyle/img/diy/1_openGroup.png";//自定义组图标路径
|
||||
var userImgPath = "${ctx_js_plugins}/zTree/css/zTreeStyle/img/diy/1_openUser.png";//用户图标路径
|
||||
|
||||
function func_submit(){
|
||||
//组装主送人员数据
|
||||
var retValus = "";
|
||||
var retNames = "";
|
||||
$("#lstUsr").each(
|
||||
function()
|
||||
{
|
||||
for(var i = 0; i < this.options.length; i++){
|
||||
var optionTextArr = this.options[i].text;
|
||||
var optionValueArr=this.options[i].value;
|
||||
if("" == optionValueArr[0]){
|
||||
continue;
|
||||
}
|
||||
if(retValus.length == 0){
|
||||
retNames += optionTextArr.split(":")[0];
|
||||
retValus += optionValueArr;
|
||||
}else{
|
||||
retNames += ","+ optionTextArr.split(":")[0];
|
||||
retValus += ","+ optionValueArr;
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
if(""!=actId){
|
||||
art.dialog.opener.createActUser(retValus,retNames,actId);
|
||||
}else{
|
||||
art.dialog.opener.createActUser(retValus,retNames);
|
||||
}
|
||||
|
||||
//$("#selectSender",art.dialog.opener.document).attr("src","${ctx}/pages/commons/user_org_select.jsp");
|
||||
art.dialog.close();
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
var asyncStatus = false;//是否为异步加载
|
||||
var rolesetting = {
|
||||
view: {
|
||||
dblClickExpand : false,
|
||||
selectedMulti: false
|
||||
},
|
||||
data: {
|
||||
simpleData: {
|
||||
enable: true
|
||||
}
|
||||
},
|
||||
callback: {
|
||||
onDblClick: onDblClick
|
||||
}
|
||||
};
|
||||
|
||||
/**用于捕获 zTree 上鼠标双击之前的事件回调函数,并且根据返回值确定触发 onDblClick 事件回调函数*/
|
||||
function onDblClick(event, treeId, treeNode) {
|
||||
add();
|
||||
setUserCount();
|
||||
return true;
|
||||
}
|
||||
/**用于捕获异步加载正常结束的事件回调函数*/
|
||||
function zTreeOnAsyncSuccess(event, treeId, treeNode, msg) {
|
||||
//hideSelectedUserTreeNode();
|
||||
var treetype=$('input:radio[name="treetype"]:checked').val();
|
||||
if(treetype==1 && getElementById("usertree").style.display=="none"){//如果选择的是用户树并且用户树为隐藏状态
|
||||
getElementById("loadDIV").style.display="none";
|
||||
getElementById("usertree").style.display="block";
|
||||
}
|
||||
|
||||
if(asyncStatus){
|
||||
var zTree = $.fn.zTree.getZTreeObj(treeId);
|
||||
childrenNodesToUserTable(zTree,treeNode);
|
||||
asyncStatus=false;
|
||||
setUserCount();
|
||||
}
|
||||
}
|
||||
|
||||
//从userOrgTree里面移植过来的setting
|
||||
var setting = {
|
||||
view: {
|
||||
dblClickExpand : false,
|
||||
selectedMulti: false
|
||||
},
|
||||
edit: {
|
||||
enable: false,
|
||||
drag:{isMove:false}
|
||||
|
||||
},
|
||||
data: {
|
||||
simpleData: {
|
||||
enable : true,
|
||||
idKey : "id",
|
||||
pIdKey : "pId" ,
|
||||
DIY:"isAccessTopMenu"
|
||||
}
|
||||
},async: {
|
||||
enable: true,
|
||||
url:getUserTreeAjaxURL,
|
||||
autoParam:["id", "name=n","level=lv"],
|
||||
otherParam:{"filterNodeIdsStr":"${filterNodeIdsStr }","showTreeType":"${param.showTreeType}","id":"${param.orgId}","otherParam":"userTreeAsync"},
|
||||
dataFilter: filter
|
||||
},callback: {
|
||||
onDblClick: onDblClick,
|
||||
onAsyncSuccess: zTreeOnAsyncSuccess
|
||||
}
|
||||
};
|
||||
|
||||
function filter(treeId, parentNode, childNodes) {
|
||||
return childNodes;
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
if(!isShowGroup){//如果不需要分组
|
||||
$("#roleRadio").hide();//隐藏自定义组按钮
|
||||
$("#addressBook").hide();//隐藏自定义分组按钮
|
||||
$("#roleRadioText").hide();
|
||||
}else{
|
||||
initRoleTree();
|
||||
$("#roleRadio").click();
|
||||
$("#roletree").show();
|
||||
$("#usertree").hide();
|
||||
}
|
||||
|
||||
//选择一项
|
||||
$("#addOne").click(function() {
|
||||
add();
|
||||
setUserCount();
|
||||
});
|
||||
//移除一项
|
||||
$("#removeOne").click(function() {
|
||||
if(trSelectedObj!=null){
|
||||
removeOptionToTable(trSelectedObj.id);
|
||||
setUserCount();
|
||||
}
|
||||
});
|
||||
|
||||
//移除全部
|
||||
$("#removeAll").click(function() {
|
||||
for(var i=tableIndex-1;i>=1;i--){
|
||||
removeOptionToTable("tr"+i);
|
||||
setUserCount();
|
||||
}
|
||||
});
|
||||
|
||||
$("input[name='treetype']").click(function() {
|
||||
var treetype = this.value;
|
||||
if(treetype == 1){
|
||||
$("#roletree").hide();
|
||||
$("#usertree").show();
|
||||
}else if(treetype == 3){
|
||||
$("#roletree").show();
|
||||
$("#usertree").hide();
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
/**初始化已选用户*/
|
||||
function init(){
|
||||
if(isShowBodyBackgroundImg){
|
||||
document.body.style.backgroundImage="url("+bodyBackgroundImgPath+")";//设置背景图片
|
||||
}
|
||||
getElementById("loadIMG").src=loadImgPath;
|
||||
getElementById("listLoadIMG").src=loadImgPath;
|
||||
|
||||
var isGroup = "${param.isGroup}";//判断父页面是否来自用户自定义分组页面
|
||||
if(isGroup=="true"){
|
||||
getElementById("addressBook").style.display="none";
|
||||
getElementById("roleRadio").style.display="none";
|
||||
getElementById("roleRadioText").style.display="none";
|
||||
getElementById("subButton").onclick=Function("group_submit()");
|
||||
}
|
||||
|
||||
var userIds = "${param.userIds}";//获取已选用户id集合(格式如:longwp0807;huangshb1023;czadmin)
|
||||
if(userIds==""){
|
||||
//从父页面获取userIds
|
||||
userIds = $("#appManagerIds",art.dialog.opener.document).val();
|
||||
|
||||
//如果在父页面也获取不到元素
|
||||
if(userIds==""){
|
||||
$.fn.zTree.init($("#usertreeDemo"), setting);
|
||||
getElementById("listLoadDIV").style.display="none";
|
||||
getElementById("resultList").style.display="block";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var data = {"userIds":userIds};
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: queryUserInfoByUserIdsAjaxURL,
|
||||
data: data,
|
||||
dataType: "json",
|
||||
success: function(data){
|
||||
for(var i=0;i<data.length;i++){
|
||||
var userName = data[i].userName;
|
||||
var orgName = data[i].deptName;
|
||||
//为了避免重复选择人员,必须在userId之前加上USER#,保持 与手工选择的数据一致
|
||||
var userId = "USER#"+data[i].userId;
|
||||
addOptionToTable(userName,orgName,userId,"USER");
|
||||
addItemToSelect(getElementById("lstUsr"),userName+":"+orgName,userId);
|
||||
}
|
||||
//用户初始化列表完成后隐藏加载图片,显示已选用户列表
|
||||
getElementById("listLoadDIV").style.display="none";
|
||||
getElementById("resultList").style.display="block";
|
||||
setUserCount();
|
||||
$.fn.zTree.init($("#usertreeDemo"), setting);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function initRoleTree(queryVal){
|
||||
var data={"queryVal":queryVal};
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url:getRoleTreeAjaxURL,
|
||||
data: data,
|
||||
dataType: "json",
|
||||
success: function(data){
|
||||
$.fn.zTree.init($("#roletreeDemo"), rolesetting,data);
|
||||
//hideSelectroleupTreeNode();
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
/**将选中节点添加到右边列表*/
|
||||
function add(){
|
||||
var treetype=$('input:radio[name="treetype"]:checked').val();
|
||||
if(1 == treetype){
|
||||
var zTree = $.fn.zTree.getZTreeObj("usertreeDemo");
|
||||
var treeNode = zTree.getSelectedNodes()[0];//获取当前选中节点
|
||||
if(treeNode==null){
|
||||
return;
|
||||
}
|
||||
var isTopNode = (treeNode.parentId=="-1");
|
||||
if (isTopNode){
|
||||
alert("无法选取顶级节点!");
|
||||
return ;
|
||||
}
|
||||
|
||||
if(!multiselect){
|
||||
for(var i=tableIndex-1;i>=1;i--){
|
||||
removeOptionToTable("tr"+i);
|
||||
setUserCount();
|
||||
}
|
||||
}
|
||||
|
||||
var optionnums = getElementById("lstUsr")["options"].length;
|
||||
|
||||
|
||||
if(treeNode.type=="USER"){
|
||||
//hideTreeNode(treeNode.id);//隐藏节点
|
||||
var userId = treeNode.id;
|
||||
var userName = treeNode.name;
|
||||
var orgName = treeNode.getParentNode().name;
|
||||
var result = addItemToSelect(getElementById("lstUsr"),userName+":"+orgName,"USER#"+userId);
|
||||
if(result){
|
||||
addOptionToTable(userName,orgName,userId,"USER");
|
||||
}
|
||||
}else if(treeNode.type=="ORG"){
|
||||
if(!isSelectOrg){
|
||||
return;
|
||||
}
|
||||
var orgName = "";
|
||||
try{
|
||||
var parentNode = treeNode.getParentNode();
|
||||
orgName=parentNode.name;
|
||||
}catch(e){}
|
||||
var userId = treeNode.id;
|
||||
var userName = treeNode.name;
|
||||
var result = addItemToSelect(getElementById("lstUsr"),userName+":"+orgName,"ORG#"+userId);
|
||||
if(result){
|
||||
addOptionToTable(userName,orgName,userId,"ORG");
|
||||
}
|
||||
}
|
||||
}else if(3 == treetype){
|
||||
var zTree = $.fn.zTree.getZTreeObj("roletreeDemo");
|
||||
var treeNode = zTree.getSelectedNodes()[0];//获取当前选中节点
|
||||
if(treeNode==null){
|
||||
return;
|
||||
}
|
||||
var isTopNode = (treeNode.parentId=="-1");
|
||||
if (isTopNode){
|
||||
alert("无法选取顶级节点!");
|
||||
return ;
|
||||
}
|
||||
var userId = treeNode.id;
|
||||
var userName = treeNode.name;
|
||||
var orgName = treeNode.pName;
|
||||
var result = addItemToSelect(getElementById("lstUsr"),userName+":"+orgName,"ROLE#"+userId);
|
||||
if(result){
|
||||
addOptionToTable(userName,"",userId,"ROLE");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**将指定节点下的所有子节点添加到用户表*/
|
||||
function childrenNodesToUserTable(zTree,treeNode){
|
||||
var childrenNodes = treeNode.children;
|
||||
//hideChildrenNodes(childrenNodes);//隐藏所有子节点
|
||||
if (childrenNodes) {
|
||||
for (var i = 0; i < childrenNodes.length; i++) {
|
||||
var userId = childrenNodes[i].id;
|
||||
var userName = childrenNodes[i].name;
|
||||
var orgName = childrenNodes[i].pName;
|
||||
var result = addItemToSelect(getElementById("lstUsr"),userName+":"+orgName,userId);
|
||||
if(result){
|
||||
addOptionToTable(userName,orgName,userId,"USER");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**隐藏指定节点下面所有子节点*/
|
||||
function hideChildrenNodes(childrenNodes){
|
||||
for (var i = 0; i < childrenNodes.length; i++) {
|
||||
hideTreeNode(childrenNodes[i].id);
|
||||
}
|
||||
}
|
||||
|
||||
/**隐藏指定节点*/
|
||||
function hideTreeNode(userId){
|
||||
//处理用户树
|
||||
var zTree = $.fn.zTree.getZTreeObj("usertreeDemo");
|
||||
var node = zTree.getNodeByParam("id",userId,null);
|
||||
if (node) {
|
||||
zTree.hideNode(node);
|
||||
}
|
||||
if(!isShowGroup){//如果不需要用户自定义组功能则直接返回不用处理自定义组树
|
||||
return;
|
||||
}
|
||||
//处理组织树
|
||||
var roleTree = $.fn.zTree.getZTreeObj("roletreeDemo");
|
||||
var node = roleTree.getNodeByParam("id",userId,null);
|
||||
if (node) {
|
||||
roleTree.hideNode(node);
|
||||
}
|
||||
}
|
||||
|
||||
/**设置已选择用户数量*/
|
||||
function setUserCount(){
|
||||
var number = getElementById("lstUsr").options.length;
|
||||
getElementById("userCount").innerHTML=number;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
//已选择列表显示表达控制----start
|
||||
var tableIndex=1;//下一行可插入列位置(选择人数=tableIndex-1) 主送列表
|
||||
var trSelectedObj;//被选中行 主送列表
|
||||
var trSelectedBackgroundColor;
|
||||
|
||||
/**向已选择列表中插入一行数据
|
||||
* 用于主送列表
|
||||
*/
|
||||
function addOptionToTable(name,orgName,userId,type){
|
||||
var firstTD = getElementById("name"+tableIndex);//第一列存放用户名
|
||||
var secondTD = getElementById("orgName"+tableIndex);//第二列存放组织名
|
||||
var thirdTD = getElementById("userId"+tableIndex);//第三列存放用户id(隐藏)
|
||||
if(type=="ORG"){
|
||||
firstTD.innerHTML="<img src='"+orgImgPath+"' style='vertical-align:middle;margin-left:5px;hight:20px;'/> "+name;
|
||||
}else if(type=="ROLE"){
|
||||
firstTD.innerHTML="<img src='"+roleImgPath+"' style='vertical-align:middle;margin-left:5px;hight:20px;'/> "+name;
|
||||
}else{
|
||||
type="USER";
|
||||
firstTD.innerHTML="<img src='"+userImgPath+"' style='vertical-align:middle;margin-left:5px;hight:20px;'/> "+name;
|
||||
}
|
||||
var name = getFullPath(userId);
|
||||
secondTD.innerHTML= name=="" ? orgName : name; //
|
||||
thirdTD.innerHTML=userId+"$"+type;
|
||||
tableIndex++;
|
||||
if(tableIndex>=7){
|
||||
insertRow();
|
||||
}
|
||||
getElementById('resultList').scrollTop = getElementById('resultList').scrollHeight;//滚动条置底
|
||||
}
|
||||
|
||||
|
||||
/**从列表中删除一项*/
|
||||
function removeOptionToTable(trId){
|
||||
var trIndex = parseInt(trId.substring(2));
|
||||
//showTreeNode(getElementById("userId"+trIndex).innerHTML);//显示隐藏节点
|
||||
if(getElementById("userId"+trIndex).innerHTML==""){
|
||||
return;
|
||||
}
|
||||
selectItemByValue(getElementById("lstUsr"),getElementById("userId"+trIndex).innerHTML);
|
||||
removeOp();
|
||||
for(var a=trIndex;a<tableIndex;a++){
|
||||
getElementById("name"+a).innerHTML=getElementById("name"+(a+1)).innerHTML;
|
||||
getElementById("orgName"+a).innerHTML=getElementById("orgName"+(a+1)).innerHTML;
|
||||
getElementById("userId"+a).innerHTML=getElementById("userId"+(a+1)).innerHTML;
|
||||
}
|
||||
getElementById("name"+tableIndex).innerHTML="";
|
||||
getElementById("orgName"+tableIndex).innerHTML="";
|
||||
getElementById("userId"+tableIndex).innerHTML="";
|
||||
|
||||
if(tableIndex!=1){
|
||||
tableIndex--;
|
||||
}
|
||||
if(tableIndex>=7){
|
||||
deleteLastRow();
|
||||
}
|
||||
}
|
||||
|
||||
/**删除用来保存数据的隐藏下拉列表已选中项目*/
|
||||
function removeOp(){
|
||||
var opVal = $("#lstUsr option:selected").val();
|
||||
if("undefined"==typeof(opVal)){
|
||||
return ;
|
||||
}
|
||||
$("#lstUsr option:selected").remove();
|
||||
|
||||
setUserCount();
|
||||
}
|
||||
|
||||
|
||||
/**选中一行 主送列表*/
|
||||
function chooseTr(trObj){
|
||||
if(trSelectedObj!=null){
|
||||
trSelectedObj.style.backgroundColor=trSelectedBackgroundColor;//还原背景色
|
||||
}
|
||||
trSelectedObj=trObj;
|
||||
trSelectedBackgroundColor=trObj.style.backgroundColor;
|
||||
trObj.style.backgroundColor="#BFCEE7";
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**用户列表插入一行 用于主送列表*/
|
||||
function insertRow(){
|
||||
var obj=getElementById("userList");
|
||||
var objTR=obj.insertRow(-1);
|
||||
if(tableIndex%2==0){
|
||||
objTR.className="trEven";
|
||||
}else{
|
||||
objTR.className="trOdd";
|
||||
}
|
||||
var trId = "tr"+(tableIndex+1);
|
||||
objTR.id=trId;
|
||||
objTR.ondblclick=Function("removeOptionToTable('"+trId+"')");
|
||||
objTR.onclick=Function("chooseTr(this)");
|
||||
|
||||
var objTD1 = document.createElement("td");
|
||||
objTD1.id="name"+(tableIndex+1);
|
||||
objTD1.className="tdcss";
|
||||
objTR.appendChild(objTD1);
|
||||
|
||||
var objTD2 = document.createElement("td");
|
||||
objTD2.id="orgName"+(tableIndex+1);
|
||||
objTD2.className="tdcss";
|
||||
objTR.appendChild(objTD2);
|
||||
|
||||
var objTD3 = document.createElement("td");
|
||||
objTD3.id="userId"+(tableIndex+1);
|
||||
objTD3.style.display="none";
|
||||
objTR.appendChild(objTD3);
|
||||
}
|
||||
|
||||
/**删除用户列表最后一行*/
|
||||
function deleteLastRow(){
|
||||
var obj=getElementById("userList");
|
||||
obj.deleteRow(obj.childNodes[0].childNodes.length-1);
|
||||
}
|
||||
/**删除用户列表最后一行*/
|
||||
function deleteLastRow1(){
|
||||
var obj=getElementById("userList1");
|
||||
obj.deleteRow(obj.childNodes[0].childNodes.length-1);
|
||||
}
|
||||
|
||||
/**获取节点全路径*/
|
||||
function getFullPath(id){
|
||||
var zTree = $.fn.zTree.getZTreeObj("usertreeDemo");
|
||||
if(zTree == null)
|
||||
return "";
|
||||
var node = zTree.getNodeByParam("id", id,null);
|
||||
if(node == null)
|
||||
return "";
|
||||
|
||||
if(node.type == "USER")
|
||||
node = node.getParentNode();
|
||||
|
||||
var path = "";
|
||||
while (node.level>=1){
|
||||
path = node.name + "/" + path;
|
||||
node = node.getParentNode();
|
||||
}
|
||||
return path;
|
||||
}
|
||||
//已选择列表显示表达控制----end
|
||||
|
||||
/**根据姓名或工号查询*/
|
||||
function query(){
|
||||
var queryVal = getElementById("queryVal").value;
|
||||
var treetype=$('input:radio[name="treetype"]:checked').val();
|
||||
//alert(treetype);
|
||||
if(treetype==1){
|
||||
if(queryVal==""){
|
||||
$.fn.zTree.init($("#usertreeDemo"), setting);
|
||||
return;
|
||||
}else{
|
||||
var data={"queryVal":queryVal,"showTreeType":"USER","id":"${param.orgId}"};
|
||||
getElementById("loadDIV").style.display="";
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url:getUserTreeAjaxURL,
|
||||
data: data,
|
||||
dataType: "json",
|
||||
success: function(data){
|
||||
$.fn.zTree.init($("#usertreeDemo"), setting,data);
|
||||
getElementById("loadDIV").style.display="none";
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function isShowSearchInput(value){
|
||||
if(value=="3"){
|
||||
$("#searchInput").hide();
|
||||
}else{
|
||||
$("#searchInput").show();
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<!--
|
||||
隐藏对象lstUsr用来保存用户选人数据(格式:text=用户名:组织名,value=用户id)
|
||||
-->
|
||||
<body onload="init();" style="overflow: auto;" class="white-page">
|
||||
<!-- 用来保存主送数据 -->
|
||||
<select id="lstUsr" name="lstUsr" style="display:none"></select>
|
||||
|
||||
|
||||
<div class="contentPanel_sms" style="height: 496px;width: 760px;overflow: hidden;margin:0px auto; padding:5px 0 5px 0; background-color:#fff;">
|
||||
<div class="navPanel_sms" style="height: 471px;">
|
||||
<div class="accordion">
|
||||
<h1 class="caption on">添加方式:
|
||||
<c:if test="${empty param.roleFlag || param.roleFlag}">
|
||||
<input type="radio" name="treetype" value="3" id="roleRadio" checked="checked" onclick="isShowSearchInput(this.value);"/><span id="roleRadioText">角色</span>
|
||||
</c:if>
|
||||
<input type="radio" name="treetype" value="1" <c:if test="${not empty param.roleFlag || !param.roleFlag}">checked="checked"</c:if> onclick="isShowSearchInput(this.value);"/>组织
|
||||
</h1>
|
||||
<div id="searchInput" style="display: none;">
|
||||
姓名:<input type="text" value="" id="queryVal" style="width:100px;font-size:12px;height: 18px;" onkeydown="if(event.keyCode==13) query();"/>
|
||||
<input type="button" class="queryButtonStyle" title="根据用户名或工号查询" onclick="query();"/>
|
||||
</div>
|
||||
<div class="content on" style="background-color:#fff;">
|
||||
<div>
|
||||
<div id="loadDIV" align="center" style="width: 230px;height:420px;display: none;">
|
||||
<img src="" id="loadIMG" style="margin-top:130px;"/> </br>用户树加载中...
|
||||
</div>
|
||||
<div id="usertree" class="zTreeDemoBackground left" style="width: 230px;height:100%;display: none;">
|
||||
<ul id="usertreeDemo" class="ztree" style="width: 240px;overflow: auto;height: 390px;"></ul>
|
||||
</div>
|
||||
<c:if test="${empty param.roleFlag || param.roleFlag}">
|
||||
<div id="roletree" class="zTreeDemoBackground left" style="width: 230px;height: 100%;display: none;">
|
||||
<ul id="roletreeDemo" class="ztree" style="width: 240px;overflow: auto;height: 421px;"></ul>
|
||||
</div>
|
||||
</c:if>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="float: left; width:80px; margin:0px; padding:0px 10px; background-color: #fff;height: 100%;vertical-align: middle;padding-top: 60px;">
|
||||
<br/><br/><br/><br/><br/><br/>
|
||||
<input type="button" id="addOne" class="buttonStyle" value="添加" />
|
||||
<br/>
|
||||
<input type="button" id="removeOne" class="buttonStyle" value="删除" name="removeOne"/>
|
||||
<br/>
|
||||
<input type="button" id="removeAll" class="buttonStyle" value="全部删除" name="removeAll"/>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="workPanel_sms" style="padding:0px; margin:0px; overflow: auto; width:420px; height: 471px; float:left;">
|
||||
<div class="tabs_sms" style="width:413px;height: 471px; margin:0px; padding:0px;">
|
||||
<div class="tabs-nav_sms" >
|
||||
<ul>
|
||||
<li class="on first"><span>已选列表</span></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tabs-content" style="overflow: no; height:426px;">
|
||||
<div class="box on" style="padding:0px 8px;overflow: auto;">
|
||||
<div style="overflow: no; height:32px;padding-top:4px;">
|
||||
<table style="WIDTH: 100%; align:left;display: table;table-layout:fixed;border:#C0C0C0 solid 1px;" cellpadding="0" cellspacing="0">
|
||||
<tr >
|
||||
<th style="border-right:#C0C0C0 solid 1px;"width="120px" align="center">姓名</th><th class="" align="center">所属组织</th>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="listLoadDIV" align="center" style="overFlow-x:hidden;overFlow-x:auto; height:310px;">
|
||||
<img src="" id="listLoadIMG" style="margin-top:120px;"/> </br>用户列表加载中...
|
||||
</div>
|
||||
<div style="overFlow-x:hidden;overFlow-x:auto; height:310px;display:none" id="resultList" >
|
||||
<table id="userList" style="WIDTH: 100%; HEIGHT: 300px;align:left;display: table;table-layout:fixed;border:#C0C0C0 solid 1px;" border="1px" cellpadding="0" cellspacing="0">
|
||||
<c:forEach varStatus="st" begin="1" end="14" var="x">
|
||||
<c:choose>
|
||||
<c:when test="${x%2==0}">
|
||||
<tr id="tr${x}" ondblclick="removeOptionToTable('tr${x}');" onclick="chooseTr(this)" class="trOdd">
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<tr id="tr${x}" ondblclick="removeOptionToTable('tr${x}');" onclick="chooseTr(this)" class="trEven">
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
<td class="tdcss" id="name${x}" width="120px" nowrap></td>
|
||||
<td class="tdcss" id="orgName${x}" nowrap></td>
|
||||
<td id="userId${x}" style="display:none" nowrap></td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</table>
|
||||
</div>
|
||||
<div style="padding:4px 0px;">
|
||||
<font color="#0080FF">共计</font><font color="red" id="userCount">0</font><font color="#0080FF">条记录</font>
|
||||
</div>
|
||||
<div style="padding:5px 0px;">
|
||||
<input type="button" value="确定" class="buttonStyle" onclick="func_submit();" id="subButton"/>
|
||||
<!-- <input type="button" value="取消" class="buttonStyle" onclick="window.parent.hideUserSelectDiv();"/> -->
|
||||
<input type="button" value="取消" class="buttonStyle" onclick="javascript:art.dialog.close();"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user