Commit 17f052e9 by huangpu

角色管理,修改或者增加角色的时候 选择部门可以双击选择,树形面板会消失,不用点击空白页面

parent 1629240e
......@@ -2,12 +2,13 @@
* ztree插件的封装
*/
(function() {
var $ZTree = function(id, url) {
this.id = id;
this.url = url;
this.onClick = null;
this.settings = null;
this.ondblclick=null;
};
$ZTree.prototype = {
......@@ -22,19 +23,20 @@
},
data : {simpleData : {enable : true}},
callback : {
onClick : this.onClick
onClick : this.onClick,
onDblClick:this.ondblclick
}
};
return settings;
},
/**
* 手动设置ztree的设置
*/
setSettings : function(val) {
this.settings = val;
},
/**
* 初始化ztree
*/
......@@ -48,14 +50,21 @@
var zNodes = this.loadNodes();
$.fn.zTree.init($("#" + this.id), zNodeSeting, zNodes);
},
/**
* 绑定onclick事件
*/
bindOnClick : function(func) {
this.onClick = func;
},
/**
* 绑定双击事件
*/
bindOnDblClick : function(func) {
this.ondblclick=func;
},
/**
* 加载节点
*/
......@@ -69,7 +78,7 @@
ajax.start();
return zNodes;
},
/**
* 获取选中的值
*/
......
......@@ -77,6 +77,11 @@ RolInfoDlg.onClickDept = function (e, treeId, treeNode) {
$("#deptName").attr("value", RolInfoDlg.deptZtree.getSelectedVal());
$("#deptid").attr("value", treeNode.id);
};
RolInfoDlg.onDblClickDept = function (e, treeId, treeNode) {
$("#deptName").attr("value", RolInfoDlg.deptZtree.getSelectedVal());
$("#deptid").attr("value", treeNode.id);
$("#deptContent").fadeOut("fast");
};
/**
* 点击父级菜单input框时
......@@ -178,6 +183,7 @@ $(function () {
var deptTree = new $ZTree("deptTree", "/dept/tree");
deptTree.bindOnClick(RolInfoDlg.onClickDept);
deptTree.bindOnDblClick(RolInfoDlg.onDblClickDept)
deptTree.init();
RolInfoDlg.deptZtree = deptTree;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment