Browse Source

1.新增综合能耗报表菜单,可查询系统能耗报表

2.修改热水监控-实时监控流程图,屏蔽循环泵
3.修改仪表报警规则,修改弹框时候请求设备名称、采集点位
4.区域空间管理,针对新增、修改房间,添加设备名称、采集点位多选
meizhou
selia-zx 5 days ago
parent
commit
e94a6b8c16
  1. 4
      .env.development
  2. 9
      src/api/comprehensiveEnergy/systemEnergy.js
  3. 6
      src/api/device/gather.js
  4. BIN
      src/assets/flowimg/circulate-move.gif
  5. BIN
      src/assets/flowimg/circulate-nomove.png
  6. 3
      src/assets/styles/element-ui.scss
  7. 14
      src/views/alarm/alarmRule/index.vue
  8. 777
      src/views/comprehensiveEnergy/systemEnergy/index.vue
  9. 100
      src/views/hotWater/energyAnalysis/components/energyReport.vue
  10. 6
      src/views/hotWater/waterMonitor/waterMonitorDetails.vue
  11. 184
      src/views/region/index.vue

4
.env.development

@ -7,9 +7,9 @@ ENV = 'development'
# 开发环境
# VUE_APP_BASE_API = '/dev-api'
# 后台
# VUE_APP_BASE_API = 'http://192.168.1.222:8080'
VUE_APP_BASE_API = 'http://192.168.1.222:8080'
# 梅州云端
VUE_APP_BASE_API = 'http://106.55.173.225:8091'
# VUE_APP_BASE_API = 'http://106.55.173.225:8091'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

9
src/api/comprehensiveEnergy/systemEnergy.js

@ -0,0 +1,9 @@
import request from "@/utils/request";
export const compreReport = (data) => {
return request({
url: "/compre/report",
method: "post",
data,
});
};

6
src/api/device/gather.js

