This commit is contained in:
liqi 2025-04-13 19:49:54 +08:00
parent 603b8a4dae
commit ea1a697131
2 changed files with 26 additions and 3 deletions

View File

@ -357,7 +357,6 @@ body {
padding: 0 40px;
.device-status {
width: 95%;
height: 40%;
margin-left: 10%;
margin-top: 15%;
display: flex;

View File

@ -30,7 +30,7 @@
@click="handleTitleClick(true, 'all')"
/>
</div>
<ul>
<ul :style="ulStyle">
<li
v-for="(item, index) in positionData"
:key="index"
@ -73,10 +73,34 @@ export default {
deviceStatus: [],
positionData: [],
isContracted: false,
lastPositionsHash: null // null
lastPositionsHash: null, // null
deviceStatusHeight: 0
};
},
computed: {
ulStyle() {
const totalHeight = 829; //
const titleHeight = 50; //
const contractHeight = 80; //
const marginTop = 0; //
const availableHeight =
totalHeight -
this.deviceStatusHeight -
titleHeight -
contractHeight -
marginTop;
return {
height: `${availableHeight}px`,
overflowY: "auto",
marginTop: "0px" //
};
}
},
watch: {
deviceStatus(newVal) {
const rows = Math.ceil(newVal.length / 3);
this.deviceStatusHeight = rows * 136;
},
"homeData.positions": {
handler(newPositions) {
newPositions = newPositions || [];