Commit 149cb38d authored by Zhou Yang's avatar Zhou Yang 🍋

富文本编辑器换成了simditor

parent 42192484
Pipeline #31 failed with stages
......@@ -8,12 +8,11 @@
<link href="${rc.contextPath}/js/jk/bootstrap-datetimepicker.min.css" type="text/css" rel="stylesheet">
<link href="${rc.contextPath}/css/dropzone.css" type="text/css" rel="stylesheet">
<!--<link rel="stylesheet" type="text/css" href="${rc.contextPath}/simditor-2.3.23/site/assets/styles/simditor.css" />
<link rel="stylesheet" type="text/css" href="${rc.contextPath}/simditor-2.3.23/site/assets/styles/simditor.css" />
<script type="text/javascript" src="${rc.contextPath}/simditor-2.3.23/site/assets/scripts/module.js"></script>
<script type="text/javascript" src="${rc.contextPath}/simditor-2.3.23/site/assets/scripts/hotkeys.js"></script>
<script type="text/javascript" src="${rc.contextPath}/simditor-2.3.23/site/assets/scripts/uploader.js"></script>
<script type="text/javascript" src="${rc.contextPath}/simditor-2.3.23/site/assets/scripts/simditor.js"></script>
-->
<script type="text/javascript" src="${rc.contextPath}/statics/plugins/umeditor/third-party/template.min.js"></script>
<script type="text/javascript" charset="utf-8" src="${rc.contextPath}/statics/plugins/umeditor/umeditor.config.js"></script>
......@@ -108,20 +107,20 @@
</div>
</div>
<div class="form-group">
<!-- <div class="form-group">
<div class="col-sm-2 control-label">内容</div>
<div class="col-sm-10">
<script type="text/plain" id="myEditor" style="width: 700px; height: 250px;"></script>
</div>
</div>
<!--<div class="form-group">
</div>-->
<div class="form-group">
<div class="col-sm-2 control-label">内容</div>
<div class="col-sm-10" >
<div style="width: 700px; ">
<textarea id="editorByFancy" ></textarea>
</div>
</div>
</div>-->
</div>
<div class="form-group">
<div class="col-sm-2 control-label">是否轮播</div>
......@@ -167,10 +166,10 @@
<script type="text/javascript">
$(function(){
//实例化编辑器
var um = UM.getEditor('myEditor');
/*var um = UM.getEditor('myEditor');
um.focus();
um.execCommand('forecolor','#000');
/* var editor,toolbar;
um.execCommand('forecolor','#000');*/
/* var editor;
Simditor.locale = 'zh-CN';
editor = new Simditor({
textarea: $('#editorByFancy'),
......
......@@ -2,6 +2,7 @@ var id = T.p("id");
var photo;
var isUsedPhotoOrFile=false;
var myname;
var editor;
$(function () {
$("#jqGrid").jqGrid({
url: '../jk/jgsubject/list',
......@@ -152,6 +153,23 @@ var vm = new Vue({
}
}
})
Simditor.locale = 'zh-CN';
editor = new Simditor({
textarea: $('#editorByFancy'),
toolbar: ['title', 'bold', 'italic', 'underline', 'strikethrough', 'fontScale', 'color', '|', 'ol', 'ul', 'blockquote', 'code', 'table', '|', 'link', 'image', 'hr', '|', 'indent', 'outdent', 'alignment'],
pasteImage: true,//允许粘贴图片
upload : {
url : '../sys/oss/ToLeadImg', //文件上传的接口地址
params: null, //键值对,指定文件上传接口的额外参数,上传的时候随文件一起提交
fileKey: 'upfile', //服务器端获取文件数据的参数名
connectionCount: 1,
leaveConfirm: '正在上传文件'
}
//optional options
});
},
methods: {
query: function () {
......@@ -167,7 +185,11 @@ var vm = new Vue({
vm.jgSubject.flag=0;
UM.getEditor('myEditor').setContent("",false);
//UM.getEditor('myEditor').setContent("",false);
editor.setValue ('')
$("#photo").empty();
$("#photo").append("drop files here to upload");
......@@ -198,8 +220,10 @@ var vm = new Vue({
vm.jgSubject.pubDate = $("#pubDate").val();
vm.jgSubject.atta = photo ;
vm.jgSubject.file = myname ;
vm.jgSubject.content = UM.getEditor('myEditor').getContent();
var url = vm.jgSubject.id == null ? "../jk/jgsubject/save" : "../jk/jgsubject/update";
//vm.jgSubject.content = UM.getEditor('myEditor').getContent();
vm.jgSubject.content=editor.getValue();
var url = vm.jgSubject.id == null ? "../jk/jgsubject/save" : "../jk/jgsubject/update";
$.ajax({
type: "POST",
url: url,
......@@ -245,7 +269,9 @@ var vm = new Vue({
getInfo: function(id){
$.get("../jk/jgsubject/info/"+id, function(r){
vm.jgSubject = r.jgSubject;
UM.getEditor('myEditor').setContent(vm.jgSubject.content,false);
//UM.getEditor('myEditor').setContent(vm.jgSubject.content,false);
editor.setValue (vm.jgSubject.content)
if(vm.jgSubject.atta!=null){
$("#photo").append('<img src="../doc/'+vm.jgSubject.atta+'" style="height: 110px;width: 220px;"/>');
}else{
......@@ -286,5 +312,5 @@ var vm = new Vue({
$(function(){
UM.getEditor('myEditor')
//UM.getEditor('myEditor')
})
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment