feat: 所有表格的 alert列调整
This commit is contained in:
@@ -110,7 +110,9 @@ export default {
|
|||||||
editShow: false,
|
editShow: false,
|
||||||
show: false
|
show: false
|
||||||
},
|
},
|
||||||
fromBottom: true
|
fromBottom: true,
|
||||||
|
needAlertDaysData: true,
|
||||||
|
trendKey: 'endpointId'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -136,6 +138,25 @@ export default {
|
|||||||
item.config = JSON.parse(item.config)
|
item.config = JSON.parse(item.config)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
if (this.needAlertDaysData) {
|
||||||
|
response.data.list.forEach(item => {
|
||||||
|
item.trendLoading = true
|
||||||
|
item.alertDaysData = [
|
||||||
|
{
|
||||||
|
metric: { priority: 'P1' },
|
||||||
|
values: [[0, 0]]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
metric: { priority: 'P2' },
|
||||||
|
values: [[0, 0]]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
metric: { priority: 'P3' },
|
||||||
|
values: [[0, 0]]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
})
|
||||||
|
}
|
||||||
this.tableData = response.data.list
|
this.tableData = response.data.list
|
||||||
this.nowTime = this.utcTimeToTimezoneStr(response.time)
|
this.nowTime = this.utcTimeToTimezoneStr(response.time)
|
||||||
this.pageObj.total = response.data.total
|
this.pageObj.total = response.data.total
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
|
import alertDaysInfo from '@/components/common/alert/alertDaysInfo'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
alertDaysInfo
|
||||||
|
},
|
||||||
props: {
|
props: {
|
||||||
tableData: {
|
tableData: {
|
||||||
type: Array
|
type: Array
|
||||||
|
|||||||
@@ -41,9 +41,19 @@
|
|||||||
<i class="nz-icon nz-icon-circle" :style="{color:scope.row[item.prop].color,'font-size':'12px','margin-right':'5px'}"></i> {{scope.row[item.prop].name}}
|
<i class="nz-icon nz-icon-circle" :style="{color:scope.row[item.prop].color,'font-size':'12px','margin-right':'5px'}"></i> {{scope.row[item.prop].name}}
|
||||||
</span>
|
</span>
|
||||||
<template v-else-if="item.prop === 'alertNum'">
|
<template v-else-if="item.prop === 'alertNum'">
|
||||||
<span class="link" @click="queryMessage(scope.row)">
|
<span style="cursor: pointer" @click="queryMessage(scope.row)">
|
||||||
<i class="nz-icon nz-icon-overview-alert" :class="scope.row[item.prop]>0?'colorEF7458':'color23BF9A'"/>
|
<i :class="scope.row.alertNum ? 'red' : 'green'" class="nz-icon nz-icon-overview-alert vertical-align-top;" @mouseenter="tooltipHover(scope.row,true, $event)" @mouseleave="tooltipHover(scope.row,false, $event)"></i>
|
||||||
{{scope.row.alertNum}}
|
<div v-if="scope.row.alertNumtooltipShow" class="alert-days-info-tooltip" :style="{left: scope.row.left + 'px',top:scope.row.top + 'px'}">
|
||||||
|
<div class="tooltip-title">Alert message (active)</div>
|
||||||
|
<div class="severity-info" style='justify-content: space-between'>
|
||||||
|
<div class="severity-name">{{$t('overall.result.total')}}</div>
|
||||||
|
<div class="severity-value">{{scope.row.alertNum}}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<alertDaysInfo
|
||||||
|
v-show="!scope.row.trendLoading"
|
||||||
|
:alertDaysData="scope.row.alertDaysData"
|
||||||
|
/>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="item.prop === 'type'">
|
<template v-else-if="item.prop === 'type'">
|
||||||
@@ -156,6 +166,8 @@ export default {
|
|||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
needAlertDaysData: true,
|
||||||
|
trendKey: 'ruleId',
|
||||||
tableTitle: [
|
tableTitle: [
|
||||||
{
|
{
|
||||||
label: 'ID',
|
label: 'ID',
|
||||||
|
|||||||
@@ -89,9 +89,19 @@
|
|||||||
></alertLabel>
|
></alertLabel>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="item.prop === 'alerts'">
|
<template v-else-if="item.prop === 'alerts'">
|
||||||
<span class="alert-num" @click="showBottomBox('endpointAlertMessage', scope.row)">
|
<span style="cursor: pointer" @click="showBottomBox('endpointAlertMessage', scope.row)">
|
||||||
<i class="nz-icon nz-icon-overview-alert" :class="scope.row.alertNum>0?'colorEF7458':'color23BF9A'"/>
|
<i :class="scope.row.alertNum ? 'red' : 'green'" class="nz-icon nz-icon-overview-alert vertical-align-top;" @mouseenter="tooltipHover(scope.row,true, $event)" @mouseleave="tooltipHover(scope.row,false, $event)"></i>
|
||||||
{{scope.row.alertNum}}
|
<div v-if="scope.row.alertNumtooltipShow" class="alert-days-info-tooltip" :style="{left: scope.row.left + 'px',top:scope.row.top + 'px'}">
|
||||||
|
<div class="tooltip-title">Alert message (active)</div>
|
||||||
|
<div class="severity-info" style='justify-content: space-between'>
|
||||||
|
<div class="severity-name">{{$t('overall.result.total')}}</div>
|
||||||
|
<div class="severity-value">{{scope.row.alertNum}}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<alertDaysInfo
|
||||||
|
v-show="!scope.row.trendLoading"
|
||||||
|
:alertDaysData="scope.row.alertDaysData"
|
||||||
|
/>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="item.prop === 'configs'">
|
<template v-else-if="item.prop === 'configs'">
|
||||||
@@ -215,6 +225,8 @@ export default {
|
|||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
needAlertDaysData: true,
|
||||||
|
trendKey: 'endpointId',
|
||||||
tableTitle: [ // 原始table列
|
tableTitle: [ // 原始table列
|
||||||
{
|
{
|
||||||
label: 'ID',
|
label: 'ID',
|
||||||
|
|||||||
@@ -51,9 +51,19 @@
|
|||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="item.prop === 'alertNum'">
|
<template v-else-if="item.prop === 'alertNum'">
|
||||||
<span class="alert-num" @click="showBottomBox('moduleAlertMessage', scope.row)">
|
<span style="cursor: pointer" @click="showBottomBox('moduleAlertMessage', scope.row)">
|
||||||
<i class="nz-icon nz-icon-overview-alert" :class="scope.row[item.prop]>0?'colorEF7458':'color23BF9A'"/>
|
<i :class="scope.row.alertNum ? 'red' : 'green'" class="nz-icon nz-icon-overview-alert vertical-align-top;" @mouseenter="tooltipHover(scope.row,true, $event)" @mouseleave="tooltipHover(scope.row,false, $event)"></i>
|
||||||
{{scope.row[item.prop]}}
|
<div v-if="scope.row.alertNumtooltipShow" class="alert-days-info-tooltip" :style="{left: scope.row.left + 'px',top:scope.row.top + 'px'}">
|
||||||
|
<div class="tooltip-title">Alert message (active)</div>
|
||||||
|
<div class="severity-info" style='justify-content: space-between'>
|
||||||
|
<div class="severity-name">{{$t('overall.result.total')}}</div>
|
||||||
|
<div class="severity-value">{{scope.row.alertNum}}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<alertDaysInfo
|
||||||
|
v-show="!scope.row.trendLoading"
|
||||||
|
:alertDaysData="scope.row.alertDaysData"
|
||||||
|
/>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<span v-else-if="item.prop === 'id'" :id="'globalSearch' + scope.row.id">{{scope.row[item.prop]}}</span>
|
<span v-else-if="item.prop === 'id'" :id="'globalSearch' + scope.row.id">{{scope.row[item.prop]}}</span>
|
||||||
@@ -104,6 +114,8 @@ export default {
|
|||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
needAlertDaysData: true,
|
||||||
|
trendKey: 'moduleId',
|
||||||
tableTitle: [ // 原始table列
|
tableTitle: [ // 原始table列
|
||||||
{
|
{
|
||||||
label: 'ID',
|
label: 'ID',
|
||||||
|
|||||||
@@ -54,9 +54,21 @@
|
|||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="item.prop === 'alertNum'">
|
<template v-else-if="item.prop === 'alertNum'">
|
||||||
<span class="alert-num" @click="jumpAlertMessage(scope.row)">
|
<span class="alert-num">
|
||||||
<i class="nz-icon nz-icon-overview-alert" :class="scope.row[item.prop]>0?'colorEF7458':'color23BF9A'"/>
|
<span style="cursor: pointer" @click="jumpAlertMessage(scope.row)">
|
||||||
{{scope.row[item.prop]}}
|
<i :class="scope.row.alertNum ? 'red' : 'green'" class="nz-icon nz-icon-overview-alert vertical-align-top;" @mouseenter="tooltipHover(scope.row,true, $event)" @mouseleave="tooltipHover(scope.row,false, $event)"></i>
|
||||||
|
<div v-if="scope.row.alertNumtooltipShow" class="alert-days-info-tooltip" :style="{left: scope.row.left + 'px',top:scope.row.top + 'px'}">
|
||||||
|
<div class="tooltip-title">Alert message (active)</div>
|
||||||
|
<div class="severity-info" style='justify-content: space-between'>
|
||||||
|
<div class="severity-name">{{$t('overall.result.total')}}</div>
|
||||||
|
<div class="severity-value">{{scope.row.alertNum}}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<alertDaysInfo
|
||||||
|
v-show="!scope.row.trendLoading"
|
||||||
|
:alertDaysData="scope.row.alertDaysData"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<span v-else-if="item.prop === 'id'" :id="'globalSearch' + scope.row.id">{{scope.row[item.prop]}}</span>
|
<span v-else-if="item.prop === 'id'" :id="'globalSearch' + scope.row.id">{{scope.row[item.prop]}}</span>
|
||||||
@@ -96,6 +108,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import table from '@/components/common/mixin/table'
|
import table from '@/components/common/mixin/table'
|
||||||
|
import alertDaysInfo from '@/components/common/alert/alertDaysInfo'
|
||||||
export default {
|
export default {
|
||||||
name: 'projectTable',
|
name: 'projectTable',
|
||||||
mixins: [table],
|
mixins: [table],
|
||||||
@@ -104,6 +117,8 @@ export default {
|
|||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
needAlertDaysData: true,
|
||||||
|
trendKey: 'projectId',
|
||||||
tableTitle: [ // 原始table列
|
tableTitle: [ // 原始table列
|
||||||
{
|
{
|
||||||
label: 'ID',
|
label: 'ID',
|
||||||
@@ -133,7 +148,7 @@ export default {
|
|||||||
label: this.$t('project.endpoint.alerts'),
|
label: this.$t('project.endpoint.alerts'),
|
||||||
prop: 'alertNum',
|
prop: 'alertNum',
|
||||||
show: true,
|
show: true,
|
||||||
width: 100,
|
width: 120,
|
||||||
sortable: 'custom'
|
sortable: 'custom'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -248,7 +248,9 @@ export default {
|
|||||||
disabled: false
|
disabled: false
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
searchTime: bus.getTimezontDateRange()
|
searchTime: bus.getTimezontDateRange(),
|
||||||
|
needAlertDaysData: true,
|
||||||
|
trendKey: 'ruleId',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -282,6 +284,25 @@ export default {
|
|||||||
}
|
}
|
||||||
item.receiverShow = temp
|
item.receiverShow = temp
|
||||||
})
|
})
|
||||||
|
if (this.needAlertDaysData) {
|
||||||
|
response.data.list.forEach(item => {
|
||||||
|
item.trendLoading = true
|
||||||
|
item.alertDaysData = [
|
||||||
|
{
|
||||||
|
metric: { priority: 'P1' },
|
||||||
|
values: [[0, 0]]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
metric: { priority: 'P2' },
|
||||||
|
values: [[0, 0]]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
metric: { priority: 'P3' },
|
||||||
|
values: [[0, 0]]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
})
|
||||||
|
}
|
||||||
this.tableData = response.data.list
|
this.tableData = response.data.list
|
||||||
const globalSearchId = this.$store.getters.getGlobalSearchId
|
const globalSearchId = this.$store.getters.getGlobalSearchId
|
||||||
let detailViewRightObj = ''
|
let detailViewRightObj = ''
|
||||||
|
|||||||
@@ -458,7 +458,9 @@ export default {
|
|||||||
type: []
|
type: []
|
||||||
},
|
},
|
||||||
searchCheckBox: {},
|
searchCheckBox: {},
|
||||||
endpointNzTableHeightOffset: 204
|
endpointNzTableHeightOffset: 204,
|
||||||
|
needAlertDaysData: true,
|
||||||
|
trendKey: 'endpointId'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -623,6 +625,25 @@ export default {
|
|||||||
item.config = JSON.parse(item.config)
|
item.config = JSON.parse(item.config)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
if (this.needAlertDaysData) {
|
||||||
|
response.data.list.forEach(item => {
|
||||||
|
item.trendLoading = true
|
||||||
|
item.alertDaysData = [
|
||||||
|
{
|
||||||
|
metric: { priority: 'P1' },
|
||||||
|
values: [[0, 0]]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
metric: { priority: 'P2' },
|
||||||
|
values: [[0, 0]]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
metric: { priority: 'P3' },
|
||||||
|
values: [[0, 0]]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
})
|
||||||
|
}
|
||||||
this.tableData = response.data.list
|
this.tableData = response.data.list
|
||||||
const globalSearchId = this.$store.getters.getGlobalSearchId
|
const globalSearchId = this.$store.getters.getGlobalSearchId
|
||||||
let detailViewRightObj = ''
|
let detailViewRightObj = ''
|
||||||
|
|||||||
@@ -280,7 +280,9 @@ export default {
|
|||||||
disabled: false
|
disabled: false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
needAlertDaysData: true,
|
||||||
|
trendKey: 'moduleId'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -404,6 +406,25 @@ export default {
|
|||||||
for (let i = 0; i < response.data.list.length; i++) {
|
for (let i = 0; i < response.data.list.length; i++) {
|
||||||
response.data.list[i].status = response.data.list[i].status + ''
|
response.data.list[i].status = response.data.list[i].status + ''
|
||||||
}
|
}
|
||||||
|
if (this.needAlertDaysData) {
|
||||||
|
response.data.list.forEach(item => {
|
||||||
|
item.trendLoading = true
|
||||||
|
item.alertDaysData = [
|
||||||
|
{
|
||||||
|
metric: { priority: 'P1' },
|
||||||
|
values: [[0, 0]]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
metric: { priority: 'P2' },
|
||||||
|
values: [[0, 0]]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
metric: { priority: 'P3' },
|
||||||
|
values: [[0, 0]]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
})
|
||||||
|
}
|
||||||
this.tableData = response.data.list
|
this.tableData = response.data.list
|
||||||
const globalSearchId = this.$store.getters.getGlobalSearchId
|
const globalSearchId = this.$store.getters.getGlobalSearchId
|
||||||
let detailViewRightObj = ''
|
let detailViewRightObj = ''
|
||||||
|
|||||||
@@ -114,7 +114,9 @@ export default {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
roles: []
|
roles: [],
|
||||||
|
needAlertDaysData: true,
|
||||||
|
trendKey: 'projectId'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -142,6 +144,25 @@ export default {
|
|||||||
for (let i = 0; i < response.data.list.length; i++) {
|
for (let i = 0; i < response.data.list.length; i++) {
|
||||||
response.data.list[i].status = response.data.list[i].status + ''
|
response.data.list[i].status = response.data.list[i].status + ''
|
||||||
}
|
}
|
||||||
|
if (this.needAlertDaysData) {
|
||||||
|
response.data.list.forEach(item => {
|
||||||
|
item.trendLoading = true
|
||||||
|
item.alertDaysData = [
|
||||||
|
{
|
||||||
|
metric: { priority: 'P1' },
|
||||||
|
values: [[0, 0]]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
metric: { priority: 'P2' },
|
||||||
|
values: [[0, 0]]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
metric: { priority: 'P3' },
|
||||||
|
values: [[0, 0]]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
})
|
||||||
|
}
|
||||||
if (!this.$store.state.currentProject.id) {
|
if (!this.$store.state.currentProject.id) {
|
||||||
this.$store.commit('currentProjectChange', response.data.list[0])
|
this.$store.commit('currentProjectChange', response.data.list[0])
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user