|
@@ -17,25 +17,17 @@
|
|
font-weight: bold;
|
|
font-weight: bold;
|
|
}
|
|
}
|
|
|
|
|
|
- .insertexactRule-form{
|
|
|
|
- display: block;
|
|
|
|
- padding: 10px;
|
|
|
|
- border-bottom: 1px solid #ffffff;
|
|
|
|
- min-height: 0;
|
|
|
|
- max-height: none;
|
|
|
|
- }
|
|
|
|
- .insertexactRule-form .division-line{
|
|
|
|
|
|
+ .insertexactRule-form .division-line ,.editexactRule-form .division-line{
|
|
display: inline-block !important;
|
|
display: inline-block !important;
|
|
}
|
|
}
|
|
- .insertexactRule-form .form-group{
|
|
|
|
|
|
+ .insertexactRule-form .form-group,.editexactRule-form .form-group{
|
|
display: block;
|
|
display: block;
|
|
- /*overflow: auto;*/
|
|
|
|
margin-bottom: 1px !important;
|
|
margin-bottom: 1px !important;
|
|
}
|
|
}
|
|
- .insertexactRule-form .form-group label{
|
|
|
|
|
|
+ .insertexactRule-form .form-group label,.editexactRule-form .form-group label{
|
|
padding-top: 8px;
|
|
padding-top: 8px;
|
|
}
|
|
}
|
|
- .insertexactRule-form .form-group .col-sm-8{
|
|
|
|
|
|
+ .insertexactRule-form .form-group .col-sm-8,.editexactRule-form .form-group .col-sm-8 {
|
|
margin-bottom: 5px;
|
|
margin-bottom: 5px;
|
|
}
|
|
}
|
|
.modal-header {
|
|
.modal-header {
|
|
@@ -45,7 +37,7 @@
|
|
#addExactRuleButton a {
|
|
#addExactRuleButton a {
|
|
cursor:pointer;
|
|
cursor:pointer;
|
|
}
|
|
}
|
|
- .insertexactRule-form {
|
|
|
|
|
|
+ .insertexactRule-form , .editexactRule-form{
|
|
padding: 10px 10px 0px 10px;
|
|
padding: 10px 10px 0px 10px;
|
|
}
|
|
}
|
|
#editExactRuleButton a {
|
|
#editExactRuleButton a {
|
|
@@ -2972,7 +2964,7 @@
|
|
}
|
|
}
|
|
return exactRuleTableArrTmp;
|
|
return exactRuleTableArrTmp;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ var editexactRuleId = 0;
|
|
const matchWayMap = {
|
|
const matchWayMap = {
|
|
"title":"标题匹配",
|
|
"title":"标题匹配",
|
|
"content":"全文匹配"
|
|
"content":"全文匹配"
|
|
@@ -3035,7 +3027,8 @@
|
|
$("#editExactRuleButton").show();
|
|
$("#editExactRuleButton").show();
|
|
// showGroupListData("#modal-edit-exactRule") // 铺分组下拉列表数据
|
|
// showGroupListData("#modal-edit-exactRule") // 铺分组下拉列表数据
|
|
// matchWayShow("#editexactRule")
|
|
// matchWayShow("#editexactRule")
|
|
- $("#editexactRuleId").text(index) // 隐藏选中的数组行号
|
|
|
|
|
|
+ // $("#editexactRuleId").text(index) // 隐藏选中的数组行号
|
|
|
|
+ editexactRuleId = index;
|
|
// 铺数据
|
|
// 铺数据
|
|
let contentArr = exactRuleTableArr[index]
|
|
let contentArr = exactRuleTableArr[index]
|
|
// keyArr 定义数组 维持最后有序
|
|
// keyArr 定义数组 维持最后有序
|
|
@@ -3086,33 +3079,50 @@
|
|
}
|
|
}
|
|
// 编辑保存
|
|
// 编辑保存
|
|
function edit_exactRule_save(){
|
|
function edit_exactRule_save(){
|
|
- let index = $("#editexactRuleId").text()
|
|
|
|
|
|
+ // let index = $("#editexactRuleId").text()
|
|
// 获取数
|
|
// 获取数
|
|
let ruleArr = []
|
|
let ruleArr = []
|
|
let formList = $("#editexactRule .editexactRule-form")
|
|
let formList = $("#editexactRule .editexactRule-form")
|
|
- for (let i = 0; i < formList.length; i++) {
|
|
|
|
- let groupName = formList[i].querySelector('[name=groupSelect]').value
|
|
|
|
- let count = formList[i].querySelector('[name=count]').value
|
|
|
|
- // 这是因为现在新增的表单是写死的两个
|
|
|
|
- let tmp = '#editexactRule .exact-rule-'+(i+1)+' select[name=matchWay]'
|
|
|
|
- let matchWay = $(tmp).val();
|
|
|
|
- if (groupName==""||matchWay.length==0||count==""){
|
|
|
|
|
|
+ formList.each(function() {
|
|
|
|
+ var groupName = $(this).find('select[name="groupSelect"]').val();
|
|
|
|
+ var count = $(this).find('input[name="count"]').val();
|
|
|
|
+ var matchWayValue = $(this).find('select[name="matchWay"]').val();
|
|
|
|
+ if (groupName===""||matchWayValue.length===0||count===""){
|
|
// todo
|
|
// todo
|
|
- showMsg("必填项缺失")
|
|
|
|
- return
|
|
|
|
|
|
+ return true;
|
|
}
|
|
}
|
|
- for (let j = 0; j < matchWay.length; j++) {
|
|
|
|
|
|
+ for (let j = 0; j < matchWayValue.length; j++) {
|
|
let rule = {
|
|
let rule = {
|
|
- "group":groupName,"match_way":matchWay[j],"count":count
|
|
|
|
|
|
+ "group":groupName,"match_way":matchWayValue[j],"count":count
|
|
}
|
|
}
|
|
ruleArr.push(rule)
|
|
ruleArr.push(rule)
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ console.log(matchWayValue);
|
|
|
|
+ });
|
|
|
|
+ // for (let i = 0; i < formList.length; i++) {
|
|
|
|
+ // let groupName = formList[i].querySelector('[name=groupSelect]').value
|
|
|
|
+ // let count = formList[i].querySelector('[name=count]').value
|
|
|
|
+ // let mw = formList[i].querySelector('[name=matchWay]').value
|
|
|
|
+ // // 这是因为现在新增的表单是写死的两个
|
|
|
|
+ // let tmp = '#editexactRule .exact-rule-'+(i+1)+' select[name=matchWay]'
|
|
|
|
+ // let matchWay = $(tmp).val();
|
|
|
|
+ // if (groupName==""||matchWay.length==0||count==""){
|
|
|
|
+ // // todo
|
|
|
|
+ // showMsg("必填项缺失")
|
|
|
|
+ // return
|
|
|
|
+ // }
|
|
|
|
+ // for (let j = 0; j < matchWay.length; j++) {
|
|
|
|
+ // let rule = {
|
|
|
|
+ // "group":groupName,"match_way":matchWay[j],"count":count
|
|
|
|
+ // }
|
|
|
|
+ // ruleArr.push(rule)
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
// 保存到exactRuleTableArr 临时数组
|
|
// 保存到exactRuleTableArr 临时数组
|
|
- exactRuleTableArr[index] = ruleArr
|
|
|
|
|
|
+ exactRuleTableArr[editexactRuleId] = ruleArr
|
|
$('#exactRuleTable').dataTable().fnClearTable();
|
|
$('#exactRuleTable').dataTable().fnClearTable();
|
|
$('#exactRuleTable').dataTable().fnAddData(exactRuleTableArr);
|
|
$('#exactRuleTable').dataTable().fnAddData(exactRuleTableArr);
|
|
- if (exactRuleTableArr.length == 0) {
|
|
|
|
|
|
+ if (exactRuleTableArr.length === 0) {
|
|
$('#exactRuleTable').dataTable().fnClearTable();
|
|
$('#exactRuleTable').dataTable().fnClearTable();
|
|
}
|
|
}
|
|
$("#modal-edit-exactRule").modal("hide");
|
|
$("#modal-edit-exactRule").modal("hide");
|