fix: alert rule trbShot 未设置时不显示
This commit is contained in:
@@ -554,9 +554,11 @@ export default {
|
|||||||
confirmReg.push(item)
|
confirmReg.push(item)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
confirmReg = this.$loadsh.sortBy(confirmReg, function (item) { // 根据 匹配的name的长度排序 避免匹配的 $a 没匹配 $asset的问题
|
confirmReg = this.$loadsh.orderBy(confirmReg, function (item) { // 根据 匹配的name的长度排序 避免匹配的 $a 没匹配 $asset的问题
|
||||||
|
console.log(item.name.length)
|
||||||
return item.name.length
|
return item.name.length
|
||||||
})
|
}, 'desc')
|
||||||
|
console.log(confirmReg)
|
||||||
if (confirmReg.length) {
|
if (confirmReg.length) {
|
||||||
confirmReg.forEach(item => {
|
confirmReg.forEach(item => {
|
||||||
const reg = new RegExp('\\$' + item.name, 'g') // 后续需要考虑 item,name 使用特殊字符的问题
|
const reg = new RegExp('\\$' + item.name, 'g') // 后续需要考虑 item,name 使用特殊字符的问题
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="item.key === 'trbShot' && activeName === 'trbShot'">
|
<div v-else-if="item.key === 'trbShot' && activeName === 'trbShot'">
|
||||||
<div v-html="infoData.alertRule.trbShot">
|
<div v-html="infoData.alertRule.trbShot" v-if="infoData.alertRule.trbShot">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
@@ -108,7 +108,7 @@ export default {
|
|||||||
this.cardNames.push(item)
|
this.cardNames.push(item)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
if (n.alertRule && n.alertRule.trbShot) {
|
if (n.alertRule && n.alertRule.trbShot && n.alertRule.trbShot != '<div class="editor-core ql-container ql-snow"><div class="ql-editor"><p><br></p></div></div>') {
|
||||||
this.cardNames.push({
|
this.cardNames.push({
|
||||||
key: 'trbShot',
|
key: 'trbShot',
|
||||||
label: this.$t('alert.config.trbShot')
|
label: this.$t('alert.config.trbShot')
|
||||||
|
|||||||
@@ -507,6 +507,9 @@ export default {
|
|||||||
method: this.editAlertRule.method.join(','),
|
method: this.editAlertRule.method.join(','),
|
||||||
type: this.editAlertRule.type
|
type: this.editAlertRule.type
|
||||||
}
|
}
|
||||||
|
if (this.editAlertRule.trbShot && this.editAlertRule.trbShot == '<div class="editor-core ql-container ql-snow"><div class="ql-editor"><p><br></p></div></div>') {
|
||||||
|
this.editAlertRule.trbShot = ''
|
||||||
|
}
|
||||||
this.$refs.alertRuleForm.validate((valid) => {
|
this.$refs.alertRuleForm.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
params.receiver = this.editAlertRule.receiverShow.join(',')
|
params.receiver = this.editAlertRule.receiverShow.join(',')
|
||||||
|
|||||||
Reference in New Issue
Block a user