fix:添加alertMessagrInfo(30%)

This commit is contained in:
zhangyu
2022-03-30 15:55:38 +08:00
parent 42ae7d5dfe
commit 5b6e01c79b
3 changed files with 36 additions and 4 deletions

View File

@@ -40,8 +40,9 @@
:showAllData="showAllData" :showAllData="showAllData"
v-if="!isGroup(chartInfo.type) || !chartInfo.param.collapse" v-if="!isGroup(chartInfo.type) || !chartInfo.param.collapse"
></chart> ></chart>
<alertMessageInfoTab class="alert-message-info-tab"> <alertMessageInfoTab
</alertMessageInfoTab> class="alert-message-info-tab"
:id="chartInfo.id" />
</div> </div>
<div class="info-box-right"> <div class="info-box-right">
时间 时间

View File

@@ -1,21 +1,51 @@
<template> <template>
<div> <div>
<el-tabs v-model="activeName" type="card"> <el-tabs v-model="activeName" type="card" v-if="nodata">
<el-tab-pane label="用户管理" name="first">用户管理</el-tab-pane> <el-tab-pane label="用户管理" name="first">用户管理</el-tab-pane>
<el-tab-pane label="配置管理" name="second">配置管理</el-tab-pane> <el-tab-pane label="配置管理" name="second">配置管理</el-tab-pane>
<el-tab-pane label="角色管理" name="third">角色管理</el-tab-pane> <el-tab-pane label="角色管理" name="third">角色管理</el-tab-pane>
<el-tab-pane label="定时任务补偿" name="fourth">定时任务补偿</el-tab-pane> <el-tab-pane label="定时任务补偿" name="fourth">定时任务补偿</el-tab-pane>
</el-tabs> </el-tabs>
<div v-else class="table-no-data">
<svg class="icon" aria-hidden="true">
<use xlink:href="#nz-icon-no-data-list"></use>
</svg>
<div class="table-no-data__title">No results found</div>
</div>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: 'alertMessageInfoTab', name: 'alertMessageInfoTab',
props: {
id: {
type: Number
}
},
data () { data () {
return { return {
activeName: '', activeName: '',
nodata: false,
cardNames: [{
key: 'detail',
label: this.$t('overall.detail')
}]
}
},
mounted () {
this.getAlertMessageInfo()
},
methods: {
getAlertMessageInfo () {
this.nodata = false
this.$get('/alert/message/' + this.id).then(res => {
if (res.code === 200) {
console.log(res)
} else {
this.nodata = true
}
})
} }
} }
} }

View File

@@ -625,6 +625,7 @@ export default {
}] }]
} }
} }
chartInfo.id = this.currentMsg.id
chartInfo.name = this.currentMsg.alertRule.name chartInfo.name = this.currentMsg.alertRule.name
chartInfo.isAlertMessage = true chartInfo.isAlertMessage = true
chartInfo.elements && (chartInfo.elements[0].expression = this.currentMsg.alertRule.expr.replace(/\"/g, '\'').replace(/\r|\n+/g, '')) chartInfo.elements && (chartInfo.elements[0].expression = this.currentMsg.alertRule.expr.replace(/\"/g, '\'').replace(/\r|\n+/g, ''))