Commit 91d03704 authored by 朱超's avatar 朱超

环比增加国内接口

parent 16d572bd
......@@ -78,8 +78,15 @@ export const postHeatAnalysis = params => {
})
}
//换热站机组用量环比接口(耗水量、耗电量、耗热量)
export const postQOQ = params => {
//换热站机组用量环比接口(耗水量、耗电量、耗热量)网内
export const postWithinQOQ = params => {
return http.post(`/api/analysis/within/QOQ`, params).then(res => res).catch(function (error) {
console.log(error);
})
}
//换热站机组用量环比接口(耗水量、耗电量、耗热量)网外
export const postExternalQOQ = params => {
return http.post(`/api/analysis/external/QOQ`, params).then(res => res).catch(function (error) {
console.log(error);
})
......
......@@ -101,7 +101,7 @@
v-model="enertyInfo.energyType"
placeholder="请选择"
style="width: 80px"
@change="postQOQFun"
@change="postExternalQOQFun"
>
<el-option label="耗气" :value="1" v-show="networkType == 1" />
<el-option label="耗水" :value="2" />
......@@ -113,7 +113,7 @@
<div style="position: absolute; right: 2%">
<el-button
type="primary"
@click="postQOQFun"
@click="postExternalQOQFun"
style="margin: 15px 0 0 0"
>查询</el-button
><el-button
......@@ -173,7 +173,7 @@ import zhCn from "element-plus/dist/locale/zh-cn.mjs";
import { ElMessage } from "element-plus";
import { saveAs } from "file-saver";
import XLSX from "xlsx-js-style";
import { postQOQ } from "../../api/analysis";
import { postExternalQOQ, postWithinQOQ } from "../../api/analysis";
const tdType = ref(1);
const networkType = ref(2);
......@@ -194,6 +194,7 @@ const switchV = ref(true);
const echartF = ref(false);
const nodata = ref(false);
let tableData = reactive([]);
const echartTitle = reactive(["耗水量趋势图"]);
const echartData = reactive([]);
const echartDataTime = reactive([]);
const echartDataLegend = reactive([]);
......@@ -348,12 +349,25 @@ function selTypeChange() {
}
//换热站机组能耗数据接口(用量环比)
function postQOQFun() {
function postExternalQOQFun() {
tabloading.value = true;
switch(enertyInfo.energyType) {
case 2: company.value = "T";break;
case 3: company.value = "GJ";break;
case 4: company.value = "A";break;
switch (enertyInfo.energyType) {
case 1:
company.value = "Nm³";
echartTitle.value = "耗气量趋势图";
break;
case 2:
company.value = "T";
echartTitle.value = "耗水量趋势图";
break;
case 3:
company.value = "GJ";
echartTitle.value = "耗热量趋势图";
break;
case 4:
company.value = "A";
echartTitle.value = "耗电量趋势图";
break;
}
let params = {
supplyIdList: networkType.value == 1 ? enertyInfo.supplyIdList : null,
......@@ -363,22 +377,41 @@ function postQOQFun() {
energyType: enertyInfo.energyType,
interval: enertyInfo.interval,
};
postQOQ(params).then((res) => {
echarts.dispose(document.getElementById("echartsLayer"));
if (res.success === true) {
pageInitFun(res);
tableData = res.data.hourWater;
tabloading.value = false;
} else {
echartData.length = 0;
echartSeries.length = 0;
echartDataLegend.length = 0;
echartDataTime.length = 0;
tableData.length = 0;
tabloading.value = false;
ElMessage.error(res.message);
}
});
clearData();
if (networkType.value == 2) {
postExternalQOQ(params).then((res) => {
echarts.dispose(document.getElementById("echartsLayer"));
if (res.success === true) {
if (res.data.hourWater.length >0) {
pageInitFun(res);
tableData = res.data.hourWater;
}
} else {
ElMessage.error(res.message);
}
});
} else {
postWithinQOQ(params).then((res) => {
echarts.dispose(document.getElementById("echartsLayer"));
if (res.success === true) {
if (res.data.data.length >0) {
pageInitFun(res);
tableData = res.data.hourWater;
}
} else {
ElMessage.error(res.message);
}
});
}
}
function clearData() {
echartData.length = 0;
echartSeries.length = 0;
echartDataLegend.length = 0;
echartDataTime.length = 0;
tableData.length = 0;
tabloading.value = false;
}
function pageInitFun(res) {
......@@ -488,7 +521,7 @@ function dataDeal(data) {
gatherDay: el.gatherDay,
gatherHour: el.gatherHour,
gatherMonth: el.gatherMonth,
gatherTime: el.gatherTime,
gatherTime: el.gatherTime.replace("T", " "),
gatherYear: el.gatherYear,
temperature: el.temperature,
transferId: el.transferId,
......@@ -524,7 +557,7 @@ function echartInit() {
"#470c66",
],
title: {
text: "换热站趋势图",
text: echartTitle.value,
top: 0,
left: 50,
},
......@@ -582,6 +615,7 @@ function echartInit() {
}
function changeFun() {
tabloading.value = false;
nodata.value = true;
var divWidth = document.getElementById("contentBlock").offsetWidth;
var divHeight = document.getElementById("contentBlock").scrollHeight;
......@@ -594,7 +628,7 @@ onMounted(() => {
timeFun();
getEnterprise();
getSupplys();
postQOQFun();
postExternalQOQFun();
changeFun();
window.addEventListener("resize", function () {
location.reload();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment