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
cccaa913
Commit
cccaa913
authored
Jun 16, 2017
by
naan1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
通知管理增加表单验证
parent
61f1562f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
8 deletions
+41
-8
src/main/webapp/WEB-INF/view/system/notice/notice_add.html
+3
-3
src/main/webapp/WEB-INF/view/system/notice/notice_edit.html
+3
-3
src/main/webapp/static/modular/system/notice/notice_info.js
+35
-2
No files found.
src/main/webapp/WEB-INF/view/system/notice/notice_add.html
View file @
cccaa913
@layout("/common/_container.html"){
@layout("/common/_container.html"){
<div
class=
"ibox float-e-margins"
>
<div
class=
"ibox float-e-margins"
>
<div
class=
"ibox-content"
>
<div
class=
"ibox-content"
>
<div
class=
"form-horizontal"
>
<div
class=
"form-horizontal"
id=
"noticeInfoForm"
>
<input
type=
"hidden"
id=
"id"
value=
""
>
<input
type=
"hidden"
id=
"id"
value=
""
>
...
@@ -10,14 +10,14 @@
...
@@ -10,14 +10,14 @@
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-1 control-label"
>
标题
</label>
<label
class=
"col-sm-1 control-label"
>
标题
</label>
<div
class=
"col-sm-11"
>
<div
class=
"col-sm-11"
>
<input
class=
"form-control"
id=
"title"
type=
"text"
>
<input
class=
"form-control"
id=
"title"
name=
"title"
type=
"text"
>
</div>
</div>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-1 control-label"
>
内容
</label>
<label
class=
"col-sm-1 control-label"
>
内容
</label>
<div
class=
"col-sm-11"
>
<div
class=
"col-sm-11"
>
<textarea
class=
"form-control"
id=
"content"
type=
"text"
style=
"height: 150px;"
></textarea>
<textarea
class=
"form-control"
id=
"content"
name=
"content"
type=
"text"
style=
"height: 150px;"
></textarea>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
src/main/webapp/WEB-INF/view/system/notice/notice_edit.html
View file @
cccaa913
@layout("/common/_container.html"){
@layout("/common/_container.html"){
<div
class=
"ibox float-e-margins"
>
<div
class=
"ibox float-e-margins"
>
<div
class=
"ibox-content"
>
<div
class=
"ibox-content"
>
<div
class=
"form-horizontal"
>
<div
class=
"form-horizontal"
id=
"noticeInfoForm"
>
<input
type=
"hidden"
id=
"id"
value=
"${notice.id}"
>
<input
type=
"hidden"
id=
"id"
value=
"${notice.id}"
>
...
@@ -10,14 +10,14 @@
...
@@ -10,14 +10,14 @@
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-1 control-label"
>
标题
</label>
<label
class=
"col-sm-1 control-label"
>
标题
</label>
<div
class=
"col-sm-11"
>
<div
class=
"col-sm-11"
>
<input
class=
"form-control"
id=
"title"
type=
"text"
value=
"${notice.title}"
>
<input
class=
"form-control"
id=
"title"
name=
"title"
type=
"text"
value=
"${notice.title}"
>
</div>
</div>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-1 control-label"
>
内容
</label>
<label
class=
"col-sm-1 control-label"
>
内容
</label>
<div
class=
"col-sm-11"
>
<div
class=
"col-sm-11"
>
<textarea
class=
"form-control"
id=
"content"
type=
"text"
style=
"height: 150px;"
>
${notice.content}
</textarea>
<textarea
class=
"form-control"
id=
"content"
name=
"content"
type=
"text"
style=
"height: 150px;"
>
${notice.content}
</textarea>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
src/main/webapp/static/modular/system/notice/notice_info.js
View file @
cccaa913
...
@@ -2,7 +2,23 @@
...
@@ -2,7 +2,23 @@
* 初始化通知详情对话框
* 初始化通知详情对话框
*/
*/
var
NoticeInfoDlg
=
{
var
NoticeInfoDlg
=
{
noticeInfoData
:
{}
noticeInfoData
:
{},
validateFields
:
{
title
:
{
validators
:
{
notEmpty
:
{
message
:
'标题不能为空'
}
}
},
content
:
{
validators
:
{
notEmpty
:
{
message
:
'内容不能为空'
}
}
}
}
};
};
/**
/**
...
@@ -48,6 +64,15 @@ NoticeInfoDlg.collectData = function() {
...
@@ -48,6 +64,15 @@ NoticeInfoDlg.collectData = function() {
}
}
/**
/**
* 验证数据是否为空
*/
NoticeInfoDlg
.
validate
=
function
()
{
$
(
'#noticeInfoForm'
).
data
(
"bootstrapValidator"
).
resetForm
();
$
(
'#noticeInfoForm'
).
bootstrapValidator
(
'validate'
);
return
$
(
"#noticeInfoForm"
).
data
(
'bootstrapValidator'
).
isValid
();
};
/**
* 提交添加
* 提交添加
*/
*/
NoticeInfoDlg
.
addSubmit
=
function
()
{
NoticeInfoDlg
.
addSubmit
=
function
()
{
...
@@ -55,6 +80,10 @@ NoticeInfoDlg.addSubmit = function() {
...
@@ -55,6 +80,10 @@ NoticeInfoDlg.addSubmit = function() {
this
.
clearData
();
this
.
clearData
();
this
.
collectData
();
this
.
collectData
();
if
(
!
this
.
validate
())
{
return
;
}
//提交信息
//提交信息
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/notice/add"
,
function
(
data
){
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/notice/add"
,
function
(
data
){
Feng
.
success
(
"添加成功!"
);
Feng
.
success
(
"添加成功!"
);
...
@@ -75,6 +104,10 @@ NoticeInfoDlg.editSubmit = function() {
...
@@ -75,6 +104,10 @@ NoticeInfoDlg.editSubmit = function() {
this
.
clearData
();
this
.
clearData
();
this
.
collectData
();
this
.
collectData
();
if
(
!
this
.
validate
())
{
return
;
}
//提交信息
//提交信息
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/notice/update"
,
function
(
data
){
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/notice/update"
,
function
(
data
){
Feng
.
success
(
"修改成功!"
);
Feng
.
success
(
"修改成功!"
);
...
@@ -88,5 +121,5 @@ NoticeInfoDlg.editSubmit = function() {
...
@@ -88,5 +121,5 @@ NoticeInfoDlg.editSubmit = function() {
}
}
$
(
function
()
{
$
(
function
()
{
Feng
.
initValidator
(
"noticeInfoForm"
,
NoticeInfoDlg
.
validateFields
);
});
});
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