修正保护名单配置回车不提示、重复数据问题
This commit is contained in:
@@ -19,6 +19,26 @@ $(function(){
|
||||
},
|
||||
errorContainer: "#messageBox",
|
||||
});
|
||||
|
||||
jQuery.validator.addMethod("protectedCfgUnique",function(value, element) {
|
||||
var result = true;
|
||||
var proId= $("[name='proId']").val();
|
||||
var keyword = $("[name='keyword']").val();
|
||||
var targetType = $("[name='targetType']").val();
|
||||
var ctx=$(element).attr("ctx");
|
||||
var url = ctx+"/basics/innerProtectionList/checkKeywordExist";
|
||||
$.ajax({
|
||||
type:'post',
|
||||
async:false,
|
||||
url: url,
|
||||
data:{"proId":proId,"keyword":keyword,"targetType":targetType},
|
||||
success:function(data){
|
||||
result = data;
|
||||
}
|
||||
});
|
||||
|
||||
return result;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
@@ -46,15 +66,6 @@ $(function(){
|
||||
<input type="hidden" name="proId" value="${_cfg.proId}">
|
||||
<div class="form-body">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="keywords"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required" type="text" name="keyword" value="${_cfg.keyword}">
|
||||
</div>
|
||||
<div for="keyword"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="type"/></label>
|
||||
@@ -70,6 +81,15 @@ $(function(){
|
||||
<div for="targetType"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="keywords"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control protectedCfgUnique required" ctx="${ctx}" type="text" name="keyword" value="${_cfg.keyword}">
|
||||
</div>
|
||||
<div for="keyword"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
|
||||
@@ -216,8 +216,8 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
||||
<th column="keyword" ><spring:message code="keywords"/></th>
|
||||
<th column="targetType" ><spring:message code="type"/></th>
|
||||
<th column="keyword" ><spring:message code="keywords"/></th>
|
||||
<th column="desc" ><spring:message code="desc"/></th>
|
||||
<th column="creator" ><spring:message code="creator"/></th>
|
||||
<th column="config_time" class="sort-column r.create_time"><spring:message code="config_time"/></th>
|
||||
@@ -229,17 +229,17 @@
|
||||
<c:forEach items="${page.list }" var="cfg" varStatus="status" step="1">
|
||||
<tr>
|
||||
<td><input type="checkbox" class="i-checks child-checks" id="${cfg.proId}"></td>
|
||||
<td>
|
||||
<c:if test="${cfg.targetType eq 'urlCheck'}"><spring:message code="URL"/></c:if>
|
||||
<c:if test="${cfg.targetType eq 'domainCheck'}"><spring:message code="domain"/></c:if>
|
||||
<c:if test="${cfg.targetType eq 'keywordSign'}"><spring:message code="keywords"/></c:if>
|
||||
</td>
|
||||
<td>
|
||||
<a href="javascript:;" data-original-title="${cfg.keyword}"
|
||||
class="tooltips" data-flag="false" data-html="true" data-placement="top">
|
||||
${fns:abbr(cfg.keyword,20)}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<c:if test="${cfg.targetType eq 'urlCheck'}"><spring:message code="URL"/></c:if>
|
||||
<c:if test="${cfg.targetType eq 'domainCheck'}"><spring:message code="domain"/></c:if>
|
||||
<c:if test="${cfg.targetType eq 'keywordSign'}"><spring:message code="keywords"/></c:if>
|
||||
</td>
|
||||
<td title="${cfg.description }">${fns:abbr(cfg.description,20)}</td>
|
||||
<td>${cfg.creatorName }</td>
|
||||
<td><fmt:formatDate value="${cfg.createTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
|
||||
Reference in New Issue
Block a user