能耗分析-园区总能耗分析总能耗最多保留两位小数点;分项总能耗近14天非工作时段设备统计重新联调(数据表更换);用户登录注释掉未用到的租户和验证码接口调用;监控模式-照明开关状态回执变更为socket方式,废弃以前的轮询

dev
zhangqun 3 years ago
parent 676c291af4
commit 16be6d13b7
  1. 70
      src/components/monitoring/light.vue
  2. 8
      src/page/login/userlogin.vue
  3. 8
      src/router/axios.js
  4. 26
      src/util/bfHelper.js
  5. 4
      src/views/sourceAnaly/components/buildWarm.vue
  6. 75
      src/views/sourceAnaly/components/conditionAnaly.vue
  7. 6
      src/views/sourceAnaly/components/consumeAnaly.vue
  8. 11
      vue.config.js

@ -310,6 +310,7 @@ export default {
},
data() {
return {
path:'ws://192.168.1.12/blade-datahttp/ws',//socket
build: "00", //
floored: null, //
controlAll: 2, //
@ -455,8 +456,13 @@ export default {
},
mounted() {
this.getNavigationMap();
this.initSocket();
},
beforeDestroy() {
if (this.socket) {
this.socket.close();
this.socket = "";
}
if (this.setInterval) {
clearInterval(this.setInterval);
}
@ -465,6 +471,47 @@ export default {
}
},
methods: {
//socket
initSocket() {
if (typeof (WebSocket) === "undefined") {
alert("您的浏览器不支持socket");
} else {
this.socket = new WebSocket(this.path);
// socket
this.socket.onopen = this.open;
// socket
this.socket.onerror = this.error;
// socket
this.socket.onmessage = this.getMessage;
}
},
open() {
console.log("socket连接成功")
},
error() {
console.log("socket连接错误")
},
getMessage(msg) {
console.log('scoket 模拟',msg)
let retData = JSON.parse(msg.data);
if (this.tableData.floorData && this.tableData.floorData.length > 0) {
this.tableData.floorData.map((item1,index) => {
let lightObjIndex = item1.lightList.findIndex(item2 => item2.code == retData.code);
if(lightObjIndex > -1 && item1.lightList[lightObjIndex].openStatus != retData.openStatus){
item1.lightList[lightObjIndex].openStatus = retData.openStatus;
if(retData.openStatus == 1){
//
console.log(item1.lightList[lightObjIndex].name,'开灯')
this.getLight([{arr: item1.lightList[lightObjIndex].ctrlList.split(','),build: item1.lightList[lightObjIndex].build}]);
}else{
//
console.log(item1.lightList[lightObjIndex].name,'关灯')
this.cleanLight([{arr: item1.lightList[lightObjIndex].ctrlList.split(','),build: item1.lightList[lightObjIndex].build}]);
}
}
})
}
},
// -
doCancelWarn(id) {
getCancelWarn(id).then((res) => {
@ -567,6 +614,7 @@ export default {
bfHelper.setColor("#a5bbe5", offList);
},
getNavigationMap() {
// bfHelper.mapDestroy();
setTimeout(() => {
commonValue.getNavigationMap("water");
});
@ -606,6 +654,7 @@ export default {
}
}
if (arr.length > 0) {
// console.log('arr', arr)
bfHelper.setGlowEffectById(arr); //ID
bfHelper.setColor("#fff99a", arr);
bfHelper.restoreComponentsOpacityById(arr);
@ -693,7 +742,11 @@ export default {
this.$message.success("指令发送成功");
if (res.data.data[0].status == 1) {
// this.getSblb();
this.checkLight();
// this.checkLight();
//
// setTimeout(() => {
// this.getMessage({code: row.code, openStatus: 1, ctrlList: row.ctrlList, build: row.build});
// },10*1000)
} else {
this.$message.warning(res.data.data[0].msg);
}
@ -705,7 +758,11 @@ export default {
this.$message.success("指令发送成功");
if (res.data.data[0].status == 1) {
// this.getSblb();
this.checkLight();
// this.checkLight();
//
// setTimeout(() => {
// this.getMessage({code: row.code, openStatus: 2, ctrlList: row.ctrlList, build: row.build});
// },10*1000)
} else {
this.$message.warning(res.data.data[0].msg);
}
@ -734,7 +791,7 @@ export default {
}
}
// this.getSblb();
this.checkLight();
// this.checkLight();
}
});
} else {
@ -761,7 +818,7 @@ export default {
}
}
// this.getSblb();
this.checkLight();
// this.checkLight();
}
});
} else {
@ -786,7 +843,7 @@ export default {
}
}
// this.getSblb();
this.checkLight();
// this.checkLight();
}
});
},
@ -808,13 +865,14 @@ export default {
}
}
// this.getSblb();
this.checkLight();
// this.checkLight();
}
});
},
/**
* 定时轮询空开状态
* 15秒执行一次执行5次
* 废弃 - 变更使用socket 20230313
*/
checkLight() {
if (this.intervalCheckLight == 0) {

@ -101,8 +101,8 @@
};
},
created() {
this.getTenant();
this.refreshCode();
// this.getTenant();
// this.refreshCode();
},
mounted() {},
computed: {
@ -137,7 +137,7 @@
loading.close();
}).catch(() => {
loading.close();
this.refreshCode();
// this.refreshCode();
});
}
});
@ -194,4 +194,4 @@
transform: translateY(-50%);
width: 100px;
}
</style>
</style>

