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
4a1a19e9
Commit
4a1a19e9
authored
Nov 05, 2018
by
fengshuonan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加一个部门的下拉框
parent
fed7b80c
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
184 additions
and
38 deletions
+184
-38
src/main/java/cn/stylefeng/guns/modular/system/controller/SystemController.java
+64
-0
src/main/webapp/WEB-INF/common/common_tree_dlg.html
+101
-0
src/main/webapp/WEB-INF/system/user/user_add.html
+2
-2
src/main/webapp/WEB-INF/system/user/user_roleassign.html
+3
-35
src/main/webapp/assets/modular/system/user/user_info.js
+14
-1
No files found.
src/main/java/cn/stylefeng/guns/modular/system/controller/SystemController.java
0 → 100644
View file @
4a1a19e9
/**
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
cn
.
stylefeng
.
guns
.
modular
.
system
.
controller
;
import
cn.stylefeng.roses.core.base.controller.BaseController
;
import
cn.stylefeng.roses.core.util.ToolUtil
;
import
cn.stylefeng.roses.kernel.model.exception.RequestEmptyException
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLDecoder
;
/**
* 通用控制器
*
* @author fengshuonan
* @Date 2017年2月17日20:27:22
*/
@Controller
@RequestMapping
(
"/system"
)
public
class
SystemController
extends
BaseController
{
private
String
PREFIX
=
"/common/"
;
/**
* 通用的树列表选择器
*/
@RequestMapping
(
"/commonTree"
)
public
String
deptTreeList
(
@RequestParam
(
"formName"
)
String
formName
,
@RequestParam
(
"formId"
)
String
formId
,
@RequestParam
(
"treeUrl"
)
String
treeUrl
,
Model
model
)
{
if
(
ToolUtil
.
isOneEmpty
(
formName
,
formId
,
treeUrl
))
{
throw
new
RequestEmptyException
(
"请求数据不完整!"
);
}
try
{
model
.
addAttribute
(
"formName"
,
URLDecoder
.
decode
(
formName
,
"UTF-8"
));
model
.
addAttribute
(
"formId"
,
URLDecoder
.
decode
(
formId
,
"UTF-8"
));
model
.
addAttribute
(
"treeUrl"
,
URLDecoder
.
decode
(
treeUrl
,
"UTF-8"
));
}
catch
(
UnsupportedEncodingException
e
)
{
throw
new
RequestEmptyException
(
"请求数据不完整!"
);
}
return
PREFIX
+
"common_tree_dlg.html"
;
}
}
src/main/webapp/WEB-INF/common/common_tree_dlg.html
0 → 100644
View file @
4a1a19e9
<!DOCTYPE html>
<html
lang=
"en"
>
@/**
@ * 本页面所用的模板变量
@ *
@ * treeUrl : 加载树的url
@ * fromName : 需要设置的显示名称
@ * fromId : 需要设置的隐藏id
@ **/
<head>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
${title!"Guns管理系统"}
</title>
<meta
name=
"description"
content=
"Guns管理系统"
>
<meta
name=
"author"
content=
"stylefeng"
>
<!-- Bootstrap Core CSS -->
<link
href=
"${ctxPath}/assets/common/plugins/bootstrap/css/bootstrap.min.css"
rel=
"stylesheet"
>
<!-- Custom CSS -->
<link
href=
"${ctxPath}/assets/common/static/css/style.css"
rel=
"stylesheet"
>
<link
href=
"${ctxPath}/assets/common/static/stylefeng/feng.css"
rel=
"stylesheet"
>
<!--其他插件css-->
<link
href=
"${ctxPath}/assets/common/plugins/ztree/zTreeStyle.css"
rel=
"stylesheet"
type=
"text/css"
/>
</head>
<body
class=
"fix-header fix-sidebar card-no-border"
>
<div
id=
"main-wrapper"
>
<div
class=
"container-fluid"
>
<div
class=
"row p-10"
style=
"background: #f2f7f8;"
>
<ul
id=
"zTree"
class=
"ztree"
></ul>
</div>
<div
class=
"row p-10"
style=
"background: #CFD4D5;"
>
<div
style=
"float:left;margin: auto"
>
<button
class=
"btn btn-sm btn-info"
type=
"button"
id=
"saveButton"
>
<i
class=
"ace-icon fa fa-check"
></i>
保存
</button>
<button
class=
"btn btn-sm btn-danger"
type=
"button"
id=
"closeButton"
>
<i
class=
"ace-icon fa fa-close"
></i>
关闭
</button>
</div>
</div>
</div>
</div>
<!-- jquery -->
<script
src=
"${ctxPath}/assets/common/plugins/jquery/jquery.min.js"
></script>
<!-- Bootstrap tether Core JavaScript -->
<script
src=
"${ctxPath}/assets/common/plugins/bootstrap/js/tether.min.js"
></script>
<script
src=
"${ctxPath}/assets/common/plugins/bootstrap/js/bootstrap.min.js"
></script>
<!--Guns JavaScript -->
<script
src=
"${ctxPath}/assets/common/static/stylefeng/Feng.js"
></script>
<script
src=
"${ctxPath}/assets/common/static/stylefeng/ajax-object.js"
></script>
<!-- vue -->
<script
src=
"${ctxPath}/assets/common/plugins/vue/vue.js"
></script>
<!-- 加入contextPath属性和session超时的配置 -->
<script
type=
"text/javascript"
>
Feng
.
addCtx
(
"${ctxPath}"
);
Feng
.
sessionTimeoutRegistry
();
</script>
<!--其他插件js-->
<script
src=
"${ctxPath}/assets/common/plugins/ztree/jquery.ztree.all.min.js"
></script>
<script
src=
"${ctxPath}/assets/common/plugins/ztree/ztree-object.js"
></script>
<script
type=
"text/javascript"
>
var
ZTreeDlg
=
{};
ZTreeDlg
.
onClickItem
=
function
(
e
,
treeId
,
treeNode
)
{
$
{
formName
}
=
ZTreeDlg
.
instance
.
getSelectedVal
();
$
{
formId
}
=
treeNode
.
id
;
};
$
(
function
()
{
var
index
=
parent
.
layer
.
getFrameIndex
(
window
.
name
);
//获取窗口索引
$
(
"#closeButton"
).
bind
(
"click"
,
function
()
{
parent
.
layer
.
close
(
index
);
});
$
(
"#saveButton"
).
bind
(
"click"
,
function
()
{
parent
.
layer
.
close
(
index
);
});
var
ztree
=
new
$ZTree
(
"zTree"
,
"${treeUrl}"
);
ztree
.
bindOnClick
(
ZTreeDlg
.
onClickItem
);
ztree
.
init
();
ZTreeDlg
.
instance
=
ztree
;
});
</script>
</body>
</html>
src/main/webapp/WEB-INF/system/user/user_add.html
View file @
4a1a19e9
@layout("/common/_dialog.html",{plugins:["laydate","sweet-alert"],js:["/assets/modular/system/user/user_info.js"]}){
@layout("/common/_dialog.html",{plugins:["laydate","sweet-alert"
,"layer"
],js:["/assets/modular/system/user/user_info.js"]}){
<div
class=
"container-fluid"
>
<div
class=
"container-fluid"
>
<form
id=
"userAddForm"
\@
submit=
"submitForm"
>
<form
id=
"userAddForm"
\@
submit=
"submitForm"
>
<div
class=
"row"
>
<div
class=
"row"
>
...
@@ -55,7 +55,7 @@
...
@@ -55,7 +55,7 @@
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<h5>
部门
<span
class=
"text-danger"
>
*
</span></h5>
<h5>
部门
<span
class=
"text-danger"
>
*
</span></h5>
<div
class=
"controls"
>
<div
class=
"controls"
>
<input
v-model=
"de
tpName"
id=
"detpName"
type=
"text"
class=
"form-control
"
>
<input
v-model=
"de
ptName"
id=
"detpName"
\@
click=
"showDeptSelectTree"
type=
"text"
class=
"form-control"
autocomplete=
"off
"
>
<input
v-model=
"deptid"
type=
"hidden"
class=
"form-control"
>
<input
v-model=
"deptid"
type=
"hidden"
class=
"form-control"
>
</div>
</div>
</div>
</div>
...
...
src/main/webapp/WEB-INF/system/user/user_roleassign.html
View file @
4a1a19e9
@layout("/common/_container.html"){
@layout("/common/_tree_dialog.html"){
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
$
(
function
()
{
$
(
function
()
{
var
index
=
parent
.
layer
.
getFrameIndex
(
window
.
name
);
//获取窗口索引
var
index
=
parent
.
layer
.
getFrameIndex
(
window
.
name
);
//获取窗口索引
$
(
"#closeButton"
).
bind
(
"click"
,
function
()
{
$
(
"#btn_close"
).
bind
(
"click"
,
function
()
{
parent
.
layer
.
close
(
index
);
parent
.
layer
.
close
(
index
);
});
});
$
(
"#
btn_save
"
).
bind
(
"click"
,
function
()
{
$
(
"#
saveButton
"
).
bind
(
"click"
,
function
()
{
var
ids
=
Feng
.
zTreeCheckedNodes
(
"zTree"
);
var
ids
=
Feng
.
zTreeCheckedNodes
(
"zTree"
);
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/mgr/setRole"
,
function
(
data
)
{
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/mgr/setRole"
,
function
(
data
)
{
Feng
.
success
(
"分配角色成功!"
);
Feng
.
success
(
"分配角色成功!"
);
...
@@ -42,38 +39,9 @@
...
@@ -42,38 +39,9 @@
}
}
}
}
};
};
var
ztree
=
new
$ZTree
(
"zTree"
,
"/role/roleTreeListByUserId/${userId}"
);
var
ztree
=
new
$ZTree
(
"zTree"
,
"/role/roleTreeListByUserId/${userId}"
);
ztree
.
setSettings
(
setting
);
ztree
.
setSettings
(
setting
);
ztree
.
init
();
ztree
.
init
();
}
}
</script>
</script>
<!-- 配置grid -->
<div
class=
"container"
style=
"padding: 0px 10px !important; margin-top: -10px; text-align: center !important;"
>
<div
class=
"row"
>
<div
class=
"ibox float-e-margins"
>
<div
class=
"ibox-title"
>
<h5>
${userAccount!}
</h5>
</div>
<div
class=
"ibox-content"
>
<ul
id=
"zTree"
class=
"ztree"
></ul>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-md-12"
>
<button
class=
"btn btn-sm btn-info"
type=
"button"
id=
"btn_save"
>
<i
class=
"ace-icon fa fa-check bigger-110"
></i>
保存
</button>
<button
class=
"btn btn-sm btn-danger"
type=
"button"
id=
"btn_close"
>
<i
class=
"ace-icon fa fa-close bigger-110"
></i>
关闭
</button>
</div>
</div>
</div>
@}
@}
src/main/webapp/assets/modular/system/user/user_info.js
View file @
4a1a19e9
...
@@ -13,7 +13,7 @@ var UserInfoDlg = {
...
@@ -13,7 +13,7 @@ var UserInfoDlg = {
name
:
""
,
name
:
""
,
birthday
:
""
,
birthday
:
""
,
deptid
:
""
,
deptid
:
""
,
de
tp
Name
:
""
,
de
pt
Name
:
""
,
phone
:
""
phone
:
""
}
}
};
};
...
@@ -111,6 +111,19 @@ $(function () {
...
@@ -111,6 +111,19 @@ $(function () {
Feng
.
alert
(
result
);
Feng
.
alert
(
result
);
e
.
preventDefault
();
e
.
preventDefault
();
}
}
},
showDeptSelectTree
:
function
()
{
var
formName
=
encodeURIComponent
(
"parent.UserInfoDlg.app.deptName"
);
var
formId
=
encodeURIComponent
(
"parent.UserInfoDlg.app.deptid"
);
var
treeUrl
=
encodeURIComponent
(
Feng
.
ctxPath
+
"/dept/tree"
);
layer
.
open
({
type
:
2
,
title
:
'部门选择'
,
area
:
[
'300px'
,
'400px'
],
content
:
Feng
.
ctxPath
+
'/system/commonTree?formName='
+
formName
+
"&formId="
+
formId
+
"&treeUrl="
+
treeUrl
});
}
}
}
}
});
});
...
...
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