Commit d3504848 by caoyanzhi

修改会员标签关系的实现方式

parent e073d5c2
......@@ -15,7 +15,7 @@
<div v-if="(index === 0 && tagsListFilter.length > 1) || (index === 1 && tagsListFilter.length > 2)" class="tag-relation">
<span class="tag-relation__wrap">
<i class="tag-relation__cont">
{{ tags[0].levelType === 'or' ? '或者' : tags[0].levelType === 'andNot' ? '剔除' : '' }}
{{ tagsListFilter[index + 1][0].levelType === 'or' ? '或者' : tagsListFilter[index + 1][0].levelType === 'andNot' ? '剔除' : '' }}
</i>
</span>
</div>
......
......@@ -385,7 +385,7 @@ export default {
let ruleForm = this.ruleForm;
ruleForm.selectedTags.forEach((tagsGroup, tagsGroupIndex) => {
let relation = ruleForm.tagsGroupRelation[tagsGroupIndex];
let relation = ruleForm.tagsGroupRelation[tagsGroupIndex - 1];
tagsGroup.forEach(item => {
item.levelType = relation ? relation : 'or';
})
......@@ -523,9 +523,11 @@ export default {
});
});
this.ruleForm.selectedTags = this.ruleForm.selectedTags.filter(item => item.length > 0);
this.ruleForm.selectedTags.map(tagsGroup => {
this.ruleForm.tagsGroupRelation.push(tagsGroup[0].levelType ? tagsGroup[0].levelType : 'or');
});
this.ruleForm.selectedTags.map((tagsGroup, index) => {
if (this.ruleForm.selectedTags[index + 1]) {
this.ruleForm.tagsGroupRelation.push(this.ruleForm.selectedTags[index + 1][0].levelType ? this.ruleForm.selectedTags[index + 1][0].levelType : 'or');
}
})
}
})
.catch(error => {
......
......@@ -69,7 +69,7 @@ export default {
tagsData: Array,
// 是否显示剔除按钮
showTagsRelation: Boolean,
// 与一组标签之间的关系 or 、andNot
// 与一组标签之间的关系 or 、andNot
tagsRelation: String,
// 当前标签组的索引
tagsGroupIndex: Number,
......
......@@ -284,7 +284,7 @@ export default {
createNewGroup() {
this.selectedTags.forEach((tagsGroup, tagsGroupIndex) => {
let relation = this.tagsGroupRelation[tagsGroupIndex];
let relation = this.tagsGroupRelation[tagsGroupIndex - 1];
tagsGroup.forEach(item => {
item.levelType = relation ? relation : 'or';
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment