From fa04054986219191750fe18a03f4561ed7a826c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=BB=E7=8F=AE=E5=AE=87?= Date: Mon, 5 Feb 2024 17:42:56 +0800 Subject: [PATCH] =?UTF-8?q?bug=20=E4=BF=AE=E6=94=B9=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=B6=88=E6=81=AF=E5=BC=B9=E7=AA=97=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/tools/UserMenu.vue | 340 +++++++++--------- .../instances/conditionBox.vue | 12 +- .../emailMonitor/instances/index.vue | 15 +- .../serverMonitor/instances/cpu.vue | 12 +- .../serverMonitor/instances/details.vue | 125 +++---- .../serverMonitor/instances/monitor.vue | 12 +- .../instances/serviceProcess.vue | 12 +- src/views/system/DataBase.vue | 28 +- 8 files changed, 301 insertions(+), 255 deletions(-) diff --git a/src/components/tools/UserMenu.vue b/src/components/tools/UserMenu.vue index 18d6f18..7e68251 100644 --- a/src/components/tools/UserMenu.vue +++ b/src/components/tools/UserMenu.vue @@ -1,12 +1,12 @@ \ No newline at end of file diff --git a/src/views/abnormalAlarm/databaseMonitor/instances/conditionBox.vue b/src/views/abnormalAlarm/databaseMonitor/instances/conditionBox.vue index 6ab2ab4..23969f9 100644 --- a/src/views/abnormalAlarm/databaseMonitor/instances/conditionBox.vue +++ b/src/views/abnormalAlarm/databaseMonitor/instances/conditionBox.vue @@ -75,8 +75,16 @@ export default { mounted() { this.getDbList() }, - activated() { - this.getDbList() + watch: { + $route: { + handler: function (val, oldVal) { + if (val.query && val.query.id) { + this.getDbList() + } + }, + deep: true, + immediate: true, + }, }, methods: { getBeforeHours(num) { diff --git a/src/views/abnormalAlarm/emailMonitor/instances/index.vue b/src/views/abnormalAlarm/emailMonitor/instances/index.vue index 9aea6db..cc8c284 100644 --- a/src/views/abnormalAlarm/emailMonitor/instances/index.vue +++ b/src/views/abnormalAlarm/emailMonitor/instances/index.vue @@ -239,10 +239,19 @@ export default { mounted() { this.getEmailList() }, - activated() { - this.getEmailList() - }, + // activated() { + // this.getEmailList() + // }, watch: { + $route: { + handler: function (val, oldVal) { + if (val.query && val.query.emailId) { + this.getEmailList() + } + }, + deep: true, + immediate: true, + }, emailId(newValue, oldValue) { this.currId = newValue this.getEmailStatus() diff --git a/src/views/abnormalAlarm/serverMonitor/instances/cpu.vue b/src/views/abnormalAlarm/serverMonitor/instances/cpu.vue index f1b17b5..89cee10 100644 --- a/src/views/abnormalAlarm/serverMonitor/instances/cpu.vue +++ b/src/views/abnormalAlarm/serverMonitor/instances/cpu.vue @@ -237,8 +237,16 @@ export default { mounted() { this.getServerList() }, - activated() { - this.getServerList() + watch: { + $route: { + handler: function (val, oldVal) { + if (val.query && val.query.serverId) { + this.getServerList() + } + }, + deep: true, + immediate: true, + }, }, methods: { handleRefresh() { diff --git a/src/views/abnormalAlarm/serverMonitor/instances/details.vue b/src/views/abnormalAlarm/serverMonitor/instances/details.vue index 4b1d6ef..990a752 100644 --- a/src/views/abnormalAlarm/serverMonitor/instances/details.vue +++ b/src/views/abnormalAlarm/serverMonitor/instances/details.vue @@ -280,6 +280,7 @@
{ - this.loading = false - if (res.success) { - this.ipagination.total = res.result.total - this.dataSource = res.result.records - if (this.$route.query.serverId) { - this.serverId = this.$route.query.serverId - this.currIndex = this.dataSource.findIndex((item) => item.sourceId === this.serverId) - this.currHostId = this.dataSource.find((item) => item.sourceId === this.serverId).hostId - this.currSourceId = this.dataSource.find((item) => item.sourceId === this.serverId).sourceId - this.currItemId = this.dataSource.find((item) => item.sourceId === this.serverId).cpuUsedItemId - } else { - this.currHostId = this.dataSource[0].hostId - this.currSourceId = this.dataSource[0].sourceId - this.currItemId = this.dataSource[0].cpuUsedItemId - this.currIndex = 0 - } - this.getBasiclnfo(this.currHostId) - this.getCpuUtilizationData() - this.getTimeLineData() - // this.EchartsTimeline() - this.getDetailsAlarmInfo((res) => { - this.loading_alarm_info = false - if (res.success) { - this.ipagination_alarm_info.total = res.result.total - this.dataSource_alarm_info = res.result.records - } else { - this.$message.warning('This operation fails. Contact your system administrator') - } - }) - } else { - this.$message.warning('This operation fails. Contact your system administrator') - } - }) - // this.$nextTick(() => { - // setTimeout(() => { - // this.drawGuageLoads() - // }, 0) - // }) - }, - activated() { - 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.serverId = this.$route.query.serverId - this.currIndex = this.dataSource.findIndex((item) => item.sourceId === this.serverId) - this.currHostId = this.dataSource.find((item) => item.sourceId === this.serverId).hostId - this.currSourceId = this.dataSource.find((item) => item.sourceId === this.serverId).sourceId - this.currItemId = this.dataSource.find((item) => item.sourceId === this.serverId).cpuUsedItemId - } else { - this.currHostId = this.dataSource[0].hostId - this.currSourceId = this.dataSource[0].sourceId - this.currItemId = this.dataSource[0].cpuUsedItemId - this.currIndex = 0 - } - this.getBasiclnfo(this.currHostId) - this.getCpuUtilizationData() - this.getTimeLineData() - // this.EchartsTimeline() - this.getDetailsAlarmInfo((res) => { - this.loading_alarm_info = false - if (res.success) { - this.ipagination_alarm_info.total = res.result.total - this.dataSource_alarm_info = res.result.records - } else { - this.$message.warning('This operation fails. Contact your system administrator') - } - }) - } else { - this.$message.warning('This operation fails. Contact your system administrator') - } - }) + this.getData() }, + // activated() {}, methods: { + getData() { + 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.serverId = this.$route.query.serverId + this.currIndex = this.dataSource.findIndex((item) => item.sourceId === this.serverId) + this.currHostId = this.dataSource.find((item) => item.sourceId === this.serverId).hostId + this.currSourceId = this.dataSource.find((item) => item.sourceId === this.serverId).sourceId + this.currItemId = this.dataSource.find((item) => item.sourceId === this.serverId).cpuUsedItemId + } else { + this.currHostId = this.dataSource[0].hostId + this.currSourceId = this.dataSource[0].sourceId + this.currItemId = this.dataSource[0].cpuUsedItemId + this.currIndex = 0 + } + this.getBasiclnfo(this.currHostId) + this.getCpuUtilizationData() + this.getTimeLineData() + // this.EchartsTimeline() + this.getDetailsAlarmInfo((res) => { + this.loading_alarm_info = false + if (res.success) { + this.ipagination_alarm_info.total = res.result.total + this.dataSource_alarm_info = res.result.records + } else { + this.$message.warning('This operation fails. Contact your system administrator') + } + }) + } else { + this.$message.warning('This operation fails. Contact your system administrator') + } + }) + }, moment, // Basic lnformation getBasiclnfo(sourceId) { diff --git a/src/views/abnormalAlarm/serverMonitor/instances/monitor.vue b/src/views/abnormalAlarm/serverMonitor/instances/monitor.vue index 093459a..435b569 100644 --- a/src/views/abnormalAlarm/serverMonitor/instances/monitor.vue +++ b/src/views/abnormalAlarm/serverMonitor/instances/monitor.vue @@ -166,8 +166,16 @@ export default { mounted() { this.getServerList() }, - activated() { - this.getServerList() + watch: { + $route: { + handler: function (val, oldVal) { + if (val.query && val.query.serverId) { + this.getServerList() + } + }, + deep: true, + immediate: true, + }, }, methods: { handleRefresh() { diff --git a/src/views/abnormalAlarm/serverMonitor/instances/serviceProcess.vue b/src/views/abnormalAlarm/serverMonitor/instances/serviceProcess.vue index 68de0b0..e0c858b 100644 --- a/src/views/abnormalAlarm/serverMonitor/instances/serviceProcess.vue +++ b/src/views/abnormalAlarm/serverMonitor/instances/serviceProcess.vue @@ -286,8 +286,16 @@ export default { setTimeout(() => {}, 0) }) }, - activated() { - this.getServerList() + watch: { + $route: { + handler: function (val, oldVal) { + if (val.query && val.query.serverId) { + this.getServerList() + } + }, + deep: true, + immediate: true, + }, }, methods: { handleRefresh() { diff --git a/src/views/system/DataBase.vue b/src/views/system/DataBase.vue index 8fbd88d..bdfc89c 100644 --- a/src/views/system/DataBase.vue +++ b/src/views/system/DataBase.vue @@ -28,6 +28,10 @@ {{ index + 1 }} + + + +
@@ -163,11 +167,24 @@ const columns = [ dataIndex: 'status', }, ] +const columnsModal = [ + { + title: 'Index', + dataIndex: 'rowCount', + align: 'center', + }, + { + title: 'Information', + dataIndex: 'info', + align: 'left', + }, +] export default { mixins: [JeecgListMixin], data() { this.columns = columns + this.columnsModal = columnsModal return { queryParam: { collectStart: this.getBeforeDate(6), @@ -183,6 +200,8 @@ export default { }, stationList: [], detectorList: [], + visibleInfo: false, + dataInfo: [], } }, created() { @@ -264,7 +283,7 @@ export default { cancelText: 'Cancel', onOk: async () => { try { - const { success, message } = await deleteAction('/gardsSampleData/deleteById', { + const { success, message, result } = await deleteAction('/gardsSampleData/deleteById', { sampleId: this.selectedRowKeys[0], ...this.delParams, }) @@ -273,6 +292,13 @@ export default { that.loadData() } else { this.$message.error(message) + this.visibleInfo = true + this.dataInfo = result.map((item, index) => { + return { + rowCount: `${index + 1}`, + info: item, + } + }) } } catch (error) { console.error(error)