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
d4cf3ae3
Commit
d4cf3ae3
authored
Jun 16, 2017
by
naan1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
部门管理增加表单验证
parent
7f1f8d6a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
3 deletions
+45
-3
src/main/webapp/WEB-INF/view/system/dept/dept_add.html
+1
-1
src/main/webapp/WEB-INF/view/system/dept/dept_edit.html
+1
-1
src/main/webapp/static/modular/system/dept/dept_info.js
+43
-1
No files found.
src/main/webapp/WEB-INF/view/system/dept/dept_add.html
View file @
d4cf3ae3
@layout("/common/_container.html"){
<div
class=
"ibox float-e-margins"
>
<div
class=
"ibox-content"
>
<div
class=
"form-horizontal"
>
<div
class=
"form-horizontal"
id=
"deptInfoForm"
>
<input
type=
"hidden"
id=
"id"
value=
""
>
...
...
src/main/webapp/WEB-INF/view/system/dept/dept_edit.html
View file @
d4cf3ae3
@layout("/common/_container.html"){
<div
class=
"ibox float-e-margins"
>
<div
class=
"ibox-content"
>
<div
class=
"form-horizontal"
>
<div
class=
"form-horizontal"
id=
"deptInfoForm"
>
<input
type=
"hidden"
id=
"id"
value=
"${dept.id}"
>
...
...
src/main/webapp/static/modular/system/dept/dept_info.js
View file @
d4cf3ae3
...
...
@@ -3,7 +3,30 @@
*/
var
DeptInfoDlg
=
{
deptInfoData
:
{},
zTreeInstance
:
null
zTreeInstance
:
null
,
validateFields
:
{
simplename
:
{
validators
:
{
notEmpty
:
{
message
:
'部门名称不能为空'
}
}
},
fullname
:
{
validators
:
{
notEmpty
:
{
message
:
'部门全称不能为空'
}
}
},
pName
:
{
validators
:
{
notEmpty
:
{
message
:
'上级名称不能为空'
}
}
}
}
};
/**
...
...
@@ -86,6 +109,15 @@ DeptInfoDlg.collectData = function() {
}
/**
* 验证数据是否为空
*/
DeptInfoDlg
.
validate
=
function
()
{
$
(
'#deptInfoForm'
).
data
(
"bootstrapValidator"
).
resetForm
();
$
(
'#deptInfoForm'
).
bootstrapValidator
(
'validate'
);
return
$
(
"#deptInfoForm"
).
data
(
'bootstrapValidator'
).
isValid
();
}
/**
* 提交添加部门
*/
DeptInfoDlg
.
addSubmit
=
function
()
{
...
...
@@ -93,6 +125,10 @@ DeptInfoDlg.addSubmit = function() {
this
.
clearData
();
this
.
collectData
();
if
(
!
this
.
validate
())
{
return
;
}
//提交信息
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/dept/add"
,
function
(
data
){
Feng
.
success
(
"添加成功!"
);
...
...
@@ -113,6 +149,10 @@ DeptInfoDlg.editSubmit = function() {
this
.
clearData
();
this
.
collectData
();
if
(
!
this
.
validate
())
{
return
;
}
//提交信息
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/dept/update"
,
function
(
data
){
Feng
.
success
(
"修改成功!"
);
...
...
@@ -133,6 +173,8 @@ function onBodyDown(event) {
}
$
(
function
()
{
Feng
.
initValidator
(
"deptInfoForm"
,
DeptInfoDlg
.
validateFields
);
var
ztree
=
new
$ZTree
(
"parentDeptMenuTree"
,
"/dept/tree"
);
ztree
.
bindOnClick
(
DeptInfoDlg
.
onClickDept
);
ztree
.
init
();
...
...
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