Browse Source

游泳馆检测添加加载动画

yygjk
lzp 10 months ago
parent
commit
e5f37487c5
  1. 18
      src/views/index.vue

18
src/views/index.vue

@ -1,25 +1,26 @@
<template>
<div style="padding: 16px;min-height: calc(100vh - 84px);display: flex; justify-content: center;align-items: center;">
<div v-loading="loading"
style="padding: 16px;min-height: calc(100vh - 84px);display: flex; justify-content: center;align-items: center;">
<div class="div-box">
<div class="div-box-title"> 游泳馆远程监测 </div>
<div class="div-ul">
<div class="div-li">
<div>
<span>温度</span>
{{ deviceInfo.temperature || '-'}}
{{ deviceInfo.temperature || '-' }}
</div>
<div> <span>湿度</span>
{{ deviceInfo.humidity || '-'}}%</div>
{{ deviceInfo.humidity || '-' }}%</div>
</div>
<!-- ON开启 OFF关闭 -->
<div class="div-li">
<div>
<span>TVOC</span>
{{ deviceInfo.tvoc || '-'}}
{{ deviceInfo.tvoc || '-' }}
</div>
<div>
<span>TDS</span>
{{ deviceInfo.tds || '-'}}
{{ deviceInfo.tds || '-' }}
</div>
</div>
</div>
@ -95,7 +96,7 @@ export default {
this.loading = false;
const findAttr = (id, defaultValue = '0') =>
records.find(row => row.id === id)?.attributeValue ;
records.find(row => row.id === id)?.attributeValue;
this.deviceInfo = {
temperature: findAttr(447173913707267), //
humidity: findAttr(447173913707268), // 湿
@ -108,7 +109,7 @@ export default {
submitForm: function () {
this.$refs["form"].validate(valid => {
if (valid) {
let param = {"Wen":`#${this.form.threshold}`} //
let param = { "Wen": `#${this.form.threshold}` } //
sendAttribute({
"attributeParams": JSON.stringify(param), // JSON
"deviceId": this.deviceId // id
@ -155,13 +156,16 @@ export default {
display: flex;
justify-content: space-between;
margin-bottom: 12px;
div {
flex: 1
}
span {
color: #666;
}
}
.div-li:last-child {
margin-bottom: 0;
}

Loading…
Cancel
Save