feat:样品分析
This commit is contained in:
@@ -1,22 +1,25 @@
|
||||
<template>
|
||||
<view>
|
||||
<navbar-back title="天平状态"></navbar-back>
|
||||
<up-grid border :col="4">
|
||||
<up-grid-item v-for="(auncel, index) in auncelList" :index="index" :key="index">
|
||||
<view class="auncel-item" :style="{ backgroundImage: `url(${balanceBackground})` }">
|
||||
<view class="auncel-header">
|
||||
<view class="auncel-code">{{ auncel.deviceCode }}</view>
|
||||
<view class="auncel-name">{{ auncel.controlRealName }}</view>
|
||||
</view>
|
||||
<view class="weight">
|
||||
<view :class="getWeightClass(auncel)" :style="getWeightStyle(auncel)">
|
||||
{{ getWeightText(auncel) }}
|
||||
<view class="p20">
|
||||
<up-grid :col="4" style="gap: 20px">
|
||||
<up-grid-item v-for="(auncel, index) in auncelList" :key="index">
|
||||
<view class="auncel-item" :style="{ backgroundImage: `url(${balanceBackground})` }">
|
||||
<view class="auncel-header">
|
||||
<view class="auncel-code">{{ auncel.deviceCode }}</view>
|
||||
<view class="auncel-name">{{ auncel.controlRealName }}</view>
|
||||
</view>
|
||||
<view class="weight">
|
||||
<view :class="getWeightClass(auncel)" :style="getWeightStyle(auncel)">
|
||||
{{ getWeightText(auncel) }}
|
||||
</view>
|
||||
<view v-if="auncel.isConnected === 1" class="weight-unit">{{ auncel.weightUnit }}</view>
|
||||
</view>
|
||||
<view v-if="auncel.isConnected === 1" class="weight-unit">{{ auncel.weightUnit }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</up-grid-item>
|
||||
</up-grid>
|
||||
<view v-if="auncel.isConnected != 1" class="shade">天平断开</view>
|
||||
</up-grid-item>
|
||||
</up-grid>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -114,7 +117,7 @@ function handleDeviceStatus(res) {
|
||||
if (item.id === res.deviceId) {
|
||||
item.isConnected = res.connected
|
||||
if (res.connected == 0) {
|
||||
item.weightData = '天平断开'
|
||||
item.weightData = ''
|
||||
item.weightUnit = ''
|
||||
item.weightStable = 0
|
||||
}
|
||||
@@ -135,7 +138,7 @@ function handleConnClose() {
|
||||
|
||||
function getWeightText(auncel) {
|
||||
if (auncel.isConnected !== 1) {
|
||||
return '天平断开'
|
||||
return ''
|
||||
}
|
||||
return auncel.weightData || ''
|
||||
}
|
||||
@@ -175,7 +178,21 @@ function getWeightStyle(auncel) {
|
||||
padding: 10px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.shade {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background-color: rgba(31, 41, 55, 0.55);
|
||||
color: #fff;
|
||||
font-weight: 500;
|
||||
z-index: 10;
|
||||
border-radius: 8px;
|
||||
}
|
||||
.auncel-header {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
Reference in New Issue
Block a user