富文本中文处理
This commit is contained in:
parent
c93f54a812
commit
d0bd515ed4
|
|
@ -1233,8 +1233,7 @@ var table = {
|
|||
seeSummernoteDetail: function(index,fild) {
|
||||
table.set();
|
||||
var row = $("#" + table.options.id).bootstrapTable('getData')[index];
|
||||
console.log(row)
|
||||
var content =window.atob(row[fild]);
|
||||
var content = decodeURI(window.atob(row[fild]));
|
||||
var htmlcontent = [
|
||||
"<div style='padding:20px;'>",
|
||||
content,
|
||||
|
|
|
|||
|
|
@ -156,10 +156,10 @@
|
|||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">${comment}:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="hidden" name="${field}">
|
||||
<div class="file-loading">
|
||||
<input type="hidden" name="${field}">
|
||||
<input class="form-control file-upload" name="file" id="${field}"
|
||||
type="file" #if($column.required) required#end>
|
||||
type="file" >
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -261,7 +261,7 @@
|
|||
callbacks: {
|
||||
onChange: function (contents, $edittable) {
|
||||
// Xss 过滤掉了html 内容 ,所以用base64 保存
|
||||
$("input[name='" + this.id + "']").val(window.btoa(contents))
|
||||
$("input[name='" + this.id + "']").val(window.btoa(encodeURI(contents)));
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -157,15 +157,14 @@
|
|||
required#end>[[*{${field}}]]</textarea>
|
||||
</div>
|
||||
</div>
|
||||
#elseif($column.htmlType == "upload" || $column.htmlType == "uploads")
|
||||
#elseif($column.htmlType == "upload")
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">${comment}:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="hidden" th:field="*{${field}}">
|
||||
<div class="file-loading">
|
||||
<input type="hidden" th:field="*{${field}}">
|
||||
<input class="form-control file-upload" name="file" id="${field}"
|
||||
type="file" #if($column.htmlType == "uploads")
|
||||
multiple#end #if($column.required) required#end>
|
||||
type="file">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -182,18 +181,18 @@
|
|||
#end
|
||||
#end
|
||||
#if($table.sub)
|
||||
<h4 class="form-header h4">${subTable.functionName}信息</h4>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<button type="button" class="btn btn-white btn-sm" onclick="addColumn()"><i class="fa fa-plus">
|
||||
增加</i></button>
|
||||
<button type="button" class="btn btn-white btn-sm" onclick="sub.delColumn()"><i class="fa fa-minus">
|
||||
删除</i></button>
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
<h4 class="form-header h4">${subTable.functionName}信息</h4>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<button type="button" class="btn btn-white btn-sm" onclick="addColumn()"><i class="fa fa-plus">
|
||||
增加</i></button>
|
||||
<button type="button" class="btn btn-white btn-sm" onclick="sub.delColumn()"><i class="fa fa-minus">
|
||||
删除</i></button>
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
#end
|
||||
</form>
|
||||
</div>
|
||||
|
|
@ -267,14 +266,14 @@
|
|||
$(function () {
|
||||
$('.summernote').each(function (i) {
|
||||
var content = $("input[name='" + this.id + "']").val()
|
||||
content = window.atob(content);
|
||||
content = decodeURI(window.atob(content));
|
||||
this.innerHTML = content;
|
||||
$(this).summernote({
|
||||
height: 100,
|
||||
lang: 'zh-CN',
|
||||
callbacks: {
|
||||
onChange: function (contents, $edittable) {
|
||||
$("input[name='" + this.id + "']").val(window.btoa(contents))
|
||||
$("input[name='" + this.id + "']").val(window.btoa(encodeURI(contents)));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue