Browse Source

修改生活热水系统、温度系统内容

dev
selia-zx 1 week ago
parent
commit
257b0ac9aa
  1. 1
      src/assets/icons/svg/chartsSvg.svg
  2. 1
      src/assets/icons/svg/tableSvg.svg
  3. 2
      src/utils/datetime.js
  4. 740
      src/views/hotWater/waterControl/index.vue
  5. 21
      src/views/hotWater/waterMonitor/index.vue
  6. 295
      src/views/temSys/temHistory/components/historyCharts.vue
  7. 53
      src/views/temSys/temHistory/components/historyTables.vue
  8. 301
      src/views/temSys/temHistory/index.vue
  9. 9
      src/views/temSys/temMonitor/index.vue

1
src/assets/icons/svg/chartsSvg.svg

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1745569324776" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="15580" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M789.333333 967.168c-45.425778 0-68.152889-22.727111-68.152889-68.167111V490.083556c0-45.44 22.712889-68.152889 68.167112-68.167112h68.152888c45.425778 0 68.152889 22.727111 68.152889 68.167112v408.917333c0 45.44-22.727111 68.152889-68.152889 68.167111H789.333333z m-613.376 0c-45.44 0-68.167111-22.727111-68.167111-68.167111v-170.382222c0-45.44 22.712889-68.152889 68.167111-68.152889h68.124445c45.44 0 68.167111 22.712889 68.181333 68.152889v170.382222c0 45.44-22.727111 68.152889-68.167111 68.167111h-68.138667z m306.688 0c-45.44 0-68.152889-22.712889-68.152889-68.152889V592.327111c0-45.44 22.712889-68.152889 68.152889-68.167111h68.152889c45.425778 0 68.152889 22.727111 68.167111 68.167111v306.688c0 45.44-22.727111 68.152889-68.167111 68.152889h-68.152889zM136.248889 488.903111A51.100444 51.100444 0 1 1 100.977778 400.981333l110.392889-105.472c75.875556-74.851556 196.536889-78.862222 277.219555-9.201777a104.135111 104.135111 0 0 0 136.32-1.180445l149.504-125.923555h-51.697778a51.2 51.2 0 0 1-51.2-51.114667 51.2 51.2 0 0 1 51.2-51.2h176.184889a51.2 51.2 0 0 1 51.114667 51.2v176.170667a51.114667 51.114667 0 1 1-102.229333 0v-53.376L691.2 362.126222a207.018667 207.018667 0 0 1-268.8 1.550222 103.438222 103.438222 0 0 0-139.889778 4.935112l-110.762666 106.154666a51.2 51.2 0 0 1-35.285334 14.136889H136.248889z" fill="#ffffff" p-id="15581"></path></svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

1
src/assets/icons/svg/tableSvg.svg

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1745569196453" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10132" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M960 64H64v224h1v164h-1v64h1v160h-1v64h1v219.7h275v0.3h64v-0.3h216v0.3h64v-0.3h275V288h1V64zM620 452H404V288h216v164z m0 224H404V516h216v160z m64-160h211v160H684V516zM129 288h211v164H129V288z m0 228h211v160H129V516z m0 379.7V740h211v155.7H129z m275 0V740h216v155.7H404z m280 0V740h211v155.7H684zM895 452H684V288h211v164z" fill="#ffffff" p-id="10133"></path></svg>

After

Width:  |  Height:  |  Size: 697 B

2
src/utils/datetime.js

