Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fgqyxxlr
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yaru
fgqyxxlr
Commits
d24481f9
Commit
d24481f9
authored
Dec 01, 2018
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
部门修改不允许最后层级节点选择
parent
6a592827
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
8 deletions
+26
-8
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java
+1
-1
ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js
+11
-0
ruoyi-admin/src/main/resources/templates/system/dept/edit.html
+7
-4
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java
+2
-1
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java
+5
-2
No files found.
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java
View file @
d24481f9
...
...
@@ -149,7 +149,7 @@ public class SysDeptController extends BaseController
@ResponseBody
public
List
<
Map
<
String
,
Object
>>
treeData
()
{
List
<
Map
<
String
,
Object
>>
tree
=
deptService
.
selectDeptTree
();
List
<
Map
<
String
,
Object
>>
tree
=
deptService
.
selectDeptTree
(
new
SysDept
()
);
return
tree
;
}
...
...
ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js
View file @
d24481f9
...
...
@@ -744,6 +744,17 @@
}
return
true
;
},
// 不允许最后层级节点选择
notAllowLastLevel
:
function
(
_tree
)
{
var
nodes
=
_tree
.
getSelectedNodes
();
for
(
var
i
=
0
;
i
<
nodes
.
length
;
i
++
)
{
if
(
nodes
[
i
].
level
==
nodes
.
length
+
1
)
{
$
.
modal
.
msgError
(
"不能选择最后层级节点("
+
nodes
[
i
].
name
+
")"
);
return
false
;
}
}
return
true
;
},
// 隐藏/显示搜索栏
toggleSearch
:
function
()
{
$
(
'#search'
).
slideToggle
(
200
);
...
...
ruoyi-admin/src/main/resources/templates/system/dept/edit.html
View file @
d24481f9
...
...
@@ -123,10 +123,13 @@
}
function
doSubmit
(
index
,
layero
){
var
body
=
layer
.
getChildFrame
(
'body'
,
index
);
$
(
"#treeId"
).
val
(
body
.
find
(
'#treeId'
).
val
());
$
(
"#treeName"
).
val
(
body
.
find
(
'#treeName'
).
val
());
layer
.
close
(
index
);
var
tree
=
layero
.
find
(
"iframe"
)[
0
].
contentWindow
.
$
.
_tree
;
if
(
$
.
tree
.
notAllowLastLevel
(
tree
))
{
var
body
=
layer
.
getChildFrame
(
'body'
,
index
);
$
(
"#treeId"
).
val
(
body
.
find
(
'#treeId'
).
val
());
$
(
"#treeName"
).
val
(
body
.
find
(
'#treeName'
).
val
());
layer
.
close
(
index
);
}
}
</script>
</body>
...
...
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java
View file @
d24481f9
...
...
@@ -23,9 +23,10 @@ public interface ISysDeptService
/**
* 查询部门管理树
*
* @param dept 部门信息
* @return 所有部门信息
*/
public
List
<
Map
<
String
,
Object
>>
selectDeptTree
();
public
List
<
Map
<
String
,
Object
>>
selectDeptTree
(
SysDept
dept
);
/**
* 根据角色ID查询菜单
...
...
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java
View file @
d24481f9
...
...
@@ -28,6 +28,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 查询部门管理数据
*
* @param dept 部门信息
* @return 部门信息集合
*/
@Override
...
...
@@ -40,13 +41,15 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 查询部门管理树
*
* @param dept 部门信息
* @return 所有部门信息
*/
@Override
public
List
<
Map
<
String
,
Object
>>
selectDeptTree
()
@DataScope
(
tableAlias
=
"d"
)
public
List
<
Map
<
String
,
Object
>>
selectDeptTree
(
SysDept
dept
)
{
List
<
Map
<
String
,
Object
>>
trees
=
new
ArrayList
<
Map
<
String
,
Object
>>();
List
<
SysDept
>
deptList
=
selectDeptList
(
new
SysDept
()
);
List
<
SysDept
>
deptList
=
deptMapper
.
selectDeptList
(
dept
);
trees
=
getTrees
(
deptList
,
false
,
null
);
return
trees
;
}
...
...
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