diff --git a/nezha-fronted/src/components/charts/chart-alert-list.vue b/nezha-fronted/src/components/charts/chart-alert-list.vue index 92e25e6ad..c87fb324b 100644 --- a/nezha-fronted/src/components/charts/chart-alert-list.vue +++ b/nezha-fronted/src/components/charts/chart-alert-list.vue @@ -41,104 +41,16 @@
- -
- -
-
- - - - - - - - - - + >
@@ -148,100 +60,16 @@
- -
- -
-
- - - - - - - - - - + > @@ -298,6 +126,7 @@ import nzAlertTag from "../page/alert/nzAlertTag"; import axios from "axios"; import pickTime from "../common/pickTime"; import chart from "../page/dashboard/overview/chart"; +import alertMessageTable from '@/components/common/alert/alertMessageTable.vue' export default { name: 'chartTable', components: { @@ -306,6 +135,7 @@ export default { 'nz-alert-tag':nzAlertTag, 'chart':chart, 'pick-time':pickTime, + 'alertMessageTable':alertMessageTable }, props: { // 看板id @@ -505,28 +335,6 @@ export default { let vm = this; this.$chartResizeTool.start(vm, this.data, e); }, - labelsSort:function(obj){ - let buildIn=['asset','endpoint','module','project','datacenter'] - let labels=JSON.parse(JSON.stringify(obj)); - let result=[]; - for(let key of buildIn){ - if(key in labels){ - result.push({label:key,value:labels[key]}) - delete labels[key] - } - } - Object.keys(labels).sort().forEach(key=>{ - result.push({label:key,value:labels[key]}) - }) - return result; - }, - labelsClassName(row) { - if (row.column.label == this.$t("alert.list.labels")) { - return "alert-message-list-labels"; - } else { - return ""; - } - }, formatThreshold:function(value,unit){ let unitMethod=chartDataFormat.getUnit(unit) if(unitMethod&&value){ @@ -574,13 +382,7 @@ export default { screenDialogClose:function(){ this.screenModal = false this.deleteBox.ids=[]; - this.$refs.alertListScreenTable.clearSelection(); - }, - toDeleteMessage(obj) { - if (obj) { - this.deleteBox.ids = obj.id + ""; - } - this.deleteBox.show = true; + this.$refs.alertListScreenTable.$refs.alertListTable.clearSelection(); }, selectChange(s) { let ids = []; @@ -590,8 +392,8 @@ export default { }); this.deleteBox.ids = ids.join(","); }, - deleteMessage() { - this.$put("alert/message", this.deleteBox).then(res => { + deleteMessage(deleltebox) { + this.$put("alert/message", deleltebox).then(res => { if (res.code === 200) { this.$message({duration: 2000, type: 'success', message: this.$t("tip.deleteSuccess")}); this.deleteBox.show = false; @@ -970,7 +772,7 @@ export default { this.storedScreanTableData = this.storedTableData this.screenModal = true; this.deleteBox.ids=[]; - this.$refs.alertListTable.clearSelection(); + this.$refs.alertListTable.$refs.alertListTable.clearSelection(); }, // 设置数据, filter区分 setData(chartItem, seriesItem, panelId, filter,area,errorMsg) { diff --git a/nezha-fronted/src/components/common/alert/alertLabel.vue b/nezha-fronted/src/components/common/alert/alertLabel.vue index 51ec9dacf..dc2583066 100644 --- a/nezha-fronted/src/components/common/alert/alertLabel.vue +++ b/nezha-fronted/src/components/common/alert/alertLabel.vue @@ -1,96 +1,96 @@