自动化页面简写
parent
adc5a2e41f
commit
c3b30deadb
|
|
@ -7,34 +7,17 @@
|
|||
</template>
|
||||
|
||||
<view>
|
||||
<!-- 优化:温度卡片循环渲染 -->
|
||||
<view class="uni-flex_control uni-row">
|
||||
<!-- 优化:温湿度卡片循环渲染 -->
|
||||
<view class="uni-flex_control uni-row" v-for="data in dataType" :key="data.name">
|
||||
<view
|
||||
class="text uni-flex_control_one uni-view"
|
||||
v-for="item in sensorCards.temp"
|
||||
:class="['text', `uni-flex_control_${data.name}`,'uni-view']"
|
||||
v-for="item in sensorCards[data.name]"
|
||||
:key="item.key"
|
||||
@click="openDataModal(item)"
|
||||
>
|
||||
<text class="data" :style="fontStyle">
|
||||
{{ liveData[item.key] }}
|
||||
<text v-if="isEffectiveValue(liveData[item.key])" class="tempStyle">℃</text>
|
||||
</text>
|
||||
<text class="data" v-if="dtu_remark[item.key]">{{ dtu_remark[item.key] }}</text>
|
||||
<text class="data" v-else>{{ item.label }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 优化:湿度卡片循环渲染 -->
|
||||
<view class="uni-flex_control uni-row">
|
||||
<view
|
||||
class="text uni-flex_control_two uni-view"
|
||||
v-for="item in sensorCards.humi"
|
||||
:key="item.key"
|
||||
@click="openDataModal(item)"
|
||||
>
|
||||
<text class="data" :style="fontStyle">
|
||||
{{ liveData[item.key] }}
|
||||
<text v-if="isEffectiveValue(liveData[item.key])" class="humiStyle"> %RH</text>
|
||||
<text v-if="isEffectiveValue(liveData[item.key])" class="dataStyle">{{data.unit}}</text>
|
||||
</text>
|
||||
<text class="data" v-if="dtu_remark[item.key]">{{ dtu_remark[item.key] }}</text>
|
||||
<text class="data" v-else>{{ item.label }}</text>
|
||||
|
|
@ -201,6 +184,7 @@ export default {
|
|||
// 确保数据有值后执行方法
|
||||
if (newVal) {
|
||||
this.imei = this.value
|
||||
console.info(this.liveData)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -253,7 +237,7 @@ export default {
|
|||
imei: '',
|
||||
// 优化:温湿度卡片配置(固定顺序:温度1→2→3→4,湿度1→2→3→4)
|
||||
sensorCard:{},
|
||||
dataType: ["temp", "humi"]
|
||||
dataType: [{name:"temp", unit: "℃"}, {name:"humi", unit: "%RH"}]
|
||||
};
|
||||
},
|
||||
|
||||
|
|
@ -638,7 +622,7 @@ export default {
|
|||
box-shadow: 0 2rpx 8rpx #bfbec1
|
||||
}
|
||||
|
||||
.tempStyle, .humiStyle {
|
||||
.dataStyle {
|
||||
display: inline-block;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,15 +25,16 @@ form {
|
|||
flex-direction: column;
|
||||
}
|
||||
|
||||
.uni-flex_control_one {
|
||||
.uni-flex_control_temp {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: radial-gradient(circle at bottom right, #faf1f1 40%, #F8FCFE 100%);
|
||||
}
|
||||
.uni-flex_control_two {
|
||||
.uni-flex_control_humi {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: radial-gradient(circle at top left, #E8F4F8 40%, #F8FCFE 100%);
|
||||
background: radial-gradient(circle at top left, #E8F4F8 40%,
|
||||
#F8FCFE 100%);
|
||||
}
|
||||
|
||||
.uni-flex-item {
|
||||
|
|
|
|||
Loading…
Reference in New Issue