mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-27 18:59:26 +08:00
投运时间,系统总览刷新,图表警告处理等
This commit is contained in:
@@ -48,7 +48,7 @@
|
||||
:page-option="tableList[activeKey].pageOption"
|
||||
:table-info="tableList[activeKey].tableInfo"
|
||||
:table-data="tableList[activeKey].tableData"
|
||||
@pagesizeChange="pagesizeChange()"
|
||||
@pagesizeChange="pagesizeChange"
|
||||
></energyEchart>
|
||||
</a-spin>
|
||||
</div>
|
||||
@@ -60,6 +60,7 @@ import energyEchart from '@/components/statisticalAnalysis/energyEchart.vue'
|
||||
import searchBox from '@/components/SearchBox.vue'
|
||||
import { postReq, getReq } from '@/request/api'
|
||||
import { getRunDays, getDateDaysAgo } from '@/utils/dealWithData'
|
||||
import { contentQuotesLinter } from 'ant-design-vue/es/_util/cssinjs/linters'
|
||||
|
||||
export default {
|
||||
name: 'StatisicalAnView',
|
||||
@@ -509,7 +510,7 @@ export default {
|
||||
this.renderKey += 1
|
||||
},
|
||||
resetDataForInactiveKey() {
|
||||
// 重置非当前激活页面的数据,减少内存占用
|
||||
// 重置非当前激活页面的数据
|
||||
Object.keys(this.echartsInfo).forEach((key) => {
|
||||
if (key != this.activeKey) {
|
||||
this.echartsInfo[key].chartData = {}
|
||||
@@ -519,7 +520,11 @@ export default {
|
||||
|
||||
Object.keys(this.tableList).forEach((key) => {
|
||||
if (key != this.activeKey) {
|
||||
this.echartsInfo[key].tableData = {}
|
||||
this.tableList[key].tableData = []
|
||||
this.tableList[key].pageOption={
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
count: 1 }
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -556,21 +561,25 @@ export default {
|
||||
...this.paramsDate,
|
||||
category: this.activeKey,
|
||||
page_size: currentInfo.pageOption.pageSize,
|
||||
pageNumber: currentInfo.pageOption.page
|
||||
page: currentInfo.pageOption.page
|
||||
}
|
||||
|
||||
try {
|
||||
const res = await getReq('/queryStatDetailList', query)
|
||||
if (res.errcode === 0) {
|
||||
this.tableList[this.activeKey].tableData = res.data.list || res.data
|
||||
this.tableList[this.activeKey].pageOption.count = res.data.count || 0
|
||||
this.tableList[this.activeKey].pageOption.count = res.count || 0
|
||||
this.tableList[this.activeKey].pageOption.page = res.page || 0
|
||||
this.tableList[this.activeKey].pageOption.pageSize = res.page_size || 0
|
||||
this.loading.table = false
|
||||
} else {
|
||||
throw res
|
||||
}
|
||||
} catch (error) {
|
||||
this.tableList[this.activeKey].tableData = []
|
||||
this.tableList[this.activeKey].pageOption.count = 0
|
||||
this.tableList[this.activeKey].pageOption.count = 0
|
||||
this.tableList[this.activeKey].pageOption.page = 0
|
||||
this.tableList[this.activeKey].pageOption.pageSize = 0
|
||||
this.loading.table = false
|
||||
}
|
||||
},
|
||||
@@ -579,7 +588,7 @@ export default {
|
||||
if (this.activeKey) {
|
||||
this.getStatCharts() // 定时获取最新实时数据
|
||||
}
|
||||
}, 10000) // 30秒刷新一次
|
||||
}, 10000)
|
||||
},
|
||||
|
||||
async getStationList() {
|
||||
@@ -601,7 +610,6 @@ export default {
|
||||
if (!this.stationId) {
|
||||
this.stationId = this.stationList[0].value
|
||||
}
|
||||
//V I P
|
||||
}
|
||||
} else {
|
||||
const err = { tip: res.errmsg }
|
||||
@@ -619,7 +627,6 @@ export default {
|
||||
onSearch(data) {
|
||||
this.paramsDate.start_date = data.time ? data.time[0] : ''
|
||||
this.paramsDate.end_date = data.time ? data.time[1] : ''
|
||||
|
||||
this.tableList[this.activeKey].pageOption.page = 1
|
||||
this.getStationList(), this.getEchartsListForActiveKey(), this.getTableListForActiveKey()
|
||||
},
|
||||
@@ -628,7 +635,6 @@ export default {
|
||||
},
|
||||
|
||||
async getStatCharts() {
|
||||
const currentInfo = this.echartsInfo[this.activeKey]
|
||||
const query = {
|
||||
dt: this.paramsDate.end_date,
|
||||
station_id: this.stationId,
|
||||
@@ -638,16 +644,11 @@ export default {
|
||||
const res = await getReq('/queryStatCharts', query)
|
||||
if (res.errcode === 0) {
|
||||
this.echartsInfo[this.activeKey].chartDatav = res.data
|
||||
// x轴0点到24点
|
||||
} else {
|
||||
throw res
|
||||
}
|
||||
} catch (error) {
|
||||
this.echartsInfo[this.activeKey].chartDatav = {
|
||||
V: [100.0, 100.0, 100.0], // 电压曲线
|
||||
I: [10.0, 10.0, 10.0], // 电流曲线
|
||||
P: [1000.0, 1000.0, 1000.0] // 功率曲线
|
||||
}
|
||||
this.echartsInfo[this.activeKey].chartDatav = {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user