refactor(led): 设备列表动态生成,优化布局样式

- deviceDataList 由硬编码改为根据 deviceNumber 动态创建
- 隐藏 rowDom-logo 区域
- 菜品列表使用 space-around 布局,移除 info 的固定 margin

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
17792275749
2026-08-12 16:19:42 +08:00
co-authored by Claude Opus 4.7
parent 8f92dbea26
commit a5217bf272
3 changed files with 17 additions and 52 deletions
+1 -1
View File
@@ -99,7 +99,7 @@ export default {
.rowDom-info {
width: 250px;
height: 100%;
margin: 0 20px;
//margin: 0 20px;
border-radius: 8px;
overflow: hidden;
background-color: #FFFFFF;
+5 -4
View File
@@ -1,9 +1,9 @@
<template>
<div class="rowDom">
<div class="rowDom-logo">
<div></div>
<div>数味智餐</div>
</div>
<!-- <div class="rowDom-logo">-->
<!-- <div></div>-->
<!-- <div>数味智餐</div>-->
<!-- </div>-->
<div class="rowDom-dishes">
<template v-for="(item, index) in deviceDataList">
<Info :index="index" :deviceData="item" :key="item.deviceCode" />
@@ -69,6 +69,7 @@ export default {
height: 100%;
display: flex;
flex-wrap: nowrap;
justify-content: space-around;
}
}
</style>
+11 -47
View File
@@ -32,57 +32,19 @@ export default {
return {
url: "https://dev.yixiong-tech.com:8081/nutrition/",
screenWidth: 1920,
deviceDataList: [{
deviceCode: '1',
data: null
}, {
deviceCode: '2',
data: null
}, {
deviceCode: '3',
data: null
}, {
deviceCode: '4',
data: null
}, {
deviceCode: '5',
data: null
}, {
deviceCode: '6',
data: null
}, {
deviceCode: '7',
data: null
}, {
deviceCode: '8',
data: null
}, {
deviceCode: '9',
data: null
}, {
deviceCode: '10',
data: null
}, {
deviceCode: '11',
data: null
}, {
deviceCode: '12',
data: null
}, {
deviceCode: '13',
data: null
}, {
deviceCode: '14',
data: null
}, {
deviceCode: '15',
data: null
}],
deviceNumber: 13,
deviceDataList: [],
}
},
mounted() {
},
created() {
for (let i = 1; i <= this.deviceNumber; i++) {
this.deviceDataList.push({
deviceCode: i.toString(),
data: null
})
}
this.initData();
this.initMQ();
},
@@ -109,7 +71,9 @@ export default {
},
initData() {
let _this = this;
httpRequest("GET", this.url + 'neglect/large-screen/long-screen', {}, {
httpRequest("GET", this.url + 'neglect/large-screen/long-screen', {
num: this.deviceNumber
}, {
"authorization": "57ee87183f2a4fa59683ec9ef41c8f5d"
}).then(function (res) {
if (res?.code === '00000') {