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
74aa8ffb
Commit
74aa8ffb
authored
Jun 22, 2017
by
naan1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加富文本编辑器
parent
2b3b3cf9
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
36 additions
and
24 deletions
+36
-24
src/main/java/com/stylefeng/guns/modular/system/controller/NoticeController.java
+1
-0
src/main/webapp/WEB-INF/view/system/notice/notice_add.html
+3
-1
src/main/webapp/WEB-INF/view/system/notice/notice_edit.html
+4
-2
src/main/webapp/static/css/_fstyle.css
+5
-0
src/main/webapp/static/js/plugins/wangEditor/wangEditor.js
+0
-0
src/main/webapp/static/modular/system/notice/notice_info.js
+23
-21
No files found.
src/main/java/com/stylefeng/guns/modular/system/controller/NoticeController.java
View file @
74aa8ffb
...
...
@@ -66,6 +66,7 @@ public class NoticeController extends BaseController {
public
String
noticeUpdate
(
@PathVariable
Integer
noticeId
,
Model
model
)
{
Notice
notice
=
this
.
noticeMapper
.
selectById
(
noticeId
);
model
.
addAttribute
(
"notice"
,
notice
);
LogObjectHolder
.
me
().
set
(
notice
);
return
PREFIX
+
"notice_edit.html"
;
}
...
...
src/main/webapp/WEB-INF/view/system/notice/notice_add.html
View file @
74aa8ffb
...
...
@@ -17,7 +17,8 @@
<div
class=
"form-group"
>
<label
class=
"col-sm-1 control-label"
>
内容
</label>
<div
class=
"col-sm-11"
>
<textarea
class=
"form-control"
id=
"content"
name=
"content"
type=
"text"
style=
"height: 150px;"
></textarea>
<div
id=
"editor"
class=
"editorHeight"
>
</div>
</div>
</div>
</div>
...
...
@@ -33,5 +34,6 @@
</div>
</div>
<script
type=
"text/javascript"
src=
"${ctxPath}/static/js/plugins/wangEditor/wangEditor.js"
></script>
<script
src=
"${ctxPath}/static/modular/system/notice/notice_info.js"
></script>
@}
src/main/webapp/WEB-INF/view/system/notice/notice_edit.html
View file @
74aa8ffb
...
...
@@ -4,6 +4,7 @@
<div
class=
"form-horizontal"
id=
"noticeInfoForm"
>
<input
type=
"hidden"
id=
"id"
value=
"${notice.id}"
>
<input
type=
"hidden"
id=
"contentVal"
value=
"${notice.content}"
>
<div
class=
"row"
>
<div
class=
"col-sm-12"
>
...
...
@@ -17,7 +18,8 @@
<div
class=
"form-group"
>
<label
class=
"col-sm-1 control-label"
>
内容
</label>
<div
class=
"col-sm-11"
>
<textarea
class=
"form-control"
id=
"content"
name=
"content"
type=
"text"
style=
"height: 150px;"
>
${notice.content}
</textarea>
<div
id=
"editor"
class=
"editorHeight"
>
</div>
</div>
</div>
</div>
...
...
@@ -30,8 +32,8 @@
</div>
</div>
</div>
</div>
</div>
<script
type=
"text/javascript"
src=
"${ctxPath}/static/js/plugins/wangEditor/wangEditor.js"
></script>
<script
src=
"${ctxPath}/static/modular/system/notice/notice_info.js"
></script>
@}
src/main/webapp/static/css/_fstyle.css
View file @
74aa8ffb
...
...
@@ -55,3 +55,7 @@
.dept-tree
{
padding
:
10px
}
.editorHeight
{
height
:
170px
;
}
\ No newline at end of file
src/main/webapp/static/js/plugins/wangEditor/wangEditor.js
0 → 100644
View file @
74aa8ffb
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/main/webapp/static/modular/system/notice/notice_info.js
View file @
74aa8ffb
...
...
@@ -2,7 +2,8 @@
* 初始化通知详情对话框
*/
var
NoticeInfoDlg
=
{
noticeInfoData
:
{},
noticeInfoData
:
{},
editor
:
null
,
validateFields
:
{
title
:
{
validators
:
{
...
...
@@ -10,13 +11,6 @@ var NoticeInfoDlg = {
message
:
'标题不能为空'
}
}
},
content
:
{
validators
:
{
notEmpty
:
{
message
:
'内容不能为空'
}
}
}
}
};
...
...
@@ -24,7 +18,7 @@ var NoticeInfoDlg = {
/**
* 清除数据
*/
NoticeInfoDlg
.
clearData
=
function
()
{
NoticeInfoDlg
.
clearData
=
function
()
{
this
.
noticeInfoData
=
{};
}
...
...
@@ -34,7 +28,7 @@ NoticeInfoDlg.clearData = function() {
* @param key 数据的名称
* @param val 数据的具体值
*/
NoticeInfoDlg
.
set
=
function
(
key
,
val
)
{
NoticeInfoDlg
.
set
=
function
(
key
,
val
)
{
this
.
noticeInfoData
[
key
]
=
(
typeof
value
==
"undefined"
)
?
$
(
"#"
+
key
).
val
()
:
value
;
return
this
;
}
...
...
@@ -45,22 +39,23 @@ NoticeInfoDlg.set = function(key, val) {
* @param key 数据的名称
* @param val 数据的具体值
*/
NoticeInfoDlg
.
get
=
function
(
key
)
{
NoticeInfoDlg
.
get
=
function
(
key
)
{
return
$
(
"#"
+
key
).
val
();
}
/**
* 关闭此对话框
*/
NoticeInfoDlg
.
close
=
function
()
{
NoticeInfoDlg
.
close
=
function
()
{
parent
.
layer
.
close
(
window
.
parent
.
Notice
.
layerIndex
);
}
/**
* 收集数据
*/
NoticeInfoDlg
.
collectData
=
function
()
{
this
.
set
(
'id'
).
set
(
'title'
).
set
(
'content'
);
NoticeInfoDlg
.
collectData
=
function
()
{
this
.
noticeInfoData
[
'content'
]
=
NoticeInfoDlg
.
editor
.
txt
.
text
();
this
.
set
(
'id'
).
set
(
'title'
);
}
/**
...
...
@@ -75,7 +70,7 @@ NoticeInfoDlg.validate = function () {
/**
* 提交添加
*/
NoticeInfoDlg
.
addSubmit
=
function
()
{
NoticeInfoDlg
.
addSubmit
=
function
()
{
this
.
clearData
();
this
.
collectData
();
...
...
@@ -85,11 +80,11 @@ NoticeInfoDlg.addSubmit = function() {
}
//提交信息
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/notice/add"
,
function
(
data
)
{
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/notice/add"
,
function
(
data
)
{
Feng
.
success
(
"添加成功!"
);
window
.
parent
.
Notice
.
table
.
refresh
();
NoticeInfoDlg
.
close
();
},
function
(
data
)
{
},
function
(
data
)
{
Feng
.
error
(
"添加失败!"
+
data
.
responseJSON
.
message
+
"!"
);
});
ajax
.
set
(
this
.
noticeInfoData
);
...
...
@@ -99,7 +94,7 @@ NoticeInfoDlg.addSubmit = function() {
/**
* 提交修改
*/
NoticeInfoDlg
.
editSubmit
=
function
()
{
NoticeInfoDlg
.
editSubmit
=
function
()
{
this
.
clearData
();
this
.
collectData
();
...
...
@@ -109,17 +104,24 @@ NoticeInfoDlg.editSubmit = function() {
}
//提交信息
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/notice/update"
,
function
(
data
)
{
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/notice/update"
,
function
(
data
)
{
Feng
.
success
(
"修改成功!"
);
window
.
parent
.
Notice
.
table
.
refresh
();
NoticeInfoDlg
.
close
();
},
function
(
data
)
{
},
function
(
data
)
{
Feng
.
error
(
"修改失败!"
+
data
.
responseJSON
.
message
+
"!"
);
});
ajax
.
set
(
this
.
noticeInfoData
);
ajax
.
start
();
}
$
(
function
()
{
$
(
function
()
{
Feng
.
initValidator
(
"noticeInfoForm"
,
NoticeInfoDlg
.
validateFields
);
//初始化编辑器
var
E
=
window
.
wangEditor
;
var
editor
=
new
E
(
'#editor'
);
editor
.
create
();
editor
.
txt
.
html
(
$
(
"#contentVal"
).
val
());
NoticeInfoDlg
.
editor
=
editor
;
});
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