@ -8,6 +8,12 @@ export function cpmList(query) {
params: query,
});
}
export function cpmList2(cpmIds) {
return request({
url: "/device/cpm/list/" + cpmIds,
method: "get",
});
}
// 根据id查询设备采集参数信息
export function getCPM(cpmId) {

BIN
src/assets/flowimg/circulate-move.gif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 24 KiB

BIN
src/assets/flowimg/circulate-nomove.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

3
src/assets/styles/element-ui.scss

@ -1449,3 +1449,6 @@
.el-table--border th.el-table__cell {
border-bottom: 1px solid #00264f !important;
}
.el-table__expand-icon{
color: #fff !important;
}

14
src/views/alarm/alarmRule/index.vue

@ -668,7 +668,8 @@ export default {
this.multiple = !selection.length;
},
//
handleDevice(selectedValue) {
handleDevice(selectedValue, val) {
console.log("选择设备", selectedValue);
// value label
const selectedItem = this.devices.find(
(item) => item.id === selectedValue
@ -683,8 +684,13 @@ export default {
//
this.getCpmIdList(this.form.ledgerId);
}
//
this.form.cpmId = "";
if (!val) {
console.log("非第一次打开弹框-选择设备类型");
//
this.form.cpmId = "";
} else {
console.log("第一次打开弹框-默认采集点位");
}
},
//
getCpmIdList(id) {
@ -775,6 +781,8 @@ export default {
};
this.open = true;
this.title = "修改报警规则";
// handleDevice
this.handleDevice(this.form.ledgerId, true);
});
},
/** 提交按钮 */

777
src/views/comprehensiveEnergy/systemEnergy/index.vue

@ -0,0 +1,777 @@
<template>
<div class="main-body">
<div class="irregular-border">
<div class="main-content">
<div class="condition">
<div class="condition-left">
<div class="time-label">时间类型:</div>
<el-radio-group
v-model="dateType"
style="margin-right: 0.24rem"
@change="updateDateType"
>
<el-radio label="hour">小时</el-radio>
<el-radio label="day"></el-radio>
<el-radio label="month"></el-radio>
<el-radio label="year"></el-radio>
</el-radio-group>
<el-date-picker
v-model="timeDate"
:default-time="['00:00:00', '23:59:59']"
type="datetimerange"
range-separator="至"
v-if="dateType == 'hour'"
placeholder="选择日期"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
<el-date-picker
v-model="dayDate"
type="daterange"
v-if="dateType == 'day'"
:key="this.dateType"
range-separator="至"
value-format="yyyy-MM-dd"
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="dateChange"
>
</el-date-picker>
<el-date-picker
v-model="monthDate"
type="monthrange"
v-if="dateType == 'month'"
:key="this.dateType"
range-separator="至"
start-placeholder="开始月份"
end-placeholder="结束月份"
value-format="yyyy-MM"
@change="dateChange"
>
</el-date-picker>
<div
class="years-div"
v-if="dateType == 'year'"
:key="this.dateType"
>
<el-date-picker
v-model="startYear"
type="year"
placeholder="选择开始年份"
style="width: 180px"
value-format="yyyy"
>
</el-date-picker>
<div class="years-word"></div>
<el-date-picker
v-model="endYear"
type="year"
placeholder="选择结束年份"
style="width: 180px"
value-format="yyyy"
>
</el-date-picker>
</div>
<div class="success-btn" style="margin-left: 0.24rem">
<el-button type="success" @click="findData">查询</el-button>
</div>
<div class="warning-btn">
<el-button type="warning" @click="goExport()">导出</el-button>
</div>
</div>
</div>
<div class="choice">
<div
class="mr20"
v-for="(item, index) in timeData2"
:key="index"
@click="handleEnter(index, $event)"
:class="{ timeStyle: currentIndex == index }"
>
{{ item.title }}
</div>
</div>
<div class="charts" ref="chart_ref"></div>
<el-table :data="tableData" stripe>
<el-table-column label="时间" align="center" prop="time" />
<el-table-column
label="总用电量(kwh)"
align="center"
prop="electValue"
/>
<el-table-column
label="总产冷量(kw)"
align="center"
prop="coldValue"
/>
<el-table-column
label="总热水补水量(t)"
align="center"
prop="hotValue"
/>
<el-table-column
label="总蒸汽流量(t)"
align="center"
prop="steamValue"
/>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getTableData"
/>
</div>
</div>
</div>
</template>
<script>
import { format2 } from "@/utils/datetime";
import * as echarts from "echarts";
import { compreReport } from "@/api/comprehensiveEnergy/systemEnergy";
export default {
data() {
return {
listLoading: false,
dateType: "hour", //
timeDate: [], //
dayDate: [], //
monthDate: [], //
startYear: "", //
endYear: "", //
startTime: "", //
endTime: "", //
//
total: 0,
//
tableData: [],
exportData: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
startTime: "",
endTime: "",
},
brokenInstanc: null,
brokenOption: {},
timeData2: [
{ title: "总用电量" },
{ title: "总产冷量" },
{ title: "总热水补水量" },
{ title: "总蒸汽流量" },
],
currentIndex: 0,
brokenData1: [],
brokenData2: [],
brokenData3: [],
brokenData4: [],
brokenTime: [],
useWater: 0,
useWaterRadio: 0,
useElect: 0,
useElectRadio: 0,
useUnit: 0,
useUnitRadio: 0,
};
},
mounted() {
this.initializeTimeDate();
this.getTableData();
this.initChart();
window.addEventListener("resize", this.screenAdapter);
this.screenAdapter();
},
destroyed() {
//
window.removeEventListener("resize", this.screenAdapter);
},
methods: {
//
initializeTimeDate() {
const start = new Date(new Date().setHours(0, 0, 0, 0));
const end = new Date(new Date().setHours(23, 59, 59, 59));
this.timeDate = [format2(start), format2(end)]; //
this.titleDate = format2(start) + "至" + format2(end);
},
//
updateDateType() {
// this.dateType = this.radio;
console.log(this.dateType);
(this.timeDate = []), //
(this.dayDate = []), //
(this.monthDate = []), //
(this.startYear = ""), //
(this.endYear = ""); //
},
//
dateChange() {
// console.log("", this.timeform.time1);
if (!this.dayDate) {
this.$nextTick(() => {
this.dayDate = [];
});
}
if (!this.monthDate) {
this.$nextTick(() => {
this.monthDate = [];
});
}
},
//
findData() {
console.log("this.dateType", this.dateType);
console.log("this.timeDate", this.timeDate);
switch (this.dateType) {
case "hour":
if (!this.timeDate) {
this.showMessage("请选择时间!", "warning");
} else {
this.titleDate =
format2(this.timeDate[0]) + "至" + format2(this.timeDate[1]);
this.getTableData();
}
break;
case "day":
if (this.dayDate.length === 0) {
this.showMessage("请选择时间!", "warning");
} else {
const newLength =
new Date(this.dayDate[1]).getTime() -
new Date(this.dayDate[0]).getTime();
const dayDiff = Math.floor(newLength / (1000 * 60 * 60 * 24));
if (dayDiff > 31) {
this.showMessage(
"最多只能选择30天区间,请重新选择再查询!",
"warning"
);
} else {
this.titleDate = this.dayDate[0] + "至" + this.dayDate[1];
this.getTableData();
}
}
break;
case "month":
if (this.monthDate.length === 0) {
this.showMessage("请选择时间!", "warning");
} else {
const [start, end] = this.monthDate;
const startDate = new Date(start);
const endDate = new Date(end);
const startYear = startDate.getFullYear();
const startMonth = startDate.getMonth();
const endYear = endDate.getFullYear();
const endMonth = endDate.getMonth();
const monthDiff =
(endYear - startYear) * 12 + (endMonth - startMonth);
if (monthDiff > 12) {
this.showMessage(
"最多只能选择12个月区间,请重新选择再查询!",
"warning"
);
} else {
this.titleDate = this.monthDate[0] + "至" + this.monthDate[1];
this.getTableData();
}
}
break;
case "year":
if (!this.startYear || !this.endYear) {
this.showMessage("请选择全年份区间!", "warning");
} else if (this.startYear > this.endYear) {
this.showMessage("结束年份要大于开始年份!", "warning");
} else {
this.titleDate = this.startYear + "至" + this.endYear;
this.getTableData();
}
break;
default:
break;
}
},
//
showMessage(message, type) {
this.$message({
message: message,
type: type,
});
},
handleEnter(index) {
this.currentIndex = index;
this.renderingBroken();
},
//
getTableData() {
if (this.dateType == "hour") {
this.startTime = format2(this.timeDate[0]);
this.endTime = format2(this.timeDate[1]);
} else if (this.dateType == "day") {
this.startTime = this.dayDate.length > 0 ? this.dayDate[0] : "";
this.endTime = this.dayDate.length > 0 ? this.dayDate[1] : "";
} else if (this.dateType == "month") {
this.startTime = this.monthDate.length > 0 ? this.monthDate[0] : "";
this.endTime = this.monthDate.length > 0 ? this.monthDate[1] : "";
} else if (this.dateType == "year") {
(this.startTime = this.startYear), (this.endTime = this.endYear);
}
let data = {
timeType: this.dateType,
startTime: this.startTime,
endTime: this.endTime,
pageNum: this.queryParams.pageNum,
pageSize: this.queryParams.pageSize,
};
console.log("查询数据参数", data);
this.listLoading = true;
compreReport(data).then((res) => {
console.log("表格返回的数据", res);
if (res.code == 200 && res.rows.length > 0) {
this.tableData = res.rows;
this.total = res.total;
} else {
this.tableData = [];
this.total = 0;
}
this.getChartData();
});
// Just to simulate the time of the request
setTimeout(() => {
this.listLoading = false;
}, 1.0 * 1000);
},
//线
getChartData() {
if ((this.total == 10)) {
//
console.log("不用请求");
this.brokenData1 = [];
this.brokenData2 = [];
this.brokenData3 = [];
this.brokenData4 = [];
this.brokenTime = [];
if (this.tableData.length > 0) {
this.exportData = this.tableData;
this.tableData.forEach((item) => {
this.brokenData1.push(item.electValue);
this.brokenData2.push(item.coldValue);
this.brokenData3.push(item.hotValue);
this.brokenData4.push(item.steamValue);
this.brokenTime.push(item.time);
});
this.renderingBroken();
} else {
this.brokenData1 = [];
this.brokenData2 = [];
this.brokenData3 = [];
this.brokenData4 = [];
this.brokenTime = [];
}
this.renderingBroken();
} else {
console.log("图表参数", this.queryParams);
if (this.dateType == "hour") {
this.startTime = format2(this.timeDate[0]);
this.endTime = format2(this.timeDate[1]);
} else if (this.dateType == "day") {
this.startTime = this.dayDate.length > 0 ? this.dayDate[0] : "";
this.endTime = this.dayDate.length > 0 ? this.dayDate[1] : "";
} else if (this.dateType == "month") {
this.startTime = this.monthDate.length > 0 ? this.monthDate[0] : "";
this.endTime = this.monthDate.length > 0 ? this.monthDate[1] : "";
} else if (this.dateType == "year") {
(this.startTime = this.startYear), (this.endTime = this.endYear);
}
let data = {
timeType: this.dateType,
startTime: this.startTime,
endTime: this.endTime,
pageNum: this.queryParams.pageNum,
pageSize: this.total,
};
compreReport(data).then((res) => {
console.log("图表返回的数据", res);
this.brokenData1 = [];
this.brokenData2 = [];
this.brokenData3 = [];
this.brokenData4 = [];
this.brokenTime = [];
if (res.code == 200 && res.rows.length > 0) {
this.exportData = res.rows;
res.rows.forEach((item) => {
this.brokenData1.push(item.electValue);
this.brokenData2.push(item.coldValue);
this.brokenData3.push(item.hotValue);
this.brokenData4.push(item.steamValue);
this.brokenTime.push(item.time);
});
this.renderingBroken();
} else {
this.brokenData1 = [];
this.brokenData2 = [];
this.brokenData3 = [];
this.brokenData4 = [];
this.brokenTime = [];
}
this.renderingBroken();
});
}
},
renderingBroken() {
if (this.currentIndex === 0) {
this.brokenOption.yAxis.name = "kwh";
this.brokenOption.yAxis.nameTextStyle = {
color: "rgba(255, 255, 255, 1)",
fontSize: 12,
};
this.brokenOption.series[0].data = this.brokenData1;
this.brokenOption.series[0].itemStyle.color = "#d48e17";
this.brokenOption.series[0].areaStyle.color.colorStops = [
{
offset: 0,
color: "rgba(212, 142, 23, 0.3)", // 0%
},
{
offset: 0.8,
color: "rgba(212, 142, 23,0)", // 100%
},
];
} else if (this.currentIndex === 1) {
this.brokenOption.yAxis.name = "kw";
this.brokenOption.yAxis.nameTextStyle = {
color: "rgba(255, 255, 255, 1)",
fontSize: 12,
};
this.brokenOption.series[0].data = this.brokenData2;
this.brokenOption.series[0].itemStyle.color = "#1ab395";
this.brokenOption.series[0].areaStyle.color.colorStops = [
{
offset: 0,
color: "rgba(26, 179, 149, 0.3)", // 0%
},
{
offset: 0.8,
color: "rgba(26, 179, 149,0)", // 100%
},
];
} else if (this.currentIndex === 2) {
this.brokenOption.yAxis.name = "t";
this.brokenOption.yAxis.nameTextStyle = {
color: "rgba(255, 255, 255, 1)",
fontSize: 12,
};
this.brokenOption.series[0].data = this.brokenData3;
this.brokenOption.series[0].itemStyle.color = "#1f8dee";
this.brokenOption.series[0].areaStyle.color.colorStops = [
{
offset: 0,
color: "rgba(31, 141, 238, 0.3)", // 0%
},
{
offset: 0.8,
color: "rgba(31, 141, 238,0)", // 100%
},
];
} else if (this.currentIndex === 3) {
this.brokenOption.yAxis.name = "t";
this.brokenOption.yAxis.nameTextStyle = {
color: "rgba(255, 255, 255, 1)",
fontSize: 12,
};
this.brokenOption.series[0].data = this.brokenData4;
this.brokenOption.series[0].itemStyle.color = "#f1f524";
this.brokenOption.series[0].areaStyle.color.colorStops = [
{
offset: 0,
color: "rgba(241, 245, 36, 0.3)", // 0%
},
{
offset: 0.8,
color: "rgba(241, 245, 36,0)", // 100%
},
];
}
//
const currentIndex = this.currentIndex;
// tooltip
this.brokenOption.tooltip = {
trigger: "axis",
formatter: function (params) {
//
const data = params[0];
const month = data.name;
const value = data.value;
//
if (currentIndex === 0) {
return `${month}<br/>总用电量: ${value}`;
} else if (currentIndex === 1) {
return `${month}<br/>总产冷量: ${value} 千瓦`;
} else if (currentIndex === 2) {
return `${month}<br/>总热水补水量: ${value}`;
} else if (currentIndex === 3) {
return `${month}<br/>总蒸汽量: ${value}`;
}
},
};
this.brokenOption.xAxis.data = this.brokenTime;
this.brokenInstanc.setOption(this.brokenOption);
},
//
goExport() {
if (this.exportData) {
import("@/assets/excel/Export2Excel").then((excel) => {
// excel
var tHeader = [
"时间",
"总用电量(kwh)",
"总产冷量(kw)",
"总热水补水量(t)",
"总蒸汽流量(t)",
]; // excel
var filterVal = [
"time",
"electValue",
"coldValue",
"hotValue",
"steamValue",
];
const data = this.formatJson(filterVal, this.exportData);
const autoWidth = true;
excel.export_json_to_excel({
header: tHeader, //
data, //
filename: "系统能耗报表", //
autoWidth: true, //
});
});
this.$message({
type: "success",
message: "导出成功!",
});
} else {
this.$message.error("导出失败!");
}
},
//,
formatJson(filterVal, jsonData) {
return jsonData.map((v) =>
filterVal.map((j) => {
if (j === "perWater") {
return (v[j] * 1000).toFixed(1);
} else {
return v[j];
}
})
);
},
// 线+ + 线
screenAdapter() {
//,2.6 mes_ref
const titleFontSize = this.$refs.chart_ref.offsetWidth / 130;
//optionoption
const adapterOption = {};
//.chartInstanceoptiondataoption
this.brokenInstanc.setOption(adapterOption);
//resize
this.brokenInstanc.resize();
},
//chartInstance
initChart() {
this.brokenInstanc = echarts.init(this.$refs.chart_ref);
this.brokenOption = {
tooltip: {
trigger: "axis",
},
legend: {
show: false,
selectedMode: false, //
icon: "cricle", //
//
textStyle: {
color: "#ffff",
fontSize: 16, //
},
// left: "73%",
left: "66%",
top: "0",
//
itemGap: 5,
itemWidth: 10,
itemHeight: 5,
},
grid: {
top: "10%",
left: "3%",
right: "4%",
bottom: "5%",
containLabel: true,
},
xAxis: {
type: "category",
//true
boundaryGap: true,
// x
axisLabel: {
// interval: 0, //x
// rotate: 30, //x30
color: "rgba(255, 255, 255, 1)",
fontSize: 14, //
},
axisTick: {
show: false, // 线
},
// x
axisLine: {
show: true,
lineStyle: {
color: "#365576",
},
},
splitLine: {
lineStyle: {
color: "#e2e6f0",
},
}, //x线
data: this.brokenTime,
},
yAxis: {
min: 0,
// max:20,
// // // min:'dataMin',
// // // max:'dataMax',
// name: "kwh", // y
// name
nameTextStyle: {
color: "rgba(255, 255, 255, 1)",
fontSize: 12,
},
miniInterval: 5,
type: "value",
// y
axisLabel: {
color: "rgba(255, 255, 255, 1)",
},
// y
axisLine: {
show: true,
lineStyle: {
color: "#365576", // y 线
},
fontSize: 14, //
},
//y线
// splitNumber: 10,
// y线
splitLine: {
lineStyle: {
color: "#1a3d62", // 线
type: "dashed", // 线线
},
},
},
series: [
{
type: "line",
//
symbolSize: 8,
smooth: true,
showSymbol: false,
data: this.brokenData1,
//线
itemStyle: {
color: "#d48e17", //线
lineStyle: {
color: "#d48e17", //线
},
},
areaStyle: {
color: {
//线
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [],
},
},
},
],
};
//
this.brokenInstanc.setOption(this.brokenOption, true);
},
},
};
</script>
<style lang="scss" scoped>
.condition-left {
display: flex;
flex-direction: row;
align-items: center;
flex-wrap: wrap;
.years-div {
display: flex;
flex-direction: row;
align-items: center;
.years-word {
font-size: 14px;
margin: 0 5px;
color: #388ff3;
}
}
.time-label {
font-size: 16px;
line-height: 7px;
margin-right: 12px;
white-space: nowrap;
}
}
.main-content {
min-height: 6.6rem;
}
.choice {
margin: 20px 0;
.mr20 {
padding: 0.05rem 0.2rem;
white-space: nowrap;
width: auto;
}
}
.charts {
width: 100%;
height: 300px;
margin-bottom: 0.1rem;
}
// 2000px
@media (min-width: 2000px) {
.condition {
.condition-left {
.years-div {
.years-word {
font-size: 0.14rem !important;
margin: 0 0.05rem !important;
}
}
.time-label {
font-size: 0.16rem !important;
line-height: 0.07rem !important;
margin-right: 0.12rem !important;
}
}
}
}
</style>

