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

环比增加国内接口

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