This commit is contained in:
xiaoguangbin 2023-10-26 15:26:31 +08:00
commit 8d1f572aa6
2 changed files with 41 additions and 32 deletions

View File

@ -1,8 +1,8 @@
<template>
<a-card :bordered="false" style="height: 100%;">
<a-card :bordered="false" style="height: 100%">
<a-layout id="components-layout-demo-custom-trigger" style="height: 100%">
<a-layout-sider theme="light" v-model="collapsed" :trigger="null" collapsible width="350px">
<div style="height:100%">
<div style="height: 100%">
<a-menu
id="dddddd"
:defaultOpenKeys="defaultOpenKeys"
@ -97,13 +97,13 @@ export default {
},
created() {
var permissionList = this.$store.getters.permissionList
console.log("permissionList",permissionList);
console.log('permissionList', permissionList)
permissionList.forEach((f) => {
if (f.name === "abnormal-alarm") {
if (f.name === 'abnormal-alarm') {
this.menus = f.children
}
})
console.log("路由信息",this.menus);
console.log('路由信息', this.menus)
// this.initDefaultKeys(this.menus[0])
// openKeys
// const openKeys = window.sessionStorage.getItem('openKeys')
@ -113,10 +113,9 @@ export default {
// this.defaultSelectedKeys.push(selectedKeys)
this.currSlecteKey.push(selectedKeys)
} else {
this.initDefaultKeys(this.menus[0])
}
this.openKeys =this.defaultOpenKeys= this.menus.map(item => {
this.openKeys = this.defaultOpenKeys = this.menus.map((item) => {
return item.path
})
// if (openKeys) {
@ -128,22 +127,23 @@ export default {
// this.openKeys = JSON.parse(openKeys)
// }
},
// watch: {
// "$route": {
// handler: function (val, oldVal) {
// this.currSlecteKey=[]
// console.log(val);
// this.currSlecteKey.push(val.path)
// window.sessionStorage.setItem('currMenu', val.path)
// },
// deep:true,
// immediate:true
// }
// },
watch: {
$route: {
handler: function (val, oldVal) {
this.currSlecteKey = []
console.log(val)
this.currSlecteKey.push(val.path)
window.sessionStorage.setItem('currMenu_alarm', val.path)
},
deep: true,
immediate: true,
},
},
methods: {
// ,MenuItem
menuClick({ item, key, keyPath }) {
this.currSlecteKey =[]
console.log(item, key, keyPath)
this.currSlecteKey = []
window.sessionStorage.setItem('currMenu_alarm', key)
// var parentPath = item._props.parentMenu._props.eventKey;
// var parentTitle = parentPath.substring(parentPath.lastIndexOf("/") + 1, parentPath.length)
@ -155,8 +155,8 @@ export default {
})
},
initDefaultKeys(data) {
this.currSlecteKey=[]
console.log("datadefaultOpenKeys",data);
this.currSlecteKey = []
console.log('datadefaultOpenKeys', data)
this.defaultOpenKeys.push(data.path)
data.children.some((f) => {
if (f.children) {
@ -192,7 +192,7 @@ export default {
background: none;
}
}
::v-deep .ant-card-body{
::v-deep .ant-card-body {
height: 100%;
}
.ant-menu {

View File

@ -448,6 +448,8 @@ export default {
max: 0,
min: 0,
avg: 0,
xData: [],
yData: [],
},
}
},
@ -622,7 +624,6 @@ export default {
getCpuUtilizationData() {
let params = {
itemId: this.currItemId,
// itemId: '37550',
itemType: 0,
start: `${dateFormat(new Date(), 'yyyy-MM-dd')} 00:00:00`,
end: dateFormat(new Date(), 'yyyy-MM-dd hh:mm:ss'),
@ -646,7 +647,6 @@ export default {
getTimeLineData() {
let params = {
itemId: this.currItemId,
// itemId: '37550',
itemType: 0,
start: `${dateFormat(new Date(), 'yyyy-MM-dd')} 00:00:00`,
end: dateFormat(new Date(), 'yyyy-MM-dd hh:mm:ss'),
@ -728,6 +728,16 @@ export default {
this.currIndex = i
this.currItemId = item.cpuUsedItemId
this.currSourceId = item.sourceId
this.detailInfo = {}
this.cpuData = {
max: 0,
min: 0,
avg: 0,
xData: [],
yData: [],
}
startTime = null
data1 = []
this.getBasiclnfo(item.hostId)
this.getCpuUtilizationData()
this.getTimeLineData()
@ -735,8 +745,7 @@ export default {
getDetailsAlarmInfo(callBack) {
this.loading = true
let params = {
// sourceId:this.currSourceId,
sourceId: 'e2',
sourceId: this.currSourceId,
pageNo: this.ipagination_alarm_info.current,
pageSize: this.ipagination_alarm_info.pageSize,
}