能源分析

This commit is contained in:
2023-09-05 15:45:59 +08:00
parent 01fe2da523
commit 9c59a7e715
29 changed files with 2203 additions and 100 deletions

View File

@@ -25,11 +25,10 @@
</template>
<script>
import { energyReportPageAuto, energyReportPageExportAuto } from "@/api/monitoring/energyReport";
import { parseTime } from '@/utils/ruoyi'
import { energyReportPageAuto, energyReportPageExportAuto } from "@/api/monitoring/energyReport"
import { getEnergyTypeListAll } from "@/api/base/energyType";
// import { getTree } from '@/api/base/factory'
import { publicFormatter } from '@/utils/dict'
import { parseTime } from '@/utils/ruoyi'
const tableProps = [
{
prop: 'statisticType',
@@ -70,7 +69,7 @@ const tableProps = [
}
]
export default {
name: "EnergyReportSearch",
name: "EnergyLimit",
data() {
return {
formConfig: [
@@ -78,7 +77,8 @@ export default {
type: 'select',
label: '能源类型',
selectOptions: [],
param: 'energyTypeId'
param: 'energyTypeId',
filterable: true
},
{
type: 'select',
@@ -93,7 +93,7 @@ export default {
label: '时间',
dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: "yyyy-MM-ddTHH:mm:ss",
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
@@ -111,7 +111,7 @@ export default {
type: 'separate'
},
{
type: this.$auth.hasPermi('monitoring:energy-limit:create') ? 'button' : '',
type: this.$auth.hasPermi('monitoring:energy-report:export') ? 'button' : '',
btnName: '导出',
name: 'add',
color: 'primary',
@@ -129,23 +129,17 @@ export default {
pageNo: 1,
pageSize: 20,
energyTypeId: null,
statisticType: null,
startTime: null,
endTime: null,
statisticType: null
},
energyTypeList: [],
typeList: [
{label: '合并', value: '1'},
{label: '详细', value: '2'}
],
objList: []
endTime: null
}
};
},
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
this.getList();
this.getList()
this.getTypeList()
},
methods: {
@@ -158,33 +152,25 @@ export default {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.queryParams.pageNo = 1;
this.queryParams.pageNo = 1
this.queryParams.energyTypeId = val.energyTypeId
this.queryParams.statisticType = val.statisticType
this.queryParams.startTime = val.timeVal ? val.timeVal[0] : nul
this.queryParams.endTime = val.timeVal ? val.timeVal[1] : nul
this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null
this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null
this.getList()
break
default:
this.addOrEditTitle = '新增'
this.centervisible = true
this.$nextTick(() => {
this.$refs.energyLimit.init()
})
this.$modal.confirm('是否确认导出').then(() => {
return energyReportPageExportAuto({...this.queryParams});
}).then(response => {
this.$download.excel(response, '能源统计报表.xls');
}).catch(() => {})
}
},
/** 查询列表 */
getList() {
energyReportPageAuto({...this.queryParams}).then(response => {
let arr = response.data.list || [];
// arr&&arr.map(item => {
// this.typeList.map(i => {
// if (item.type === i.value) {
// item.type = i.label
// }
// })
// })
this.list = arr
energyReportPageAuto(this.queryParams).then(response => {
this.list = response.data.list || [];
this.total = response.data.total;
});
}