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