@ -16,6 +16,7 @@ import {Base64} from 'js-base64';
import NProgress from 'nprogress';
import 'nprogress/nprogress.css';
var needLoadingRequestCount = 0 //当前正在请求的数量
//默认超时时间
axios.defaults.timeout = 60*1000;
//返回其他状态码
@ -31,6 +32,7 @@ NProgress.configure({
//http request拦截
axios.interceptors.request.use(config => {
//开启 progress bar
needLoadingRequestCount++;
NProgress.start();
const meta = (config.meta || {});
const isToken = meta.isToken === false;
@ -54,7 +56,10 @@ axios.interceptors.request.use(config => {
//http response 拦截
axios.interceptors.response.use(res => {
//关闭 progress bar
NProgress.done();
needLoadingRequestCount-- //调用完一个接口就进行-1
if(needLoadingRequestCount <= 0){
NProgress.done();
}
//获取状态码
const status = res.data.code || res.status;
const statusWhiteList = website.statusWhiteList || [];
@ -73,6 +78,7 @@ axios.interceptors.response.use(res => {
}
return res;
}, error => {
needLoadingRequestCount = 0;
NProgress.done();
return Promise.reject(new Error(error));
});

@ -2862,18 +2862,23 @@ const loadModel = (i) => {
// BimfaceLoaderConfig.APIHost = "http://10.90.100.203:8080";
BimfaceLoaderConfig.dataEnvType = BimfaceEnvOption.Local;
BimfaceLoaderConfig.sdkPath = "static/jssdk@3.6.191/jssdk";
BimfaceLoaderConfig.path = i == 1 ? 'http://47.103.199.45:8000/face/ywq/viewToken.json' :
'http://47.103.199.45:8000/face/tt/viewToken.json';
BimfaceLoaderConfig.path = i == 1 ? '/bimfaceApi/ywq/viewToken.json' :
'/bimfaceApi/tt/viewToken.json';
// BimfaceLoaderConfig.path = i == 1 ? 'http://47.103.199.45:8000/face/ywq/viewToken.json' :
// 'http://47.103.199.45:8000/face/tt/viewToken.json';
// BimfaceLoaderConfig.path =
// i == 1
// ? "http://10.90.100.203:8080/ywq/viewToken.json"
// : "http://10.90.100.203:8080/tt/viewToken.json";
BimfaceSDKLoader.load(BimfaceLoaderConfig, onSDKLoadSucceeded);
BimfaceSDKLoader.load(BimfaceLoaderConfig, onSDKLoadSucceeded, (err) => {
console.log('err', err)
});
};
// 加载模型
const onSDKLoadSucceeded = (viewMetaData) => {
// console.log('load success',viewMetaData)
if (viewMetaData.viewType == "3DView") {
if (!viewer3D) {
let dom4restore = document.getElementById("domId");
@ -2892,6 +2897,7 @@ const onSDKLoadSucceeded = (viewMetaData) => {
// 改变背景图
bimBgType = null;
setBimBg(1);
// console.log('laod end')
// 加载完成监听事件
viewer3D.addEventListener(
Glodon.Bimface.Viewer.Viewer3DEvent.ViewAdded,
@ -3482,12 +3488,14 @@ const navigationMap = (dom, img, build, floor) => {
viewer3D.render();
};
const mapUpdate = (img, mapAnchors, modelAnchors) => {
navigationMap2.associateModel({
url: img,
mapAnchors: mapAnchors,
modelAnchors: modelAnchors,
});
viewer3D.render();
if (navigationMap2) {
navigationMap2.associateModel({
url: img,
mapAnchors: mapAnchors,
modelAnchors: modelAnchors,
});
viewer3D.render();
}
};
//销毁地图
const mapDestroy = () => {

@ -59,8 +59,8 @@
<div class="charts">
<div id="build-warm"></div>
<div class="warm-consume">
<span><span>{{ warmTotal }}</span>MJ</span>
<p>耗热量</p>
<span style="display: block;text-align: center;"><span style="margin:0;">{{ warmTotal }}</span>MJ</span>
<p style="margin: 0;text-align: center;">耗热量</p>
</div>
<div style="width: 30rem; height: 8.5rem">
<div style="color: #07e6ec; font-size: 14px">空调开机时长</div>

@ -152,7 +152,7 @@
class="total-source-table"
:header-row-style="headerStyle"
:row-style="rowStyle"
height="200"
height="240"
v-loaddata="loadData"
>
<el-table-column
@ -340,6 +340,8 @@ export default {
getData() {
this.getConditionBarData(); //
this.getTemperData(); //
this.current = 1;
this.closeData = [];
this.getConditionTableData(); //14
},
getConditionBarData() {
@ -504,46 +506,51 @@ export default {
this.choseDate,
this.chooseDateValue ? this.chooseDateValue : ""
).then((res) => {
this.closeData = res.data.data.records;
for (let i = 0; i < this.closeData.length; i++) {
this.closeData[i].date = this.closeData[i].startTime.substring(0, 10);
this.closeData[i].startTime = this.closeData[i].startTime.substring(
if(this.current > res.data.data.page || res.data.data.records.length == 0){
return;
}
let _retData = res.data.data.records;
for (let i = 0; i < _retData.length; i++) {
_retData[i].date = _retData[i].createTime.substring(0, 10);
_retData[i].startTime = _retData[i].createTime.substring(
11,
16
);
this.closeData[i].endTime = this.closeData[i].endTime.substring(
13
)+':00';
_retData[i].endTime = _retData[i].createTime.substring(
11,
16
);
this.closeData[i].location =
Number(this.closeData[i].buildNumber) +
13
)+':59';
_retData[i].location =
Number(_retData[i].buildNumber) +
"#" +
Number(this.closeData[i].floorNumber) +
Number(_retData[i].floorNumber) +
"层";
}
this.closeData = this.closeData.concat(_retData);
});
},
loadData() {
this.current += 1;
getDailyList(
this.area,
this.value1[0],
this.value1[1],
this.current,
this.size
).then((res) => {
if (this.current <= res.data.data.pages) {
const results = res.data.data.records;
results.forEach((item) => {
item.date = item.startTime.substring(0, 10);
item.startTime = item.startTime.substring(11, 16);
item.endTime = item.endTime.substring(11, 16);
item.location =
Number(item.buildNumber) + "#" + Number(item.floorNumber) + "层";
this.closeData.push(item);
});
}
});
this.getConditionTableData();
// getDailyList(
// this.area,
// this.value1[0],
// this.value1[1],
// this.current,
// this.size
// ).then((res) => {
// if (this.current <= res.data.data.pages) {
// const results = res.data.data.records;
// results.forEach((item) => {
// item.date = item.startTime.substring(0, 10);
// item.startTime = item.startTime.substring(11, 16);
// item.endTime = item.endTime.substring(11, 16);
// item.location =
// Number(item.buildNumber) + "#" + Number(item.floorNumber) + "";
// this.closeData.push(item);
// });
// }
// });
},
searchCondition() {
// 20221022
@ -619,7 +626,7 @@ export default {
show: true,
trigger: "item",
formatter: function (params) {
console.info(params);
// console.info(params);
let result = params.name + ":<br/>";
// let result = params[0].name + "<br/>";
// for (let i = 0; i < params.length; i++) {
@ -1183,7 +1190,7 @@ export default {
.total-source-table {
background-color: transparent;
width: 100%;
max-height: 10rem;
max-height: 12rem;
overflow-y: auto;
margin-top: 0.937rem;
}

@ -14,7 +14,11 @@
v-loaddata="loadData">
<el-table-column prop="dayStr" label="日期" align="center"></el-table-column>
<el-table-column label="|" width="15" ></el-table-column>
<el-table-column prop="totalKgce" label="总能耗" align="center"> </el-table-column>
<el-table-column label="总能耗" align="center">
<template slot-scope="scope">
{{ (scope.row.totalKgce + "").substring(".") > 2 ? scope.row.totalKgce.toFixed(2) : scope.row.totalKgce }}
</template>
</el-table-column>
<el-table-column label="|" width="15"></el-table-column>
<el-table-column prop="consumeUnitArea" label="单位面积能耗" align="center"></el-table-column>
<el-table-column label="|" width="15"></el-table-column>

@ -26,6 +26,13 @@ module.exports = {
devServer: {
port: 1888,
proxy: {
"/bimfaceApi": {
target: 'http://192.168.1.3:8088',
ws: true,
pathRewrite: {
"^/bimfaceApi": "/bimface",
},
},
"/epiHome": {
target: 'http://10.90.100.201:8116',
ws: true,
@ -38,8 +45,8 @@ module.exports = {
// target: 'http://180.76.231.175:8000',
// target: 'http://192.168.0.105:80',
// target: "http://192.168.43.35",
// target: 'http://192.168.1.106',
target: "http://192.168.1.3",
target: 'http://192.168.1.106',
// target: "http://192.168.1.3",
// target: "http://10.90.100.204",
// target: "http://rsvz4t.natappfree.cc",
//远程演示服务地址,可用于直接启动项目

Loading…
Cancel
Save