Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Springboot Plus
Commits
bc5ba410
Commit
bc5ba410
authored
Feb 22, 2018
by
ykb
Browse files
添加菜单查询、新增、删除功能
parent
25057190
Changes
26
Hide whitespace changes
Inline
Side-by-side
admin-core/src/main/java/com/ibeetl/admin/core/web/dto/SystemMenuView.java
0 → 100644
View file @
bc5ba410
package
com.ibeetl.admin.core.web.dto
;
public
class
SystemMenuView
{
String
code
;
Long
id
;
String
name
;
String
icon
;
public
SystemMenuView
(
Long
id
,
String
code
,
String
name
)
{
this
.
id
=
id
;
this
.
code
=
code
;
this
.
name
=
name
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getIcon
()
{
return
icon
;
}
public
void
setIcon
(
String
icon
)
{
this
.
icon
=
icon
;
}
}
admin-core/src/main/resources/sql/core/coreRoleMenu.md
View file @
bc5ba410
...
...
@@ -10,5 +10,5 @@ deleteRoleMenu
*
删除菜单对应的角色关系
delete CORE_ROLE_MENU where menu_id in ( #join(ids)# )
delete
from
CORE_ROLE_MENU where menu_id in ( #join(ids)# )
\ No newline at end of file
admin-core/src/main/resources/static/js/lib.js
View file @
bc5ba410
...
...
@@ -52,6 +52,56 @@ var Lib = {
var
zTreeObj
=
$
.
fn
.
zTree
.
init
(
$
(
"
#_treeDemo
"
),
{},
zNodes
);
})
},
loadMenuPanel
:
function
(
container
,
textInput
,
valueInput
)
{
$
.
post
(
Common
.
CTX
+
"
/core/user/menu/tree.json
"
,
{},
function
(
response
)
{
var
zNodes
=
response
.
data
;
// todo id别冲突了
var
index
=
layer
.
open
({
type
:
0
,
// page层
area
:
[
'
500px
'
,
'
400px
'
],
offset
:
'
t
'
,
anim
:
5
,
title
:
'
选择菜单
'
,
content
:
"
<ul id='_treeDemo' class='ztree'></ul>
"
,
yes
:
function
(
index
,
layero
)
{
var
nodes
=
zTreeObj
.
getSelectedNodes
();
if
(
nodes
.
length
==
1
)
{
var
fun
=
nodes
[
0
];
valueInput
.
val
(
fun
.
id
);
textInput
.
val
(
fun
.
name
);
}
layer
.
close
(
index
);
// 如果设定了yes回调,需进行手工关闭
}
});
var
zTreeObj
=
$
.
fn
.
zTree
.
init
(
$
(
"
#_treeDemo
"
),
{},
zNodes
);
})
},
loadMenuFunPanel
:
function
(
container
,
textInput
,
valueInput
)
{
$
.
post
(
Common
.
CTX
+
"
/core/user/function/tree.json
"
,
{},
function
(
response
)
{
var
zNodes
=
response
.
data
;
// todo id别冲突了
var
index
=
layer
.
open
({
type
:
0
,
// page层
area
:
[
'
500px
'
,
'
400px
'
],
offset
:
'
t
'
,
anim
:
5
,
title
:
'
选择功能点
'
,
content
:
"
<ul id='_treeDemo' class='ztree'></ul>
"
,
yes
:
function
(
index
,
layero
)
{
var
nodes
=
zTreeObj
.
getSelectedNodes
();
if
(
nodes
.
length
==
1
)
{
var
fun
=
nodes
[
0
];
valueInput
.
val
(
fun
.
id
);
textInput
.
val
(
fun
.
name
+
'
:
'
+
fun
.
accessUrl
);
}
layer
.
close
(
index
);
// 如果设定了yes回调,需进行手工关闭
}
});
var
zTreeObj
=
$
.
fn
.
zTree
.
init
(
$
(
"
#_treeDemo
"
),
{},
zNodes
);
})
},
/* 初始化搜索 */
initSearchForm
:
function
(
form
,
tableIns
,
layuiForm
)
{
id
=
form
.
attr
(
"
id
"
);
...
...
admin-core/src/main/resources/templates/common/query/menu.html
0 → 100644
View file @
bc5ba410
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
${label}
</label>
<layui:menuInput
style=
'layui-input-inline'
name=
"${name}"
id=
"${id!}"
text=
"${text!}"
value=
"${value!}"
></layui:menuInput>
</div>
admin-core/src/main/resources/templates/common/tag/menuFunctionInput.tag.html
0 → 100644
View file @
bc5ba410
<!--#
/*菜单页功能点选择控件
name: 表单名称
text:显示
id:表单的id
value:表单的值
*/
-->
<!--#
var text = text!"";
var id=id!"functionId";
if(isEmpty(text)&&isNotEmpty(value)){
text= core.functionName(value) + ':' + core.funAccessUrl(value);
}
-->
<div
class=
"${style!'layui-input-inline'}"
>
<input
type=
"text"
name=
"${name}Text"
id=
"${id}Text"
disabled
autocomplete=
"off"
class=
"layui-input"
value=
"${text}"
>
</div>
<span
id=
"${name}Search"
>
选择
</span>
<div
style=
"display:none;"
><input
type=
"text"
name=
'${name}'
id=
"${id}"
value=
"${value!}"
></div>
<div
id=
"${name}TreeDemoContainer"
>
</div>
<script>
$
(
document
).
ready
(
function
(){
$
(
"
#${name}Search
"
).
click
(
function
(){
Lib
.
loadMenuFunPanel
(
$
(
"
#${name}TreeDemoContainer
"
),
$
(
"
#${id}Text
"
),
$
(
"
#${id}
"
));
})
});
</script>
\ No newline at end of file
admin-core/src/main/resources/templates/common/tag/menuInput.tag.html
0 → 100644
View file @
bc5ba410
<!--#
/*菜单选择控件
name: 表单名称
text:显示
id:表单的id
value:表单的值
*/
-->
<!--#
var text = text!"";
var id=id!"menuId";
if(isEmpty(text)&&isNotEmpty(value)){
text= core.menuName(value);
}
-->
<div
class=
"${style!'layui-input-inline'}"
>
<input
type=
"text"
name=
"${name}Text"
id=
"${id}Text"
disabled
autocomplete=
"off"
class=
"layui-input"
value=
"${text}"
>
</div>
<span
id=
"${name}Search"
>
选择
</span>
<div
style=
"display:none;"
><input
type=
"text"
name=
'${name}'
id=
"${id}"
value=
"${value!}"
></div>
<div
id=
"${name}TreeDemoContainer"
>
</div>
<script>
$
(
document
).
ready
(
function
(){
$
(
"
#${name}Search
"
).
click
(
function
(){
Lib
.
loadMenuPanel
(
$
(
"
#${name}TreeDemoContainer
"
),
$
(
"
#${id}Text
"
),
$
(
"
#${id}
"
));
})
});
</script>
\ No newline at end of file
Prev
1
2
Next
Write
Preview
Supports
Markdown
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