feat:天平调整

This commit is contained in:
houjunxiang
2026-01-16 21:11:48 +08:00
parent 6ecbf27b25
commit 3fdc27eb74
6 changed files with 115 additions and 36 deletions

View File

@@ -1,7 +1,19 @@
<template>
<view>
<u-popup :show="showAuncelSelector" closeable @close="close" @open="open" mode="right">
<view class="p10">天平选择</view>
<view class="p10">
<view>天平选择</view>
<view class="x-f flex-wrap pb2">
<view
v-for="value in options"
class="location"
:class="{ selected: deployLocation === value }"
@click="handleSelectLocation(value)"
>
{{ value }}
</view>
</view>
</view>
<scroll-view scroll-y="true" class="content">
<u-grid :col="3" @click="doSelect" style="gap: 20px">
<u-grid-item v-for="(auncel, index) in auncelList" :index="index" :key="index">
@@ -62,6 +74,12 @@ const close = () => {
emit('update:showAuncelSelector', false)
}
let deployLocation = ref('全部')
const options = ref([])
const handleSelectLocation = value => {
deployLocation.value = value
getPageData()
}
const getPageData = () => {
nx.$api.laboratory
.getDeviceLaboratoryListBy({
@@ -69,10 +87,14 @@ const getPageData = () => {
pageSize: 999,
collectDeviceType: 'balance',
deviceStatus: '0',
isEnable: '1'
isEnable: '1',
deployLocation: deployLocation.value === '全部' ? '' : deployLocation.value
})
.then(res => {
auncelList.value = res.list
if (deployLocation.value === '全部') {
options.value = ['全部', ...new Set(res.list.map(item => item.deployLocation).filter(loc => loc))]
}
})
}
@@ -221,7 +243,9 @@ function getWeightStyle(auncel) {
}
return {
textAlign: 'right',
fontSize: '32px'
fontSize: '32px',
paddingRight:'20px',
lineHeight: 1
}
}
</script>
@@ -232,6 +256,20 @@ function getWeightStyle(auncel) {
height: 90vh;
padding: 0 20px 40px 20px;
}
.location {
padding: 2px 4px;
border: 1px solid #ccc;
border-radius: 4px;
margin-right: 6px;
margin-top: 6px;
cursor: pointer;
&:hover,
&.selected {
color: #fff;
background-color: #0055a2;
border-color: transparent;
}
}
.auncel-item {
height: 180px;
width: 180px;
@@ -265,7 +303,7 @@ function getWeightStyle(auncel) {
flex: 1;
font-size: 28px;
padding-top: 10px;
padding: 10px 30px 0 30px;
padding: 10px 30px 0 10px;
position: relative;
}
.weight-data,