100
src/views/hotWater/energyAnalysis/components/energyReport.vue

@ -476,42 +476,12 @@ export default {
},
//线
getChartData() {
console.log("图表参数", this.queryParams);
let timeType = null;
if (this.dateType == "day") {
timeType = 1;
this.queryParams.startTime =
this.dayDate.length > 0 ? this.dayDate[0] : "";
this.queryParams.endTime =
this.dayDate.length > 0 ? this.dayDate[1] : "";
} else if (this.dateType == "month") {
timeType = 2;
this.queryParams.startTime =
this.monthDate.length > 0 ? this.monthDate[0] : "";
this.queryParams.endTime =
this.monthDate.length > 0 ? this.monthDate[1] : "";
} else if (this.dateType == "year") {
timeType = 3;
this.queryParams.startTime = this.startYear;
this.queryParams.endTime = this.endYear;
}
let data = {
type: timeType,
page: this.queryParams.pageNum,
limit: this.total,
startDate: this.queryParams.startTime,
endDate: this.queryParams.endTime,
buildingId: this.building,
};
hotEnergyQuery(data).then((res) => {
console.log("图表返回的数据", res);
this.brokenData1 = [];
this.brokenData2 = [];
this.brokenData3 = [];
this.brokenTime = [];
if (res.code == 200 && res.rows.length > 0) {
this.exportData = res.rows;
res.rows.forEach((item) => {
if ((this.total == 10)) {
//
console.log("不用请求");
if (this.tableData.length > 0) {
this.exportData = this.tableData;
this.exportData.forEach((item) => {
this.brokenData1.push(item.useHotWater);
this.brokenData2.push(item.electValue);
this.brokenData3.push(item.electWater);
@ -530,7 +500,63 @@ export default {
this.brokenTime = [];
}
this.renderingBroken();
});
} else {
console.log("图表参数", this.queryParams);
let timeType = null;
if (this.dateType == "day") {
timeType = 1;
this.queryParams.startTime =
this.dayDate.length > 0 ? this.dayDate[0] : "";
this.queryParams.endTime =
this.dayDate.length > 0 ? this.dayDate[1] : "";
} else if (this.dateType == "month") {
timeType = 2;
this.queryParams.startTime =
this.monthDate.length > 0 ? this.monthDate[0] : "";
this.queryParams.endTime =
this.monthDate.length > 0 ? this.monthDate[1] : "";
} else if (this.dateType == "year") {
timeType = 3;
this.queryParams.startTime = this.startYear;
this.queryParams.endTime = this.endYear;
}
let data = {
type: timeType,
page: this.queryParams.pageNum,
limit: this.total,
startDate: this.queryParams.startTime,
endDate: this.queryParams.endTime,
buildingId: this.building,
};
hotEnergyQuery(data).then((res) => {
console.log("图表返回的数据", res);
this.brokenData1 = [];
this.brokenData2 = [];
this.brokenData3 = [];
this.brokenTime = [];
if (res.code == 200 && res.rows.length > 0) {
this.exportData = res.rows;
res.rows.forEach((item) => {
this.brokenData1.push(item.useHotWater);
this.brokenData2.push(item.electValue);
this.brokenData3.push(item.electWater);
this.brokenTime.push(item.curDate);
});
//
this.brokenData1.reverse();
this.brokenData2.reverse();
this.brokenData3.reverse();
this.brokenTime.reverse();
this.renderingBroken();
} else {
this.brokenData1 = [];
this.brokenData2 = [];
this.brokenData3 = [];
this.brokenTime = [];
}
this.renderingBroken();
});
}
},
renderingBroken() {
if (this.currentIndex === 0) {

6
src/views/hotWater/waterMonitor/waterMonitorDetails.vue

@ -112,7 +112,7 @@
<div class="flow-text text3">无线网关</div>
<div class="flow-text text4">回水阀</div>
<div class="flow-text text5">房间</div>
<div class="flow-text text7">循环加热泵</div>
<!-- <div class="flow-text text7">循环加热泵</div> -->
<div class="flow-text text8">补水阀</div>
<!-- 补水阀定位 -->
<img
@ -224,7 +224,7 @@
alt=""
/>
<!-- 循环加热泵定位-->
<img
<!-- <img
class="cirpum"
v-if="this.hotPumState === '1' && this.isBad !== '1'"
src="../../../assets/flowimg/startpum.png"
@ -235,7 +235,7 @@
v-else
src="../../../assets/flowimg/closepum.png"
alt=""
/>
/> -->
<!-- 热泵定位 -->
<div :class="getHotPumPositionClass">
<div

184
src/views/region/index.vue

@ -202,7 +202,7 @@
:title="dialogTitle"
:visible.sync="isDialogOpen"
@close="addExpenseClose"
width="700px"
width="730px"
append-to-body
>
<el-form
@ -477,6 +477,45 @@
/> </el-select></el-form-item
></el-col>
</el-row>
<el-row type="flex" justify="center">
<el-col :span="12">
<el-form-item label="设备名称" prop="ledgerId">
<el-select
v-model="dialogForm.ledgerId"
placeholder="请选择设备类型"
clearable
@change="handleDevice"
filterable
multiple
collapse-tags
>
<el-option
v-for="item in devices"
:key="item.id"
:label="item.deviceName"
:value="item.id"
/> </el-select></el-form-item
></el-col>
<el-col :span="12">
<el-form-item label="采集点位" prop="cpmId">
<el-select
v-model="dialogForm.cpmId"
placeholder="请选择设备类型"
clearable
@change="handleMeter"
filterable
multiple
collapse-tags
>
<el-option
v-for="item in cpmList"
:key="item.id"
:label="item.otherName"
:value="item.id"
/>
</el-select> </el-form-item
></el-col>
</el-row>
</template>
</el-form>
<div slot="footer" class="dialog-footer">
@ -510,6 +549,8 @@ import {
getHouse,
delHouse,
} from "@/api/region";
import { cpmList2 } from "@/api/device/gather";
import { ledgerList } from "@/api/device/ledger";
export default {
name: "region",
dicts: ["sys_type"],
@ -533,7 +574,12 @@ export default {
//
total: 0,
isDialogOpen: false, //
dialogForm: {},
dialogForm: {
ledgerId: "",
deviceName: "",
cpmId: "",
cpmName: "",
},
dialogRules: {
status: [
{ required: true, message: "请选择二维码状态", trigger: "blur" },
@ -543,6 +589,8 @@ export default {
isUpdate: false,
isTableUpdate: false,
rowId: "", //id
devices: [], //
cpmList: [], //
};
},
mounted() {
@ -738,6 +786,7 @@ export default {
this.dialogTitle = "修改房间";
this.currentParentId = row.floorId;
this.getDialogRoom(row.id);
this.getDeviceList();
}
this.isDialogOpen = true;
},
@ -866,6 +915,7 @@ export default {
this.dialogTitle = "新增楼层";
} else if (data.nodeType === 3) {
this.dialogTitle = "新增房间";
this.getDeviceList();
}
this.isDialogOpen = true;
},
@ -894,6 +944,7 @@ export default {
} else if (data.nodeType === 4) {
this.dialogTitle = "修改房间";
this.getDialogRoom(data.id);
this.getDeviceList();
}
this.isDialogOpen = true;
},
@ -1002,6 +1053,18 @@ export default {
this.dialogForm.status !== null
? this.dialogForm.status.toString()
: null;
// // idid,"1,2,3"["1","2","3"]
// this.dialogForm.ledgerId = this.dialogForm.ledgerId
// ? this.dialogForm.ledgerId.split(",")
// : [];
// this.dialogForm.cpmId = this.dialogForm.cpmId
// ? this.dialogForm.cpmId.split(",")
// : [];
// this.dialogForm.ledgerId
if (this.dialogForm.ledgerId && this.dialogForm.ledgerId.length > 0) {
this.getCpmIdList(this.dialogForm.ledgerId);
}
}
});
},
@ -1052,6 +1115,10 @@ export default {
},
addSet() {
if (this.currentLevel === 0) {
if (!this.dialogForm.areaName || !this.dialogForm.systemType) {
this.$modal.msgWarning("请输入新增数据");
return;
}
//
let data = {
areaName: this.dialogForm.areaName,
@ -1076,6 +1143,10 @@ export default {
}
});
} else if (this.currentLevel === 1) {
if (!this.dialogForm.buildingName) {
this.$modal.msgWarning("请输入新增数据");
return;
}
//
let data = {
buildingName: this.dialogForm.buildingName,
@ -1108,6 +1179,10 @@ export default {
}
});
} else if (this.currentLevel === 2) {
if (!this.dialogForm.floorName) {
this.$modal.msgWarning("请输入新增数据");
return;
}
//
let data = {
buildingId: this.currentId,
@ -1136,6 +1211,10 @@ export default {
}
});
} else if (this.currentLevel === 3) {
if (!this.dialogForm.houseName) {
this.$modal.msgWarning("请输入新增数据");
return;
}
//
let data = {
buildingId: "",
@ -1150,7 +1229,16 @@ export default {
usableArea: this.dialogForm.usableArea,
builtYear: this.dialogForm.builtYear,
status: this.dialogForm.status,
ledgerId:
this.dialogForm.ledgerId && this.dialogForm.ledgerId.length > 0
? this.dialogForm.ledgerId
: [],
cpmId:
this.dialogForm.cpmId && this.dialogForm.cpmId.length > 0
? this.dialogForm.cpmId
: [],
};
console.log("新增的参数", data);
addHouse(data).then((res) => {
if (res.code == 200) {
this.$modal.msgSuccess("新增成功");
@ -1169,6 +1257,10 @@ export default {
}
},
updateAreaData(id) {
if (!this.dialogForm.areaName) {
this.$modal.msgWarning("请输入修改数据");
return;
}
let data = {
id: id,
areaName: this.dialogForm.areaName,
@ -1200,6 +1292,10 @@ export default {
} else {
nextId = "";
}
if (!this.dialogForm.buildingName) {
this.$modal.msgWarning("请输入修改数据");
return;
}
let data = {
id: id,
buildingName: this.dialogForm.buildingName,
@ -1240,6 +1336,10 @@ export default {
} else {
nextId = "";
}
if (!this.dialogForm.floorName) {
this.$modal.msgWarning("请输入修改数据");
return;
}
let data = {
id: id,
buildingId: nextId,
@ -1276,6 +1376,10 @@ export default {
} else {
nextId = "";
}
if (!this.dialogForm.houseName) {
this.$modal.msgWarning("请输入修改数据");
return;
}
let data = {
id: id,
buildingId: "",
@ -1290,6 +1394,14 @@ export default {
usableArea: this.dialogForm.usableArea,
builtYear: this.dialogForm.builtYear,
status: this.dialogForm.status,
ledgerId:
this.dialogForm.ledgerId && this.dialogForm.ledgerId.length > 0
? this.dialogForm.ledgerId
: [],
cpmId:
this.dialogForm.cpmId && this.dialogForm.cpmId.length > 0
? this.dialogForm.cpmId
: [],
};
console.log("修改的参数", data);
updateHouse(data).then((res) => {
@ -1308,6 +1420,74 @@ export default {
}
});
},
//
getDeviceList() {
let data = {
pageNum: 1,
pageSize: 100000,
};
ledgerList(data).then((response) => {
this.devices = response.rows;
});
},
//
handleDevice(selectedValue) {
console.log("选择设备", selectedValue);
this.getCpmIdList(selectedValue);
// // value label
// const selectedItem = this.devices.find(
// (item) => item.id === selectedValue
// );
// if (selectedItem) {
// const selectedLabel = selectedItem.deviceName;
// console.log(" value:", selectedValue);
// console.log(" label:", selectedLabel);
// //
// this.dialogForm.ledgerId = selectedValue;
// this.dialogForm.deviceName = selectedLabel;
// //
// this.getCpmIdList(this.dialogForm.ledgerId);
// }
// if (!val) {
// console.log("-");
// //
// this.dialogForm.cpmId = "";
// } else {
// console.log("-");
// this.dialogForm = {
// cpmId: "",
// };
// }
},
//
getCpmIdList(ids) {
if (ids.length > 0) {
cpmList2(ids).then((response) => {
this.cpmList = response.rows;
console.log("this.cpmList", this.cpmList);
});
} else {
console.log("无值不请求");
this.cpmList = [];
}
},
//
handleMeter(selectedValue) {
console.log("选择的采集类型", selectedValue);
console.log("dialogForm.cpmId", this.dialogForm.cpmId);
// // value label
// const selectedItem = this.cpmList.find(
// (item) => item.id === selectedValue
// );
// if (selectedItem) {
// const selectedLabel = selectedItem.otherName;
// console.log(" value:", selectedValue);
// console.log(" label:", selectedLabel);
// //
// this.dialogForm.cpmId = selectedValue;
// this.dialogForm.cpmName = selectedLabel;
// }
},
},
};
</script>

Loading…
Cancel
Save