From 3c900440e6786dedec43db805ae52a059a06e4a3 Mon Sep 17 00:00:00 2001 From: Xu Zhimeng Date: Thu, 28 Dec 2023 16:51:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AF=B9=E6=8E=A5=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E7=9B=91=E6=8E=A7=E5=9B=BE=E8=A1=A8=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9=E5=AD=98=E5=9C=A8=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../databaseMonitor/instances/areaChart.vue | 101 +- .../instances/conditionBox.vue | 45 +- .../databaseMonitor/instances/monitor.vue | 1639 +++-------------- 3 files changed, 374 insertions(+), 1411 deletions(-) diff --git a/src/views/abnormalAlarm/databaseMonitor/instances/areaChart.vue b/src/views/abnormalAlarm/databaseMonitor/instances/areaChart.vue index e84e498..1726024 100644 --- a/src/views/abnormalAlarm/databaseMonitor/instances/areaChart.vue +++ b/src/views/abnormalAlarm/databaseMonitor/instances/areaChart.vue @@ -1,40 +1,30 @@ \ 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 4a521ce..fee8b9b 100644 --- a/src/views/abnormalAlarm/databaseMonitor/instances/conditionBox.vue +++ b/src/views/abnormalAlarm/databaseMonitor/instances/conditionBox.vue @@ -4,7 +4,7 @@ Database name
- + Refresh @@ -52,25 +52,22 @@ import moment from 'moment'; import dateFormat from '@/components/jeecg/JEasyCron/format-date' import { getAction, postAction, httpAction, deleteAction } from '@/api/manage' export default { + props: { + value: { + type: Object, + required: true + } + }, data() { return { - name: undefined, timer: 1, - startDate: dateFormat(new Date(), 'yyyy-MM-dd hh:mm:ss'), - endDate: dateFormat(new Date(), 'yyyy-MM-dd hh:mm:ss'), DbOptions: [], timerOptions: [ {label: "1Hours",value: 1}, {label: "2Hours",value: 2}, {label: "3Hours",value: 3}, {label: "user-defined",value: 0}, - ], - currId:"" - } - }, - watch: { - name(newValue, oldValue) { - this.currId = newValue + ] } }, created() { @@ -83,8 +80,8 @@ export default { getBeforeHours(num) { let currentTime = moment() let oneHourAgo = moment().subtract(num, 'hours'); - this.startDate = oneHourAgo.format('YYYY-MM-DD HH:mm:ss') - this.endDate = currentTime.format('YYYY-MM-DD HH:mm:ss') + this.value.start = oneHourAgo.format('YYYY-MM-DD HH:mm:ss') + this.value.end = currentTime.format('YYYY-MM-DD HH:mm:ss') }, moment, filterOption(input, option) { @@ -95,29 +92,37 @@ export default { getDbList() { getAction("/sysDatabase/sourceList").then(res => { if (res.success) { - this.name = this.$route.query.id || res.result[0].sourceId + this.value.hostId = this.$route.query.id || res.result[0].hostId this.DbOptions = res.result.map(item => { return { label: item.sourceName, - value: item.sourceId + value: item.hostId } }) + this.$emit('change') } else { this.$message.warning("This operation fails. Contact your system administrator") } }) }, onDbChange(val) { - this.name = val + this.value.hostId = val + this.$emit('change') }, onTimeChange(val) { this.getBeforeHours(val) + this.$emit('change') }, onRangeDateChange(date, dateString) { this.timer = 0 - this.startDate = dateString[0] - this.endDate = dateString[1] + this.value.start = dateString[0] + this.value.end = dateString[1] + this.$emit('change') }, + + handleRefresh() { + this.$emit('refresh') + } }, } diff --git a/src/views/abnormalAlarm/databaseMonitor/instances/monitor.vue b/src/views/abnormalAlarm/databaseMonitor/instances/monitor.vue index dbee0a2..08b17e8 100644 --- a/src/views/abnormalAlarm/databaseMonitor/instances/monitor.vue +++ b/src/views/abnormalAlarm/databaseMonitor/instances/monitor.vue @@ -1,47 +1,39 @@