lora面板控制联调,补充不在线样式,右上角登陆角色换为动态

dev
xuechunyuan 3 years ago
parent d20ee0008b
commit b6e1a99fb1
  1. BIN
      public/img/monitoring/device_online.png
  2. 53
      src/components/monitoring/conditioner.vue
  3. 11
      src/page/index/top/index.vue

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

@ -198,7 +198,7 @@
? "制冷" ? "制冷"
: testObject1.mode == 9 : testObject1.mode == 9
? "通风" ? "通风"
: "内机地暖同时制热" : ""
}}</span> }}</span>
</div> </div>
<div> <div>
@ -209,7 +209,8 @@
</div> </div>
</div> </div>
<div class="conditios-block" v-if="testObject1.open == 1"> <div class="conditios-block" v-if="testObject1.open == 1">
<div class="conditios-block-temper" v-if="testObject1.mode == 0 || testObject1.mode == 9" style="justify-content: center"> <div class="conditios-block-temper" v-if="testObject1.mode == 0 || testObject1.mode == 9"
style="justify-content: center">
<img src="../../../public/img/monitoring/electricity/green-wind.png" alt="" /> <img src="../../../public/img/monitoring/electricity/green-wind.png" alt="" />
</div> </div>
<div class="conditios-block-temper" v-else> <div class="conditios-block-temper" v-else>
@ -291,6 +292,11 @@
</div> </div>
</div> </div>
</div> </div>
<!-- 设备不在线 -->
<div class="conditios-block" style="text-align:center;padding:4rem 0;" v-if="testObject1.open == -1">
<img src="../../../public/img/monitoring/device_online.png" />
<div style="color:#7597cb;font-size:0.14rem;margin-top:0.1rem;">设备离线</div>
</div>
</div> </div>
</div> </div>
</template> </template>
@ -424,7 +430,7 @@ export default {
bfHelper.customTag( bfHelper.customTag(
{ x: item.xmove, y: item.ymove, z: item.zmove }, { x: item.xmove, y: item.ymove, z: item.zmove },
null, null,
this.getContent(item) item.funcCat == 1 ? this.getContent(item) : item.funcCat == 2 ? this.getOAContent(item) : this.getMbContent(item)
); );
}); });
}, },
@ -434,14 +440,14 @@ export default {
bfHelper.customTag( bfHelper.customTag(
this.position, this.position,
null, null,
this.getContent(this.testObject1) this.testObject1.funcCat == 1 ? this.getContent(this.testObject1) : this.testObject1.funcCat == 2 ? this.getOAContent(this.testObject1) : this.getMbContent(this.testObject1)
); );
} else if (this.conditionNum == 2) { } else if (this.conditionNum == 2) {
this.allDatas.forEach((item) => { this.allDatas.forEach((item) => {
bfHelper.customTag( bfHelper.customTag(
{ x: item.xmove, y: item.ymove, z: item.zmove }, { x: item.xmove, y: item.ymove, z: item.zmove },
null, null,
this.getContent(item) item.funcCat == 1 ? this.getContent(item) : item.funcCat == 2 ? this.getOAContent(item) : this.getMbContent(item)
); );
}); });
} }
@ -698,7 +704,7 @@ export default {
z: item.zmove, z: item.zmove,
}, },
null, null,
this.getContent(item) item.funcCat == 1 ? this.getContent(item) : item.funcCat == 2 ? this.getOAContent(item) : this.getMbContent(item)
); );
}); });
} }
@ -726,7 +732,7 @@ export default {
setLoraTemp(this.testObject1.code, this.testObject1.temSetting).then(res => { setLoraTemp(this.testObject1.code, this.testObject1.temSetting).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
this.$message.success('温度设置成功'); this.$message.success('温度设置成功');
}else{ } else {
this.$message.error('温度设置失败'); this.$message.error('温度设置失败');
this.testObject1.temSetting++; this.testObject1.temSetting++;
} }
@ -759,7 +765,7 @@ export default {
setLoraTemp(this.testObject1.code, this.testObject1.temSetting).then(res => { setLoraTemp(this.testObject1.code, this.testObject1.temSetting).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
this.$message.success('温度设置成功'); this.$message.success('温度设置成功');
}else{ } else {
this.$message.error('温度设置失败'); this.$message.error('温度设置失败');
this.testObject1.temSetting--; this.testObject1.temSetting--;
} }
@ -848,7 +854,7 @@ export default {
z: this.testObject1.zmove, z: this.testObject1.zmove,
}, },
null, null,
this.getContent(this.testObject1) this.testObject1.funcCat == 1 ? this.getContent(this.testObject1) : this.testObject1.funcCat == 2 ? this.getOAContent(this.testObject1) : this.getMbContent(this.testObject1)
); );
} else { } else {
this.allDatas.forEach((item) => { this.allDatas.forEach((item) => {
@ -862,7 +868,7 @@ export default {
z: item.zmove, z: item.zmove,
}, },
null, null,
this.getContent(item) item.funcCat == 1 ? this.getContent(item) : item.funcCat == 2 ? this.getOAContent(item) : this.getMbContent(item)
); );
}); });
} }
@ -899,7 +905,7 @@ export default {
z: this.testObject1.zmove, z: this.testObject1.zmove,
}, },
null, null,
this.testObject1.funcCat == 1 ? this.getContent(this.testObject1) : this.testObject1.funcCat == 1 ? this.getOAContent(this.testObject1) : this.getMbContent(this.testObject1) this.testObject1.funcCat == 1 ? this.getContent(this.testObject1) : this.testObject1.funcCat == 2 ? this.getOAContent(this.testObject1) : this.getMbContent(this.testObject1)
); );
} else { } else {
this.allDatas.forEach((item) => { this.allDatas.forEach((item) => {
@ -913,7 +919,7 @@ export default {
z: item.zmove, z: item.zmove,
}, },
null, null,
item.funcCat == 1 ? this.getContent(item) : item.funcCat == 1 ? this.getOAContent(item) : this.getMbContent(item) item.funcCat == 1 ? this.getContent(item) : item.funcCat == 2 ? this.getOAContent(item) : this.getMbContent(item)
); );
}); });
} }
@ -1006,10 +1012,6 @@ export default {
// }, // },
addEvent(e) { addEvent(e) {
let code = null; let code = null;
let funcCat = null;
if (e.target.id.indexOf("funcCat") != -1) {
funcCat = e.target.id.substring(7);
}
if (e.target.id.indexOf("condition") != -1) { if (e.target.id.indexOf("condition") != -1) {
code = e.target.id.substring(10); code = e.target.id.substring(10);
} }
@ -1029,13 +1031,19 @@ export default {
code = e.target.id.substring(7); code = e.target.id.substring(7);
} }
if (code) { if (code) {
if (funcCat == 3) { let funcCatObj = this.allDatas.find(item => { return item.code == code });
if (funcCatObj && funcCatObj.funcCat == 3) {
//lora //lora
queryLoraAll(code).then(res => { queryLoraAll(code).then(res => {
this.testObject1 = res.data.data; this.testObject1 = res.data.data;
this.testObject1.funcCat = 3;
if ( if (
e.target.id == "condition-" + code || e.target.id == "condition-" + code ||
e.target.id == "funcCat-" + code e.target.id == "temper-" + code ||
e.target.id == "tempea-" + code ||
e.target.id == "tempec-" + code ||
e.target.id == "tempac-" + code ||
e.target.id == "temped-" + code
) { ) {
this.isControl = true; this.isControl = true;
this.clickCode = code; this.clickCode = code;
@ -1121,16 +1129,13 @@ export default {
// //
getMbContent(testObject) { getMbContent(testObject) {
// console.log('',testObject) // console.log('',testObject)
testObject.xmove = '86462.91989146004';
testObject.ymove = '-18215.882156436604';
testObject.zmove = '0.14878788590431213';
let bgImg1 = require("../../../public/img/monitoring/electricity/condition_mb.png"); let bgImg1 = require("../../../public/img/monitoring/electricity/condition_mb.png");
let content = `<div id="funcCat-${testObject.funcCat}" class="lift-block" style="position:relative;width:100px"> let content = `<div class="lift-block" style="position:relative;width:100px">
<div style="background:#07a7ff url(${bgImg1}) 5px center no-repeat;width:100px;height:34px;color:white;font-size:18px;" id="temped-${testObject.code <div id="temped-${testObject.code}" style="background:#07a7ff url(${bgImg1}) 5px center no-repeat;width:100px;height:34px;color:white;font-size:18px;" id="temped-${testObject.code
}"> }">
<div id="condition-${testObject.code <div id="condition-${testObject.code
}" style="width:60px;position:absolute;height:34px;line-height: 34px;left:40px;top:0;cursor: pointer"> }" style="width:60px;position:absolute;height:34px;line-height: 34px;left:40px;top:0;cursor: pointer">
<span style="font-size:18px;font-family:fantasy;">${testObject.name}</span> <span id="temper-${testObject.code}" style="font-size:18px;font-family:fantasy;">${testObject.name}</span>
</div> </div>
</div> </div>

@ -53,8 +53,8 @@
</el-tooltip> --> </el-tooltip> -->
<img class="top-bar__img" :src="userInfo.avatar"> <img class="top-bar__img" :src="userInfo.avatar">
<div class="message"> <div class="message">
<div class="name">张华(建设指挥部)</div> <div class="name">{{userInfo.user_name}}</div>
<div class="date">2022-01-17</div> <div class="date">{{currentDate}}</div>
</div> </div>
<el-dropdown> <el-dropdown>
<span class="el-dropdown-link"> <span class="el-dropdown-link">
@ -87,6 +87,9 @@
fullscreenToggel, fullscreenToggel,
listenfullscreen listenfullscreen
} from "@/util/util"; } from "@/util/util";
import {
dateFormat
} from "@/util/date";
import topLock from "./top-lock"; import topLock from "./top-lock";
import topMenu from "./top-menu"; import topMenu from "./top-menu";
import topSearch from "./top-search"; import topSearch from "./top-search";
@ -109,7 +112,9 @@
}, },
name: "top", name: "top",
data() { data() {
return {}; return {
currentDate: dateFormat(new Date(),'yyyy-MM-dd')
};
}, },
filters: {}, filters: {},
created() {}, created() {},

Loading…
Cancel
Save