Commit 324f5372 by caoyanzhi

解决计算标签是不是实时的bug

parent bc16c1e6
......@@ -279,6 +279,21 @@ export default {
];
}
},
/**
* 检查标签是不是实时
* 1=实时 0=非实时
*/
watch: {
'ruleForm.selectedTags': {
deep: true,
handler() {
let flag = this.ruleForm.selectedTags.length === 0 || this.ruleForm.selectedTags.some(tagsGroup => {
return tagsGroup.length === 0 || tagsGroup.some(tag => parseInt(tag.isActive) === 0);
});
this.ruleForm.isActive = flag ? 0 : 1;
}
}
},
methods: {
/**
* 路由跳转
......@@ -339,21 +354,6 @@ export default {
this.ruleForm.selectedTags.splice(this.activeTagsGroupIndex, 1, tagsGroup);
break;
}
this.checkRealTime();
},
/**
* 已选标签-删除-检查实时
*/
checkRealTime() {
if (this.ruleForm.selectedTags.length === 0) {
this.rule.isActive = 0;
return;
}
let flag = this.ruleForm.selectedTags.some(tagsGroup => {
return tagsGroup.some(tag => parseInt(tag.isActive) === 0);
});
this.ruleForm.isActive = flag ? 0 : 1;
},
/**
......
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