fix: test

develop
时启龙 2024-08-28 17:05:23 +08:00
parent bb5e784429
commit cfda3a9f0d
1 changed files with 41 additions and 9 deletions

View File

@ -1,6 +1,6 @@
<template> <template>
<ItemCard title="告警列表" v-bind="$attrs"> <ItemCard title="告警列表" v-bind="$attrs">
<el-button slot="operate" type="primary" plain>查看更多</el-button> <el-button slot="operate" type="primary" plain @click="goPage"></el-button>
<cb-table :data="tableList" :params="params" :get-list="getItemList" :total="total"> <cb-table :data="tableList" :params="params" :get-list="getItemList" :total="total">
<el-table-column type="index" width="50" label="序号"> </el-table-column> <el-table-column type="index" width="50" label="序号"> </el-table-column>
<el-table-column show-overflow-tooltip label="标题" prop="alarmName"></el-table-column> <el-table-column show-overflow-tooltip label="标题" prop="alarmName"></el-table-column>
@ -14,11 +14,21 @@
<el-table-column show-overflow-tooltip label="时间" prop="createTime"></el-table-column> <el-table-column show-overflow-tooltip label="时间" prop="createTime"></el-table-column>
<el-table-column show-overflow-tooltip label="操作" width="80"> <el-table-column show-overflow-tooltip label="操作" width="80">
<template slot-scope="scope"> <template slot-scope="scope">
<cb-link @click="handleWarningOperation(scope.row)"></cb-link> <cb-link @click="getDetail(scope.row)"></cb-link>
</template> </template>
</el-table-column> </el-table-column>
<span slot="pagination"></span> <span slot="pagination"></span>
</cb-table> </cb-table>
<cb-detail-right v-if="dialog.visible" :title="detailData.alarmName" @goBack="goBack">
<div slot="custom_content">
<div class="message-card">
<pre class="site-message-detail">{{ detailData.content }}</pre>
<el-divider></el-divider>
<div class="text-right m-b-sm">发送人{{ detailData.senderName }}</div>
<div class="text-right">创建时间{{ detailData.gmtCreate }}</div>
</div>
</div>
</cb-detail-right>
</ItemCard> </ItemCard>
</template> </template>
@ -39,28 +49,40 @@ export default {
page: 1, page: 1,
rows: 10 rows: 10
}, },
total: 0 total: 0,
dialog: {
visible: false
},
detailData: {}
} }
}, },
created() { created() {
this.getItemList() this.getItemList()
}, },
methods: { methods: {
goBack() {
this.dialog.visible = false
},
//
async getDetail(row) {
this.detailData = row
this.dialog.visible = true
},
getSeverity(val) { getSeverity(val) {
const map = { const map = {
1: { 4: {
text: '严重告警', text: '严重告警',
icon: 严重 icon: 严重
}, },
2: { 3: {
text: '重要告警', text: '重要告警',
icon: 重要 icon: 重要
}, },
3: { 2: {
text: '次要告警', text: '次要告警',
icon: 次要 icon: 次要
}, },
4: { 1: {
text: '常规告警', text: '常规告警',
icon: 常规 icon: 常规
} }
@ -78,8 +100,8 @@ export default {
} }
}) })
}, },
handleWarningOperation(row) { goPage() {
console.log('处理告警', row) this.$router.push({ path: '/oms-web/dashbaord?redirect=/alarm/current' })
} }
} }
} }
@ -90,4 +112,14 @@ export default {
align-items: center; align-items: center;
gap: 13px; gap: 13px;
} }
.message-card {
padding: 20px;
font-size: 14px;
line-height: 20px;
}
.site-message-detail {
white-space: pre-wrap;
word-break: break-all;
}
</style> </style>