NEZ-604 fix: alert-message相关
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div :class="['alert-labelUp',LRTriangle?'left-triangle':'right-triangle']" :style="{top:that.position.top+'px',left:that.position.left+'px','--mt': that.position.mt+'px',}" ref="alertLabels">
|
<div ref="alertLabels" :class="['alert-labelUp',LRTriangle?'left-triangle':'right-triangle']" :style="{top:that.position.top,left:that.position.left,'--mt': that.position.mt+'px',}">
|
||||||
<div class="alert-label-info" v-if="type==='asset'" v-loading="loading">
|
<div class="alert-label-info" v-if="type==='asset'" v-loading="loading">
|
||||||
<div class="alert-label-box">
|
<div class="alert-label-box">
|
||||||
<div class="alert-label-title">ID</div>
|
<div class="alert-label-title">ID</div>
|
||||||
@@ -204,12 +204,12 @@ export default {
|
|||||||
const elHeight = self.type === 'asset' ? 318 : (self.type === 'project' ? 70 : 70)
|
const elHeight = self.type === 'asset' ? 318 : (self.type === 'project' ? 70 : 70)
|
||||||
if (position.top + elHeight > clientHeight) {
|
if (position.top + elHeight > clientHeight) {
|
||||||
return {
|
return {
|
||||||
left: `${position.left + position.width + 20}px`,
|
left: `${position.left + position.width + 120}px`,
|
||||||
top: `${position.top - elHeight - 20}px`
|
top: `${position.top - elHeight - 20}px`
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
left: `${position.left + position.width + 20}px`,
|
left: `${position.left + position.width + 120}px`,
|
||||||
top: `${position.top - 20}px`
|
top: `${position.top - 20}px`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,32 +32,49 @@
|
|||||||
@selectionChange="selectionChange"
|
@selectionChange="selectionChange"
|
||||||
@showBottomBox="(target, item) => { $refs.dataList.showBottomBox(target, item) }"
|
@showBottomBox="(target, item) => { $refs.dataList.showBottomBox(target, item) }"
|
||||||
@toDelete="toDeleteMessage"
|
@toDelete="toDeleteMessage"
|
||||||
|
@messageDetail="messageDetail"
|
||||||
></alertMessageTable>
|
></alertMessageTable>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:pagination>
|
<template v-slot:pagination>
|
||||||
<Pagination ref="Pagination" :pageObj="pageObj" :tableId="tableId" @pageNo='pageNo' @pageSize='pageSize'></Pagination>
|
<Pagination ref="Pagination" :pageObj="pageObj" :tableId="tableId" @pageNo='pageNo' @pageSize='pageSize'></Pagination>
|
||||||
</template>
|
</template>
|
||||||
</nz-bottom-data-list>
|
</nz-bottom-data-list>
|
||||||
|
<el-dialog id="viewGraphDialog"
|
||||||
|
:modal-append-to-body='false'
|
||||||
|
:title="$t('overall.detail')"
|
||||||
|
:visible.sync="graphShow"
|
||||||
|
class="line-chart-block-modal nz-dialog endpoint-dialog"
|
||||||
|
width="90%"
|
||||||
|
@close="dialogClose">
|
||||||
|
<div slot="title">
|
||||||
|
{{$t("project.endpoint.dialogTitle")}}
|
||||||
|
<div class="float-right panel-calendar dialog-tool" style="display: flex">
|
||||||
|
<pick-time v-model="searchTime" :refresh-data-func="queryChartDate" :use-chart-unit="false" :use-refresh="false" style="height: 28px;" @unitChange="chartUnitChange"></pick-time>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<chart ref="messageChart" :unit="chartUnit" name="alertMessageChart"></chart>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { getTime } from '@/components/common/js/tools'
|
||||||
import dataListMixin from '@/components/common/mixin/dataList'
|
import dataListMixin from '@/components/common/mixin/dataList'
|
||||||
import subDataListMixin from '@/components/common/mixin/subDataList'
|
import subDataListMixin from '@/components/common/mixin/subDataList'
|
||||||
import nzBottomDataList from '@/components/common/bottomBox/nzBottomDataList'
|
import nzBottomDataList from '@/components/common/bottomBox/nzBottomDataList'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import bus from '@/libs/bus'
|
import bus from '@/libs/bus'
|
||||||
import alertMessageTable from '@/components/common/table/alert/alertMessageTable.vue'
|
import alertMessageTable from '@/components/common/table/alert/alertMessageTable.vue'
|
||||||
|
import chart from '@/components/page/dashboard/overview/chart'
|
||||||
import { alertMessage as alertMessageConstant, fromRoute } from '@/components/common/js/constants'
|
import { alertMessage as alertMessageConstant, fromRoute } from '@/components/common/js/constants'
|
||||||
// import {getTime} from "@/components/common/js/tools";
|
|
||||||
// import chartDataFormat from "@/components/charts/chartDataFormat";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'alertMessageTab',
|
name: 'alertMessageTab',
|
||||||
mixins: [dataListMixin, subDataListMixin],
|
mixins: [dataListMixin, subDataListMixin],
|
||||||
components: {
|
components: {
|
||||||
nzBottomDataList,
|
nzBottomDataList,
|
||||||
alertMessageTable
|
alertMessageTable,
|
||||||
|
chart
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
from: String
|
from: String
|
||||||
@@ -161,8 +178,10 @@ export default {
|
|||||||
},
|
},
|
||||||
queryChartDate () {
|
queryChartDate () {
|
||||||
const $temp = this
|
const $temp = this
|
||||||
const start = this.searchTime[0] ? this.searchTime[0] : getTime(-1, 'h')
|
// const start = this.searchTime[0] ? this.searchTime[0] : getTime(-1, 'h')
|
||||||
const end = this.searchTime[1] ? this.searchTime[1] : getTime(0, 'h')
|
// const end = this.searchTime[1] ? this.searchTime[1] : getTime(0, 'h')
|
||||||
|
const start = this.currentMsg.startAt
|
||||||
|
const end = this.currentMsg.endAt
|
||||||
this.searchTime = [start, end]
|
this.searchTime = [start, end]
|
||||||
const timeDiff = (new Date(end).getTime() - new Date(start).getTime()) / 1000 / (24 * 60 * 60)
|
const timeDiff = (new Date(end).getTime() - new Date(start).getTime()) / 1000 / (24 * 60 * 60)
|
||||||
let step = '15s'
|
let step = '15s'
|
||||||
@@ -387,6 +406,13 @@ export default {
|
|||||||
}
|
}
|
||||||
this.deleteBox.show = true
|
this.deleteBox.show = true
|
||||||
},
|
},
|
||||||
|
messageDetail (row) {
|
||||||
|
this.currentMsg = { ...row }
|
||||||
|
this.graphShow = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.queryChartDate()
|
||||||
|
})
|
||||||
|
},
|
||||||
deleteMessage () {
|
deleteMessage () {
|
||||||
this.$refs.remarkForm.validate(valid => {
|
this.$refs.remarkForm.validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ import table from '@/components/common/mixin/table'
|
|||||||
import nzAlertTag from '../../../page/alert/nzAlertTag'
|
import nzAlertTag from '../../../page/alert/nzAlertTag'
|
||||||
import chartDataFormat from '../../../charts/chartDataFormat'
|
import chartDataFormat from '../../../charts/chartDataFormat'
|
||||||
import alertRuleInfo from '../../alert/alertRuleInfo'
|
import alertRuleInfo from '../../alert/alertRuleInfo'
|
||||||
import alertLabel from '../../alert/alertLabel'
|
import alertLabel from '../../alert/alertLabel2'
|
||||||
import { calcDurationByStringTimeB } from '../../js/tools'
|
import { calcDurationByStringTimeB } from '../../js/tools'
|
||||||
export default {
|
export default {
|
||||||
name: 'alertMessageTable',
|
name: 'alertMessageTable',
|
||||||
@@ -260,9 +260,9 @@ export default {
|
|||||||
delete labels[key]
|
delete labels[key]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Object.keys(labels).sort().forEach(key => {
|
/* Object.keys(labels).sort().forEach(key => {
|
||||||
result.push({ label: key, value: labels[key] })
|
result.push({ label: key, value: labels[key] })
|
||||||
})
|
}) */
|
||||||
return result
|
return result
|
||||||
},
|
},
|
||||||
chartUnitChange: function (unit) {
|
chartUnitChange: function (unit) {
|
||||||
|
|||||||
@@ -106,12 +106,14 @@ import deleteButton from '@/components/common/deleteButton'
|
|||||||
import nzDataList from '@/components/common/table/nzDataList'
|
import nzDataList from '@/components/common/table/nzDataList'
|
||||||
import dataListMixin from '@/components/common/mixin/dataList'
|
import dataListMixin from '@/components/common/mixin/dataList'
|
||||||
import chartDataFormat from '@/components/charts/chartDataFormat'
|
import chartDataFormat from '@/components/charts/chartDataFormat'
|
||||||
|
import chart from '@/components/page/dashboard/overview/chart'
|
||||||
import { alertMessage as alertMessageConstant } from '@/components/common/js/constants'
|
import { alertMessage as alertMessageConstant } from '@/components/common/js/constants'
|
||||||
export default {
|
export default {
|
||||||
name: 'alertList',
|
name: 'alertList',
|
||||||
components: {
|
components: {
|
||||||
alertMessageTable,
|
alertMessageTable,
|
||||||
pickTime,
|
pickTime,
|
||||||
|
chart,
|
||||||
nzDataList,
|
nzDataList,
|
||||||
deleteButton
|
deleteButton
|
||||||
},
|
},
|
||||||
@@ -226,7 +228,10 @@ export default {
|
|||||||
},
|
},
|
||||||
messageDetail (row) {
|
messageDetail (row) {
|
||||||
this.currentMsg = { ...row }
|
this.currentMsg = { ...row }
|
||||||
this.queryChartDate()
|
this.graphShow = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.queryChartDate()
|
||||||
|
})
|
||||||
},
|
},
|
||||||
queryMessage (alertMessage) {
|
queryMessage (alertMessage) {
|
||||||
if (!this.hasButton('alertMessage_view')) {
|
if (!this.hasButton('alertMessage_view')) {
|
||||||
@@ -236,8 +241,10 @@ export default {
|
|||||||
},
|
},
|
||||||
queryChartDate () {
|
queryChartDate () {
|
||||||
const $temp = this
|
const $temp = this
|
||||||
const start = this.searchTime[0] ? this.searchTime[0] : getTime(-1, 'h')
|
// const start = this.searchTime[0] ? this.searchTime[0] : getTime(-1, 'h')
|
||||||
const end = this.searchTime[1] ? this.searchTime[1] : getTime(0, 'h')
|
// const end = this.searchTime[1] ? this.searchTime[1] : getTime(0, 'h')
|
||||||
|
const start = this.currentMsg.startAt
|
||||||
|
const end = this.currentMsg.endAt
|
||||||
this.searchTime = [start, end]
|
this.searchTime = [start, end]
|
||||||
const timeDiff = (new Date(end).getTime() - new Date(start).getTime()) / 1000 / (24 * 60 * 60)
|
const timeDiff = (new Date(end).getTime() - new Date(start).getTime()) / 1000 / (24 * 60 * 60)
|
||||||
let step = '15s'
|
let step = '15s'
|
||||||
@@ -260,8 +267,8 @@ export default {
|
|||||||
axios.all(axiosArr).then(res => {
|
axios.all(axiosArr).then(res => {
|
||||||
try {
|
try {
|
||||||
res.forEach((response, promIndex) => {
|
res.forEach((response, promIndex) => {
|
||||||
if (response.status == 200) {
|
if (response.status === 200) {
|
||||||
if (response.data.status == 'success') {
|
if (response.data.status === 'success') {
|
||||||
const queryData = response.data.data.result[0]
|
const queryData = response.data.data.result[0]
|
||||||
if (queryData) {
|
if (queryData) {
|
||||||
const chartData = {
|
const chartData = {
|
||||||
|
|||||||
Reference in New Issue
Block a user