若依3.2

This commit is contained in:
RuoYi
2019-01-16 14:56:27 +08:00
parent 04f2607398
commit 57fa243747
36 changed files with 1750 additions and 6685 deletions

View File

@@ -47,8 +47,38 @@
$('.summernote').summernote({
height : '220px',
lang : 'zh-CN'
lang : 'zh-CN',
callbacks: {
onImageUpload: function (files) {
sendFile(files[0], this);
}
}
});
// 上传文件
function sendFile(file, obj) {
var data = new FormData();
data.append("file", file);
$.ajax({
type: "POST",
url: ctx + "common/upload",
data: data,
cache: false,
contentType: false,
processData: false,
dataType: 'json',
success: function(result) {
if (result.code == web_status.SUCCESS) {
$(obj).summernote('editor.insertImage', result.url, result.fileName);
} else {
$.modal.alertError(result.msg);
}
},
error: function(error) {
$.modal.alertWarning("图片上传失败。");
}
});
}
$("#form-notice-add").validate({
rules:{