2022-03-28 16:44:40 +08:00
|
|
|
<template>
|
|
|
|
|
<div>
|
2022-03-30 18:58:47 +08:00
|
|
|
<el-tabs v-model="activeName" type="card" v-if="!nodata">
|
|
|
|
|
<el-tab-pane v-for="item in cardNames" :label="item.label" :name="item.key" :key="item.key">
|
|
|
|
|
{{item.key}}
|
|
|
|
|
</el-tab-pane>
|
2022-03-28 16:44:40 +08:00
|
|
|
</el-tabs>
|
2022-03-30 15:55:38 +08:00
|
|
|
<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>
|
2022-03-28 16:44:40 +08:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
export default {
|
|
|
|
|
name: 'alertMessageInfoTab',
|
2022-03-30 15:55:38 +08:00
|
|
|
props: {
|
2022-03-30 18:58:47 +08:00
|
|
|
infoData: {
|
|
|
|
|
type: Object
|
2022-03-30 15:55:38 +08:00
|
|
|
}
|
|
|
|
|
},
|
2022-03-28 16:44:40 +08:00
|
|
|
data () {
|
|
|
|
|
return {
|
2022-03-30 18:58:47 +08:00
|
|
|
activeName: 'detail',
|
2022-03-30 15:55:38 +08:00
|
|
|
nodata: false,
|
|
|
|
|
cardNames: [{
|
|
|
|
|
key: 'detail',
|
|
|
|
|
label: this.$t('overall.detail')
|
2022-03-30 18:58:47 +08:00
|
|
|
}],
|
|
|
|
|
sysArr: [{
|
|
|
|
|
key: 'dc',
|
|
|
|
|
label: this.$t('overall.dc')
|
|
|
|
|
}, {
|
|
|
|
|
key: 'asset',
|
|
|
|
|
label: this.$t('overall.asset')
|
|
|
|
|
}, {
|
|
|
|
|
key: 'alertRule',
|
|
|
|
|
label: this.$t('alert.alertRule')
|
|
|
|
|
}, {
|
|
|
|
|
key: 'endpoint',
|
|
|
|
|
label: this.$t('overall.endpoint')
|
|
|
|
|
}, {
|
|
|
|
|
key: 'module',
|
|
|
|
|
label: this.$t('overall.module')
|
|
|
|
|
}, {
|
|
|
|
|
key: 'project',
|
|
|
|
|
label: this.$t('overall.project')
|
2022-03-30 15:55:38 +08:00
|
|
|
}]
|
|
|
|
|
}
|
|
|
|
|
},
|
2022-03-30 18:58:47 +08:00
|
|
|
watch: {
|
|
|
|
|
infoData: {
|
|
|
|
|
immediate: true,
|
|
|
|
|
handler (n) {
|
|
|
|
|
if (n) {
|
|
|
|
|
this.cardNames = [{
|
|
|
|
|
key: 'detail',
|
|
|
|
|
label: this.$t('overall.detail')
|
|
|
|
|
}]
|
|
|
|
|
this.sysArr.forEach(item => {
|
|
|
|
|
if (n[item.key]) {
|
|
|
|
|
this.cardNames.push(item)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
2022-03-30 15:55:38 +08:00
|
|
|
mounted () {
|
2022-03-30 18:58:47 +08:00
|
|
|
|
2022-03-30 15:55:38 +08:00
|
|
|
},
|
|
|
|
|
methods: {
|
2022-03-30 18:58:47 +08:00
|
|
|
|
2022-03-28 16:44:40 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
|
|
|
|
</style>
|