处理 Database Monitor 页面跳转后,下拉框不对应问题

This commit is contained in:
任珮宇 2024-02-05 14:41:21 +08:00
parent d59fd9a75e
commit 864ad75ce3
3 changed files with 15 additions and 26 deletions
src/views/abnormalAlarm
components
databaseMonitor/instances
serverMonitor/instances

View File

@ -11,8 +11,9 @@
:customRow="customRow" :customRow="customRow"
:rowClassName="() => (canSelect ? 'custom-table-row' : '')" :rowClassName="() => (canSelect ? 'custom-table-row' : '')"
@change="handleTableChange" @change="handleTableChange"
:scroll="{ y: 186 }" :scroll="scroll"
> >
<!-- :scroll="{ y: 186 }" -->
<!-- 处理 scopedSlots --> <!-- 处理 scopedSlots -->
<template v-for="slotName of scopedSlotsKeys" :slot="slotName" slot-scope="text, record, index"> <template v-for="slotName of scopedSlotsKeys" :slot="slotName" slot-scope="text, record, index">
<slot :name="slotName" :text="text" :record="record" :index="index"></slot> <slot :name="slotName" :text="text" :record="record" :index="index"></slot>
@ -58,6 +59,7 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
scroll: { type: Object },
}, },
data() { data() {
return { return {

View File

@ -49,8 +49,7 @@
<script> <script>
import moment from 'moment' import moment from 'moment'
import dateFormat from '@/components/jeecg/JEasyCron/format-date' import { getAction } from '@/api/manage'
import { getAction, postAction, httpAction, deleteAction } from '@/api/manage'
export default { export default {
props: { props: {
value: { value: {
@ -76,6 +75,9 @@ export default {
mounted() { mounted() {
this.getDbList() this.getDbList()
}, },
activated() {
this.getDbList()
},
methods: { methods: {
getBeforeHours(num) { getBeforeHours(num) {
let currentTime = moment() let currentTime = moment()
@ -94,8 +96,10 @@ export default {
// urlsourceId // urlsourceId
if (sourceId) { if (sourceId) {
const find = res.result.find((item) => item.sourceId == sourceId) const find = res.result.find((item) => item.sourceId == sourceId)
if (find) { if (find && find.hostId) {
this.value.hostId = find.hostId this.value.hostId = find.hostId
} else {
this.value.hostId = `my${find.sourceId}`
} }
} }
if (!this.value.hostId) { if (!this.value.hostId) {
@ -103,7 +107,7 @@ export default {
} }
this.DbOptions = res.result.map((item, index) => { this.DbOptions = res.result.map((item, index) => {
let str = `my${index}` let str = `my${item.sourceId}`
return { return {
label: item.sourceName, label: item.sourceName,
value: item.hostId || str, value: item.hostId || str,

View File

@ -74,35 +74,17 @@
<div class="service-content-center"> <div class="service-content-center">
<a-row :gutter="20"> <a-row :gutter="20">
<a-col :span="12"> <a-col :span="12">
<BoxTitle title="Process CPU usage(%)"> <BoxTitle title="Process CPU usage(%)" />
<!-- <template slot="right">
<ul class="legend-list">
<li v-for="(item, index) in processCpu.legend" :key="index">
<div :style="`background:${processCpu.color[index]}`" class="li-icon"></div>
{{ item }}
</li>
</ul>
</template> -->
</BoxTitle>
<div class="service-content-center-item" id="processCpu"></div> <div class="service-content-center-item" id="processCpu"></div>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<BoxTitle title="Process memory usage(%)"> <BoxTitle title="Process memory usage(%)" />
<!-- <template slot="right">
<ul class="legend-list">
<li v-for="(item, index) in processMenbry.legend" :key="index">
<div :style="`background:${processMenbry.color[index]}`" class="li-icon"></div>
{{ item }}
</li>
</ul>
</template> -->
</BoxTitle>
<div class="service-content-center-item" id="menbry"></div> <div class="service-content-center-item" id="menbry"></div>
</a-col> </a-col>
</a-row> </a-row>
</div> </div>
<div class="service-content-table"> <div class="service-content-table">
<BoxTitle title="Service"></BoxTitle> <BoxTitle title="Service" />
<div style="padding-top: 10px"> <div style="padding-top: 10px">
<TableList <TableList
size="middle" size="middle"
@ -112,6 +94,7 @@
:loading="loading" :loading="loading"
:pagination="false" :pagination="false"
:canSelect="false" :canSelect="false"
:scroll="{ y: 186 }"
> >
</TableList> </TableList>
<!-- <a-pagination <!-- <a-pagination