This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
nezha-nezha-fronted/nezha-fronted/src/components/common/alert/alertMessageInfoTab.vue

91 lines
1.9 KiB
Vue
Raw Normal View History

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}}
2022-03-31 09:52:13 +08:00
<div v-if="item.key === 'detail'">
<alert-message-info-detail :info-data="infoData"/>
</div>
2022-03-30 18:58:47 +08:00
</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>
2022-03-31 09:52:13 +08:00
import alertMessageInfoDetail from '@/components/common/alert/alertMessageInfoDetail'
2022-03-28 16:44:40 +08:00
export default {
name: 'alertMessageInfoTab',
2022-03-31 09:52:13 +08:00
components: {
alertMessageInfoDetail
},
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>