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
6ced5d45
Commit
6ced5d45
authored
Feb 23, 2019
by
fengshuonan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新初始化菜单表格
parent
93115b9f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
28 deletions
+28
-28
src/main/webapp/assets/modular/system/menu/menu.js
+26
-19
src/main/webapp/pages/modular/system/menu/menu.html
+2
-9
No files found.
src/main/webapp/assets/modular/system/menu/menu.js
View file @
6ced5d45
...
...
@@ -52,10 +52,9 @@ layui.use(['layer', 'form', 'ztree', 'laydate', 'admin', 'ax', 'table', 'treetab
*/
Menu
.
search
=
function
()
{
var
queryData
=
{};
queryData
[
'menuId'
]
=
Menu
.
condition
.
menuId
;
queryData
[
'menuName'
]
=
$
(
"#menuName"
).
val
();
queryData
[
'level'
]
=
$
(
"#level"
).
val
();
table
.
reload
(
Menu
.
tableId
,
{
where
:
queryData
}
);
Menu
.
initTable
(
Menu
.
tableId
,
queryData
);
};
/**
...
...
@@ -68,7 +67,7 @@ layui.use(['layer', 'form', 'ztree', 'laydate', 'admin', 'ax', 'table', 'treetab
title
:
'添加菜单'
,
content
:
Feng
.
ctxPath
+
'/menu/menu_add'
,
end
:
function
()
{
admin
.
getTempData
(
'formOk'
)
&&
table
.
reload
(
Menu
.
tableId
);
admin
.
getTempData
(
'formOk'
)
&&
Menu
.
initTable
(
Menu
.
tableId
);
}
});
};
...
...
@@ -97,7 +96,7 @@ layui.use(['layer', 'form', 'ztree', 'laydate', 'admin', 'ax', 'table', 'treetab
title
:
'编辑菜单'
,
content
:
Feng
.
ctxPath
+
'/menu/menu_edit?menuId='
+
data
.
menuId
,
end
:
function
()
{
admin
.
getTempData
(
'formOk'
)
&&
table
.
reload
(
Menu
.
tableId
);
admin
.
getTempData
(
'formOk'
)
&&
Menu
.
initTable
(
Menu
.
tableId
);
}
});
};
...
...
@@ -112,7 +111,7 @@ layui.use(['layer', 'form', 'ztree', 'laydate', 'admin', 'ax', 'table', 'treetab
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/menu/remove"
,
function
()
{
Feng
.
success
(
"删除成功!"
);
Menu
.
condition
.
menuId
=
""
;
table
.
reload
(
Menu
.
tableId
);
Menu
.
initTable
(
Menu
.
tableId
);
},
function
(
data
)
{
Feng
.
error
(
"删除失败!"
+
data
.
responseJSON
.
message
+
"!"
);
});
...
...
@@ -122,21 +121,29 @@ layui.use(['layer', 'form', 'ztree', 'laydate', 'admin', 'ax', 'table', 'treetab
Feng
.
confirm
(
"是否删除菜单"
+
data
.
name
+
"?"
,
operation
);
};
/**
* 初始化表格
*/
Menu
.
initTable
=
function
(
menuId
,
data
)
{
return
treetable
.
render
({
elem
:
'#'
+
menuId
,
url
:
Feng
.
ctxPath
+
'/menu/listTree'
,
where
:
data
,
page
:
false
,
height
:
"full-158"
,
cellMinWidth
:
100
,
cols
:
Menu
.
initColumn
(),
treeColIndex
:
2
,
treeSpid
:
"0"
,
treeIdName
:
'code'
,
treePidName
:
'pcode'
,
treeDefaultClose
:
false
,
treeLinkage
:
true
});
};
// 渲染表格
var
tableResult
=
treetable
.
render
({
elem
:
'#'
+
Menu
.
tableId
,
url
:
Feng
.
ctxPath
+
'/menu/listTree'
,
page
:
false
,
height
:
"full-158"
,
cellMinWidth
:
100
,
cols
:
Menu
.
initColumn
(),
treeColIndex
:
2
,
treeSpid
:
"0"
,
treeIdName
:
'code'
,
treePidName
:
'pcode'
,
treeDefaultClose
:
false
,
treeLinkage
:
true
});
var
tableResult
=
Menu
.
initTable
(
Menu
.
tableId
);
//渲染时间选择框
laydate
.
render
({
...
...
src/main/webapp/pages/modular/system/menu/menu.html
View file @
6ced5d45
...
...
@@ -6,20 +6,13 @@
<div
class=
"layui-fluid"
>
<div
class=
"layui-row layui-col-space15"
>
<div
class=
"layui-col-sm12 layui-col-md3 layui-col-lg2"
>
<div
class=
"layui-card"
>
<div
class=
"layui-card-body mini-bar"
>
<div
class=
"ztree"
id=
"menuTree"
></div>
</div>
</div>
</div>
<div
class=
"layui-col-sm12 layui-col-md9 layui-col-lg10"
>
<div
class=
"layui-col-sm12 layui-col-md12 layui-col-lg12"
>
<div
class=
"layui-card"
>
<div
class=
"layui-card-body"
>
<div
class=
"layui-form toolbar"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
>
<input
id=
"menuName"
class=
"layui-input"
type=
"text"
placeholder=
"菜单名称"
/>
<input
id=
"menuName"
class=
"layui-input"
type=
"text"
placeholder=
"菜单名称
/编码
"
/>
</div>
<div
class=
"layui-inline"
>
<input
id=
"level"
class=
"layui-input"
type=
"text"
placeholder=
"层级"
/>
...
...
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