环境监控图修改

duizhaopin_ui
13507605001 2 years ago
parent 08c7317a67
commit 36eca74de2

@ -196,7 +196,7 @@ export default {
value: '', value: '',
// //
dialogVisible: false, dialogVisible: false,
recordLoading: true, recordLoading: false,
record_client_id: undefined, record_client_id: undefined,
recordData: [], recordData: [],
record_page: 1, record_page: 1,
@ -206,17 +206,17 @@ export default {
record_day: undefined, record_day: undefined,
start_time: undefined, start_time: undefined,
end_time: undefined, end_time: undefined,
loadingLine: true loadingLine: false
} }
}, },
created() { created() {
if (this.$store.getters.currentOptions.length > 0) { if (this.$store.getters.currentOptions.length > 0) {
this.client_id = this.$store.getters.currentOptions[0].client_id this.client_id = this.$store.getters.currentOptions[0].client_id
this.daily_client_id = this.client_id this.daily_client_id = this.client_id
this.getMonitoringData()
this.getDailyData()
// this.initCharts()
} }
this.getMonitoringData()
this.getDailyData()
this.initCharts()
}, },
beforeDestroy() { beforeDestroy() {
window.removeEventListener('resize', () => { window.removeEventListener('resize', () => {
@ -295,20 +295,22 @@ export default {
get_monitoring_info(stringify(data)).then( get_monitoring_info(stringify(data)).then(
res => { res => {
this.linechartData = res.data this.linechartData = res.data
this.lineCharts(t)
} }
).finally(() => { ).finally(() => {
this.loadingLine = false this.loadingLine = false
}) })
}, },
initCharts() { initCharts() {
this.$nextTick(() => { // this.$nextTick(() => {
this.lineCharts() // this.lineCharts()
}) // })
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
this.myChart2.resize() this.myChart2.resize()
}) })
}, },
lineCharts(t) { lineCharts(t) {
console.log('0101222222222', t)
if (t) { if (t) {
this.myChart2.clear() this.myChart2.clear()
} else { } else {

@ -400,13 +400,13 @@ export default {
this.loading = true this.loading = true
this.client_id = this.$store.getters.currentOptions[0].client_id this.client_id = this.$store.getters.currentOptions[0].client_id
this.rclient_id = this.client_id this.rclient_id = this.client_id
this.getMonitoringData()
home_info().then(res => {
this.initDataFunc(res.data)
this.initAllCharts()
}).finally(() => (this.loading = false))
this.remainingPageChange(1)
} }
this.getMonitoringData()
home_info().then(res => {
this.initDataFunc(res.data)
this.initAllCharts()
}).finally(() => (this.loading = false))
this.remainingPageChange(1)
}, },
beforeDestroy() { beforeDestroy() {
window.removeEventListener('resize', () => { window.removeEventListener('resize', () => {

Loading…
Cancel
Save