@ -23,7 +23,7 @@ export function formatDay (datetime) {
/**
* 时间格式化
* 2018-09-23T11:54:16.000+0000 格式化成 2018/09/23 11:54:16
* 2018-09-23T11:54:16.000+0000 格式化成 2018/09/23 11:54
* @param datetime 国际化日期格式
*/
export function format2(datetime) {

740
src/views/hotWater/waterControl/index.vue

@ -58,27 +58,107 @@
>
<div class="monitor-title">{{ item.name }}</div>
<div class="monitor-flex">
<!-- 水泵 -->
<div class="monitor-flex-left" v-if="activeName.includes('水泵')">
<img
class="monitor-img2"
src="../../../assets/images/startpum.png"
/>
<div class="monitor-words">
<div class="words-li">
<div class="ash">开关状态:</div>
<div class="white">
<el-switch
style="display: block"
v-model="item.switchStatus"
active-color="#13ce66"
active-text="开启"
inactive-text="停止"
@change="handleWaterPump(item)"
<!-- 热泵 -->
<div class="monitor-flex-left" v-if="activeName.includes('热泵')">
<div class="control-top">
<img
class="monitor-img1"
src="../../../assets/images/starthotpum.png"
/>
<div class="monitor-words">
<div class="words-li">
<div class="ash">开关状态:</div>
<div class="white">
<el-switch
style="display: block"
v-model="item.switchStatus"
active-color="#13ce66"
active-text="开启"
inactive-text="关闭"
@change="handleHotPump(item)"
>
</el-switch>
</div>
</div>
<div class="words-li">
<div class="ash">故障信息:</div>
<el-tag
size="mini"
v-if="item.alarmStatus === '无故障'"
type="success"
>{{ item.alarmStatus }}</el-tag
>
</el-switch>
<el-tag size="mini" v-else type="danger">{{
item.alarmStatus
}}</el-tag>
</div>
<div class="words-li">
<div class="ash">实际温度:</div>
<div class="white">{{ item.temp }}</div>
</div>
<div class="words-li">
<div class="ash">设定温度:</div>
<div class="white">
<el-input
size="mini"
v-model="item.tempSet"
placeholder="请输入"
@keyup.enter.native="
handleEnter(
item,
item.tempSet,
item.tempSetId,
'设定温度',
'℃'
)
"
@input="handleInput(item)"
@blur="handleBlur()"
></el-input>
</div>
</div>
</div>
</div>
</div>
<!-- 裙楼供水泵高区供水泵中厨供水泵 -->
<div class="monitor-flex-left" v-if="activeName.includes('供水泵')">
<div class="control-top">
<img
class="monitor-img2"
src="../../../assets/images/startpum.png"
/>
<div class="monitor-words">
<div class="words-li">
<div class="ash">PID手自动:</div>
<div class="white">
<el-switch
style="display: block"
v-model="item.handAutomaticSwitch"
active-color="#13ce66"
active-text="手动"
inactive-text="自动"
@change="handAutomatic(item)"
>
</el-switch>
</div>
</div>
<div class="words-li">
<div class="ash">启停控制:</div>
<div class="white">
<el-switch
style="display: block"
v-model="item.switchStatus"
active-color="#13ce66"
active-text="开启"
inactive-text="停止"
@change="handleSwitch(item)"
>
</el-switch>
</div>
</div>
</div>
</div>
<div class="control-bottom">
<div class="words-li">
<div class="ash">故障信息:</div>
<el-tag
@ -91,89 +171,315 @@
item.alarmStatus
}}</el-tag>
</div>
<div class="words-li">
<div class="ash">运行状态:</div>
<el-tag
size="mini"
v-if="item.runningStatus === '运行'"
type="success"
>{{ item.runningStatus }}</el-tag
>
<el-tag size="mini" v-else type="danger">{{
item.runningStatus
}}</el-tag>
</div>
<div class="words-li">
<div class="ash">当前频率:</div>
<div class="white">{{ item.frequency }}Hz</div>
</div>
</div>
</div>
<!-- 热泵 -->
<div class="monitor-flex-left" v-if="activeName.includes('热泵')">
<img
class="monitor-img1"
src="../../../assets/images/starthotpum.png"
/>
<div class="monitor-words">
<div class="words-li">
<div class="ash">开关状态:</div>
<div class="white">
<el-switch
style="display: block"
v-model="item.switchStatus"
active-color="#13ce66"
active-text="开启"
inactive-text="停止"
@change="handleHotPump(item)"
>
</el-switch>
</div>
<div class="ash">频率设置:</div>
<el-input
v-model="item.frequencySet"
@keyup.enter.native="
handleEnter(
item,
item.frequencySet,
item.frequencySetId,
'频率设置',
'Hz'
)
"
@input="handleInput(item)"
@blur="handleBlur()"
size="mini"
></el-input>
<div class="white">Hz</div>
</div>
<div class="words-li">
<div class="ash">故障信息:</div>
<el-tag
<div class="ash">压力设置:</div>
<el-input
v-model="item.pressureSet"
@keyup.enter.native="
handleEnter(
item,
item.pressureSet,
item.pressureSetId,
'压力设置',
'bar'
)
"
@input="handleInput(item)"
@blur="handleBlur()"
size="mini"
v-if="item.alarmStatus === '无故障'"
type="success"
>{{ item.alarmStatus }}</el-tag
>
<el-tag size="mini" v-else type="danger">{{
item.alarmStatus
}}</el-tag>
></el-input>
<div class="white">bar</div>
</div>
<div class="words-li">
<div class="ash">实际温度:</div>
<div class="white">{{ item.temp }}</div>
<div class="ash">停机延时:</div>
<el-input
v-model="item.delayTimeSet"
@keyup.enter.native="
handleEnter(
item,
item.delayTimeSet,
item.delayTimeSetId,
'停机延时',
'S'
)
"
@input="handleInput(item)"
@blur="handleBlur()"
size="mini"
></el-input>
<div class="white">S</div>
</div>
<div class="words-li">
<div class="ash">设定温度:</div>
<div class="white">
<el-input
size="mini"
style="width: 100px"
v-model="item.tempSet"
placeholder="请输入"
@keyup.enter.native="handleEnter(item)"
@input="handleInput(item)"
></el-input>
</div>
<div class="ash">换机周期:</div>
<el-input
v-model="item.switchTimeSet"
@keyup.enter.native="
handleEnter(
item,
item.switchTimeSet,
item.switchTimeSetId,
'换机周期',
'S'
)
"
@input="handleInput(item)"
@blur="handleBlur()"
size="mini"
></el-input>
<div class="white">min</div>
</div>
</div>
</div>
<!-- 水箱 -->
<div class="monitor-flex-left" v-if="activeName.includes('水箱')">
<water-tank :waterLevel="item.waterLevel"></water-tank>
<div class="monitor-words">
<div class="words-li">
<div class="control-top">
<water-tank :waterLevel="item.waterLevel"></water-tank>
<div class="monitor-words">
<div class="words-li">
<div class="ash">补水阀启停:</div>
<div class="white">
<el-switch
style="display: block"
v-model="item.switchStatus"
active-color="#13ce66"
active-text="开启"
inactive-text="停止"
@change="handleSwitch(item)"
>
</el-switch>
</div>
</div>
</div>
</div>
<div class="control-bottom">
<div class="words-li words-li5">
<div class="ash">实际液位:</div>
<div class="white">{{ item.waterLevel }} %</div>
</div>
<div class="words-li">
<div class="ash">设置液位:</div>
<div class="words-li words-li5">
<div class="ash ash2">设置液位:</div>
<el-input
size="mini"
style="width: 100px"
v-model="item.waterLevelSet"
placeholder="请输入"
@keyup.enter.native="handleWaterEnter(item)"
@keyup.enter.native="
handleEnter(
item,
item.waterLevelSet,
item.waterLevelSetId,
'液位设置',
'%'
)
"
@input="handleWaterInput(item)"
></el-input>
<div class="white">%</div>
</div>
<div class="words-li">
<div class="ash">采集时间:</div>
<div class="words-li words-li5">
<div class="ash">补水延时时间:</div>
<el-input
size="mini"
v-model="item.delayTimeSet"
placeholder="请输入"
@keyup.enter.native="
handleEnter(
item,
item.delayTimeSet,
item.delayTimeSetId,
'补水延时时间',
'S'
)
"
@input="handleWaterInput(item)"
></el-input>
<div class="white">S</div>
</div>
<div class="words-li words-li5">
<div class="ash ash2">液位误差值:</div>
<el-input
size="mini"
v-model="item.diffValueSet"
placeholder="请输入"
@keyup.enter.native="
handleEnter(
item,
item.diffValueSet,
item.diffValueSetId,
'液位误差值',
'%'
)
"
@input="handleWaterInput(item)"
></el-input>
<div class="white">%</div>
</div>
<div class="words-li words-li2">
<div class="ash">时间:</div>
<div class="white">{{ item.curTime }}</div>
</div>
</div>
</div>
<!-- 高区中厨中区裙楼 -->
<div
class="monitor-flex-left"
v-if="
activeName === '裙楼' ||
activeName === '中厨' ||
activeName === '高区' ||
activeName === '中区'
"
>
<div class="control-top">
<img
class="monitor-img2"
src="../../../assets/images/startpum.png"
/>
<div class="sigClass">
<div class="words-li">
<div class="ash">启动:</div>
<div class="white">
<el-switch
style="display: block"
v-model="item.openSwitch"
active-color="#13ce66"
active-text=""
inactive-text=""
@change="handleAllStart(item)"
>
</el-switch>
</div>
</div>
<div class="words-li">
<div class="ash">停止:</div>
<div class="white">
<el-switch
style="display: block"
v-model="item.closeSwitch"
active-color="#13ce66"
active-text=""
inactive-text=""
@change="handleAllEnd(item)"
>
</el-switch>
</div>
</div>
</div>
</div>
<div class="control-bottom">
<div class="words-li words-li3">
<div class="ash">供水温度:</div>
<div class="white">{{ item.temp }}</div>
</div>
<div class="words-li words-li4">
<div class="ash">供水温度设定:</div>
<el-input
v-model="item.tempSet"
size="mini"
@keyup.enter.native="
handleEnter(
item,
item.tempSet,
item.tempSetId,
'供水温度设定',
'℃'
)
"
@input="handleInput(item)"
@blur="handleBlur()"
></el-input>
<div class="white"></div>
</div>
<div class="words-li words-li3">
<div class="ash">供水压力</div>
<div class="white">{{ item.pressure }}bar</div>
</div>
<div class="words-li words-li4">
<div class="ash">供水温度误差设定:</div>
<el-input
v-model="item.diffValueSet"
@keyup.enter.native="
handleEnter(
item,
item.diffValueSet,
item.diffValueSetId,
'供水温度误差设定',
'℃'
)
"
@input="handleInput(item)"
@blur="handleBlur()"
size="mini"
></el-input>
<div class="white"></div>
</div>
<div class="words-li words-li3">
<div class="ash">故障信息:</div>
<el-tag
size="mini"
v-if="item.alarmStatus === '无故障'"
type="success"
>{{ item.alarmStatus }}</el-tag
>
<el-tag size="mini" v-else type="danger">{{
item.alarmStatus
}}</el-tag>
</div>
<div class="words-li words-li4">
<div class="ash">补水延时时间设定:</div>
<el-input
v-model="item.delayTimeSet"
@keyup.enter.native="
handleEnter(
item,
item.delayTimeSet,
item.delayTimeSetId,
'补水延时时间设定',
'S'
)
"
@input="handleInput(item)"
@blur="handleBlur()"
size="mini"
></el-input>
<div class="white">S</div>
</div>
</div>
</div>
</div>
</div>
</div>
@ -186,6 +492,7 @@ import { spaceTree } from "@/api/region";
import { waterOperateList, operationConrol } from "@/api/hotWater/waterControl";
import waterTank from "../../components/waterTank.vue";
export default {
name: "WaterControl",
components: { waterTank },
data() {
return {
@ -204,6 +511,8 @@ export default {
activeName: "", //
tabsList: [], //tab
devicesList: [], //
isInitialPage: true, //
isNodeClicked: false, //tree
};
},
mounted() {
@ -321,6 +630,7 @@ export default {
//
handleNodeClick(node, data) {
console.log("点击的当前节点", node, data);
this.isNodeClicked = true; // true
if (data.level !== 4) {
console.log("不是第4层000");
// ,
@ -342,6 +652,7 @@ export default {
}
},
handleClick(tab, event) {
this.isNodeClicked = false; // tabtree
console.log(tab, event);
console.log("activeName", this.activeName);
// tab name tabsList item,devicesList
@ -353,17 +664,15 @@ export default {
if (item.name) {
// deviceItem
let deviceItem = {
id: item.id,
name: item.name,
temp: item.temp,
tempSet: item.tempSet,
frequency: item.frequency,
frequencySet: item.frequencySet,
...item,
waterLevel: Number(item.waterLevel),
waterLevelSet: item.waterLevelSet,
curTime: item.curTime,
alarmStatus: Number(item.alarmStatus) == 0 ? "无故障" : "故障",
switchStatus: Number(item.switchStatus) == 0 ? false : true,
runningStatus: Number(item.switchStatus) == 0 ? "运行" : "停止", //
switchStatus: Number(item.switchStatus) == 0 ? false : true, //
alarmStatus: Number(item.alarmStatus) == 0 ? "无故障" : "故障", //
handAutomaticSwitch:
Number(item.handAutomaticSwitch) == 0 ? false : true, //
openSwitch: Number(item.openSwitch) == 0 ? false : true, //
closeSwitch: Number(item.closeSwitch) == 0 ? false : true, //
};
// devicesList
this.devicesList.push(deviceItem);
@ -372,6 +681,8 @@ export default {
console.log("当前楼层water列表", this.devicesList);
}
},
//
handleBlur() {},
//
getWaterList() {
return new Promise((resolve, reject) => {
@ -382,8 +693,25 @@ export default {
waterOperateList(data)
.then((res) => {
if (res.code == 200 && res.rows.length > 0) {
console.log("页面请求数据了~~~~~~~~~~~", res.rows);
this.tabsList = res.rows;
this.activeName = res.rows[0].name;
// tabs,
if (this.isInitialPage) {
this.activeName = res.rows[0].name;
this.isInitialPage = false;
console.log("初始页面默认tabs", this.activeName);
} else {
console.log("非初始页面默认tabs", this.activeName);
// treetabs,
if (this.isNodeClicked) {
// tree
this.activeName = res.rows[0].name;
console.log("非初始页面默认tabs-点击tree", this.activeName);
} else {
this.activeName = this.activeName;
console.log("非初始页面默认tabs-tabs中更新", this.activeName);
}
}
// tab name tabsList item,devicesList
const currentItem = this.tabsList.find(
(item) => item.name === this.activeName
@ -395,19 +723,18 @@ export default {
if (item.name) {
// deviceItem
let deviceItem = {
id: item.id,
name: item.name,
temp: item.temp,
tempSet: item.tempSet,
frequency: item.frequency,
frequencySet: item.frequencySet,
waterLevel: item.waterLevel,
waterLevelSet: item.waterLevelSet,
curTime: item.curTime,
alarmStatus:
Number(item.alarmStatus) == 0 ? "无故障" : "故障",
...item,
waterLevel: Number(item.waterLevel),
runningStatus:
Number(item.switchStatus) == 0 ? "运行" : "停止", //
switchStatus:
Number(item.switchStatus) == 0 ? false : true,
Number(item.switchStatus) == 0 ? false : true, //
alarmStatus:
Number(item.alarmStatus) == 0 ? "无故障" : "故障", //
handAutomaticSwitch:
Number(item.handAutomaticSwitch) == 0 ? false : true, //
openSwitch: Number(item.openSwitch) == 0 ? false : true, //
closeSwitch: Number(item.closeSwitch) == 0 ? false : true, //
};
// devicesList
this.devicesList.push(deviceItem);
@ -429,12 +756,12 @@ export default {
});
});
},
//
handleWaterPump(item) {
//
handleAllStart(item) {
this.$confirm(
`确定要切换设备"${item.name}"的状态为:${
item.switchStatus ? "开启" : "停止 吗?"
}`,
`确定要 ${item.openSwitch ? "一键开启" : "关闭一键开启"} ${
item.name
}的设备吗?`,
"提示",
{
confirmButtonText: "确定",
@ -443,26 +770,69 @@ export default {
}
)
.then(() => {
//
console.log("请求后台", item.switchStatus);
console.log("请求后台", item.openSwitch);
let param = null;
if (item.switchStatus) {
if (item.openSwitch) {
param = 1;
} else {
param = 0;
}
this.hadleOperationConrol(item.id, param);
this.hadleOperationConrol(item.openSwitchId, param);
})
.catch(() => {
//
item.switchStatus = !item.switchStatus;
item.openSwitch = !item.openSwitch;
});
},
//
handleAllEnd(item) {
this.$confirm(
`确定要 ${item.closeSwitch ? "一键停止" : "关闭一键停止"} ${
item.name
}的设备吗?`,
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(() => {
console.log("请求后台", item.closeSwitch);
let param = null;
if (item.closeSwitch) {
param = 1;
} else {
param = 0;
}
this.hadleOperationConrol(item.closeSwitchId, param);
})
.catch(() => {
//
item.closeSwitch = !item.closeSwitch;
});
},
// input
handleEnter(item, value, id, set, unit) {
this.$confirm(
`确定要修改"${item.name}"的${set}为:${value} ${unit}吗?`,
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(() => {
this.hadleOperationConrol(id, value);
})
.catch(() => {});
},
//
handleHotPump(item) {
this.$confirm(
`确定要切换设备"${item.name}"的状态为:${
item.switchStatus ? "开启" : "停止 吗?"
item.switchStatus ? "开启" : "关闭 吗?"
}`,
"提示",
{
@ -480,17 +850,19 @@ export default {
} else {
param = 0;
}
this.hadleOperationConrol(item.id, param);
this.hadleOperationConrol(item.switchStatusId, param);
})
.catch(() => {
//
item.switchStatus = !item.switchStatus;
});
},
//
handleEnter(item) {
//
handAutomatic(item) {
this.$confirm(
`确定要修改"${item.name}"的温度为:${item.tempSet} ℃吗?`,
`确定要切换设备"${item.name}"的状态为:${
item.handAutomaticSwitch ? "手动" : "自动 吗?"
}`,
"提示",
{
confirmButtonText: "确定",
@ -499,15 +871,27 @@ export default {
}
)
.then(() => {
this.hadleOperationConrol(item.id, item.tempSet);
//
console.log("请求后台", item.handAutomaticSwitch);
let param = null;
if (item.handAutomaticSwitch) {
param = 0;
} else {
param = 1;
}
this.hadleOperationConrol(item.handAutomaticSwitchId, param);
})
.catch(() => {});
.catch(() => {
//
item.handAutomaticSwitch = !item.handAutomaticSwitch;
});
},
//
handleWaterEnter(item) {
console.log("请求后端");
//
handleSwitch(item) {
this.$confirm(
`确定要修改"${item.name}"的水位为:${item.waterLevelSet} %吗?`,
`确定要切换设备"${item.name}"的状态为:${
item.switchStatus ? "开启" : "停止 吗?"
}`,
"提示",
{
confirmButtonText: "确定",
@ -516,9 +900,20 @@ export default {
}
)
.then(() => {
this.hadleOperationConrol(item.id, item.waterLevelSet);
//
console.log("请求后台", item.switchStatus);
let param = null;
if (item.switchStatus) {
param = 1;
} else {
param = 0;
}
this.hadleOperationConrol(item.switchStatusId, param);
})
.catch(() => {});
.catch(() => {
//
item.switchStatus = !item.switchStatus;
});
},
//
handleInput(item) {
@ -593,7 +988,7 @@ export default {
align-items: stretch;
height: 100%;
.left-tree {
width: 216px;
width: 256px;
padding: 15px 10px;
border: 1px solid #004b8c;
min-height: 800px;
@ -655,7 +1050,7 @@ export default {
}
}
.right-monitor {
width: calc(100% - 240px);
width: calc(100% - 280px);
display: flex;
flex-direction: column;
justify-content: flex-start;
@ -742,39 +1137,91 @@ export default {
justify-content: space-between;
margin-top: 20px;
.monitor-flex-left {
padding: 0 0.2rem;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
flex-direction: column;
width: 100%;
padding: 0 0.2rem;
.monitor-img1 {
width: 1.2rem;
height: 1.2rem;
.control-top {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
width: 100%;
.monitor-img1 {
width: 1.2rem;
height: 1.2rem;
}
.monitor-img2 {
width: 1.2rem;
height: 0.8rem;
}
}
.monitor-img2 {
width: 1.2rem;
height: 0.8rem;
.control-bottom {
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
margin-top: 20px;
}
.ash {
color: #b8bfcb;
white-space: nowrap;
margin-right: 8px;
}
.white {
color: #ffffff;
}
.words-li {
display: flex;
flex-direction: row;
align-items: center;
font-family: SourceHanSansCN-Regular;
font-size: 16px;
line-height: 28px;
margin-bottom: 10px;
}
.monitor-words {
flex-wrap: wrap;
.words-li {
width: 100%;
}
}
.control-bottom {
flex-wrap: wrap;
.words-li {
width: 45%;
flex-wrap: nowrap;
}
.words-li2 {
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
font-family: SourceHanSansCN-Regular;
font-size: 16px;
line-height: 28px;
margin-bottom: 10px;
}
.words-li3 {
width: 36%;
}
.words-li4 {
width: 60%;
.ash {
color: #b8bfcb;
white-space: nowrap;
margin-right: 8px;
width: 130px;
}
.white {
color: #ffffff;
}
.words-li5 {
width: 45%;
.ash2 {
width: 100px;
}
}
}
.sigClass {
width: 40%;
flex-wrap: wrap;
.words-li {
width: 100%;
}
}
}
}
}
@ -885,4 +1332,23 @@ export default {
/* color: #f56c6c; */
color: #25f1f8;
}
.monitor-flex-left >>> .el-input {
width: 80px !important;
margin: 0 5px;
}
.monitor-flex-left >>> .el-input__inner {
background-color: #04193a;
border: 1px solid #1262db;
color: #3ef0fd;
font-weight: 700;
text-align: center;
padding: 0 0.1rem !important;
}
/* // 媒体查询,适配大于2000px分辨率的大屏样式 */
@media (min-width: 2000px) {
.monitor-flex-left >>> .el-input {
width: 0.8rem !important;
margin: 0 0.15rem 0 0.05rem !important;
}
}
</style>

21
src/views/hotWater/waterMonitor/index.vue

@ -281,13 +281,13 @@
</el-table-column>
<el-table-column prop="upWaterState" label="供水状态">
<template slot-scope="{ row }">
<span v-if="row.rupWaterState === '0'">不运行 </span>
<span v-if="row.upWaterState === '0'">不运行 </span>
<span v-if="row.upWaterState === '1'">运行 </span>
</template>
</el-table-column>
<el-table-column prop="isFault" label="是否故障">
<template slot-scope="{ row }">
<span v-if="row.risFault === '0'">无故障</span>
<span v-if="row.isFault === '0'">无故障</span>
<span v-if="row.isFault === '1'">有故障</span>
</template>
</el-table-column>
@ -482,6 +482,7 @@ export default {
},
//
handlerow(row, event, column) {
console.log("row", row);
//
this.progress = row.waterLevel;
this.temdata = row.waterTemp;
@ -540,7 +541,17 @@ export default {
waterMonitorList(data).then((res) => {
console.log("系统状态返回", res);
if (res.code == 200 && res.rows.length > 0) {
this.tableData = res.rows;
this.tableData = [];
res.rows.forEach((item) => {
let deviceItem = {
...item,
runState: Number(item.runState) == 0 ? "0" : "1", //
upWaterState: Number(item.upWaterState) == 0 ? "0" : "1", //
isFault: Number(item.isFault) == 0 ? "0" : "1", //
};
this.tableData.push(deviceItem);
});
console.log("处理后的tableData", this.tableData);
if (this.tableData.length > 0) {
//
const firstRow = this.tableData[0];
@ -1035,9 +1046,9 @@ export default {
}
}
.changecontent {
border-radius:0.06rem !important;
border-radius: 0.06rem !important;
height: 3rem !important;
padding: 0.15rem 0.1rem 0 0.1rem !important;
padding: 0.15rem 0.1rem 0 0.1rem !important;
margin-top: 0.3rem !important;
.tablemaeta {

295
src/views/temSys/temHistory/components/historyCharts.vue

@ -0,0 +1,295 @@
<template>
<div>
<div class="historyCharts" ref="chart_ref"></div>
</div>
</template>
<script>
import * as echarts from "echarts";
export default {
props: {
chartsData: {
type: Array,
default: () => [],
},
},
data() {
return {
chartInstance: null,
option: {},
chartData1: [],
chartData2: [],
bottomData: [],
};
},
watch: {
chartsData: {
immediate: true, //
handler(newVal, oldVal) {
if (newVal) {
console.log("charts传值", newVal);
let data = newVal;
if (data.length > 0) {
data.forEach((item) => {
// chartData1
const value1 =
item.indoorTemp === null || item.indoorTemp === ""
? 0
: item.indoorTemp;
this.chartData1.push(value1);
// item chartData2 indoorHumidity
const value2 =
item.indoorHumidity === null || item.indoorHumidity === ""
? 0
: item.indoorHumidity;
this.chartData2.push(value2);
// item bottomData curTime
const value3 =
item.curTime === null || item.curTime === "" ? 0 : item.curTime;
this.bottomData.push(value3);
});
this.$nextTick(() => {
const adapterOption = {
xAxis: {
data: this.bottomData,
},
series: [
{
yAxisIndex: 0,
data: this.chartData1,
},
{
yAxisIndex: 0,
data: this.chartData2,
},
],
};
this.chartInstance.setOption(adapterOption);
//resize
this.chartInstance.resize();
});
} else {
this.$nextTick(() => {
const adapterOption = {
xAxis: {
data: [],
},
series: [
{
yAxisIndex: 0,
data: [],
},
{
yAxisIndex: 0,
data: [],
},
],
};
this.chartInstance.setOption(adapterOption);
//resize
this.chartInstance.resize();
this.screenAdapter();
});
}
}
},
},
},
mounted() {
this.initChart();
this.screenAdapter();
},
destroyed() {
//
window.removeEventListener("resize", this.screenAdapter);
},
methods: {
// 线+ + 线
screenAdapter() {
//,2.6 mes_ref
const titleFontSize = this.$refs.chart_ref.offsetWidth / 130;
//optionoption
const adapterOption = {};
//.chartInstanceoptiondataoption
this.chartInstance.setOption(adapterOption);
//resize
this.chartInstance.resize();
},
//chartInstance
initChart() {
const chartRef = this.$refs.chart_ref;
if (chartRef) {
//
this.chartInstance = echarts.init(this.$refs.chart_ref);
this.option = {
tooltip: {
trigger: "axis",
},
legend: {
show: true,
top: 0,
textStyle: {
color: "white",
},
},
grid: {
top: "10%",
left: "4%",
right: "6%",
bottom: "3%",
containLabel: true,
},
xAxis: {
type: "category",
//true
boundaryGap: true,
// x
axisLabel: {
// interval: 0, //x
// rotate: 30, //x30
color: "rgba(255, 255, 255, 1)",
},
axisTick: {
show: false, // 线
},
// x
axisLine: {
show: true,
lineStyle: {
color: "#365576",
},
},
splitLine: {
lineStyle: {
color: "#e2e6f0",
},
}, //x线
data: this.bottomData,
},
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 线
},
},
//y线
// splitNumber: 10,
// y线
splitLine: {
lineStyle: {
color: "#1a3d62", // 线
type: "dashed", // 线线
},
},
},
series: [
{
type: "line",
//
symbolSize: 8,
data: this.chartData1,
name: "温度",
//线
itemStyle: {
color: "#1a69f1", //线
},
lineStyle: {
color: "#1a69f1", //线
},
smooth: false,
// 线
showSymbol: false,
//
areaStyle: {
color: {
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "rgba(26, 105, 241, 0.5)", //
},
{
offset: 1,
color: "rgba(26, 105, 241, 0)", //
},
],
global: false, // false
},
},
},
{
type: "line",
//
symbolSize: 8,
data: this.chartData2,
name: "湿度",
//线
itemStyle: {
color: "#00CED1", //线
},
smooth: false,
// 线
showSymbol: false,
areaStyle: {
color: {
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "rgba(0, 206, 209, 0.5)", //
},
{
offset: 1,
color: "rgba(0, 206, 209, 0)", //
},
],
global: false, // false
},
},
},
],
};
//
this.chartInstance.setOption(this.option, true);
} else {
console.error("未找到有效的 DOM 元素");
}
},
},
};
</script>
<style lang="scss" scoped>
.historyCharts {
width: 100%;
height: 200px;
}
</style>

53
src/views/temSys/temHistory/components/historyTables.vue

@ -0,0 +1,53 @@
<template>
<div>
<el-table class="historyTables" :data="tableList" height="200px">
<el-table-column
prop="curTime"
label="时间"
></el-table-column>
<el-table-column
prop="indoorTemp"
label="温度(℃)"
></el-table-column>
<el-table-column
prop="indoorHumidity"
label="湿度(%)"
></el-table-column>
</el-table>
</div>
</template>
<script>
export default {
props: {
tableData: {
type: Array,
default: () => [],
},
},
data() {
return {
tableList: [],
};
},
watch: {
tableData: {
immediate: true, //
handler(newVal, oldVal) {
if (newVal) {
console.log("charts传值", newVal);
let data = newVal;
if (data.length > 0) {
this.tableList = newVal;
} else {
this.tableList = [];
}
}
},
deep: true, //
},
},
};
</script>
<style></style>

301
src/views/temSys/temHistory/index.vue

@ -1,13 +1,306 @@
<template>
<div>历史数据</div>
<div class="app-container">
<div class="btn-condition">
<div class="condition-left">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
label-width="68px"
>
<el-form-item label="房间" prop="gwName">
<el-cascader
class="elCascader"
:options="options"
:props="props"
collapse-tags
clearable
v-model="selectedValue"
@change="handleCascaderChange"
></el-cascader>
</el-form-item>
<el-form-item label="时间范围" prop="gwName">
<el-date-picker
v-model="timeDate"
:default-time="['00:00:00', '23:59:59']"
type="datetimerange"
range-separator="至"
placeholder="选择日期"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</el-form-item>
</el-form>
<div class="primary-btn">
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
</div>
</div>
</div>
<div class="history" v-loading="loading">
<div
class="history-li"
:class="{ oneClass: tableData.length === 1 }"
v-for="(item, index) in tableData"
:key="index"
>
<div class="history-top">
<div class="room">{{ item.houseName }}</div>
<div class="change" @click="toggleComponent(index)">
<svg-icon
slot="prefix"
icon-class="chartsSvg"
class="chartsSvg"
v-if="item.showCharts"
/>
<svg-icon
slot="prefix"
icon-class="tableSvg"
class="tableSvg"
v-else
/>
</div>
</div>
<div class="title">{{ timeDate[0] }}-{{ timeDate[1] }}温湿度数据</div>
<!-- 图表和表格可以自由切换 -->
<history-charts
v-if="item.showCharts"
:chartsData="item.dataList"
></history-charts>
<history-tables v-else :tableData="item.dataList"></history-tables>
</div>
</div>
</div>
</template>
<script>
import { format2 } from "@/utils/datetime";
import { spaceTree } from "@/api/region";
import { temHistory } from "@/api/temSys/temMonitor";
import historyCharts from "./components/historyCharts.vue";
import HistoryTables from "./components/historyTables.vue";
export default {
components: { historyCharts, HistoryTables },
data() {
return {
loading: false,
timeDate: [],
//
queryParams: {
systemType: "4",
houseIds: [], //id
startTime: "",
endTime: "",
},
selectedValue: [], //()
props: {
value: "id", // 使 id
label: "label",
children: "children",
multiple: true,
},
options: [],
tableData: [
{
name: "A201",
showCharts: true, //
},
{
name: "A202",
showCharts: true, //
},
{
name: "A203",
showCharts: true, //
},
],
};
},
mounted() {
this.initializeTimeDate();
this.getSysBuild();
},
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)]; //
},
getSysBuild() {
spaceTree().then((res) => {
if (res.code == 200) {
//
console.log("楼栋返回值", res);
let newRes = { ...res };
}
</script>
if (newRes.data && newRes.data[0] && newRes.data[0].children) {
newRes.data[0].children = newRes.data[0].children.filter((item) => {
// label ""
return item.label && item.label.includes("温度监测");
});
}
this.options = newRes.data[0].children[0].children;
console.log("温度监测的数组", this.options);
//
if (this.options.length > 0) {
//
const lastLevelFirstChild = this.findLastLevelFirstChild(
this.options[0]
);
console.log("最后一个节点的id", lastLevelFirstChild);
//
const path = this.findPath(this.options, lastLevelFirstChild.id);
if (path) {
this.selectedValue = [path];
}
console.log("反推三个id", path);
}
<style>
this.getList();
}
});
},
//
findLastLevelFirstChild(node, level = 1) {
if (!node.children || node.children.length === 0) {
return {
id: node.id,
};
}
return this.findLastLevelFirstChild(node.children[0], level + 1);
},
// idid
findPath(options, targetId, currentPath = []) {
for (let i = 0; i < options.length; i++) {
const item = options[i];
// item id
if (!item.id) continue;
const newPath = [...currentPath, item.id];
if (item.id === targetId) {
return newPath;
}
if (item.children && item.children.length > 0) {
const result = this.findPath(item.children, targetId, newPath);
if (result) {
return result;
}
}
}
return null;
},
handleQuery() {
this.getList();
},
getList() {
this.queryParams.startTime = this.timeDate[0];
this.queryParams.endTime = this.timeDate[1];
let data = this.queryParams;
console.log("参数", data);
temHistory(data).then((res) => {
console.log("历史数据返回", res);
if (res.code == 200) {
// loading
this.loading = true;
// dataList
const filteredRows = res.rows.filter(
(item) => item.dataList && item.dataList.length > 0
);
// showCharts: true
const newRows = filteredRows.map((item) => ({
...item,
showCharts: true,
}));
this.tableData = newRows;
console.log("处理后的历史数据", newRows);
}
}).catch((error) => {
console.error("查询表格数据时发生错误:", error);
})
.finally(() => {
setTimeout(() => {
this.loading = false;
}, 1000);
});
},
handleCascaderChange(selectedOptions) {
console.log("选中的完全路径", selectedOptions);
// id
const selectedIds = selectedOptions.map(
(option) => option[option.length - 1]
);
console.log("选中的 id 数组:", selectedIds);
this.queryParams.houseIds = selectedIds;
},
toggleComponent(index) {
//
this.tableData[index].showCharts = !this.tableData[index].showCharts;
},
},
};
</script>
<style lang="scss" scoped>
.elCascader {
width: 290px;
}
.history {
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
flex-wrap: wrap;
.history-li {
background-color: rgb(38, 64, 99);
width: calc(49% - 20px);
height: 330px;
margin: 0 10px;
padding: 20px;
border-radius: 20px;
margin-bottom: 20px;
.history-top {
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
.room {
font-family: Arial, sans-serif;
font-size: 20px;
font-weight: bold;
color: #00aaff;
text-shadow: 0 0 5px rgba(0, 170, 255, 0.5);
}
.change {
cursor: pointer;
width: 30px;
height: 30px;
border-radius: 50%;
background-color: #00aaff;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
}
.title {
width: 100%;
font-size: 15px;
color: #fff;
font-weight: bold;
margin: 10px 0;
text-align: center;
}
}
.oneClass {
width: 100% !important;
}
}
</style>

9
src/views/temSys/temMonitor/index.vue

@ -148,7 +148,7 @@
</div>
<!-- 历史数据弹框 -->
<el-dialog
title="历史记录"
title="当日数据"
:visible.sync="openDialog"
width="900px"
append-to-body
@ -161,6 +161,7 @@
<script>
import { spaceTree } from "@/api/region";
import { format } from "@/utils/datetime";
import { temList, temHistory } from "@/api/temSys/temMonitor";
import * as echarts from "echarts";
export default {
@ -395,9 +396,13 @@ export default {
});
},
echartsData(id) {
const start = new Date(new Date().setHours(0, 0, 0, 0));
const end = new Date(new Date().setHours(23, 59, 59, 59));
let data = {
systemType: "4",
houseIds: [id],
startTime: format(start),
endTime: format(end),
};
temHistory(data).then((res) => {
console.log("历史数据返回", res);
@ -837,7 +842,7 @@ export default {
height: 300px;
}
.tree-container {
height: 300px; /* 设置固定高度 */
height: 330px; /* 设置固定高度 */
overflow-y: auto; /* 启用垂直滚动条 */
}
//

Loading…
Cancel
Save