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

View File

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

View File

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

View File

@ -1,7 +1,7 @@
<template> <template>
<div style="height: 100%;"> <div style="height: 100%;">
<a-card :bordered="false" style="height:100%;margin-left: 20px;"> <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"> <a-tab-pane key="detais" tab="DETAILS">
<Details></Details> <Details></Details>
</a-tab-pane> </a-tab-pane>

View File

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

View File

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

View File

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