Center - History 接口增加type参数

处理页面跳转或者刷新时,下拉默认选中的问题
This commit is contained in:
renpy 2023-08-18 13:49:25 +08:00
parent 7eab692686
commit 0b6aa43a57
7 changed files with 28 additions and 8 deletions

View File

@ -145,15 +145,16 @@ export default {
endDate,
types
}
this.getAlarmLogBar({ startDate, endDate })
this.getAlarmLogBar({ startDate, endDate, types })
this.getTypeAlarmPie({ startDate, endDate })
this.getAlarmLogTable({ startDate, endDate, types })
this.getAlarmTop({ startDate, endDate })
this.getAlarmTop({ startDate, endDate, types })
},
getAlarmLogBar(obj) {
let params = {
startDate:obj.startDate,
endDate:obj.endDate,
endDate: obj.endDate,
type: obj.types
}
postAction("/alarmLog/viewAll", params).then(res => {
if (res.success) {
@ -236,7 +237,6 @@ export default {
},
label: {
formatter: (params) => {
console.log(params);
return params.value>0?params.value:""
},
show: true,
@ -360,6 +360,7 @@ export default {
let params = {
startDate:obj.startDate,
endDate:obj.endDate,
type: obj.types
}
postAction("/alarmLog/ruleTop", params).then(res => {
console.log(res);

View File

@ -191,6 +191,7 @@ export default {
value: item.sourceId
}
})
this.queryParams.server = this.$route.query.serverId || res.result[0].sourceId
} else {
this.$message.warning("This operation fails. Contact your system administrator")
}

View File

@ -429,15 +429,24 @@ export default {
guageMemory: null,
guageLoads: null,
areaCpu: null,
currId: ""
}
},
mounted () {
mounted() {
// this.currId = this.$route.query.serverId||""
this.getSysServer(res => {
this.loading = false
if (res.success) {
this.ipagination.total = res.result.total
this.dataSource = res.result.records
if (this.$route.query.serverId) {
this.currId = this.$route.query.serverId
this.currIndex = this.dataSource.findIndex(item=>item.id === this.currId)
} else {
this.currId = this.dataSource[0].id
this.currIndex = 0
}
} else {
this.$message.warning("This operation fails. Contact your system administrator")
}

View File

@ -1,7 +1,7 @@
<template>
<div style="height: 100%;">
<a-card :bordered="false" style="height:100%;margin-left: 20px;">
<a-tabs default-active-key="monitor" @change="handleTabChange">
<a-tabs default-active-key="detais" @change="handleTabChange">
<a-tab-pane key="detais" tab="DETAILS">
<Details></Details>
</a-tab-pane>

View File

@ -289,6 +289,7 @@ export default {
value: item.sourceId
}
})
this.queryParams.server = this.$route.query.serverId || res.result[0].sourceId
} else {
this.$message.warning("This operation fails. Contact your system administrator")
}

View File

@ -248,6 +248,7 @@ export default {
value: item.sourceId
}
})
this.queryParams.server = this.$route.query.serverId || res.result[0].sourceId
} else {
this.$message.warning("This operation fails. Contact your system administrator")
}

View File

@ -324,8 +324,15 @@ export default {
this.form.resetFields()
this.visible = false
},
onRowDbclick() {
this.$router.push("/alarm/serverMonitor/instances")
onRowDbclick(record) {
console.log(record);
let query = {
serverId:record.id
}
this.$router.push({
path: '/alarm/serverMonitor/instances',
query
})
}
},
}