Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
guns-vip
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenjunxiong
guns-vip
Commits
17f052e9
Commit
17f052e9
authored
Jul 10, 2017
by
huangpu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
角色管理,修改或者增加角色的时候 选择部门可以双击选择,树形面板会消失,不用点击空白页面
parent
1629240e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
7 deletions
+22
-7
src/main/webapp/static/js/common/ztree-object.js
+16
-7
src/main/webapp/static/modular/system/role/role_info.js
+6
-0
No files found.
src/main/webapp/static/js/common/ztree-object.js
View file @
17f052e9
...
@@ -2,12 +2,13 @@
...
@@ -2,12 +2,13 @@
* ztree插件的封装
* ztree插件的封装
*/
*/
(
function
()
{
(
function
()
{
var
$ZTree
=
function
(
id
,
url
)
{
var
$ZTree
=
function
(
id
,
url
)
{
this
.
id
=
id
;
this
.
id
=
id
;
this
.
url
=
url
;
this
.
url
=
url
;
this
.
onClick
=
null
;
this
.
onClick
=
null
;
this
.
settings
=
null
;
this
.
settings
=
null
;
this
.
ondblclick
=
null
;
};
};
$ZTree
.
prototype
=
{
$ZTree
.
prototype
=
{
...
@@ -22,19 +23,20 @@
...
@@ -22,19 +23,20 @@
},
},
data
:
{
simpleData
:
{
enable
:
true
}},
data
:
{
simpleData
:
{
enable
:
true
}},
callback
:
{
callback
:
{
onClick
:
this
.
onClick
onClick
:
this
.
onClick
,
onDblClick
:
this
.
ondblclick
}
}
};
};
return
settings
;
return
settings
;
},
},
/**
/**
* 手动设置ztree的设置
* 手动设置ztree的设置
*/
*/
setSettings
:
function
(
val
)
{
setSettings
:
function
(
val
)
{
this
.
settings
=
val
;
this
.
settings
=
val
;
},
},
/**
/**
* 初始化ztree
* 初始化ztree
*/
*/
...
@@ -48,14 +50,21 @@
...
@@ -48,14 +50,21 @@
var
zNodes
=
this
.
loadNodes
();
var
zNodes
=
this
.
loadNodes
();
$
.
fn
.
zTree
.
init
(
$
(
"#"
+
this
.
id
),
zNodeSeting
,
zNodes
);
$
.
fn
.
zTree
.
init
(
$
(
"#"
+
this
.
id
),
zNodeSeting
,
zNodes
);
},
},
/**
/**
* 绑定onclick事件
* 绑定onclick事件
*/
*/
bindOnClick
:
function
(
func
)
{
bindOnClick
:
function
(
func
)
{
this
.
onClick
=
func
;
this
.
onClick
=
func
;
},
},
/**
* 绑定双击事件
*/
bindOnDblClick
:
function
(
func
)
{
this
.
ondblclick
=
func
;
},
/**
/**
* 加载节点
* 加载节点
*/
*/
...
@@ -69,7 +78,7 @@
...
@@ -69,7 +78,7 @@
ajax
.
start
();
ajax
.
start
();
return
zNodes
;
return
zNodes
;
},
},
/**
/**
* 获取选中的值
* 获取选中的值
*/
*/
...
...
src/main/webapp/static/modular/system/role/role_info.js
View file @
17f052e9
...
@@ -77,6 +77,11 @@ RolInfoDlg.onClickDept = function (e, treeId, treeNode) {
...
@@ -77,6 +77,11 @@ RolInfoDlg.onClickDept = function (e, treeId, treeNode) {
$
(
"#deptName"
).
attr
(
"value"
,
RolInfoDlg
.
deptZtree
.
getSelectedVal
());
$
(
"#deptName"
).
attr
(
"value"
,
RolInfoDlg
.
deptZtree
.
getSelectedVal
());
$
(
"#deptid"
).
attr
(
"value"
,
treeNode
.
id
);
$
(
"#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框时
* 点击父级菜单input框时
...
@@ -178,6 +183,7 @@ $(function () {
...
@@ -178,6 +183,7 @@ $(function () {
var
deptTree
=
new
$ZTree
(
"deptTree"
,
"/dept/tree"
);
var
deptTree
=
new
$ZTree
(
"deptTree"
,
"/dept/tree"
);
deptTree
.
bindOnClick
(
RolInfoDlg
.
onClickDept
);
deptTree
.
bindOnClick
(
RolInfoDlg
.
onClickDept
);
deptTree
.
bindOnDblClick
(
RolInfoDlg
.
onDblClickDept
)
deptTree
.
init
();
deptTree
.
init
();
RolInfoDlg
.
deptZtree
=
deptTree
;
RolInfoDlg
.
deptZtree
=
deptTree
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment