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 @@