....
This commit is contained in:
parent
85d1045648
commit
8a288e9e78
@ -34,7 +34,7 @@ spring:
|
||||
enabled: true # 开启 Elasticsearch仓库(默认值:true)
|
||||
client:
|
||||
reactive:
|
||||
endpoints: 127.0.0.1:9200
|
||||
endpoints: 172.24.133.129:9200
|
||||
connection-timeout: 5000
|
||||
socket-timeout: 5000
|
||||
|
||||
|
||||
@ -157,9 +157,36 @@
|
||||
<script th:inline="javascript">
|
||||
var caseType = [[${caseType}]];
|
||||
</script>
|
||||
<script charset="utf-8" type="text/javascript" th:src="@{/libs/kindeditor/kindeditor-all-custom-min.js}"></script>
|
||||
<script charset="utf-8" type="text/javascript" th:src="@{/libs/kindeditor/lang/zh-CN.js}"></script>
|
||||
<script charset="utf-8" type="text/javascript" th:src="@{/libs/jquery.form/jquery.form.min.js}"></script>
|
||||
<script charset="utf-8" type="text/javascript" th:src="@{/js/cases/content.js}"></script>
|
||||
<script type="text/javascript">
|
||||
var editor;
|
||||
function initKEdit(desct){
|
||||
editor = KindEditor.create(desct,{
|
||||
filterMode: false, // 取消过滤video等
|
||||
themeType : 'simple', // 简单风格'simple'
|
||||
width: '100%',
|
||||
height: '400px',
|
||||
langType: 'zh-CN', // 语言 'zh-CN' 'en'
|
||||
uploadJson: '[[@{/console/kindeditor/oss/api/file-upload}]]', // 指定上传文件的服务器端程序
|
||||
// fileManagerJson: '[[@{/console/kindeditor/local/api/file-manager}]]', // 指定浏览远程图片的服务器端程序
|
||||
allowFileManager: false, // 不允许对上传图片/文件进行管理,文件空间功能,OSS是KeyMap文件系统对目录列表支持不一样
|
||||
afterChange:function(){this.sync();},
|
||||
afterUpload: function(){this.sync();}, // 图片上传后,将上传内容同步到textarea中
|
||||
afterBlur: function(){this.sync();}, // 失去焦点时,将上传内容同步到textarea中
|
||||
afterCreate: function(){
|
||||
// console.log('after Create');
|
||||
// let _styles = '<style> .ke-content img{max-width:100%;} </style>'
|
||||
// $(".ke-edit-iframe").contents().find("body").append(_styles);
|
||||
},
|
||||
resizeMode: 1
|
||||
});
|
||||
// editor.ready(function() {
|
||||
// console.log('DOM loaded');
|
||||
// });
|
||||
}
|
||||
|
||||
$(".selectpicker").selectpicker({
|
||||
noneSelectedText : '请选择'
|
||||
@ -192,12 +219,18 @@ var caseType = [[${caseType}]];
|
||||
|
||||
}
|
||||
});
|
||||
/* $("#contentType26").find("option[value='"+$("#contentType26 option:eq(0)").val()+"']").attr("selected",true);
|
||||
$("#contentType18").find("option[value='"+$("#contentType18 option:eq(0)").val()+"']").attr("selected",true);
|
||||
$("#contentType19").find("option[value='"+$("#contentType19 option:eq(0)").val()+"']").attr("selected",true);
|
||||
$("#contentType20").find("option[value='"+$("#contentType20 option:eq(0)").val()+"']").attr("selected",true);
|
||||
$("#contentType21").find("option[value='"+$("#contentType21 option:eq(0)").val()+"']").attr("selected",true);
|
||||
$("#contentType23").find("option[value='"+$("#contentType23 option:eq(0)").val()+"']").attr("selected",true);
|
||||
$("#contentType24").find("option[value='"+$("#contentType24 option:eq(0)").val()+"']").attr("selected",true);*/
|
||||
//使用refresh方法更新UI以匹配新状态
|
||||
$('.selectpicker').selectpicker('refresh');
|
||||
//render方法强制重新渲染引导程序
|
||||
$('.selectpicker').selectpicker('render');
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -433,9 +466,10 @@ var caseType = [[${caseType}]];
|
||||
}
|
||||
|
||||
$(function () {
|
||||
|
||||
initKEdit('#desct'); // 初始化编辑器
|
||||
getDropDownBox();
|
||||
|
||||
|
||||
if($("#result").val() > 0){
|
||||
$("#btn_save").hide();
|
||||
}
|
||||
@ -500,10 +534,39 @@ var caseType = [[${caseType}]];
|
||||
|
||||
// 提交保存
|
||||
$("#btn_save").on('click', function () {
|
||||
if($("#contentType26").val() === null){
|
||||
layer.msg('关联部门不能为空!');
|
||||
}
|
||||
if($("#contentType18").val() === null){
|
||||
layer.msg('案例类型不能为空!');
|
||||
}
|
||||
if($("#contentType19").val() === null){
|
||||
layer.msg('案例用途不能为空!');
|
||||
}
|
||||
if($("#contentType20").val() === null){
|
||||
layer.msg('创意形式不能为空!');
|
||||
}
|
||||
if($("#contentType21").val() === null){
|
||||
layer.msg('节日事件不能为空!');
|
||||
}
|
||||
if($("#contentType23").val() === null){
|
||||
layer.msg('品牌公司不能为空!');
|
||||
}
|
||||
if($("#contentType24").val() === null){
|
||||
layer.msg('广告公司不能为空!');
|
||||
}
|
||||
// editor.sync(); // 同步editor数据
|
||||
if(caseType == 'design' || caseType == 'video' || caseType == 'h5'){
|
||||
$('#imgList').val(getImgJsonList()); // 同步多图json数据
|
||||
}
|
||||
editor.sync(); // 同步editor数据
|
||||
|
||||
// let htmlValue = editor.html();
|
||||
let textValue = editor.text();
|
||||
// 替换所有的换行符和所有所有的空格
|
||||
textValue = textValue.trim().replace(/\r\n/g, "").replace(/\n/g, "").replace(/\s/g,"");
|
||||
$('#content_text').val(textValue);
|
||||
|
||||
if (doValidForm(newsForm)) {
|
||||
// $('#type').removeAttr('disabled'); // disabled的表单form.serialize取不到值
|
||||
Core.mask("#btn_save");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user