|
@@ -151,16 +151,19 @@
|
|
|
.select2-choice{
|
|
|
width: 200px
|
|
|
}
|
|
|
+
|
|
|
+ .red {
|
|
|
+ color: red;
|
|
|
+ }
|
|
|
</style>
|
|
|
<script type="text/javascript">
|
|
|
$(document).ready(function() {
|
|
|
//$("#name").focus();
|
|
|
$("#inputForm").validate({
|
|
|
submitHandler: function(form){
|
|
|
- var status = $("#status").val();
|
|
|
+ var status = $("input[name='status']:checked").val();
|
|
|
var commodityType = $("#commodityType").val();
|
|
|
// 计算空数据条数
|
|
|
-
|
|
|
var propertyArr = [];
|
|
|
var name = $("#name").val();
|
|
|
var alias = $("#alias").val();
|
|
@@ -226,12 +229,87 @@
|
|
|
}
|
|
|
}
|
|
|
$("#emptyNum").val(emptyNum);
|
|
|
+
|
|
|
+ // 检测敏感词
|
|
|
+ var propertyMap = new Map();
|
|
|
+ propertyMap.set("name", name);
|
|
|
+ propertyMap.set("alias", alias);
|
|
|
+ propertyMap.set("discription", discription);
|
|
|
+ propertyMap.set("productLink", productLink);
|
|
|
+ for (var i = 0; i <= 20; i++) {
|
|
|
+ var paramName = "\"paramList[" + i + "].name\"";
|
|
|
+ var contentName = "\"paramList[" + i + "].content\"";
|
|
|
+ var param = $('input[name=' + paramName + ']').val();
|
|
|
+ var content = $('input[name=' + contentName + ']').val();
|
|
|
+ if ( param === undefined || param === '') {
|
|
|
+ break;
|
|
|
+ } else {
|
|
|
+ propertyMap.set("param" + i, param);
|
|
|
+ propertyMap.set("content" + i, content);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ propertyMap.set("advantage", advantage);
|
|
|
+ propertyMap.set("disadvantage", disadvantage);
|
|
|
+ propertyMap.set("principle", principle);
|
|
|
+ propertyMap.set("seoKeyword", seoKeyword);
|
|
|
+ propertyMap.set("brand", brand);
|
|
|
+ propertyMap.set("producePlace", producePlace);
|
|
|
+ propertyMap.set("company", company);
|
|
|
+ propertyMap.set("adaptiveMan", adaptiveMan);
|
|
|
+ propertyMap.set("unAdaptiveMan", unAdaptiveMan);
|
|
|
+ propertyMap.set("aroundOperation", aroundOperation);
|
|
|
+ if (2 == commodityType) {
|
|
|
+ propertyMap.set("authLink", authLink);
|
|
|
+ }
|
|
|
+ for (var i = 0; i <= 20; i++) {
|
|
|
+ var questionName = "\"questionList[" + i + "].question\"";
|
|
|
+ var answerName = "\"questionList[" + i + "].answer\"";
|
|
|
+ var question = $('input[name=' + questionName + ']').val();
|
|
|
+ var answer = $('input[name=' + answerName + ']').val();
|
|
|
+ if (question === undefined || question === '') {
|
|
|
+ break;
|
|
|
+ } else {
|
|
|
+ propertyMap.set("question" + i, question);
|
|
|
+ propertyMap.set("answer" + i, answer);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var sensitiveWords = '${sensitiveWords}';
|
|
|
+ const mint = new MintFilter(sensitiveWords.split('|'));
|
|
|
+ var filterSync = '';
|
|
|
+ var touchWords = '';
|
|
|
+ var touchNum = 0;
|
|
|
+ propertyMap.forEach(function (value,key,map) {
|
|
|
+ filterSync = mint.filterSync(value);
|
|
|
+ filterSync.words.forEach(word=>{
|
|
|
+ touchWords += touchWords === '' ? word : "," + word;
|
|
|
+ })
|
|
|
+ if (touchWords !== '') {
|
|
|
+ // 增加敏感词触发数量
|
|
|
+ touchNum++;
|
|
|
+ // 设置敏感词提示
|
|
|
+ $("#" + key + "SensitiveWords").text("敏感词:" + touchWords);
|
|
|
+ touchWords = '';
|
|
|
+ }
|
|
|
+ });
|
|
|
if (1 == status && emptyNum > 0) {
|
|
|
var msg = "您还剩余" + emptyNum + "项未完善,将会导致用户对您产品/仪器的认识度不够,确认是否提交?";
|
|
|
top.$.jBox.confirm(msg, '系统提示', function (v, h, f) {
|
|
|
if (v == 'ok') {
|
|
|
- loading('正在提交,请稍等...');
|
|
|
- form.submit();
|
|
|
+ if (touchNum > 0) {
|
|
|
+ var msg = 1 == status?"当前发布内容存在敏感词,已为您标记在输入框下方," +
|
|
|
+ "请修改后,再进行保存发布,强行保存发布将会导致审核不通过!":
|
|
|
+ "当前内容存在敏感词,已为您标记在输入框下方,建议修改后再进行保存!否则," +
|
|
|
+ "将会影响发布时审核不通过!";
|
|
|
+ top.$.jBox.confirm(msg, '系统提示', function (v, h, f) {
|
|
|
+ if (v == 'ok') {
|
|
|
+ loading('正在提交,请稍等...');
|
|
|
+ form.submit();
|
|
|
+ }
|
|
|
+ }, {buttonsFocus: 1, persistent: true});
|
|
|
+ } else{
|
|
|
+ loading('正在提交,请稍等...');
|
|
|
+ form.submit();
|
|
|
+ }
|
|
|
}
|
|
|
}, {buttonsFocus: 1, persistent: true});
|
|
|
} else {
|
|
@@ -269,18 +347,21 @@
|
|
|
<label class="control-label">${commodityType}名称:</label>
|
|
|
<div class="controls">
|
|
|
<form:input path="name" htmlEscape="false" class="input-xlarge "/>
|
|
|
+ <label id="nameSensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
|
<label class="control-label">${commodityType}别名:</label>
|
|
|
<div class="controls">
|
|
|
<form:input path="alias" htmlEscape="false" class="input-xlarge " placeholder="输入英文名或者其他名称"/>
|
|
|
+ <label id="aliasSensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
|
<label class="control-label">${commodityType}概述:</label>
|
|
|
<div class="controls" style="width:812px">
|
|
|
<textarea type="text" id="discription" name="discription" style="position: relative;height: 100px; width: 450px;" >${cmBaikeProduct.discription}</textarea>
|
|
|
+ <label id="discriptionSensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
@@ -296,6 +377,7 @@
|
|
|
<label class="control-label">${commodityType}链接:</label>
|
|
|
<div class="controls">
|
|
|
<form:input path="productLink" htmlEscape="false" class="input-xxlarge " placeholder="输入采美商城的相关商品详情链接,便于用户精准找到"/>
|
|
|
+ <label id="productLinkSensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
@@ -320,6 +402,7 @@
|
|
|
<label class="control-label">认证链接:</label>
|
|
|
<div class="controls">
|
|
|
<form:input path="authLink" htmlEscape="false" class="input-xxlarge " cssStyle="position: relative"/>
|
|
|
+ <label id="authLinkSensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
@@ -343,42 +426,54 @@
|
|
|
<div class="controls paramRow" id="paramRow0">
|
|
|
<input name="paramList[0].name" htmlEscape="false" class="input-small "
|
|
|
placeholder="例如:型号">
|
|
|
+ <label id="param0SensitiveWords" class="red"></label>
|
|
|
<input name="paramList[0].content" htmlEscape="false" class="input-xlarge "
|
|
|
placeholder="输入参数信息">
|
|
|
+ <label id="content0SensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
<div class="controls paramRow" id="paramRow1">
|
|
|
<input name="paramList[1].name" htmlEscape="false" class="input-small "
|
|
|
placeholder="例如:性质类型">
|
|
|
+ <label id="param1SensitiveWords" class="red"></label>
|
|
|
<input name="paramList[1].content" htmlEscape="false" class="input-xlarge "
|
|
|
placeholder="输入参数信息">
|
|
|
+ <label id="content1SensitiveWords" class="red"></label>
|
|
|
<a onclick="deleteParam(1)" style="cursor: pointer">删除</a>
|
|
|
</div>
|
|
|
<div class="controls paramRow" id="paramRow2">
|
|
|
<input name="paramList[2].name" htmlEscape="false" class="input-small "
|
|
|
placeholder="例如:成分">
|
|
|
+ <label id="param2SensitiveWords" class="red"></label>
|
|
|
<input name="paramList[2].content" htmlEscape="false" class="input-xlarge "
|
|
|
placeholder="输入参数信息">
|
|
|
+ <label id="content2SensitiveWords" class="red"></label>
|
|
|
<a onclick="deleteParam(2)" style="cursor: pointer">删除</a>
|
|
|
</div>
|
|
|
<div class="controls paramRow" id="paramRow3">
|
|
|
<input name="paramList[3].name" htmlEscape="false" class="input-small "
|
|
|
placeholder="例如:规格">
|
|
|
+ <label id="param3SensitiveWords" class="red"></label>
|
|
|
<input name="paramList[3].content" htmlEscape="false" class="input-xlarge "
|
|
|
placeholder="输入参数信息">
|
|
|
+ <label id="content3SensitiveWords" class="red"></label>
|
|
|
<a onclick="deleteParam(3)" style="cursor: pointer">删除</a>
|
|
|
</div>
|
|
|
<div class="controls paramRow" id="paramRow4">
|
|
|
<input name="paramList[4].name" htmlEscape="false" class="input-small "
|
|
|
placeholder="例如:性质类型">
|
|
|
+ <label id="param4SensitiveWords" class="red"></label>
|
|
|
<input name="paramList[4].content" htmlEscape="false" class="input-xlarge "
|
|
|
placeholder="输入参数信息">
|
|
|
+ <label id="content4SensitiveWords" class="red"></label>
|
|
|
<a onclick="deleteParam(4)" style="cursor: pointer">删除</a>
|
|
|
</div>
|
|
|
<div class="controls paramRow" id="paramRow5">
|
|
|
<input name="paramList[5].name" htmlEscape="false" class="input-small "
|
|
|
placeholder="例如:性质类型">
|
|
|
+ <label id="param5SensitiveWords" class="red"></label>
|
|
|
<input name="paramList[5].content" htmlEscape="false" class="input-xlarge "
|
|
|
placeholder="输入参数信息">
|
|
|
+ <label id="content5SensitiveWords" class="red"></label>
|
|
|
<a onclick="deleteParam(5)" style="cursor: pointer">删除</a>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -387,6 +482,7 @@
|
|
|
<div class="controls" style="width:812px">
|
|
|
<form:textarea path="advantage" htmlEscape="false" class="input-xlarge hide" />
|
|
|
<div id="advantageEditor" class="contentEditor">${cmBaikeProduct.advantage}</div>
|
|
|
+ <label id="advantageSensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
@@ -394,6 +490,7 @@
|
|
|
<div class="controls" style="width:812px">
|
|
|
<form:textarea path="disadvantage" htmlEscape="false" class="input-xlarge hide" />
|
|
|
<div id="disadvantageEditor" class="contentEditor">${cmBaikeProduct.disadvantage}</div>
|
|
|
+ <label id="disadvantageSensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
@@ -401,12 +498,14 @@
|
|
|
<div class="controls" style="width:812px">
|
|
|
<form:textarea path="principle" htmlEscape="false" class="input-xlarge hide" />
|
|
|
<div id="principleEditor" class="contentEditor">${cmBaikeProduct.principle}</div>
|
|
|
+ <label id="principleSensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
|
<label class="control-label">SEO关键词:</label>
|
|
|
<div class="controls">
|
|
|
<form:input path="seoKeyword" htmlEscape="false" style="position: relative" class="input-xlarge"/>
|
|
|
+ <label id="seoKeywordSensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
@@ -416,12 +515,14 @@
|
|
|
<label class="control-label">品牌:</label>
|
|
|
<div class="controls">
|
|
|
<form:input path="brand" htmlEscape="false" class="input-xlarge "/>
|
|
|
+ <label id="brandSensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
|
<label class="control-label">产地:</label>
|
|
|
<div class="controls">
|
|
|
<form:input path="producePlace" htmlEscape="false" class="input-xlarge "/>
|
|
|
+ <label id="producePlaceSensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
@@ -436,6 +537,7 @@
|
|
|
<label class="control-label">供应商:</label>
|
|
|
<div class="controls">
|
|
|
<form:input path="company" htmlEscape="false" class="input-xlarge "/>
|
|
|
+ <label id="companySensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group" style="position: relative">
|
|
@@ -481,6 +583,7 @@
|
|
|
<div class="controls" style="width:812px">
|
|
|
<form:textarea path="adaptiveMan" htmlEscape="false" class="input-xlarge hide" />
|
|
|
<div id="adaptiveManEditor" class="contentEditor">${cmBaikeProduct.adaptiveMan}</div>
|
|
|
+ <label id="adaptiveManSensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
@@ -488,6 +591,7 @@
|
|
|
<div class="controls" style="width:812px">
|
|
|
<form:textarea path="unAdaptiveMan" htmlEscape="false" class="input-xlarge hide" />
|
|
|
<div id="unAdaptiveManEditor" class="contentEditor">${cmBaikeProduct.unAdaptiveMan}</div>
|
|
|
+ <label id="unAdaptiveManSensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
@@ -495,6 +599,7 @@
|
|
|
<div class="controls" style="width:812px">
|
|
|
<form:textarea path="aroundOperation" htmlEscape="false" class="input-xlarge hide" />
|
|
|
<div id="aroundOperationEditor" class="contentEditor">${cmBaikeProduct.aroundOperation}</div>
|
|
|
+ <label id="aroundOperationSensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group" style="width: 1000px">
|
|
@@ -536,18 +641,21 @@
|
|
|
<label class="control-label">问题1:</label>
|
|
|
<div class="controls">
|
|
|
<input name="questionList[0].question" style="width: 550px" htmlEscape="false" class="input-xlarge ">
|
|
|
+ <label id="question0SensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group" id="answerRow0">
|
|
|
<label class="control-label">答:</label>
|
|
|
<div class="controls">
|
|
|
<input name="questionList[0].answer" style="width: 550px" htmlEscape="false" class="input-xlarge ">
|
|
|
+ <label id="answer0SensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group" id="questionRow1">
|
|
|
<label class="control-label">问题2:</label>
|
|
|
<div class="controls">
|
|
|
<input name="questionList[1].question" style="width: 550px" htmlEscape="false" class="input-xlarge questionInput">
|
|
|
+ <label id="question1SensitiveWords" class="red"></label>
|
|
|
<a id="questionDelBtn1" onclick="deleteQuestion(1)" style="cursor: pointer">删除</a>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -555,6 +663,7 @@
|
|
|
<label class="control-label">答:</label>
|
|
|
<div class="controls">
|
|
|
<input name="questionList[1].answer" style="width: 550px" htmlEscape="false" class="input-xlarge questionInput">
|
|
|
+ <label id="answer1SensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -596,6 +705,7 @@
|
|
|
|
|
|
<% request.setAttribute("caimeiCore", Global.getConfig("caimei.core"));%>
|
|
|
<script type="text/javascript" src="${ctxStatic}/ckeditor5-new/ckeditor.js"></script>
|
|
|
+<script type="text/javascript" src="${ctxStatic}/sensitiveWords/mint-filter.umd.js"></script>
|
|
|
<script>
|
|
|
var paramIndex = 6;
|
|
|
var questionIndex = 2;
|
|
@@ -715,7 +825,9 @@
|
|
|
while (index < paramListSize) {
|
|
|
$(".paramList").append("<div class=\"controls paramRow\" id=\"paramRow" + index + "\">\n" +
|
|
|
"\t\t\t\t<input name=\"paramList[" + index + "].name\" htmlEscape=\"false\" class=\"input-small \" placeholder=\"参数名称\">\n" +
|
|
|
+ "\t\t\t\t<label id=\"param" + index + "SensitiveWords\" class=\"red\"></label>\n" +
|
|
|
"\t\t\t\t<input name=\"paramList[" + index + "].content\" htmlEscape=\"false\" class=\"input-xlarge \" placeholder=\"输入参数信息\">\n" +
|
|
|
+ "\t\t\t\t<label id=\"content" + index + "SensitiveWords\" class=\"red\"></label>\n" +
|
|
|
"\t\t\t\t<a onclick=\"deleteParam(" + index + ")\" style=\"cursor: pointer\">删除</a>\n" +
|
|
|
" </div>");
|
|
|
index = index + 1;
|
|
@@ -751,6 +863,7 @@
|
|
|
" <label class=\"control-label\">问题" + (index+1) + ":</label>\n" +
|
|
|
" <div class=\"controls\">\n" +
|
|
|
" <input name=\"questionList[" + index + "].question\" style=\"width: 550px\" htmlEscape=\"false\" class=\"input-xlarge \">\n" +
|
|
|
+ "\t\t\t\t<label id=\"question" + index + "SensitiveWords\" class=\"red\"></label>\n" +
|
|
|
"\t\t\t\t<a id=\"questionDelBtn" + index + "\" onclick=\"deleteQuestion(" + index + ")\" style=\"cursor: pointer\">删除</a>\n" +
|
|
|
" </div>\n" +
|
|
|
" </div>\n" +
|
|
@@ -758,6 +871,7 @@
|
|
|
" <label class=\"control-label\">答:</label>\n" +
|
|
|
" <div class=\"controls\">\n" +
|
|
|
" <input name=\"questionList[" + index + "].answer\" style=\"width: 550px\" htmlEscape=\"false\" class=\"input-xlarge \">\n" +
|
|
|
+ "\t\t\t\t<label id=\"answer" + index + "SensitiveWords\" class=\"red\"></label>\n" +
|
|
|
" </div>\n" +
|
|
|
" </div>");
|
|
|
index = index + 1;
|
|
@@ -792,7 +906,9 @@
|
|
|
function addParam() {
|
|
|
$(".paramList").append("<div class=\"controls paramRow\" id=\"paramRow" + paramIndex + "\">\n" +
|
|
|
"\t\t\t\t<input name=\"paramList[" + paramIndex + "].name\" htmlEscape=\"false\" class=\"input-small \" placeholder=\"例如:性质类型\">\n" +
|
|
|
+ "\t\t\t\t<label id=\"param" + paramIndex + "SensitiveWords\" class=\"red\"></label>\n" +
|
|
|
"\t\t\t\t<input name=\"paramList[" + paramIndex + "].content\" htmlEscape=\"false\" class=\"input-xlarge \" placeholder=\"输入参数信息\">\n" +
|
|
|
+ "\t\t\t\t<label id=\"content" + paramIndex + "SensitiveWords\" class=\"red\"></label>\n" +
|
|
|
"\t\t\t\t<a onclick=\"deleteParam(" + paramIndex + ")\" style=\"cursor: pointer\">删除</a>\n" +
|
|
|
" </div>")
|
|
|
paramIndex = paramIndex + 1;
|
|
@@ -813,6 +929,7 @@
|
|
|
" <label class=\"control-label\">问题" + (questionIndex+1) + ":</label>\n" +
|
|
|
" <div class=\"controls\">\n" +
|
|
|
" <input name=\"questionList[" + questionIndex + "].question\" style=\"width: 550px\" htmlEscape=\"false\" class=\"input-xlarge \">\n" +
|
|
|
+ "\t\t\t\t<label id=\"question" + questionIndex + "SensitiveWords\" class=\"red\"></label>\n" +
|
|
|
"\t\t\t\t<a id=\"questionDelBtn" + questionIndex + "\" onclick=\"deleteQuestion(" + questionIndex + ")\" style=\"cursor: pointer\">删除</a>\n" +
|
|
|
" </div>\n" +
|
|
|
" </div>\n" +
|
|
@@ -820,6 +937,7 @@
|
|
|
" <label class=\"control-label\">答:</label>\n" +
|
|
|
" <div class=\"controls\">\n" +
|
|
|
" <input name=\"questionList[" + questionIndex + "].answer\" style=\"width: 550px\" htmlEscape=\"false\" class=\"input-xlarge \">\n" +
|
|
|
+ "\t\t\t\t<label id=\"answer" + questionIndex + "SensitiveWords\" class=\"red\"></label>\n" +
|
|
|
" </div>\n" +
|
|
|
" </div>")
|
|
|
$("#questionDelBtn" + (questionIndex - 1)).attr("style", "display:none;cursor: pointer");
|