fix: 修改projet页面 显示悬浮窗 topo不断刷新的问题

This commit is contained in:
zhangyu
2022-02-25 16:36:40 +08:00
parent 280dcf0bd6
commit 68ac416c3e
3 changed files with 46 additions and 4 deletions

View File

@@ -142,7 +142,9 @@ export default {
loading: false, loading: false,
tableHeight: '100%', tableHeight: '100%',
searchLabel: {}, searchLabel: {},
deleteBox: {} deleteBox: {},
needAlertDaysData: true,
trendKey: 'assetId'
} }
}, },
created () { created () {
@@ -165,6 +167,25 @@ export default {
this.$get(this.url, { ...this.searchLabel }).then(response => { this.$get(this.url, { ...this.searchLabel }).then(response => {
this.tools.loading = false this.tools.loading = false
if (response.code == 200) { if (response.code == 200) {
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.deleteBox.ids = '' this.deleteBox.ids = ''
this.pageObj.total = response.data.total this.pageObj.total = response.data.total

View File

@@ -134,7 +134,9 @@ export default {
searchLabel: { searchLabel: {
}, },
deleteBox: {} deleteBox: {},
needAlertDaysData: true,
trendKey: 'endpointId'
} }
}, },
created () { created () {
@@ -171,6 +173,25 @@ export default {
d.port = JSON.parse(d.configs[0].config).port d.port = JSON.parse(d.configs[0].config).port
d.path = JSON.parse(d.configs[0].config).protocol d.path = JSON.parse(d.configs[0].config).protocol
}) })
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.pageObj.total = response.data.total this.pageObj.total = response.data.total
} }

View File

@@ -550,8 +550,8 @@ export default {
obj: { obj: {
deep: true, deep: true,
immediate: true, immediate: true,
handler (n) { handler (n, o) {
if (n && n.id) { if (n && n.id && n.id !== o.id) {
// if (getTopology(this.topologyIndex)) { // if (getTopology(this.topologyIndex)) {
// getTopology(this.topologyIndex).destroy() // getTopology(this.topologyIndex).destroy()
// setTopology(this.topologyIndex, null) // setTopology(this.topologyIndex, null)