From 04c6b8c0a565ce864443567482e3f69b9e12de93 Mon Sep 17 00:00:00 2001 From: songjingcheng Date: Sat, 8 May 2021 15:04:17 +0800 Subject: [PATCH] =?UTF-8?q?=20alert=20message=20=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/table/alert/alertMessageTable.vue | 35 +++---------------- .../components/page/alert/alertMessage.vue | 11 ++++-- 2 files changed, 12 insertions(+), 34 deletions(-) diff --git a/nezha-fronted/src/components/common/table/alert/alertMessageTable.vue b/nezha-fronted/src/components/common/table/alert/alertMessageTable.vue index 975d40445..c40dff27c 100644 --- a/nezha-fronted/src/components/common/table/alert/alertMessageTable.vue +++ b/nezha-fronted/src/components/common/table/alert/alertMessageTable.vue @@ -106,37 +106,12 @@ fixed="right">
{{$t('overall.option')}}
- -
- - - -
- - {{formatThreshold(scope.row.current[1],scope.row.alertRule.unit)}} -
-
{{$unixTimeParseToString(scope.row.current[0])}}
-
-
- + +
- -
- {{$t("project.endpoint.dialogTitle")}} -
- -
-
- -
@@ -149,14 +124,12 @@ import chartDataFormat from '../../../charts/chartDataFormat' import alertRuleInfo from '../../alert/alertRuleInfo' import alertLabel from '../../alert/alertLabel' import { calcDurationByStringTimeB } from '../../js/tools' -import chart from "../../../page/dashboard/overview/chart" export default { name: 'alertMessageTable', components: { nzAlertTag, alertRuleInfo: alertRuleInfo, alertLabel: alertLabel, - chart:chart, }, props: { nowTime: { @@ -439,8 +412,8 @@ export default { }) }, dialogClose() { - this.graphShow = false; - }, + this.graphShow = false; + }, getAlertList () { if (!this.scrollbarWrap) { this.$nextTick(() => { diff --git a/nezha-fronted/src/components/page/alert/alertMessage.vue b/nezha-fronted/src/components/page/alert/alertMessage.vue index b095f59df..2c77fa0dd 100644 --- a/nezha-fronted/src/components/page/alert/alertMessage.vue +++ b/nezha-fronted/src/components/page/alert/alertMessage.vue @@ -39,6 +39,7 @@ @del="del" @edit="edit" @orderBy="tableDataSort" + @queryMessage='queryMessage' @reload="getTableData" @selectionChange="selectionChange" @showBottomBox="(targetTab, object) => { $refs.dataList.showBottomBox(targetTab, object) }" @@ -268,6 +269,12 @@ export default { this.queryChartDate() }) }, + queryMessage (alertMessage) { + if (!this.hasButton('alertMessage_view')) { + return + } + this.$refs.dataList.showBottomBox(alertMessage, alertRule) + }, queryChartDate () { const $temp = this const start = this.searchTime[0] ? this.searchTime[0] : getTime(-1, 'h') @@ -393,13 +400,11 @@ export default { delete this.searchLabel.endAt } this.tools.loading = true - if(ind===0){ - console.log(1); + if(ind===0 || ind ===1 || ind ===2){ delete this.searchLabel.startAt delete this.searchLabel.endAt } this.$get(this.url+'?state='+ii, this.searchLabel).then(response => { - console.log(this.searchLabel) this.tools.loading = false if (response.code == 200) { this.nowTime = this.utcTimeToTimezoneStr(response.time)